/* Quiz 24: COLREGs in Practice — Level 2 Scenario Quiz */
@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;
    --navy-deep: #0a1628;
    --navy-mid: #122a4a;
    --orange: #FF9800;
    --orange-dark: #f08c00;
    --orange-glow: rgba(255, 152, 0, 0.15);
    --text-primary: rgba(255, 255, 255, 0.95);
    --text-secondary: rgba(255, 255, 255, 0.7);
    --card-bg: rgba(255, 255, 255, 0.06);
}

body {
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(160deg, #071520 0%, #0d2840 50%, #091a30 100%);
    color: #ffffff;
    min-height: 100vh;
    line-height: 1.5;
}

.container {
    max-width: 560px;
    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 ===== */

#landing-page.active {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

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

.landing-badge {
    text-align: center;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #FF9800;
    margin-bottom: 0.3rem;
    opacity: 0;
    animation: fadeSlideUp 0.5s ease forwards;
}

.landing-badge-level {
    text-align: center;
    font-size: 0.55rem;
    font-weight: 800;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: #4fc3f7;
    margin-bottom: 0.8rem;
    opacity: 0;
    animation: fadeSlideUp 0.5s ease 0.05s forwards;
}

.hero-box {
    background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.03) 100%);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 20px;
    padding: 2rem 1.5rem 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
    opacity: 0;
    animation: fadeSlideUp 0.6s ease 0.1s forwards;
}

.landing-title {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.1;
    margin-bottom: 0.4rem;
    text-shadow: 0 0 60px rgba(255,255,255,0.06), 0 2px 4px rgba(0,0,0,0.3);
}

.landing-subtitle {
    font-size: 1.2rem;
    font-weight: 600;
    color: #FF9800;
    margin-bottom: 1.5rem;
}

/* Scenario Preview SVG */
.scenario-preview {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(79,195,247,0.15);
}

.preview-svg {
    width: 100%;
    height: auto;
    display: block;
}

.preview-question-mark {
    animation: questionPulse 2s ease-in-out infinite;
}
@keyframes questionPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.preview-light-pulse {
    animation: lightPulse 2s ease-in-out infinite;
}
@keyframes lightPulse {
    0%, 100% { opacity: 1; r: 2.5; }
    50% { opacity: 0.5; r: 2; }
}

/* Feature pills */
.landing-features {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 1rem;
    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; }

/* CTA Button */
@keyframes ctaGlow {
    0%, 100% { box-shadow: 0 4px 20px rgba(255,107,53,0.35), 0 0 40px rgba(255,107,53,0.08); }
    50% { box-shadow: 0 6px 28px rgba(255,107,53,0.5), 0 0 60px rgba(255,107,53,0.18); }
}

.cta-button {
    display: block;
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
    padding: 1.1rem 2rem;
    font-size: 1.25rem;
    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.35s forwards, ctaGlow 3s ease-in-out 0.85s infinite;
    font-family: inherit;
}
.cta-button:hover { background: #ff8555; transform: translateY(-2px); }
.cta-button:active { transform: translateY(0); }
.cta-icon { font-size: 0.8rem; margin-right: 0.2rem; vertical-align: middle; }

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

/* Timer */
.timer-bar-top {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 10px;
    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: timerPulse 1s ease-in-out infinite; }
.timer-bar-fill.timer-critical { background: #ef4444; animation: timerPulse 0.5s ease-in-out infinite; height: 12px; }
@keyframes timerPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* HUD */
.game-hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1rem;
    background: rgba(0,20,40,0.6);
    border: 1px solid rgba(79,195,247,0.15);
    border-radius: 10px;
    margin-bottom: 0.8rem;
}
.hud-item { display: flex; flex-direction: column; align-items: center; }
.hud-label {
    font-size: 0.6rem; font-weight: 700; letter-spacing: 2px;
    text-transform: uppercase; color: rgba(255,255,255,0.4);
}
.hud-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.4rem; font-weight: 700; color: #FF9800;
}
.hud-streak {
    font-size: 0.85rem; font-weight: 700; color: #FF9800;
    opacity: 0; transition: opacity 0.3s;
}
.hud-streak.visible { opacity: 1; }
.hud-streak.pulse { animation: streakPulse 0.4s ease; }
@keyframes streakPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Scenario Display */
.scenario-display {
    margin-bottom: 1rem;
}

.anim-enter {
    animation: fadeSlideUp 0.4s ease;
}

.scenario-diagram {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 0.8rem;
}

.scenario-svg {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    border: 1px solid rgba(79,195,247,0.15);
}

