/* =============================================================
   Quiz 17: TRIAGE DEGRADATION — Styles
   Dark cockpit. Progressive visual degradation across 4 phases.
   The most visually intense quiz in the portfolio.
   ============================================================= */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;600&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --navy: #1e3a5f;
    --orange: #FF9800;
    --bg: #0a1628;
    --critical: #FF3B30;
    --moderate: #FF9500;
    --noise: #8E8E93;
    --correct: #22c55e;
    --incorrect: #ef4444;
    --text: #e2e8f0;
    --card-bg: rgba(255,255,255,0.06);
}

body {
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
    overflow-x: hidden;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 1.5rem 1.2rem;
}

/* --- SCREENS --- */
.screen { display: none; animation: fadeIn 0.3s ease; }
.screen.active { display: block; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ===== LANDING PAGE ===== */

@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes ctaGlow {
    0%, 100% { box-shadow: 0 0 15px rgba(255,152,0,0.4); }
    50% { box-shadow: 0 0 30px rgba(255,152,0,0.6), 0 0 60px rgba(255,152,0,0.2); }
}

.landing-badge {
    display: block;
    text-align: center;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--orange);
    margin-bottom: 10px;
    animation: fadeSlideUp 0.5s ease both;
}

.landing-doi {
    display: block;
    text-align: center;
    font-size: 0.65rem;
    color: rgba(255,255,255,0.3);
    margin-bottom: 16px;
    animation: fadeSlideUp 0.5s ease 0.05s both;
}

.landing-doi a { color: rgba(255,255,255,0.4); text-decoration: none; }
.landing-doi a:hover { color: var(--orange); }

.landing-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-section {
    background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 2rem 1.5rem 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
    animation: fadeSlideUp 0.5s ease 0.2s both;
    position: relative;
    overflow: hidden;
}

.hero-section h1 {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.1;
    margin-bottom: 0.6rem;
    text-shadow: 0 0 60px rgba(255,255,255,0.06), 0 2px 4px rgba(0,0,0,0.3);
    animation: fadeSlideUp 0.5s ease 0.2s both;
}

.hero-section h2 {
    font-size: 1.05rem;
    font-weight: 500;
    color: rgba(255,255,255,0.6);
    margin-bottom: 1.5rem;
    animation: fadeSlideUp 0.5s ease 0.4s both;
}

.landing-description {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.5);
    line-height: 1.7;
    text-align: center;
    margin-bottom: 1.5rem;
    animation: fadeSlideUp 0.5s ease 0.6s both;
}

/* Alert descending preview animation */
.alert-stream-preview {
    position: relative;
    width: 100%;
    max-width: 300px;
    height: 160px;
    margin: 0 auto 1.5rem;
    overflow: hidden;
    border-radius: 12px;
    background: rgba(0,0,0,0.3);
}

.preview-invader {
    position: absolute;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    opacity: 0;
    border: 2px solid;
}

.preview-invader.critical { border-color: var(--critical); background: rgba(255,59,48,0.2); box-shadow: 0 0 10px rgba(255,59,48,0.3); }
.preview-invader.moderate { border-color: var(--moderate); background: rgba(255,149,0,0.15); }
.preview-invader.noise { border-color: var(--noise); background: rgba(142,142,147,0.1); }

.preview-invader.critical::after {
    content: '';
    position: absolute;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--critical);
    animation: previewPulse 1.5s ease-in-out infinite;
}

.preview-deck-line {
    position: absolute;
    bottom: 20px;
    left: 8px;
    right: 8px;
    height: 2px;
    border-top: 2px dashed rgba(255,59,48,0.3);
}

@keyframes previewPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

@keyframes previewDescend {
    0% { transform: translateY(-50px); opacity: 0; }
    8% { opacity: 1; }
    75% { opacity: 1; }
    100% { transform: translateY(140px); opacity: 0; }
}

.preview-invader:nth-child(1) { left: 20px;  animation: previewDescend 2.8s linear infinite; }
.preview-invader:nth-child(2) { left: 130px; animation: previewDescend 2.8s linear 0.5s infinite; }
.preview-invader:nth-child(3) { left: 75px;  animation: previewDescend 2.8s linear 1.0s infinite; }
.preview-invader:nth-child(4) { left: 200px; animation: previewDescend 2.8s linear 1.5s infinite; }
.preview-invader:nth-child(5) { left: 40px;  animation: previewDescend 2.8s linear 2.0s infinite; }

