/* ========== ИГРОВОЙ ЭКРАН - НОВЫЙ LAYOUT ========== */
.game-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    overflow: hidden;
}

/* ========== ВЕРХНЯЯ ПАНЕЛЬ ========== */
.game-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
    gap: 15px;
}

.back-btn-compact {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.back-btn-compact:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Счёт команд в одну линию */
.teams-score-bar {
    display: flex;
    gap: 8px;
    flex: 1;
    justify-content: center;
    max-width: 600px;
}

.team-score-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    transition: all 0.3s;
}

.team-score-item.my-team {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    border-color: #667eea;
}

.team-score-item.leading {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.team-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, 0.2);
}

.team-score-item.red .team-dot { background: #ff4444; }
.team-score-item.blue .team-dot { background: #4488ff; }
.team-score-item.green .team-dot { background: #44cc44; }
.team-score-item.yellow .team-dot { background: #ffcc00; }

.team-score-value {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    min-width: 40px;
    text-align: center;
}

/* Таймеры */
.game-timers {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.season-timer,
.round-timer-compact {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.timer-label {
    font-size: 14px;
}

.timer-val {
    font-size: 14px;
    font-weight: bold;
    color: white;
    font-family: 'Courier New', monospace;
}

.round-timer-compact.warning {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
}

.round-timer-compact.warning .timer-val {
    animation: timerPulse 0.5s ease infinite;
}

.round-timer-compact.critical {
    background: linear-gradient(135deg, #ff4444 0%, #cc0000 100%);
}

.round-timer-compact.critical .timer-val {
    animation: timerPulse 0.25s ease infinite;
}

@keyframes timerPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ========== ОСНОВНАЯ ОБЛАСТЬ ========== */
.game-main {
    flex: 1;
    display: flex;
    min-height: 0;
    position: relative;
}

/* ========== ЛЕВАЯ ПАНЕЛЬ ========== */
.game-left-panel {
    position: absolute;
    left: 10px;
    top: 10px;
    display: flex;
    flex-direction: row;
    gap: 8px;
    z-index: 30;
}

.left-panel-section {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.team-section {
    padding: 6px 10px;
}

.team-color-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, 0.2);
}

.team-name-label {
    color: #333;
    font-weight: bold;
    font-size: 13px;
    text-transform: capitalize;
}

.section-icon {
    font-size: 14px;
}

.section-value {
    color: #333;
    font-weight: bold;
    font-size: 14px;
    min-width: 24px;
}

.money-section .section-value {
    color: #d4a000;
}

.online-section .section-value {
    color: #28a745;
}

/* ========== CANVAS WRAPPER ========== */
.game-canvas-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 60px 10px 10px 10px; /* Верхний отступ для левой панели */
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

#gameCanvas {
    border-radius: 8px;
    cursor: crosshair;
    background: transparent;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

.canvas-overlay {
    position: absolute;
    top: 60px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    z-index: 10;
}

.canvas-overlay.hidden {
    display: none;
}

.loading {
    font-size: 1.5em;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: bold;
}

/* Zoom controls */
.zoom-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 25;
    display: flex;
    flex-direction: row;
    gap: 6px;
    background: rgba(255, 255, 255, 0.95);
    padding: 6px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.zoom-btn {
    width: 36px;
    height: 36px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 8px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.zoom-btn:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: scale(1.1);
}

/* ========== ПРАВАЯ ПАНЕЛЬ - УЧАСТНИКИ ========== */
.game-right-panel {
    position: absolute;
    right: 10px;
    top: 10px;
    width: 200px;
    max-height: calc(100% - 80px);
    display: flex;
    flex-direction: column;
    z-index: 30;
    transition: all 0.3s ease;
}

.game-right-panel.collapsed {
    width: 40px;
}

.panel-toggle-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    align-self: flex-end;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.4);
}

.panel-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.5);
}

.participants-content {
    margin-top: 8px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-height: 300px;
    position: relative;
}

/* Индикатор что можно скроллить вниз */
.participants-content::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 25px;
    background: linear-gradient(transparent, rgba(255, 255, 255, 0.9));
    pointer-events: none;
    border-radius: 0 0 12px 12px;
}

.game-right-panel.collapsed .participants-content {
    display: none;
}

.participants-header {
    padding: 10px 12px;
    font-weight: bold;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    border-bottom: 2px solid #eee;
    font-size: 13px;
    flex-shrink: 0;
}

.participants-list {
    flex: 1;
    overflow-y: scroll;
    padding: 6px;
    padding-right: 2px;
    min-height: 60px;
    max-height: 250px;
}

/* Видимый скроллбар как в достижениях */
.participants-list::-webkit-scrollbar {
    width: 8px;
}

.participants-list::-webkit-scrollbar-track {
    background: #e9ecef;
    border-radius: 4px;
}

.participants-list::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 4px;
}