/* SVG Animations */
.anim-approach-stbd {
    animation: approachStbd 4s ease-in-out infinite;
}
@keyframes approachStbd {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-15px, 15px); }
}

.anim-approach-head {
    animation: approachHead 4s ease-in-out infinite;
}
@keyframes approachHead {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(0, 20px); }
}

.anim-approach-crossing {
    animation: approachCrossing 4s ease-in-out infinite;
}
@keyframes approachCrossing {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-20px, 15px); }
}

.anim-light-pulse {
    animation: svgLightPulse 2s ease-in-out infinite;
}
@keyframes svgLightPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.anim-ais-blink {
    animation: aisBlink 1.5s ease-in-out infinite;
}
@keyframes aisBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.anim-danger-pulse {
    animation: dangerPulse 1.5s ease-in-out infinite;
}
@keyframes dangerPulse {
    0%, 100% { r: 12; opacity: 0.3; }
    50% { r: 16; opacity: 0.6; }
}

/* Scenario Context */
.scenario-context {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0.5rem;
    padding: 0.6rem 0.8rem;
    background: rgba(255,255,255,0.03);
    border-left: 3px solid rgba(79,195,247,0.3);
    border-radius: 0 8px 8px 0;
}

.scenario-question {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
}

/* Answer Options */
.answer-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: opacity 0.3s;
}

.answer-btn {
    display: block;
    width: 100%;
    padding: 0.9rem 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--card-bg);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    font-family: inherit;
    line-height: 1.4;
}
.answer-btn:hover:not(:disabled) {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
    transform: translateX(4px);
}
.answer-btn:disabled {
    cursor: default;
    opacity: 0.7;
}
.answer-btn.correct {
    background: rgba(74, 222, 128, 0.15);
    border-color: #4ade80;
    opacity: 1 !important;
}
.answer-btn.wrong {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
    opacity: 1 !important;
}

/* Feedback Panel */
.feedback-panel {
    margin-top: 1rem;
    padding: 1.2rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
}