/* Feature pills */
.landing-features {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
    animation: fadeSlideUp 0.5s ease 0.8s both;
}
.feature-pill {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.5);
    font-weight: 600;
}
.feature-pill-dot {
    color: rgba(255,255,255,0.25);
    font-size: 0.7rem;
}

/* CTA button */
.cta-button {
    display: block;
    width: 100%;
    max-width: 360px;
    margin: 1.5rem auto 1rem;
    padding: 1.1rem 2rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: #0a1628;
    background: linear-gradient(135deg, var(--orange) 0%, #ff8f5e 100%);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(255,152,0,0.35);
    -webkit-tap-highlight-color: transparent;
    animation: fadeSlideUp 0.5s ease 1s both, ctaGlow 3s ease-in-out 1.5s infinite;
    font-family: inherit;
}

.cta-button:hover {
    background: #ff8555;
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(255,152,0,0.45);
    animation: none;
}

.cta-button:active { transform: translateY(0); }

/* ===== BRIEFING SCREEN ===== */
.briefing-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}
.briefing-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #fff;
}
.briefing-instruction {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.7);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}
.briefing-legend {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 1.5rem;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
}
.legend-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
}
.legend-dot {
    flex-shrink: 0;
}
.legend-info {
    display: flex;
    flex-direction: column;
    text-align: left;
}
.legend-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
}
.legend-desc {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.5);
}
.briefing-practice {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.4);
    margin-bottom: 1rem;
    font-style: italic;
}
.briefing-btn {
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    padding: 1rem 2rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: #0a1628;
    background: linear-gradient(135deg, #FF9800 0%, #ff8f5e 100%);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    box-shadow: 0 4px 20px rgba(255,152,0,0.35);
}
.briefing-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(255,152,0,0.45);
}

/* ===== GAME SCREEN ===== */

.game-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    position: relative;
    touch-action: manipulation;
    transition: filter 2s ease, background 2s ease;
}

/* Phase backgrounds via body classes */
.game-container.phase-1 { background: var(--bg); }
.game-container.phase-2 { background: #081422; }
.game-container.phase-3 { background: #060f1c; }
.game-container.phase-4 { background: #04080f; }

/* Vignette overlay via box-shadow (avoids filter stacking context issues) */
.game-container.phase-2 { box-shadow: inset 0 0 80px rgba(0,0,0,0.3); }
.game-container.phase-3 { box-shadow: inset 0 0 120px rgba(0,0,0,0.5); }
.game-container.phase-4 { box-shadow: inset 0 0 160px rgba(0,0,0,0.6); }

/* CRT scanlines (phases 3-4) */
.scanlines {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity 1s ease;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0,0,0,0.03) 2px,
        rgba(0,0,0,0.03) 4px
    );
}

.game-container.phase-3 .scanlines { opacity: 0.1; }
.game-container.phase-4 .scanlines { opacity: 0.2; }

/* Red edge pulse (phase 4) */
.edge-glow {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    transition: opacity 1s ease;
}

.game-container.phase-4 .edge-glow {
    opacity: 1;
    animation: edgePulse 2s ease-in-out infinite;
}

@keyframes edgePulse {
    0%, 100% { box-shadow: inset 0 0 60px rgba(255,59,48,0.08); }
    50% { box-shadow: inset 0 0 100px rgba(255,59,48,0.15); }
}

/* Phase/timer bar */
.phase-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    position: relative;
    z-index: 2;
    background: rgba(0,0,0,0.3);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.phase-label-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(255,255,255,0.6);
}

.timer-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255,255,255,0.5);
    transition: color 0.3s;
}

.timer-text.urgent {
    color: var(--orange);
    animation: timerPulse 0.5s ease-in-out infinite;
}

@keyframes timerPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Timer progress bar */
.timer-bar {
    height: 12px;
    background: rgba(255,255,255,0.06);
    position: relative;
    z-index: 10000;
}

