/* =============================================================
   Quiz 14: THE CRY WOLF TEST — Styles
   Dark cockpit at night. Nav station atmosphere.
   ============================================================= */

@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: #ff3b3b;
    --critical-bar: #8b1a1a;
    --routine: #ffaa00;
    --routine-bar: #8b6914;
    --false: #6b7280;
    --false-bar: #374151;
    --correct: #22c55e;
    --incorrect: #ef4444;
    --progress-track: #1e3a5f;
    --instrument: #2a4a6a;
    --text: #e2e8f0;
}

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-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.1s both;
    position: relative;
    overflow: hidden;
}

/* CRT scanline overlay */
.hero-section::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0,0,0,0.03) 2px,
        rgba(0,0,0,0.03) 4px
    );
    pointer-events: none;
}

.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);
}

.hero-section h2 {
    font-size: 1.05rem;
    font-weight: 500;
    color: rgba(255,255,255,0.6);
    margin-bottom: 1.5rem;
}

/* Landing alarm grid preview */
.alarm-grid-preview {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    padding: 16px;
    margin: 0 auto 1rem;
    max-width: 280px;
}

.grid-dot {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    opacity: 0;
}

/* Grid animation: 6-second cycle */
@keyframes gridPhase1 {
    0% { opacity: 0; background: rgba(255,255,255,0.08); }
    5% { opacity: 1; background: var(--critical); box-shadow: 0 0 12px rgba(255,59,59,0.6); }
    12% { opacity: 0.3; background: rgba(255,59,59,0.2); }
    100% { opacity: 0.15; background: rgba(255,255,255,0.08); }
}

@keyframes gridPhase2 {
    0%, 30% { opacity: 0.15; background: rgba(255,255,255,0.08); }
    35% { opacity: 1; background: var(--false); }
    45% { opacity: 0.3; background: rgba(107,114,128,0.3); }
    100% { opacity: 0.15; background: rgba(255,255,255,0.08); }
}

@keyframes gridCryWolf {
    0%, 65% { opacity: 0.15; background: rgba(255,255,255,0.08); }
    70% { opacity: 1; background: var(--critical); box-shadow: 0 0 12px rgba(255,59,59,0.6); }
    85% { opacity: 0.5; background: rgba(255,59,59,0.3); }
    90% { opacity: 0.15; background: rgba(255,59,59,0.1); }
    100% { opacity: 0.15; background: rgba(255,255,255,0.08); }
}

.grid-dot:nth-child(-n+10) {
    animation: gridPhase1 6s ease-in-out infinite;
}
.grid-dot:nth-child(1) { animation-delay: 0s; }
.grid-dot:nth-child(2) { animation-delay: 0.13s; }
.grid-dot:nth-child(3) { animation-delay: 0.26s; }
.grid-dot:nth-child(4) { animation-delay: 0.39s; }
.grid-dot:nth-child(5) { animation-delay: 0.52s; }
.grid-dot:nth-child(6) { animation-delay: 0.65s; }
.grid-dot:nth-child(7) { animation-delay: 0.78s; }
.grid-dot:nth-child(8) { animation-delay: 0.91s; }
.grid-dot:nth-child(9) { animation-delay: 1.04s; }
.grid-dot:nth-child(10) { animation-delay: 1.17s; }

.grid-dot:nth-child(n+11):nth-child(-n+12) { animation: gridPhase2 6s ease-in-out infinite; animation-delay: 2.2s; }
.grid-dot:nth-child(13) { animation: gridPhase2 6s ease-in-out infinite; animation-delay: 2.6s; }
.grid-dot:nth-child(14) { animation: gridPhase2 6s ease-in-out infinite; animation-delay: 3s; }

.grid-dot:nth-child(15) { animation: gridCryWolf 6s ease-in-out infinite; }

/* Feature pills */
.landing-features {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
    animation: fadeSlideUp 0.5s ease 0.5s 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 0.35s 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); }

