* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

body {
    background-color: #121212;
    color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    touch-action: manipulation;
}

.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 10px;
    width: 100%;
    max-width: 650px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 10px;
}

h1 {
    font-size: 18px;
    color: #4CAF50;
    text-transform: uppercase;
}

.card {
    background: #1e1e1e;
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid #333;
    width: 100%;
    text-align: center;
}

.btn {
    padding: 8px 14px;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
    font-size: 14px;
}

.btn.primary { background: #2196F3; color: white; }
.btn.secondary { background: #424242; color: white; }
.btn.success { background: #4CAF50; color: white; }
.btn.danger { background: #F44336; color: white; }
.btn:hover { opacity: 0.85; }

.admin-panel {
    border: 1px solid #FF9800;
    background: #261c14;
}

.admin-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 10px;
}

.admin-players-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
    justify-content: center;
}

.admin-player-badge {
    background: #333;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.admin-player-badge button {
    background: #ff5252;
    border: none;
    color: white;
    border-radius: 3px;
    padding: 2px 5px;
    cursor: pointer;
}

.status-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.nick-badge {
    background: #2a2a2a;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 14px;
    color: #4CAF50;
    border: 1px solid #444;
}

.main-layout {
    display: flex;
    flex-direction: row;
    gap: 15px;
    width: 100%;
    max-width: 850px;
    justify-content: center;
    align-items: flex-start;
}

.admin-sidebar {
    width: 220px;
    min-width: 200px;
    background: #1e1e1e;
    border: 1px solid #FF9800;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 600px;
    overflow-y: auto;
}

.admin-sidebar h3 {
    font-size: 15px;
    color: #FF9800;
    text-align: center;
    border-bottom: 1px solid #333;
    padding-bottom: 6px;
}

.scoreboard-vertical-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    background: #2a2a2a;
    border-radius: 4px;
    font-size: 13px;
    list-style: none;
}

.leaderboard-item.dead {
    opacity: 0.4;
    text-decoration: line-through;
}

.leaderboard-name {
    font-weight: bold;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 110px;
}

.leaderboard-score {
    color: #4CAF50;
    font-weight: bold;
}

.hidden { display: none !important; }

.game-wrapper {
    position: relative;
    border: 2px solid #333;
    border-radius: 8px;
    overflow: hidden;
    background-color: #000;
    width: 100%;
    max-width: 600px;
    aspect-ratio: 1 / 1;
}

.zone-warning-banner {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(244, 67, 54, 0.9);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 14px;
    z-index: 10;
    box-shadow: 0 0 15px rgba(244, 67, 54, 0.6);
    animation: pulse-warning 1s infinite alternate;
}

@keyframes pulse-warning {
    0% { transform: translateX(-50%) scale(1); }
    100% { transform: translateX(-50%) scale(1.05); }
}

canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 15px;
    gap: 10px;
}

.overlay h2 {
    font-size: 22px;
}

.overlay p {
    font-size: 14px;
    color: #aaa;
}

/* Мобильный D-Pad управления */
.mobile-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
    touch-action: manipulation;
}

.dpad-row {
    display: flex;
    gap: 5px;
}

.dpad-center {
    width: 60px;
    height: 60px;
}

.dpad-btn {
    width: 60px;
    height: 60px;
    background: #2a2a2a;
    border: 2px solid #444;
    color: #fff;
    border-radius: 12px;
    font-size: 22px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    touch-action: manipulation;
    transition: background 0.1s, transform 0.05s;
    -webkit-tap-highlight-color: transparent;
}

.dpad-btn:active {
    background: #4CAF50;
    color: #000;
    transform: scale(0.95);
}

.modal {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal-content {
    width: 90%;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal-content input {
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #444;
    background: #111;
    color: #fff;
    font-size: 16px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

@media (min-width: 769px) {
    h1 { font-size: 22px; }
    .mobile-controls { display: none; } /* Скрываем D-Pad на ПК */
}