.timer-bar-fill {
    height: 100%;
    background: var(--orange);
    width: 0%;
    transition: width 0.1s linear;
}

.timer-bar-fill.timer-critical {
    height: 14px;
}

/* Phase flash overlay */
.phase-flash {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(10,22,40,0.95);
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.phase-flash.visible {
    opacity: 1;
    pointer-events: auto;
}

.phase-flash-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--orange);
    margin-bottom: 8px;
}

.phase-flash-name {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.5);
}

/* USP flash overlay (between phase 3 and 4) */
.usp-flash {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10,22,40,0.97);
    z-index: 101;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
    padding: 2rem;
}

.usp-flash.visible { opacity: 1; }

.usp-flash-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: rgba(255,255,255,0.8);
    text-align: center;
    line-height: 1.6;
    max-width: 400px;
}

/* Arena — the play field */
.arena {
    flex: 1;
    position: relative;
    z-index: 2;
    overflow: hidden;
    min-height: 400px;
    touch-action: manipulation;
}

/* Deck line — danger zone near bottom */
.deck-line {
    position: absolute;
    bottom: 8%;
    left: 12px;
    right: 12px;
    height: 2px;
    border-top: 2px dashed rgba(255,59,48,0.35);
    z-index: 3;
    pointer-events: none;
}

.deck-label {
    position: absolute;
    right: 0;
    top: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.55rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(255,59,48,0.35);
}

/* Alert invaders — compact tiles that descend */
.alert-invader {
    position: absolute;
    width: 64px;
    height: 64px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    z-index: 5;
    transition: box-shadow 0.15s ease;
    will-change: transform;
    /* No transform transition — we animate via JS */
}

.alert-invader .invader-icon {
    font-size: 1.3rem;
    line-height: 1;
    margin-bottom: 2px;
}

.alert-invader .invader-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.45rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255,255,255,0.7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 56px;
    text-align: center;
}

/* Severity styles */
.alert-invader.severity-critical {
    background: rgba(255, 59, 48, 0.25);
    border: 2px solid var(--critical);
    box-shadow: 0 0 12px rgba(255,59,48,0.3);
    animation: invaderPulse 1s ease-in-out infinite;
}

.alert-invader.severity-moderate {
    background: rgba(255, 149, 0, 0.18);
    border: 2px solid var(--moderate);
    box-shadow: 0 0 8px rgba(255,149,0,0.2);
}

.alert-invader.severity-noise {
    background: rgba(142, 142, 147, 0.1);
    border: 2px solid rgba(142,142,147,0.35);
    opacity: 0.7;
}

@keyframes invaderPulse {
    0%, 100% { box-shadow: 0 0 12px rgba(255,59,48,0.3); }
    50% { box-shadow: 0 0 20px rgba(255,59,48,0.5); }
}

/* Invader tap states */
.alert-invader.tapped-correct {
    animation: invaderExplode 0.25s ease forwards !important;
}

@keyframes invaderExplode {
    0% { transform: scale(1); opacity: 1; }
    40% { transform: scale(1.3); background: rgba(52,199,89,0.5); border-color: var(--correct); opacity: 1; }
    100% { transform: scale(0); opacity: 0; }
}

.alert-invader.tapped-false {
    animation: invaderShake 0.35s ease !important;
}

@keyframes invaderShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); border-color: var(--incorrect); }
    40%, 80% { transform: translateX(6px); border-color: var(--incorrect); }
}

.alert-invader.missed-exit {
    animation: invaderMiss 0.4s ease forwards !important;
}

@keyframes invaderMiss {
    0% { opacity: 1; }
    50% { border-color: var(--critical); box-shadow: 0 0 20px rgba(255,59,48,0.6); }
    100% { opacity: 0; transform: scale(0.5); }
}

.alert-invader.noise-exit {
    animation: invaderFade 0.3s ease forwards !important;
}

@keyframes invaderFade {
    0% { opacity: 0.7; }
    100% { opacity: 0; }
}

/* Impact flash — full-screen red flash when critical reaches deck */
.impact-flash {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,59,48,0.15);
    pointer-events: none;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.1s ease;
}

.impact-flash.active {
    opacity: 1;
    animation: impactFlash 0.4s ease forwards;
}