.participants-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a6fd6, #6a4190);
}

.participants-list:empty::after {
    content: "Загрузка...";
    color: #888;
    font-size: 12px;
    display: block;
    padding: 10px;
    text-align: center;
}

.participant-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    margin-bottom: 3px;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #e9ecef;
}

.participant-item:hover {
    background: #e9ecef;
    border-color: #667eea;
}

.participant-team {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 1px solid rgba(0, 0, 0, 0.2);
}

.participant-name {
    flex: 1;
    color: #333;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ========== МОБИЛЬНЫЙ МОДАЛ УЧАСТНИКОВ ========== */
.participants-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.98);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.participants-modal.hidden {
    display: none;
}

.participants-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eee;
}

.participants-modal-header h3 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 18px;
    margin: 0;
}

.participants-modal-close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

.participants-modal-list {
    flex: 1;
    overflow-y: auto;
}

.participants-modal-list .participant-item {
    padding: 12px 15px;
    margin-bottom: 6px;
    font-size: 14px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
}

.participants-modal-list .participant-item:hover {
    background: #e9ecef;
    border-color: #667eea;
}

.participants-modal-list .participant-team {
    width: 14px;
    height: 14px;
}

.participants-modal-list .participant-name {
    font-size: 15px;
    color: #333;
}

/* ========== НИЖНЯЯ ПАНЕЛЬ - ИНВЕНТАРЬ ========== */
.game-bottom-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.active-boosters-compact {
    display: flex;
    gap: 8px;
}

.active-booster-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
    color: white;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.active-booster-badge .booster-time {
    font-size: 11px;
    opacity: 0.9;
}

.boosters-inventory {
    display: flex;
    gap: 8px;
    align-items: center;
}

.booster-circle {
    position: relative;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 22px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.booster-circle:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    transform: scale(1.1);
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.booster-circle.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.booster-circle.disabled:hover {
    transform: none;
    background: #f8f9fa;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Выбранный бустер (зеленая рамка) */
.booster-circle.selected {
    border: 3px solid #28a745;
    background: rgba(40, 167, 69, 0.15);
    box-shadow: 0 0 15px rgba(40, 167, 69, 0.5);
    animation: selectedPulse 1.5s ease-in-out infinite;
}

@keyframes selectedPulse {
    0%, 100% {
        box-shadow: 0 0 15px rgba(40, 167, 69, 0.5);
    }
    50% {
        box-shadow: 0 0 25px rgba(40, 167, 69, 0.8);
    }
}

/* Бустер с активным таймером */
.booster-circle.active-timer {
    border: 2px solid #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
}

/* Таймер поверх бустера */
.booster-timer-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: bold;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.booster-count-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 10px;
    font-size: 11px;
    font-weight: bold;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.4);
}

.booster-count-badge.empty {
    background: #adb5bd;
}

.booster-price-badge {
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    padding: 2px 6px;
    background: #333;
    border-radius: 8px;
    font-size: 10px;
    color: #ffd700;
    white-space: nowrap;
}