.sound-inline {
    cursor: pointer;
    vertical-align: middle;
}

.sound-inline input[type="checkbox"] {
    accent-color: var(--orange);
    vertical-align: middle;
    margin-left: 2px;
}

/* ===== 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 {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-dot-critical { background: var(--critical); box-shadow: 0 0 8px rgba(255,59,59,0.5); }
.legend-dot-routine { background: var(--routine); }
.legend-dot-false { background: var(--false); }

.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, var(--orange) 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-top: 8px;
    padding-bottom: 0;
    position: relative;
}

/* Ambient stars */
.game-container::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(1px 1px at 10% 15%, rgba(255,255,255,0.15), transparent),
        radial-gradient(1px 1px at 30% 8%, rgba(255,255,255,0.1), transparent),
        radial-gradient(1px 1px at 55% 22%, rgba(255,255,255,0.12), transparent),
        radial-gradient(1px 1px at 75% 5%, rgba(255,255,255,0.08), transparent),
        radial-gradient(1px 1px at 90% 18%, rgba(255,255,255,0.1), transparent),
        radial-gradient(1px 1px at 15% 30%, rgba(255,255,255,0.06), transparent),
        radial-gradient(1px 1px at 45% 35%, rgba(255,255,255,0.08), transparent),
        radial-gradient(1px 1px at 85% 28%, rgba(255,255,255,0.1), transparent);
    pointer-events: none;
    z-index: 0;
}

/* Horizon line */
.game-container::after {
    content: '';
    position: fixed;
    bottom: 18%;
    left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(30,58,95,0.3) 30%, rgba(30,58,95,0.5) 50%, rgba(30,58,95,0.3) 70%, transparent 100%);
    pointer-events: none;
    z-index: 0;
}

/* Status bar */
.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}

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

.watch-time {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    font-weight: 600;
    color: var(--instrument);
    letter-spacing: 1px;
    transition: color 0.3s, text-shadow 0.3s;
}

/* Timer progress bar */
.timer-bar-top {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 12px;
    background: rgba(255,255,255,0.08);
    z-index: 10000;
}

.timer-bar-fill {
    height: 100%;
    width: 100%;
    background: #4ade80;
    transition: width 1s linear, background-color 0.5s ease;
    border-radius: 0 2px 2px 0;
}

.timer-bar-fill.timer-warning {
    background: #FF9800;
}

.timer-bar-fill.timer-danger {
    background: #ef4444;
    animation: timerBarPulse 1s ease-in-out infinite;
}

.timer-bar-fill.timer-critical {
    background: #ef4444;
    animation: timerBarPulse 0.5s ease-in-out infinite;
    height: 14px;
}

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

.practice-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--orange);
    background: rgba(255,152,0,0.1);
    border: 1px solid rgba(255,152,0,0.3);
    border-radius: 4px;
    padding: 2px 8px;
    display: none;
}

/* Centre zone — instrument panel */
.instrument-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    min-height: 400px;
}