@keyframes impactFlash {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

/* Shield display */
.shield-display {
    display: flex;
    gap: 4px;
    align-items: center;
}

.shield-icon {
    font-size: 1rem;
    transition: all 0.3s ease;
}

.shield-icon.lost {
    opacity: 0.15;
    filter: grayscale(1);
    animation: shieldShatter 0.4s ease forwards;
}

@keyframes shieldShatter {
    0% { transform: scale(1); opacity: 1; }
    30% { transform: scale(1.3) rotate(10deg); }
    100% { transform: scale(0.8) rotate(-5deg); opacity: 0.15; }
}

/* Defenses down overlay */
.defenses-down {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--critical);
    text-transform: uppercase;
    letter-spacing: 4px;
    text-shadow: 0 0 30px rgba(255,59,48,0.5);
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.defenses-down.visible {
    animation: defensesDown 2s ease forwards;
}

@keyframes defensesDown {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
    15% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
    30% { transform: translate(-50%, -50%) scale(1); }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

/* Player ship */
.player-ship {
    position: absolute;
    bottom: 2%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 6;
    pointer-events: none;
    transition: left 0.05s linear;
}

.ship-body {
    width: 0;
    height: 0;
    border-left: 18px solid transparent;
    border-right: 18px solid transparent;
    border-bottom: 30px solid var(--orange);
    filter: drop-shadow(0 0 8px rgba(255,152,0,0.5));
    position: relative;
}

.ship-body::after {
    content: '';
    position: absolute;
    bottom: -30px;
    left: -10px;
    width: 20px;
    height: 6px;
    background: var(--orange);
    border-radius: 0 0 4px 4px;
    opacity: 0.6;
}

/* Projectile */
.projectile {
    position: absolute;
    width: 4px;
    height: 16px;
    background: var(--orange);
    border-radius: 2px;
    z-index: 4;
    box-shadow: 0 0 6px rgba(255,152,0,0.6), 0 0 12px rgba(255,152,0,0.3);
    pointer-events: none;
    will-change: transform;
}

/* Fire controls bar */
.fire-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 8px 16px;
    background: rgba(0,0,0,0.3);
    position: relative;
    z-index: 2;
}

.fire-btn {
    padding: 10px 32px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #0a1628;
    background: var(--orange);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    box-shadow: 0 0 12px rgba(255,152,0,0.4);
    transition: transform 0.05s, box-shadow 0.1s;
    min-height: 44px;
}

.fire-btn:active {
    transform: scale(0.95);
    box-shadow: 0 0 20px rgba(255,152,0,0.6);
}

.control-hint {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.55rem;
    color: rgba(255,255,255,0.25);
    letter-spacing: 0.5px;
}

/* Show desktop hints on desktop, mobile hints on mobile */
.control-hint.mobile-only { display: none; }
.control-hint.desktop-only { display: inline; }

@media (max-width: 768px) {
    .control-hint.mobile-only { display: inline; }
    .control-hint.desktop-only { display: none; }
}

/* Briefing shields note */
.briefing-shields {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.5);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

/* Phase 3-4: desaturation on arena only (filter on game-container breaks fixed positioning) */
.game-container.phase-3 .arena {
    filter: saturate(0.85);
}

.game-container.phase-4 .arena {
    filter: saturate(0.7);
}

/* Screen shake on new alert */
@keyframes screenShake {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-1px, 0); }
    75% { transform: translate(1px, 0); }
}

.game-container.phase-3 .shake-trigger { animation: screenShake 0.05s ease; }
.game-container.phase-4 .shake-trigger { animation: screenShake 0.05s ease; }

/* HUD footer */
.hud-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: rgba(0,0,0,0.4);
    border-top: 1px solid rgba(255,255,255,0.06);
    position: relative;
    z-index: 2;
}

.hud-stats {
    display: flex;
    gap: 16px;
}

.hud-stat {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.5);
}

.hud-stat-value {
    color: #fff;
    font-weight: 700;
}

.hud-stat.hits .hud-stat-value { color: var(--correct); }
.hud-stat.misses .hud-stat-value { color: var(--incorrect); }
.hud-stat.false-alarms .hud-stat-value { color: var(--moderate); }

