/* Quiz L2-3: Chart Decisions — What's Wrong With This Route? */

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

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

:root { --navy: #1e3a5f; --orange: #FF9800; --text: #ffffff; }

body {
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background: linear-gradient(135deg, #0a1628 0%, #162a4a 100%);
    color: #ffffff;
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

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

/* Screen Management */
.screen { display: none; animation: fadeIn 0.3s ease-in; }
.screen.active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

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

/* Level 2 indicator */
.level-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 12px;
    animation: fadeSlideUp 0.5s ease 0.05s both;
}
.level-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: rgba(255,152,0,0.15);
    border: 1px solid rgba(255,152,0,0.3);
}
.level-dot.filled {
    background: #FF9800;
    border-color: #FF9800;
    box-shadow: 0 0 6px rgba(255,152,0,0.4);
}
.level-line {
    width: 20px; height: 2px;
    background: rgba(255,152,0,0.2);
}

.landing-title {
    text-align: center;
    font-size: 2.6rem;
    font-weight: 800;
    color: #FF9800;
    margin-bottom: 0.3rem;
    letter-spacing: -1px;
    line-height: 1.1;
    text-shadow: 0 0 30px rgba(255,152,0,0.2), 0 0 80px rgba(255,152,0,0.05);
    opacity: 0;
    animation: fadeSlideUp 0.6s ease 0.1s forwards;
}

.landing-subtitle {
    text-align: center;
    font-size: 1.15rem;
    font-weight: 400;
    color: rgba(255,255,255,0.65);
    margin-bottom: 1.5rem;
    opacity: 0;
    animation: fadeSlideUp 0.6s ease 0.25s forwards;
}

/* ===== CHART HERO ANIMATION ===== */
.chart-hero {
    margin: 0 auto 1.5rem;
    max-width: 400px;
    opacity: 0;
    animation: fadeSlideUp 0.6s ease 0.15s forwards;
}

.chart-hero-inner {
    position: relative;
    width: 100%;
    padding-top: 60%;
    background: rgba(0,16,32,0.6);
    border: 1px solid rgba(79,195,247,0.15);
    border-radius: 12px;
    overflow: hidden;
}

.hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(79,195,247,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(79,195,247,0.05) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
}

.hero-scanline {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(79,195,247,0.3), transparent);
    animation: heroScan 5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes heroScan {
    0% { top: 0; opacity: 0; }
    5% { opacity: 0.8; }
    95% { opacity: 0.8; }
    100% { top: 100%; opacity: 0; }
}

.hero-route {
    position: absolute;
    top: 20%; left: 15%; width: 70%; height: 60%;
    background: none;
    pointer-events: none;
}

.hero-route::before {
    content: '';
    position: absolute;
    top: 80%; left: 0; width: 100%; height: 2px;
    background: repeating-linear-gradient(90deg, rgba(200,50,200,0.5) 0px, rgba(200,50,200,0.5) 6px, transparent 6px, transparent 12px);
    transform: rotate(-25deg);
    transform-origin: left center;
}

.hero-wp {
    position: absolute;
    width: 10px; height: 10px;
    border: 2px solid rgba(200,50,200,0.6);
    border-radius: 50%;
}
.hero-wp::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 3px; height: 3px;
    background: rgba(200,50,200,0.8);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.wp-1 { top: 65%; left: 12%; }
.wp-2 { top: 40%; left: 48%; }
.wp-3 { top: 22%; left: 82%; }

.hero-barb {
    position: absolute;
    width: 16px; height: 2px;
    background: rgba(255,152,0,0.25);
    transform: rotate(-30deg);
}
.hero-barb::after {
    content: '';
    position: absolute;
    right: 0; top: -4px;
    width: 2px; height: 6px;
    background: rgba(255,152,0,0.3);
    transform: rotate(30deg);
}
.barb-1 { top: 25%; left: 25%; }
.barb-2 { top: 35%; left: 55%; }
.barb-3 { top: 20%; left: 70%; }

.hero-warning {
    position: absolute;
    bottom: 8%; left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: rgba(255,68,68,0.12);
    border: 1px solid rgba(255,68,68,0.4);
    border-radius: 6px;
    animation: warnPulse 2s ease-in-out infinite;
}

.hero-warn-icon {
    color: #ff4444;
    font-size: 0.8rem;
}
.hero-warn-text {
    color: #ff4444;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    font-family: 'Courier New', monospace;
}

@keyframes warnPulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* Scenario text */
.scenario-text {
    text-align: center;
    margin-bottom: 1.2rem;
    opacity: 0;
    animation: fadeSlideUp 0.6s ease 0.3s forwards;
}
.scenario-text p {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.55);
    margin-bottom: 0.4rem;
}
.scenario-highlight {
    color: rgba(255,152,0,0.8) !important;
    font-weight: 600;
}