.feedback-verdict {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.feedback-verdict.correct { color: #4ade80; }
.feedback-verdict.wrong { color: #ef4444; }
.verdict-icon { font-size: 1.2rem; }

.feedback-explanation {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0.8rem;
}

.feedback-explanation .rule-ref {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #4fc3f7;
    margin-bottom: 0.4rem;
}

.feedback-forum {
    padding: 0.8rem;
    background: rgba(79,195,247,0.06);
    border: 1px solid rgba(79,195,247,0.12);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.forum-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(79,195,247,0.6);
    margin-bottom: 0.4rem;
}

.feedback-forum p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    font-style: italic;
}

.next-btn {
    display: block;
    width: 100%;
    padding: 0.9rem;
    font-size: 1rem;
    font-weight: 700;
    color: #0a1628;
    background: linear-gradient(135deg, #FF9800 0%, #ff8f5e 100%);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(255,152,0,0.3);
}
.next-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(255,152,0,0.4); }

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

.results-title {
    text-align: center;
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.rank-display {
    text-align: center;
    margin-bottom: 1rem;
}
.rank-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: #FF9800;
    text-shadow: 0 0 20px rgba(255,152,0,0.3);
}

.score-display {
    text-align: center;
    padding: 1.5rem;
    background: var(--card-bg);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    margin-bottom: 1.5rem;
}
.score-number {
    font-family: 'JetBrains Mono', monospace;
    font-size: 3rem;
    font-weight: 800;
    color: #FF9800;
}
.score-of {
    font-size: 1.5rem;
    color: var(--text-secondary);
}
.score-bar {
    height: 8px;
    background: rgba(255,255,255,0.08);
    border-radius: 4px;
    margin: 1rem 0;
    overflow: hidden;
}
.score-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #FF9800, #ff6b35);
    border-radius: 4px;
    transition: width 1s ease-out;
}
.score-message {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Email Gate */
.email-gate {
    background: var(--card-bg);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.email-gate.visible {
    opacity: 1;
    transform: translateY(0);
}
.email-gate h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.gate-subtext {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}
.email-gate input[type="email"] {
    width: 100%;
    padding: 0.8rem 1rem;
    font-size: 1rem;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    background: rgba(255,255,255,0.06);
    color: #fff;
    font-family: inherit;
    margin-bottom: 0.6rem;
}
.email-gate input[type="email"]::placeholder { color: rgba(255,255,255,0.3); }
.gdpr-consent {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: left;
    margin-bottom: 0.8rem;
    cursor: pointer;
}
.gdpr-consent a { color: #4fc3f7; }
.subscribe-button {
    width: 100%;
    padding: 0.8rem;
    font-size: 1rem;
    font-weight: 700;
    color: #0a1628;
    background: linear-gradient(135deg, #FF9800 0%, #ff8f5e 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
}
.reassurance-text {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.3);
    margin-top: 0.5rem;
}
.reassurance-text a { color: rgba(79,195,247,0.6); }
.form-message {
    font-size: 0.85rem;
    color: #FF9800;
    margin-top: 0.5rem;
}

.skip-link {
    text-align: center;
    margin-bottom: 1rem;
}
.skip-link a {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-decoration: none;
}
.skip-link a:hover { color: #fff; }

/* Gated Content */
.score-reveal { margin-top: 1rem; }

/* Answer Breakdown */
.answer-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
}
.breakdown-card {
    display: flex;
    gap: 0.8rem;
    padding: 0.8rem;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
}
.breakdown-card.bd-correct { border-left: 3px solid #4ade80; }
.breakdown-card.bd-wrong { border-left: 3px solid #ef4444; }
.bd-icon {
    font-size: 1.1rem;
    font-weight: 700;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}
.bd-correct .bd-icon { color: #4ade80; }
.bd-wrong .bd-icon { color: #ef4444; }
.bd-content { flex: 1; }
.bd-question { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); margin-bottom: 0.3rem; }
.bd-yours { font-size: 0.8rem; color: #ef4444; margin-bottom: 0.2rem; }
.bd-correct-text { font-size: 0.8rem; color: #4ade80; margin-bottom: 0.2rem; }
.bd-rule { font-size: 0.7rem; font-weight: 700; color: #4fc3f7; letter-spacing: 0.5px; }
.bd-time { font-size: 0.7rem; color: rgba(255,255,255,0.3); font-family: 'JetBrains Mono', monospace; }

/* Twist */
.twist {
    background: rgba(255,152,0,0.06);
    border: 1px solid rgba(255,152,0,0.15);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}
.twist-headline {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 0.8rem;
    color: var(--text-primary);
}
.twist-body {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Forum Attribution */
.forum-attribution {
    background: rgba(79,195,247,0.04);
    border: 1px solid rgba(79,195,247,0.1);
    border-radius: 12px;
    padding: 1.2rem;
    margin-bottom: 1.5rem;
    text-align: center;
}
.forum-attribution h3 {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(79,195,247,0.6);
    margin-bottom: 0.5rem;
}
.forum-attribution p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Social Sharing */
.social-sharing {
    text-align: center;
    margin-bottom: 1.5rem;
}
.social-sharing h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
}
.share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}
.share-btn {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    background: var(--card-bg);
    color: #fff;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}
.share-btn:hover { background: rgba(255,255,255,0.1); }

/* Explanation */
.explanation {
    margin-bottom: 1.5rem;
}
.explanation h2 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
}
.explanation p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0.8rem;
}
.insight-link {
    color: #FF9800;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9rem;
}
.insight-link:hover { text-decoration: underline; }

/* Second Chance */
.second-chance {
    background: var(--card-bg);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 1.2rem;
    text-align: center;
    margin-top: 1rem;
}
.second-chance h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.4rem; }
.second-chance p { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 0.8rem; }
.second-chance input[type="email"] {
    width: 100%; padding: 0.7rem; font-size: 0.95rem;
    border: 1px solid rgba(255,255,255,0.12); border-radius: 8px;
    background: rgba(255,255,255,0.05); color: #fff; font-family: inherit;
    margin-bottom: 0.5rem;
}

/* Particles */
.particle {
    position: fixed;
    width: 6px;
    height: 6px;
    background: #FF9800;
    border-radius: 50%;
    pointer-events: none;
    z-index: 99999;
    animation: particleBurst 0.7s ease-out forwards;
}
@keyframes particleBurst {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(calc(var(--dx) * 60px), calc(var(--dy) * 60px)) scale(0); opacity: 0; }
}

/* Mobile */
@media (max-width: 600px) {
    .container { padding: 1rem 0.8rem; }
    .landing-title { font-size: 1.7rem; }
    .landing-subtitle { font-size: 1rem; }
    .scenario-question { font-size: 1rem; }
    .answer-btn { padding: 0.8rem; font-size: 0.9rem; min-height: 44px; }
    .score-number { font-size: 2.5rem; }
    .cta-button { font-size: 1.1rem; }
}

@media (max-width: 380px) {
    .landing-title { font-size: 1.5rem; }
    .answer-btn { font-size: 0.85rem; }
}