/* Recording indicator */
.recording-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    color: rgba(255,255,255,0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.recording-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--critical);
    animation: recordingPulse 1.5s ease-in-out infinite;
}

@keyframes recordingPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Tap instruction */
.tap-instruction {
    text-align: center;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.3);
    padding: 6px 0;
    font-style: italic;
    position: relative;
    z-index: 2;
}

/* ===== RESULTS PAGE ===== */
.results-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: 24px;
    padding-bottom: 40px;
}

/* Score display */
.score-display {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 2rem 1.5rem;
    background: rgba(255,255,255,0.04);
    border-radius: 16px;
}

.score-number {
    font-size: 4rem;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
    line-height: 1;
    margin-bottom: 4px;
}

.score-number.score-green { color: var(--correct); }
.score-number.score-orange { color: var(--orange); }
.score-number.score-red { color: var(--incorrect); }

.score-label {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.4);
    margin-bottom: 8px;
}

.score-title {
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.score-title.score-green { color: var(--correct); }
.score-title.score-orange { color: var(--orange); }
.score-title.score-red { color: var(--incorrect); }

.score-desc {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.5);
    margin-top: 8px;
    line-height: 1.5;
}

/* Phase accuracy chart */
.chart-section {
    margin-bottom: 1.5rem;
}

.chart-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,0.5);
    text-align: center;
    margin-bottom: 12px;
}

.chart-container {
    width: 100%;
    background: #0f1a2e;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.08);
    padding: 16px 12px 8px;
    overflow: hidden;
}

.chart-container canvas {
    width: 100%;
    height: 220px;
    display: block;
}

/* Degradation headline */
.degradation-headline {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1.2rem;
    background: rgba(255,255,255,0.04);
    border-radius: 12px;
}

.degradation-text {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 8px;
}

.degradation-text.deg-red { color: var(--incorrect); }
.degradation-text.deg-orange { color: var(--orange); }
.degradation-text.deg-green { color: var(--correct); }

.breaking-point-text {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.5);
}

/* Stats table */
.stats-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    font-size: 0.75rem;
}

.stats-table th {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.4);
    padding: 8px 6px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.stats-table td {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
    padding: 8px 6px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.stats-table tr:nth-child(even) td {
    background: rgba(255,255,255,0.02);
}

.stats-table .row-label {
    text-align: left;
    color: rgba(255,255,255,0.5);
    font-size: 0.7rem;
}

/* Explanation section */
.explanation {
    background: rgba(255,255,255,0.04);
    border-left: 4px solid var(--orange);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.explanation h3 {
    color: var(--orange);
    margin-bottom: 0.8rem;
    font-size: 1.2rem;
    font-weight: 700;
}

.explanation p {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.7);
    line-height: 1.7;
    margin-bottom: 0.8rem;
}

.explanation p:last-child { margin-bottom: 0; }

.explanation .insight-text {
    color: rgba(255,255,255,0.5);
    font-style: italic;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.study-link {
    display: inline-block;
    color: var(--orange);
    font-weight: 600;
    text-decoration: none;
    font-size: 0.85rem;
}

.study-link:hover { text-decoration: underline; }

/* Email gate */
.report-gate {
    text-align: center;
    margin-bottom: 0.8rem;
    padding: 1.5rem;
    background: rgba(255,152,0,0.1);
    border: 2px solid rgba(255,152,0,0.4);
    border-radius: 16px;
}

.report-gate h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.3rem;
}

.report-gate > p {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.6);
    line-height: 1.6;
    margin-bottom: 1rem;
}

#newsletter-form,
#email-form {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    max-width: 320px;
    margin: 0 auto;
}

#newsletter-form input[type="email"],
.second-chance input[type="email"] {
    padding: 0.85rem;
    font-size: 1rem;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 10px;
    background: rgba(255,255,255,0.08);
    color: #fff;
    font-family: inherit;
}

#newsletter-form input[type="email"]::placeholder,
.second-chance input[type="email"]::placeholder {
    color: rgba(255,255,255,0.4);
}

#newsletter-form input[type="email"]:focus,
.second-chance input[type="email"]:focus {
    outline: none;
    border-color: var(--orange);
}