/* Alarm card */
.alarm-card {
    width: 100%;
    max-width: 460px;
    border-radius: 14px;
    margin-bottom: 20px;
    opacity: 0;
    transform: translateY(-15px) scale(0.95);
    transition: opacity 0.2s ease, transform 0.2s ease;
    overflow: hidden;
    min-height: 76px;
    display: flex;
    align-items: stretch;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.alarm-card.active {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.alarm-card.critical {
    background: rgba(255,59,59,0.12);
    border: 2px solid rgba(255,59,59,0.5);
    box-shadow: 0 0 30px rgba(255,59,59,0.2), 0 0 60px rgba(255,59,59,0.08);
    animation: cardPulseCritical 800ms ease-in-out infinite;
}

.alarm-card.routine {
    background: rgba(255,170,0,0.08);
    border: 2px solid rgba(255,170,0,0.35);
    box-shadow: 0 0 15px rgba(255,170,0,0.1);
}

.alarm-card.false-alarm {
    background: rgba(107,114,128,0.08);
    border: 2px solid rgba(107,114,128,0.25);
    animation: cardFlicker 400ms ease;
}

.alarm-card.missed-flash {
    border-color: var(--incorrect) !important;
    box-shadow: 0 0 40px rgba(239,68,68,0.5) !important;
    animation: none !important;
}

@keyframes cardPulseCritical {
    0%, 100% { box-shadow: 0 0 30px rgba(255,59,59,0.2), 0 0 60px rgba(255,59,59,0.08); }
    50% { box-shadow: 0 0 45px rgba(255,59,59,0.35), 0 0 80px rgba(255,59,59,0.15); }
}

@keyframes cardFlicker {
    0% { opacity: 1; }
    15% { opacity: 0.3; }
    30% { opacity: 1; }
    45% { opacity: 0.3; }
    60% { opacity: 1; }
    100% { opacity: 1; }
}

/* Card icon panel */
.alarm-card-icon {
    width: 64px;
    min-width: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
}

.alarm-card.critical .alarm-card-icon {
    color: var(--critical);
    background: rgba(255,59,59,0.12);
}

.alarm-card.routine .alarm-card-icon {
    color: var(--routine);
    background: rgba(255,170,0,0.08);
}

.alarm-card.false-alarm .alarm-card-icon {
    color: var(--false);
    background: rgba(107,114,128,0.08);
}

.alarm-card-icon svg {
    width: 32px;
    height: 32px;
}

/* Card body */
.alarm-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 12px 16px 12px 0;
}

.alarm-card-type {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    line-height: 1.3;
}

.alarm-card.critical .alarm-card-type { color: var(--critical); }
.alarm-card.routine .alarm-card-type { color: var(--routine); }
.alarm-card.false-alarm .alarm-card-type { color: rgba(156,163,175,0.8); }

.alarm-card-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: rgba(255,255,255,0.45);
    margin-top: 3px;
    letter-spacing: 0.5px;
}

/* Vignette overlay (miss flash) */
.vignette-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 100;
    opacity: 0;
    box-shadow: inset 0 0 120px 60px rgba(239,68,68,0.3);
}

.vignette-overlay.active {
    animation: vignetteFlash 0.8s ease-out forwards;
}

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

/* Miss message */
.miss-message {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.6);
    text-align: center;
    max-width: 400px;
    margin: 0 auto 16px;
    opacity: 0;
    transition: opacity 0.3s ease;
    min-height: 24px;
    line-height: 1.5;
    font-style: italic;
}

.miss-message.visible {
    opacity: 1;
}

/* Missed label */
.missed-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--incorrect);
    text-align: center;
    margin-bottom: 8px;
    opacity: 0;
    animation: missedFade 800ms ease forwards;
}

@keyframes missedFade {
    0% { opacity: 1; transform: translateY(-4px); }
    70% { opacity: 1; }
    100% { opacity: 0; transform: translateY(0); }
}

/* Response button */
.respond-btn {
    width: calc(100% - 40px);
    max-width: 460px;
    padding: 18px 20px;
    font-family: 'Manrope', sans-serif;
    font-size: 1.2rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--orange);
    background: var(--navy);
    border: 3px solid var(--orange);
    border-radius: 14px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
    -webkit-tap-highlight-color: transparent;
    min-height: 64px;
    margin-bottom: 20px;
    position: relative;
    z-index: 2;
}

.respond-btn:active {
    transform: scale(0.97);
}

.respond-btn.correct-flash {
    background: var(--correct);
    border-color: var(--correct);
    color: #fff;
}

.respond-btn.incorrect-flash {
    background: var(--incorrect);
    border-color: var(--incorrect);
    color: #fff;
    pointer-events: none;
}

/* Instrument readouts */
.instrument-readouts {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 8px;
}

.readout {
    text-align: center;
}

.readout-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(42,74,106,0.6);
    margin-bottom: 2px;
}