/* Level link */
.level-link {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.35);
    opacity: 0;
    animation: fadeSlideUp 0.5s ease 0.35s forwards;
}
.level-link a {
    color: rgba(255,152,0,0.6);
    text-decoration: underline;
}
.level-link a:hover { color: #FF9800; }

/* CTA */
@keyframes ctaGlow {
    0%, 100% { box-shadow: 0 4px 20px rgba(255,107,53,0.35); }
    50% { box-shadow: 0 6px 28px rgba(255,107,53,0.5); }
}
.cta-button {
    display: block;
    width: 100%;
    max-width: 380px;
    margin: 0 auto 1rem;
    padding: 1.1rem 2rem;
    font-size: 1.2rem;
    font-weight: 700;
    color: #0a1628;
    background: linear-gradient(135deg, #FF9800 0%, #ff8f5e 100%);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 20px rgba(255,107,53,0.35);
    opacity: 0;
    animation: fadeSlideUp 0.5s ease 0.4s forwards, ctaGlow 3s ease-in-out 0.9s infinite;
}
.cta-button:hover { background: #ff8555; transform: translateY(-2px); }
.cta-button:active { transform: translateY(0); }
.cta-icon { font-size: 0.8rem; margin-right: 0.2rem; }

.landing-features {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    opacity: 0;
    animation: fadeSlideUp 0.5s ease 0.5s forwards;
}
.feature-pill {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255,255,255,0.4);
    padding: 0.2rem 0.6rem;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
}
.feature-pill-dot { color: rgba(255,255,255,0.15); font-size: 0.7rem; }

/* ===== GAME PAGE ===== */

.game-hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background: rgba(0,16,32,0.7);
    border: 1px solid rgba(79,195,247,0.12);
    border-radius: 10px;
    margin: 0.5rem 1rem;
}
.hud-left, .hud-center, .hud-right {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.hud-label {
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: rgba(255,255,255,0.35);
}
.hud-value {
    font-size: 1.3rem;
    font-weight: 800;
    color: #FF9800;
    font-family: 'Courier New', monospace;
}
.hud-timer { color: rgba(255,255,255,0.7); }
.hud-timer.warning { color: #FF9800; }
.hud-timer.urgent { color: #ff4444; animation: timerPulse 0.5s ease infinite; }

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

/* Timer bar */
.timer-bar {
    height: 3px;
    margin: 0 1rem 0.8rem;
    background: rgba(255,255,255,0.06);
    border-radius: 2px;
    overflow: hidden;
}
.timer-bar-fill {
    height: 100%;
    width: 100%;
    background: rgba(79,195,247,0.4);
    border-radius: 2px;
    transition: width 0.1s linear;
}
.timer-bar-fill.warning { background: #FF9800; }
.timer-bar-fill.urgent { background: #ff4444; }

/* Scenario container */
.scenario-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 1rem;
}

.situation-header {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255,152,0,0.6);
    margin-bottom: 0.4rem;
    text-align: center;
}

.briefing {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.75);
    line-height: 1.5;
    margin-bottom: 0.8rem;
    text-align: center;
}

/* SVG situation display */
.situation-display {
    width: 100%;
    aspect-ratio: 5 / 3;
    background: #0a1628;
    border: 2px solid rgba(79,195,247,0.15);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.8rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.situation-svg {
    display: block;
}

/* Instrument strip */
.instrument-strip {
    display: flex;
    justify-content: center;
    gap: 1.2rem;
    margin-bottom: 0.6rem;
    padding: 0.5rem;
    background: rgba(0,16,32,0.5);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
}

/* Instruction text */
.instruction {
    font-size: 1rem;
    font-weight: 700;
    color: #FF9800;
    text-align: center;
    margin-bottom: 0.8rem;
}

/* Choices */
.choices-panel { margin-bottom: 1rem; }

.choices-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.choice-btn {
    width: 100%;
    padding: 0.9rem 1rem;
    font-size: 0.92rem;
    font-weight: 600;
    font-family: 'Manrope', sans-serif;
    color: rgba(255,255,255,0.85);
    background: rgba(255,255,255,0.05);
    border: 2px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    min-height: 48px;
}
.choice-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,152,0,0.3);
}
.choice-btn:active {
    transform: scale(0.98);
}
.choice-btn:disabled {
    cursor: default;
    pointer-events: none;
    opacity: 0.5;
}
.choice-btn.correct {
    border-color: #4caf50 !important;
    background: rgba(76,175,80,0.15) !important;
    color: #fff !important;
    opacity: 1 !important;
}
.choice-btn.wrong {
    border-color: #ff4444 !important;
    background: rgba(255,68,68,0.15) !important;
    color: rgba(255,255,255,0.6) !important;
    opacity: 1 !important;
}

/* Feedback banner */
.feedback-banner {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    padding: 1rem 1.2rem;
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    z-index: 100;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    background: rgba(10,22,40,0.95);
    border-top: 2px solid rgba(255,255,255,0.1);
}
.feedback-banner.visible { transform: translateY(0); }
.feedback-banner.correct { border-top-color: #4caf50; }
.feedback-banner.wrong { border-top-color: #ff4444; }

.feedback-icon {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 800;
    flex-shrink: 0;
}
.feedback-icon.correct { background: rgba(76,175,80,0.2); color: #4caf50; }
.feedback-icon.wrong { background: rgba(255,68,68,0.2); color: #ff4444; }

.feedback-text {
    font-size: 0.9rem;
    font-weight: 700;
    color: rgba(255,255,255,0.9);
    margin-bottom: 0.2rem;
}
.feedback-detail {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.55);
    line-height: 1.4;
}

/* SVG animations */
@keyframes boatPulse {
    0%, 100% { r: 1.5; opacity: 1; }
    50% { r: 2.2; opacity: 0.7; }
}
.boat-pulse { animation: boatPulse 2s ease-in-out infinite; }

@keyframes alarmFlash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}
.alarm-flash { animation: alarmFlash 1s ease-in-out infinite; }

/* ===== RESULTS PAGE ===== */

.results-title, #results h1 {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 1.2rem;
    color: #FF9800;
}

.score-display {
    text-align: center;
    padding: 1.5rem;
    background: rgba(255,255,255,0.04);
    border-radius: 16px;
    margin-bottom: 1.5rem;
}
.rank-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #FF9800;
    margin-bottom: 0.3rem;
}
.score-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: rgba(255,255,255,0.9);
    font-family: 'Courier New', monospace;
}
.score-of {
    font-size: 1.2rem;
    color: rgba(255,255,255,0.35);
}
.score-breakdown {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin: 0.6rem 0;
    font-size: 0.85rem;
    font-weight: 600;
}
.stat-correct { color: #4caf50; }
.stat-wrong { color: #ff4444; }
.stat-missed { color: #FF9800; }

.score-bar {
    width: 80%;
    max-width: 240px;
    height: 6px;
    background: rgba(255,255,255,0.08);
    border-radius: 3px;
    overflow: hidden;
    margin: 0.6rem auto;
}
.score-bar-fill {
    height: 100%;
    width: 0%;
    border-radius: 3px;
    transition: width 0.8s ease;
    background: #FF9800;
}

/* Rank colour classes */
.rank-ocean .rank-title { color: #4caf50; }
.rank-ocean .score-bar-fill { background: #4caf50; }
.rank-skipper .rank-title { color: #66bb6a; }
.rank-skipper .score-bar-fill { background: #66bb6a; }
.rank-mate .rank-title { color: #FF9800; }
.rank-mate .score-bar-fill { background: #FF9800; }
.rank-crew .rank-title { color: #ff8a65; }
.rank-crew .score-bar-fill { background: #ff8a65; }
.rank-green .rank-title { color: #ff5252; }
.rank-green .score-bar-fill { background: #ff5252; }

.score-message {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.6);
    line-height: 1.5;
    text-align: center;
    margin-bottom: 1.5rem;
}

/* Passage callout */
.passage-callout {
    background: rgba(255,152,0,0.08);
    border: 1px solid rgba(255,152,0,0.2);
    border-radius: 12px;
    padding: 1.2rem;
    text-align: center;
    margin-bottom: 1.5rem;
}
.passage-callout strong { color: #FF9800; }
.passage-callout p {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.6);
    line-height: 1.5;
    margin-bottom: 0.4rem;
}
.passage-callout p:last-child { margin-bottom: 0; }

/* Forum attribution */
.forum-attribution {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 0.8rem;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
}
.forum-attribution p {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.35);
    font-style: italic;
}

/* Email gate */
.email-gate {
    background: rgba(255,107,53,0.1);
    border: 2px solid rgba(255,107,53,0.4);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 0.8rem;
}
.email-gate h3 { font-size: 1.15rem; margin-bottom: 0.3rem; }
.gate-subtext { font-size: 0.9rem; color: rgba(255,255,255,0.55); margin-bottom: 1rem; }
.email-gate form {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    max-width: 320px;
    margin: 0 auto;
}
.email-gate 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: #ffffff;
}
.email-gate input::placeholder { color: rgba(255,255,255,0.4); }

.subscribe-button {
    padding: 0.9rem 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    color: #0a1628;
    background: #FF9800;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 48px;
}
.subscribe-button:hover { background: #ff8555; }

.reassurance-text { font-size: 0.78rem; color: rgba(255,255,255,0.3); margin-top: 0.4rem; }
.reassurance-text a { color: rgba(255,255,255,0.35); }
.form-message { margin-top: 0.5rem; font-size: 0.85rem; }
.form-message.success { color: #4caf50; }
.form-message.error { color: #ff4444; }

.skip-link { text-align: center; margin-bottom: 1.5rem; }
.skip-link a { color: rgba(255,255,255,0.45); text-decoration: underline; font-size: 0.85rem; }

.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: #FF9800;
    width: 16px; height: 16px; cursor: pointer;
}
.gdpr-consent a { color: rgba(255,255,255,0.5); text-decoration: underline; }

/* 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.1rem; }
.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;
    min-height: 48px;
}
.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.1); color: #fff; border: 1px solid rgba(255,255,255,0.2); }
.share-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.3); }

/* Explanation */
.explanation {
    background: rgba(255,255,255,0.04);
    border-left: 4px solid #FF9800;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.explanation h2 { color: #FF9800; margin-bottom: 0.8rem; font-size: 1.3rem; }
.explanation p { margin-bottom: 0.8rem; font-size: 0.92rem; line-height: 1.6; color: rgba(255,255,255,0.7); }
.insight-link {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.7rem 1.2rem;
    color: #FF9800;
    text-decoration: none;
    border: 2px solid #FF9800;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}
.insight-link:hover { background: #FF9800; color: #fff; }

/* Second chance */
.second-chance {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 1.5rem;
}
.second-chance h3 { font-size: 1.1rem; margin-bottom: 0.3rem; }
.second-chance p { font-size: 0.85rem; color: rgba(255,255,255,0.5); margin-bottom: 0.8rem; }
.second-chance form {
    display: flex; flex-direction: column; gap: 0.7rem;
    max-width: 320px; margin: 0 auto;
}
.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: #ffffff;
}

/* Play again */
.play-again {
    text-align: center;
    margin-top: 1.5rem;
}

/* ===== MOBILE ===== */
@media (max-width: 480px) {
    .container { padding: 1.5rem 1rem; }
    .landing-title { font-size: 2.2rem; }
    .game-hud { margin: 0.3rem 0.5rem; padding: 0.4rem 0.6rem; }
    .scenario-container { padding: 0 0.5rem; }
    .hud-value { font-size: 1.1rem; }
    .briefing { font-size: 0.88rem; }
    .choice-btn { font-size: 0.85rem; padding: 0.8rem; }
    .score-number { font-size: 2rem; }
    .rank-title { font-size: 1.3rem; }
}

@media (max-width: 380px) {
    .landing-title { font-size: 1.9rem; }
    .situation-display { aspect-ratio: 5 / 3.5; }
}
