/* ============================================
   ATC QUIZ BATTLE — Aesthetic Effects
   Radar console animations & ATC atmosphere
   ============================================ */

/* --- RADAR SWEEP EFFECT (Background) --- */
.bg-image::after {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: conic-gradient(
        from 0deg at 50% 120%,
        transparent 0deg,
        rgba(0,255,65,0.03) 15deg,
        transparent 30deg
    );
    animation: radarSweep 8s linear infinite;
    pointer-events: none;
}
@keyframes radarSweep {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* --- ACTIVE TEAM PULSE (Green glow) --- */
.team-score.active.team-a {
    animation: teamPulseA 2s ease infinite;
}
.team-score.active.team-b {
    animation: teamPulseB 2s ease infinite;
}
@keyframes teamPulseA {
    0%, 100% { box-shadow: 0 0 15px rgba(255,107,53,0.1); }
    50% { box-shadow: 0 0 25px rgba(255,107,53,0.2); }
}
@keyframes teamPulseB {
    0%, 100% { box-shadow: 0 0 15px rgba(0,212,255,0.1); }
    50% { box-shadow: 0 0 25px rgba(0,212,255,0.2); }
}

/* --- HEADER GLOW --- */
.header h1 {
    animation: headerGlow 4s ease-in-out infinite;
}
@keyframes headerGlow {
    0%, 100% { text-shadow: 0 0 15px rgba(0,255,65,0.2); }
    50% { text-shadow: 0 0 30px rgba(0,255,65,0.4); }
}

/* --- QUESTION BUTTON HOVER --- */
.question-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.2s;
}
.question-btn:hover:not(.used) {
    background: rgba(255,255,255,0.04);
    filter: brightness(1.15);
}
.question-btn.easy:hover:not(.used) { background: rgba(0,204,51,0.06); }
.question-btn.medium:hover:not(.used) { background: rgba(255,176,0,0.06); }
.question-btn.hard:hover:not(.used) { background: rgba(255,45,45,0.06); }

/* --- USED QUESTION OVERLAY --- */
.question-btn.used {
    position: relative;
}
.question-btn.used::after {
    content: '';
    position: absolute;
    top: 50%; left: 10%; right: 10%;
    height: 1px;
    background: rgba(255,255,255,0.15);
    transform: translateY(-50%);
}

/* --- CATEGORY COLUMN SLIDE-IN --- */
.category-column {
    opacity: 0;
    transform: translateX(-15px);
    animation: columnAppear 0.4s ease forwards;
}
.category-column:nth-child(1) { animation-delay: 0.05s; }
.category-column:nth-child(2) { animation-delay: 0.1s; }
.category-column:nth-child(3) { animation-delay: 0.15s; }
.category-column:nth-child(4) { animation-delay: 0.2s; }
.category-column:nth-child(5) { animation-delay: 0.25s; }
.category-column:nth-child(6) { animation-delay: 0.3s; }
.category-column:nth-child(7) { animation-delay: 0.35s; }
.category-column:nth-child(8) { animation-delay: 0.4s; }
@keyframes columnAppear {
    to { opacity: 1; transform: translateX(0); }
}

/* --- MODAL ENTER (Clearance issued) --- */
.question-modal {
    animation: clearanceSlide 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
@keyframes clearanceSlide {
    0% { opacity: 0; transform: translateY(-15px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* --- ANSWER SECTION REVEAL --- */
.answer-section.flip-in {
    animation: answerReveal 0.3s ease;
}
@keyframes answerReveal {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* --- RESULT POPUP --- */
.result-popup.correct .result-icon {
    animation: affirmPulse 0.5s ease;
}
@keyframes affirmPulse {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

/* --- WINNER SCREEN RADAR BACKGROUND --- */
.winner-screen.active::before {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background:
        radial-gradient(circle at 50% 50%, transparent 150px, rgba(0,255,65,0.025) 151px, transparent 152px),
        radial-gradient(circle at 50% 50%, transparent 300px, rgba(0,255,65,0.018) 301px, transparent 302px),
        radial-gradient(circle at 50% 50%, transparent 450px, rgba(0,255,65,0.012) 451px, transparent 452px);
    pointer-events: none;
    z-index: -1;
}
.winner-screen.active::after {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: conic-gradient(
        from 0deg at 50% 50%,
        transparent 0deg,
        rgba(0,255,65,0.04) 20deg,
        transparent 40deg
    );
    animation: winnerRadar 6s linear infinite;
    pointer-events: none;
    z-index: -1;
}
@keyframes winnerRadar {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* --- SCORE VALUE GLOW --- */
.score-value {
    transition: text-shadow 0.3s;
}

/* --- SELECTION TURN INDICATOR --- */
.selection-turn-indicator {
    transition: all 0.3s ease;
}

/* --- CATEGORY OPTION SELECTED EFFECT --- */
.category-option.selected-a,
.category-option.selected-b {
    transform: translateY(-2px);
    transition: all 0.2s;
}

/* --- START BUTTON HOVER --- */
.start-btn:not(:disabled) {
    transition: all 0.2s;
}
.start-btn:not(:disabled):hover {
    transform: translateY(-2px);
}

/* --- SOUND TOGGLE --- */
.sound-toggle:hover {
    border-color: var(--atc-green);
    color: var(--atc-green);
}

/* --- TEAM MEMBERS DISPLAY --- */
.team-members-display {
    background: rgba(0,0,0,0.15);
    padding: 3px 8px;
    border-radius: 3px;
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --- SCROLLBAR (Dark ATC) --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--atc-bg); }
::-webkit-scrollbar-thumb { background: var(--atc-border-light); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,255,65,0.3); }

/* --- FOCUS STATES --- */
button:focus-visible,
input:focus-visible {
    outline: 1px solid var(--atc-green);
    outline-offset: 2px;
}

/* --- STEAL/INTERCEPT PULSE --- */
.steal-mode-indicator.active {
    animation: interceptPulse 1.5s ease infinite;
}
@keyframes interceptPulse {
    0%, 100% { box-shadow: 0 0 10px rgba(155,89,182,0.2); border-color: var(--purple); }
    50% { box-shadow: 0 0 22px rgba(155,89,182,0.35); border-color: #b8a0d9; }
}

/* --- PROGRESS BAR --- */
.game-progress .progress-fill {
    background: var(--atc-green);
    box-shadow: 0 0 6px rgba(0,255,65,0.2);
}
.game-progress.complete .progress-fill {
    animation: progressComplete 1.5s ease infinite;
}
@keyframes progressComplete {
    0%, 100% { box-shadow: 0 0 6px rgba(0,255,65,0.2); }
    50% { box-shadow: 0 0 16px rgba(0,255,65,0.4); }
}

/* --- BUTTON PRESS FEEDBACK --- */
.answer-btn:active,
.pre-game-btn:active,
.start-btn:active:not(:disabled),
.play-again-btn:active {
    transform: scale(0.97);
}

/* --- CRT FLICKER (very subtle) --- */
@keyframes crtFlicker {
    0% { opacity: 1; }
    5% { opacity: 0.98; }
    10% { opacity: 1; }
    15% { opacity: 0.99; }
    20% { opacity: 1; }
    100% { opacity: 1; }
}
.bg-overlay {
    animation: crtFlicker 4s steps(1) infinite;
}