.readout-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--instrument);
    text-shadow: 0 0 8px rgba(42,106,74,0.3);
}

/* Progress bar */
.progress-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--progress-track);
    z-index: 10;
}

.progress-fill {
    height: 100%;
    background: var(--orange);
    width: 0%;
    transition: width 0.3s ease;
}

/* Screen shake */
@keyframes screenShake {
    0%, 100% { transform: translateX(0) translateY(0); }
    10% { transform: translateX(-3px) translateY(1px); }
    20% { transform: translateX(3px) translateY(-1px); }
    30% { transform: translateX(-2px) translateY(2px); }
    40% { transform: translateX(2px) translateY(-2px); }
    50% { transform: translateX(-1px) translateY(1px); }
}

.screen-shake {
    animation: screenShake 0.4s ease;
}

/* ===== 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); }

/* Degradation 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: 200px;
    display: block;
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.4);
}

.legend-swatch {
    width: 16px;
    height: 3px;
    border-radius: 1px;
}

.legend-swatch-player { background: var(--orange); }
.legend-swatch-average { background: rgba(255,255,255,0.3); background-image: repeating-linear-gradient(90deg, rgba(255,255,255,0.3), rgba(255,255,255,0.3) 4px, transparent 4px, transparent 8px); }
.legend-swatch-perfect { background: rgba(255,255,255,0.15); background-image: repeating-linear-gradient(90deg, rgba(255,255,255,0.15), rgba(255,255,255,0.15) 4px, transparent 4px, transparent 8px); }

/* Chart interpretation */
.chart-interpretation {
    margin-top: 12px;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
    line-height: 1.6;
    text-align: center;
}

/* Phase breakdown cards */
.phase-breakdown {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 1.5rem;
}

.phase-card {
    background: rgba(255,255,255,0.04);
    border-radius: 12px;
    padding: 14px 10px;
    text-align: center;
    border-top: 3px solid rgba(255,255,255,0.1);
}

.phase-card.phase-green { border-top-color: var(--correct); }
.phase-card.phase-red { border-top-color: var(--incorrect); }
.phase-card.phase-amber { border-top-color: var(--orange); }

.phase-card-title {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.5);
    margin-bottom: 10px;
}

.phase-stat {
    margin-bottom: 8px;
}

.phase-stat-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
}

.phase-stat-label {
    font-size: 0.6rem;
    color: rgba(255,255,255,0.35);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 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"],
#email-form input[type="email"],
.second-chance input[type="email"],
#email-form-2 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,
#email-form input[type="email"]::placeholder,
.second-chance input[type="email"]::placeholder,
#email-form-2 input[type="email"]::placeholder {
    color: rgba(255,255,255,0.4);
}

#newsletter-form input[type="email"]:focus,
#email-form input[type="email"]:focus,
.second-chance input[type="email"]:focus,
#email-form-2 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,
#email-form-2 {
    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);
}

/* 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; }
}

/* 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); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .alarm-card-icon {
        width: 52px;
        min-width: 52px;
        padding: 10px;
    }

    .alarm-card-icon svg {
        width: 28px;
        height: 28px;
    }

    .alarm-card-type {
        font-size: 0.72rem;
        letter-spacing: 1px;
    }

    .alarm-card-text {
        font-size: 0.65rem;
    }

    .respond-btn {
        width: calc(100% - 20px);
        font-size: 1.1rem;
        min-height: 64px;
    }

    .phase-breakdown {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .phase-card {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 8px;
        align-items: center;
        text-align: center;
    }

    .phase-card-title {
        grid-column: 1 / -1;
        margin-bottom: 4px;
    }
}

@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, .respond-btn { min-height: 48px; }
    .instrument-readouts { gap: 16px; }

    .alarm-card-icon {
        width: 44px;
        min-width: 44px;
        padding: 8px;
    }

    .alarm-card-icon svg {
        width: 24px;
        height: 24px;
    }

    .alarm-card-type {
        font-size: 0.68rem;
    }
}