/* Tooltip для бустеров */
.booster-circle[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 10px;
    background: #333;
    color: white;
    font-size: 12px;
    border-radius: 6px;
    white-space: nowrap;
    margin-bottom: 8px;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* ========== СКРЫТЫЕ ЭЛЕМЕНТЫ ========== */
.hidden {
    display: none !important;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .game-top-bar {
        padding: 6px 10px;
        gap: 8px;
    }
    
    .teams-score-bar {
        gap: 4px;
    }
    
    .team-score-item {
        padding: 4px 8px;
        gap: 4px;
    }
    
    .team-dot {
        width: 10px;
        height: 10px;
    }
    
    .team-score-value {
        font-size: 13px;
        min-width: 30px;
    }
    
    .game-timers {
        gap: 6px;
    }
    
    .season-timer,
    .round-timer-compact {
        padding: 4px 8px;
    }
    
    .timer-val {
        font-size: 12px;
    }
    
    .game-left-panel {
        left: 5px;
        top: 5px;
    }
    
    .left-panel-section {
        padding: 5px 8px;
        gap: 4px;
    }
    
    .section-icon {
        font-size: 12px;
    }
    
    .section-value {
        font-size: 12px;
    }
    
    .team-color-dot {
        width: 12px;
        height: 12px;
    }
    
    .team-name-label {
        font-size: 11px;
    }
    
    .game-canvas-wrapper {
        padding: 50px 5px 5px 5px;
    }
    
    .game-right-panel {
        width: 160px;
        right: 5px;
    }
    
    .game-right-panel.collapsed {
        width: 36px;
    }
    
    .panel-toggle-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .game-bottom-bar {
        padding: 6px 8px;
        gap: 8px;
    }
    
    .booster-circle {
        width: 42px;
        height: 42px;
        font-size: 18px;
    }
    
    .booster-count-badge {
        min-width: 16px;
        height: 16px;
        font-size: 10px;
    }
    
    .zoom-controls {
        bottom: 10px;
        right: 10px;
    }
    
    .zoom-btn {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
}

@media (max-width: 600px) {
    /* На маленьких экранах скрываем правую панель - используем модал */
    .game-right-panel .participants-content {
        display: none !important;
    }
    
    .game-right-panel {
        width: 36px;
    }
    
    .panel-toggle-btn {
        width: 36px;
        height: 36px;
    }
    
    .game-left-panel {
        flex-wrap: wrap;
        max-width: 50%;
    }
    
    /* Компактные таймеры - оба остаются видимыми! */
    .season-timer,
    .round-timer-compact {
        padding: 4px 8px;
    }
    
    .season-timer .timer-label,
    .round-timer-compact .timer-label {
        font-size: 12px;
    }
    
    .season-timer .timer-val,
    .round-timer-compact .timer-val {
        font-size: 12px;
    }
}

@media (max-width: 400px) {
    .teams-score-bar {
        gap: 2px;
    }
    
    .team-score-item {
        padding: 3px 6px;
    }
    
    .team-score-value {
        font-size: 11px;
        min-width: 20px;
    }
    
    .back-btn-compact {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
    
    .booster-circle {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }
    
    /* Левая панель ВСЕГДА видна, только компактнее */
    .game-left-panel {
        gap: 4px;
    }
    
    .left-panel-section {
        padding: 4px 6px;
    }
    
    .section-icon {
        font-size: 10px;
    }
    
    .section-value {
        font-size: 10px;
    }
    
    .team-color-dot {
        width: 10px;
        height: 10px;
    }
    
    .team-name-label {
        font-size: 10px;
    }
}

/* ========== СОВМЕСТИМОСТЬ СО СТАРЫМИ СТИЛЯМИ ========== */
/* Для режимов, которые используют старый layout */
.sidebar {
    display: none;
}

.canvas-container {
    display: none;
}

/* Захват флага */
.capture-scores-container {
    display: none;
}
