/* ============================================================================
   Zombie Tag Game Page - Robomates Style (Green Theme)
   Requires: game-common.css loaded first
   ============================================================================ */

/* ============================================================================
   Game-Specific Toast Types
   ============================================================================ */

.toast.zombie-event {
    background: linear-gradient(135deg, rgba(255, 82, 82, 0.95), rgba(220, 53, 69, 0.95));
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.toast.survivor-event {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.95), rgba(56, 142, 60, 0.95));
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.toast.game-event {
    background: linear-gradient(135deg, rgba(38, 222, 129, 0.95), rgba(32, 201, 151, 0.95));
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

[data-theme="light"] .toast.zombie-event {
    background: linear-gradient(135deg, rgba(198, 40, 40, 0.95), rgba(183, 28, 28, 0.95));
    color: white;
}

[data-theme="light"] .toast.survivor-event {
    background: linear-gradient(135deg, rgba(46, 125, 50, 0.95), rgba(27, 94, 32, 0.95));
    color: white;
}

/* ============================================================================
   Main Dashboard Layout
   ============================================================================ */

.tag-dashboard {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 1rem;
    gap: 0;
    max-width: 1800px;
    margin: 0 auto;
}

.tag-dashboard .header {
    flex-shrink: 0;
    margin-bottom: 0.75rem;
}

/* ============================================================================
   Tag Content (sidebar + main)
   ============================================================================ */

.tag-content {
    display: flex;
    gap: 1rem;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* ============================================================================
   Sidebar (Left)
   ============================================================================ */

.tag-dashboard .sidebar {
    width: 300px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    overflow-x: hidden;
}

.tag-dashboard .ble-panel { flex-shrink: 0; }

.tag-dashboard .device-list {
    max-height: 150px;
    min-height: 60px;
}

/* ============================================================================
   Game Config Panel
   ============================================================================ */

.game-config-panel { flex-shrink: 0; }

/* Tag uses 2-column stats grid */
.tag-dashboard .game-stats {
    grid-template-columns: repeat(2, 1fr);
}

.zombie-color { color: #ff5252 !important; }
.survivor-color { color: #4caf50 !important; }

.setting-item input[type="number"]:focus {
    outline: none;
    border-color: var(--accent-green, #4caf50);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

/* ============================================================================
   Game Control Bar Overrides (Green Theme)
   ============================================================================ */

.tag-dashboard .game-control-bar {
    gap: 1.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 14px;
}

.gcb-right {
    gap: 0.75rem;
}

/* Game Timer */
.game-timer {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1.2rem;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.15), rgba(38, 222, 129, 0.1));
    border: 2px solid var(--accent-green, #4caf50);
    border-radius: 12px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-weight: 700;
    transition: all 0.3s ease;
}

.game-timer.timer-warning {
    border-color: #ff9800;
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.15), rgba(255, 193, 7, 0.1));
}

.game-timer.timer-critical {
    border-color: #ff5252;
    background: linear-gradient(135deg, rgba(255, 82, 82, 0.15), rgba(220, 53, 69, 0.1));
    animation: timer-pulse 0.5s ease-in-out infinite;
}

@keyframes timer-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.timer-icon { font-size: 1rem; }

.timer-value {
    font-size: 1.6rem;
    color: var(--text-primary);
    min-width: 3ch;
    text-align: center;
}

/* Player count badge */
.player-count {
    display: inline-block;
    background: var(--accent-green, #4caf50);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    margin-left: 0.25rem;
}

/* ============================================================================
   Buttons (Green Theme Overrides)
   ============================================================================ */

.tag-dashboard .btn-start {
    padding: 0.6rem 2rem;
    background: linear-gradient(135deg, #26de81, #20c997);
    font-size: 1.05rem;
    box-shadow: 0 4px 15px rgba(38, 222, 129, 0.3);
}

.tag-dashboard .btn-start:hover:not(:disabled) {
    box-shadow: 0 6px 20px rgba(38, 222, 129, 0.4);
}

.tag-dashboard .btn-reset {
    padding: 0.6rem 1.5rem;
    font-size: 0.95rem;
}

.tag-dashboard .btn-sound {
    width: 40px;
    height: 40px;
    font-size: 1.15rem;
    border-radius: 10px;
}

.tag-dashboard .btn-sound:hover {
    border-color: var(--accent-green, #4caf50);
}

.btn-accent {
    padding: 0.4rem 0.8rem;
    background: linear-gradient(135deg, #26de81, #20c997);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-accent:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(38, 222, 129, 0.3);
}

.tag-dashboard .btn-outline:hover {
    border-color: var(--accent-green, #4caf50);
    color: var(--accent-green, #4caf50);
}

/* ============================================================================
   Player Card Game-Specific States
   ============================================================================ */

.player-card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-green, #4caf50);
}

.player-card.is-zombie {
    border-color: #ff5252;
    background: linear-gradient(90deg, rgba(255, 82, 82, 0.12), var(--card-hover));
}

.player-card.is-survivor {
    border-color: #4caf50;
    background: linear-gradient(90deg, rgba(76, 175, 80, 0.12), var(--card-hover));
}

.player-card.is-zombie-starter {
    border-color: #ff5252;
    background: linear-gradient(90deg, rgba(255, 82, 82, 0.18), var(--card-hover));
    box-shadow: 0 0 8px rgba(255, 82, 82, 0.2);
}

.player-card.just-infected {
    animation: infect-flash 0.8s ease-out;
}

@keyframes infect-flash {
    0% { background: rgba(255, 82, 82, 0.6); transform: scale(1.02); box-shadow: 0 0 30px rgba(255, 82, 82, 0.5); }
    100% { transform: scale(1); box-shadow: none; }
}

/* Badges */
.zombie-badge {
    font-size: 0.75rem;
    flex-shrink: 0;
    padding: 0.05rem 0.35rem;
    background: rgba(255, 82, 82, 0.2);
    color: #ff5252;
    border: 1px solid rgba(255, 82, 82, 0.3);
    border-radius: 4px;
    font-weight: 700;
    font-family: 'Consolas', 'Monaco', monospace;
}

.survivor-badge {
    font-size: 0.75rem;
    flex-shrink: 0;
    padding: 0.05rem 0.35rem;
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: 4px;
    font-weight: 700;
    font-family: 'Consolas', 'Monaco', monospace;
}

.zombie-select-cb {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #ff5252;
    flex-shrink: 0;
}

/* Infection time info */
.pc-infected-at {
    font-size: 0.65rem;
    color: #ff5252;
    padding-top: 0.15rem;
    font-family: 'Consolas', 'Monaco', monospace;
}

/* Find button green theme */
.tag-dashboard .find-btn {
    background: linear-gradient(135deg, #4caf50, #388e3c);
}

/* Countdown GO color */
.tag-dashboard .countdown-text {
    text-shadow: 0 0 40px rgba(255, 255, 255, 0.6), 0 0 80px rgba(76, 175, 80, 0.4);
}

.tag-dashboard .countdown-text.go {
    color: #4caf50;
    text-shadow: 0 0 40px rgba(76, 175, 80, 0.8), 0 0 80px rgba(76, 175, 80, 0.4);
}

/* ============================================================================
   Tag Results Overlay Extras
   ============================================================================ */

.results-title.zombies-win { color: #ff5252; }
.results-title.survivors-win { color: #4caf50; }

.results-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.results-section-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin: 0;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--card-border);
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.result-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.85rem;
}

.result-row.result-survivor {
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.2);
}

.result-row.result-zombie {
    background: rgba(255, 82, 82, 0.08);
    border: 1px solid rgba(255, 82, 82, 0.15);
}

.result-icon { font-size: 1.1rem; flex-shrink: 0; }
.result-name { font-weight: 700; color: var(--text-primary); flex: 1; }
.result-time { color: var(--text-muted); font-size: 0.75rem; }

/* ============================================================================
   Fullscreen / Projector Mode
   ============================================================================ */

.fs-mode .header { display: none !important; }
.fs-mode .sidebar { display: none !important; }

.fs-mode {
    max-width: none;
    padding: 1rem 1.5rem;
    background: var(--bg-primary);
}

.fs-mode .tag-content { flex-direction: column; }

.fs-mode .game-control-bar {
    padding: 1rem 2rem;
    border-radius: 18px;
    gap: 2rem;
    margin-bottom: 1rem;
    border-width: 2px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.fs-mode .game-timer { padding: 0.7rem 1.5rem; border-radius: 14px; }
.fs-mode .timer-value { font-size: 2.5rem; }
.fs-mode .timer-icon { font-size: 1.3rem; }

.fs-mode .btn-start { padding: 0.8rem 3rem; font-size: 1.3rem; border-radius: 14px; }
.fs-mode .btn-reset { padding: 0.8rem 2rem; font-size: 1.1rem; border-radius: 14px; }
.fs-mode .btn-sound { width: 48px; height: 48px; font-size: 1.3rem; border-radius: 14px; }

.fs-mode .players-area { border-radius: 20px; padding: 1.5rem; }
.fs-mode .players-grid { grid-template-columns: repeat(auto-fill, minmax(480px, 1fr)); gap: 0.75rem; }
.fs-mode .player-card { padding: 0.6rem 0.8rem; border-radius: 10px; }
.fs-mode .pc-row { font-size: 0.95rem; min-height: 34px; }
.fs-mode .pc-name { font-size: 1.1rem; }
.fs-mode .zombie-badge, .fs-mode .survivor-badge { font-size: 0.9rem; }
.fs-mode .find-btn { width: 30px; height: 30px; font-size: 0.9rem; }
.fs-mode .pc-reported { font-size: 0.82rem; }
.fs-mode .led-dot { width: 10px; height: 10px; }

.fs-mode .player-card.just-infected {
    animation: fs-infect-flash 0.8s ease-out;
}

@keyframes fs-infect-flash {
    0% { background: rgba(255, 82, 82, 0.6); transform: scale(1.04); box-shadow: 0 0 40px rgba(255, 82, 82, 0.5); }
    100% { transform: scale(1); box-shadow: none; }
}

:fullscreen .results-card { max-width: 700px; padding: 2.5rem; }
:fullscreen .results-title { font-size: 2rem; margin-bottom: 2rem; }
:fullscreen .result-row { font-size: 1rem; padding: 0.6rem 0.8rem; }
:fullscreen .result-icon { font-size: 1.4rem; }

/* ============================================================================
   Responsive Adjustments
   ============================================================================ */

@media (max-width: 1200px) {
    .tag-dashboard .sidebar { width: 260px; }
    .players-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    .game-control-bar { flex-direction: column; align-items: center; gap: 0.75rem; }
    .gcb-center { flex-wrap: wrap; justify-content: center; }
    .gcb-right { justify-content: center; }
    .tag-content { flex-direction: column; }

    .tag-dashboard .sidebar {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .tag-dashboard .ble-panel,
    .tag-dashboard .game-config-panel {
        flex: 1;
        min-width: 280px;
    }

    .players-area { min-height: 400px; }
}

/* ============================================================================
   Light Theme Adjustments
   ============================================================================ */

[data-theme="light"] .player-card:hover {
    background: rgba(255, 255, 255, 1);
    border-color: var(--accent-green, #4caf50);
}

[data-theme="light"] .player-card.is-zombie {
    border-color: #c62828;
    background: linear-gradient(90deg, rgba(198, 40, 40, 0.1), rgba(255, 255, 255, 0.95));
}

[data-theme="light"] .player-card.is-survivor {
    border-color: #2e7d32;
    background: linear-gradient(90deg, rgba(46, 125, 50, 0.1), rgba(255, 255, 255, 0.95));
}

[data-theme="light"] .player-card.is-zombie-starter {
    border-color: #c62828;
    background: linear-gradient(90deg, rgba(198, 40, 40, 0.15), rgba(255, 255, 255, 0.95));
}

[data-theme="light"] .find-btn {
    background: linear-gradient(135deg, #388e3c, #2e7d32);
}

[data-theme="light"] .btn-start {
    background: linear-gradient(135deg, #4a9964, #3d8054);
}