.subscribe-button {
    padding: 0.9rem 1.5rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: #0a1628;
    background: var(--orange);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.subscribe-button:hover:not(:disabled) { background: #ff8555; }
.subscribe-button:disabled { opacity: 0.6; cursor: default; }

.form-message { font-size: 0.9rem; margin-top: 0.6rem; }
.form-message.success { color: #4caf50; }
.form-message.error { color: #ff4444; }

.skip-link {
    display: block;
    text-align: center;
    margin: 0.5rem auto 1.5rem;
    padding: 8px;
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: underline;
    font-family: inherit;
}

.skip-link:hover { color: rgba(255,255,255,0.7); }

/* Social sharing */
.social-sharing {
    background: rgba(255,255,255,0.04);
    border-radius: 14px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.social-sharing h3 {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: rgba(255,255,255,0.8);
}

.share-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.share-btn {
    padding: 0.85rem;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.share-btn.native { background: #FF9800; color: #0a1628; }
.share-btn.facebook { background: #1877f2; color: #fff; }
.share-btn.linkedin { background: #0a66c2; color: #fff; }
.share-btn.copy { background: rgba(255,255,255,0.12); color: #fff; border: 1px solid rgba(255,255,255,0.2); }

/* Second chance */
.second-chance {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.second-chance > p {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.6);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.second-chance form {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    max-width: 320px;
    margin: 0 auto;
}

/* Play again */
.play-again-btn {
    display: block;
    width: 100%;
    max-width: 240px;
    margin: 1rem auto 0;
    padding: 0.9rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--orange);
    background: transparent;
    border: 2px solid rgba(255,152,0,0.3);
    border-radius: 50px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    font-family: inherit;
}

.play-again-btn:hover {
    border-color: var(--orange);
    background: rgba(255,152,0,0.08);
}

/* GDPR consent */
.gdpr-consent {
    display: flex; align-items: flex-start; gap: 8px;
    font-size: 0.75rem; color: rgba(255,255,255,0.4);
    cursor: pointer; text-align: left; line-height: 1.4;
}
.gdpr-consent input[type="checkbox"] {
    margin-top: 2px; flex-shrink: 0; accent-color: var(--orange);
    width: 16px; height: 16px; cursor: pointer;
}
.gdpr-consent a { color: rgba(255,255,255,0.5); text-decoration: underline; }
.gdpr-consent a:hover { color: var(--orange); }

/* Particle burst */
.particle {
    position: fixed;
    width: 6px;
    height: 6px;
    background: var(--orange);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    animation: particleBurst 0.7s ease-out forwards;
}

@keyframes particleBurst {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(var(--dx), var(--dy)) scale(0); opacity: 0; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .stats-table th,
    .stats-table td {
        padding: 6px 4px;
        font-size: 0.7rem;
    }

    .alert-invader {
        width: 58px;
        height: 58px;
    }

    .alert-invader .invader-icon {
        font-size: 1.15rem;
    }

    .defenses-down {
        font-size: 1.2rem;
        letter-spacing: 3px;
    }
}

@media (max-width: 480px) {
    .container { padding: 1.2rem 1rem; }
    .hero-section h1 { font-size: 1.8rem; }
    .hero-section h2 { font-size: 0.95rem; }
    .score-number { font-size: 3rem; }
    .cta-button, .subscribe-button, .share-btn { min-height: 48px; }
    .alert-invader { width: 52px; height: 52px; }
    .alert-invader .invader-icon { font-size: 1rem; }
    .alert-invader .invader-label { font-size: 0.4rem; max-width: 46px; }
    .defenses-down { font-size: 1rem; letter-spacing: 2px; }

    .ship-body {
        border-left-width: 14px;
        border-right-width: 14px;
        border-bottom-width: 24px;
    }
    .ship-body::after { left: -7px; width: 14px; height: 5px; bottom: -24px; }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .game-container.phase-3 .shake-trigger,
    .game-container.phase-4 .shake-trigger { animation: none; }
    .scanlines { display: none; }
    .edge-glow { display: none; }
    .game-container.phase-3,
    .game-container.phase-4 { filter: none; }
    .alert-invader.severity-critical { animation: none; }
}
