/* Reset */
@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; --text: #ffffff; }

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

.container {
    max-width: 500px;
    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; } }

/* Logo */
.logo { text-align: center; margin-bottom: 1.5rem; }
.logo-small img { max-width: 200px; width: 100%; height: auto; }

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

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

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

/* Badge */
.landing-badge {
    text-align: center;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #FF9800;
    margin-bottom: 0.8rem;
    opacity: 0;
    animation: fadeSlideUp 0.5s ease 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: 2.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.4rem;
    font-weight: 600;
    color: #FF9800;
    margin-bottom: 1.5rem;
}

/* ===== CHARTPLOTTER SCREEN EFFECT ===== */
.plotter-screen {
    position: relative;
    border-radius: 12px;
    padding: 1rem 0;
    overflow: hidden;
    background: rgba(0,20,40,0.5);
    border: 1px solid rgba(79,195,247,0.15);
}

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

.plotter-scanline {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(79,195,247,0.4), transparent);
    box-shadow: 0 0 8px rgba(79,195,247,0.3), 0 4px 16px rgba(79,195,247,0.1);
    animation: scanDrop 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes scanDrop {
    0% { top: 0; opacity: 0; }
    5% { opacity: 1; }
    95% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

/* Preview symbol icons on landing */
.preview-symbols {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 0.5rem 0;
}

.preview-sym {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    animation: symFloat 3s ease-in-out infinite;
}

.preview-sym:nth-child(1) { transform: rotate(-8deg); animation-delay: 0s; }
.preview-sym:nth-child(2) { transform: rotate(-4deg); animation-delay: 0.4s; }
.preview-sym:nth-child(3) { transform: rotate(0deg); animation-delay: 0.8s; }
.preview-sym:nth-child(4) { transform: rotate(4deg); animation-delay: 1.2s; }
.preview-sym:nth-child(5) { transform: rotate(8deg); animation-delay: 1.6s; }

@keyframes symFloat {
    0%, 100% { transform: translateY(3px) scale(1); }
    50% { transform: translateY(-5px) scale(1.08); }
}

.sym-red {
    background: rgba(255,68,68,0.2); border: 2px solid rgba(255,68,68,0.4); color: #ff4444;
    animation-name: symGlowRed;
}
.sym-orange {
    background: rgba(255,107,53,0.2); border: 2px solid rgba(255,107,53,0.4); color: #FF9800;
    animation-name: symGlowOrange;
}
.sym-magenta {
    background: rgba(200,50,200,0.2); border: 2px solid rgba(200,50,200,0.4); color: #c832c8;
    animation-name: symGlowMagenta;
}
.sym-yellow {
    background: rgba(255,179,0,0.2); border: 2px solid rgba(255,179,0,0.4); color: #ffb300;
    animation-name: symGlowYellow;
}
.sym-blue {
    background: rgba(79,195,247,0.2); border: 2px solid rgba(79,195,247,0.4); color: #4fc3f7;
    animation-name: symGlowBlue;
}

@keyframes symGlowRed {
    0%, 100% { transform: translateY(3px) scale(1); box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
    50% { transform: translateY(-5px) scale(1.08); box-shadow: 0 0 18px rgba(255,68,68,0.5), 0 0 6px rgba(255,68,68,0.3); }
}
@keyframes symGlowOrange {
    0%, 100% { transform: translateY(3px) scale(1); box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
    50% { transform: translateY(-5px) scale(1.08); box-shadow: 0 0 18px rgba(255,107,53,0.5), 0 0 6px rgba(255,107,53,0.3); }
}
@keyframes symGlowMagenta {
    0%, 100% { transform: translateY(3px) scale(1); box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
    50% { transform: translateY(-5px) scale(1.08); box-shadow: 0 0 18px rgba(200,50,200,0.5), 0 0 6px rgba(200,50,200,0.3); }
}
@keyframes symGlowYellow {
    0%, 100% { transform: translateY(3px) scale(1); box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
    50% { transform: translateY(-5px) scale(1.08); box-shadow: 0 0 18px rgba(255,179,0,0.5), 0 0 6px rgba(255,179,0,0.3); }
}
@keyframes symGlowBlue {
    0%, 100% { transform: translateY(3px) scale(1); box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
    50% { transform: translateY(-5px) scale(1.08); box-shadow: 0 0 18px rgba(79,195,247,0.5), 0 0 6px rgba(79,195,247,0.3); }
}

/* 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-icon { font-size: 0.8rem; margin-right: 0.2rem; vertical-align: middle; }

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

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

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

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

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

/* Chart Display */
.chart-display {
    position: relative;
    width: 100%;
    height: 320px;
    background: #001020;
    border-radius: 12px;
    border: 2px solid rgba(79,195,247,0.2);
    overflow: hidden;
    margin-bottom: 0.8rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.chart-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: 32px 32px;
    pointer-events: none;
}

/* Route line */
.route-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 3px;
    transform: translateX(-50%);
    background: repeating-linear-gradient(
        to bottom,
        #c832c8 0px, #c832c8 8px,
        transparent 8px, transparent 16px
    );
    opacity: 0.6;
    pointer-events: none;
}

/* Boat icon */
.boat-icon {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 36px;
    z-index: 5;
}

.boat-icon::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 2px;
    width: 20px;
    height: 12px;
    background: #4fc3f7;
    border-radius: 0 0 10px 10px;
    clip-path: polygon(0 0, 100% 0, 85% 100%, 15% 100%);
}

.boat-icon::after {
    content: '';
    position: absolute;
    bottom: 10px;
    left: 9px;
    width: 3px;
    height: 22px;
    background: #ffffff;
    border-radius: 1px;
    box-shadow: 4px 4px 0 0 rgba(255,255,255,0.6);
}

/* Chart symbols — base */
.chart-symbol {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: top 0.1s linear;
}

/* Symbol label */
.symbol-label {
    position: absolute;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
    white-space: nowrap;
    text-shadow: 0 1px 4px rgba(0,0,0,0.8);
    pointer-events: none;
    z-index: 11;
}

/* ===== 8 SYMBOL CSS DRAWINGS ===== */

/* DANGER: AIS collision — red filled triangle */
.sym-ais-danger {
    width: 0;
    height: 0;
    border-left: 22px solid transparent;
    border-right: 22px solid transparent;
    border-bottom: 40px solid #ff4444;
    filter: drop-shadow(0 0 8px rgba(255,68,68,0.6));
}

/* DANGER: Shallow water — blue translucent rect with depth */
.sym-shallow {
    width: 48px;
    height: 36px;
    background: rgba(79,195,247,0.3);
    border: 2px solid rgba(79,195,247,0.5);
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    font-weight: 700;
    color: #4fc3f7;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sym-shallow::after {
    content: '2.1m';
}

/* DANGER: Submerged rock — cross (+) symbol */
.sym-rock {
    width: 40px;
    height: 40px;
    position: relative;
}
.sym-rock::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 5px;
    right: 5px;
    height: 6px;
    background: #333;
    transform: translateY(-50%);
    border-radius: 2px;
    box-shadow: 0 0 6px rgba(0,0,0,0.8);
}
.sym-rock::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 5px;
    bottom: 5px;
    width: 6px;
    background: #333;
    transform: translateX(-50%);
    border-radius: 2px;
    box-shadow: 0 0 6px rgba(0,0,0,0.8);
}

/* DANGER: Wreck — half-circle with mast line */
.sym-wreck {
    width: 40px;
    height: 40px;
    position: relative;
}
.sym-wreck::before {
    content: '';
    position: absolute;
    bottom: 6px;
    left: 4px;
    width: 32px;
    height: 16px;
    border-radius: 0 0 16px 16px;
    border: 3px solid #888;
    border-top: none;
}
.sym-wreck::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 4px;
    bottom: 18px;
    width: 3px;
    background: #888;
    transform: translateX(-50%);
}

/* SAFE: Lateral buoy — green diamond */
.sym-buoy {
    width: 32px;
    height: 32px;
    background: #4caf50;
    transform: rotate(45deg);
    border-radius: 3px;
    box-shadow: 0 0 10px rgba(76,175,80,0.5);
}

/* SAFE: Anchor alarm zone — dashed circle */
.sym-anchor-zone {
    width: 44px;
    height: 44px;
    border: 3px dashed rgba(255,255,255,0.5);
    border-radius: 50%;
}
.sym-anchor-zone::after {
    content: '\2693';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1rem;
    color: rgba(255,255,255,0.6);
}

/* SAFE: Waypoint — magenta circle with dot */
.sym-waypoint {
    width: 32px;
    height: 32px;
    border: 3px solid #c832c8;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(200,50,200,0.4);
}
.sym-waypoint::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background: #c832c8;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

/* SAFE: AIS safe target — green open triangle */
.sym-ais-safe {
    width: 0;
    height: 0;
    border-left: 18px solid transparent;
    border-right: 18px solid transparent;
    border-bottom: 32px solid transparent;
    position: relative;
}
.sym-ais-safe::before {
    content: '';
    position: absolute;
    top: 8px;
    left: -14px;
    width: 0;
    height: 0;
    border-left: 14px solid transparent;
    border-right: 14px solid transparent;
    border-bottom: 24px solid #001020;
}
.sym-ais-safe::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -18px;
    width: 0;
    height: 0;
    border-left: 18px solid transparent;
    border-right: 18px solid transparent;
    border-bottom: 32px solid #4caf50;
    z-index: -1;
    filter: drop-shadow(0 0 6px rgba(76,175,80,0.4));
}

/* DANGER: Traffic Separation Scheme — diagonal parallel lines */
.sym-tss {
    width: 44px;
    height: 36px;
    background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 4px,
        rgba(200,50,200,0.5) 4px,
        rgba(200,50,200,0.5) 7px
    );
    border: 2px solid rgba(200,50,200,0.6);
    border-radius: 4px;
    box-shadow: 0 0 8px rgba(200,50,200,0.3);
}

/* DANGER: Submarine cable/pipeline — wavy line */
.sym-cable {
    width: 44px;
    height: 20px;
    position: relative;
    border-bottom: 3px solid #ff9800;
    border-radius: 0;
}
.sym-cable::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 0;
    right: 0;
    height: 14px;
    background: transparent;
    border-top: 3px solid #ff9800;
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}
.sym-cable::after {
    content: '\26A0';
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    color: #ff9800;
}

/* DANGER: Restricted/prohibited area — red hatched rectangle */
.sym-restricted {
    width: 44px;
    height: 36px;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 5px,
        rgba(255,68,68,0.3) 5px,
        rgba(255,68,68,0.3) 8px
    );
    border: 2px solid rgba(255,68,68,0.6);
    border-radius: 4px;
    box-shadow: 0 0 8px rgba(255,68,68,0.3);
}
.sym-restricted::after {
    content: '\2298';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.2rem;
    color: #ff4444;
}

/* SAFE: Safe water mark — red/white striped circle */
.sym-safe-water {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: repeating-linear-gradient(
        0deg,
        #ff4444 0px, #ff4444 5px,
        #ffffff 5px, #ffffff 10px
    );
    border: 2px solid rgba(255,255,255,0.5);
    box-shadow: 0 0 8px rgba(255,255,255,0.2);
}

/* SAFE: Lighthouse — star/rays */
.sym-light {
    width: 36px;
    height: 36px;
    position: relative;
}
.sym-light::before {
    content: '\2605';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.8rem;
    color: #ffeb3b;
    text-shadow: 0 0 12px rgba(255,235,59,0.8), 0 0 24px rgba(255,235,59,0.4);
}

/* SAFE: Deep water sounding — green depth number */
.sym-depth-ok {
    width: 48px;
    height: 36px;
    background: rgba(76,175,80,0.15);
    border: 2px solid rgba(76,175,80,0.4);
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    font-weight: 700;
    color: #4caf50;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sym-depth-ok::after {
    content: '18.5m';
}

/* Approach bar */
.approach-bar-container {
    position: absolute;
    bottom: 58px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    overflow: hidden;
    z-index: 15;
}

.approach-bar-fill {
    height: 100%;
    width: 100%;
    background: #4caf50;
    border-radius: 3px;
    transition: width 0.1s linear, background-color 0.3s ease;
}

.approach-bar-fill.warning { background: #FF9800; }
.approach-bar-fill.critical { background: #ff4444; }

/* Decision buttons */
.decision-buttons {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
}

.decision-btn {
    flex: 1;
    padding: 1rem 0.5rem;
    border: 3px solid;
    border-radius: 14px;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    background: transparent;
}

.decision-btn .btn-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.decision-btn .btn-label {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 1px;
}

.decision-btn .btn-sub {
    font-size: 0.75rem;
    font-weight: 600;
    opacity: 0.7;
}

.btn-danger {
    border-color: #ff4444;
    color: #ff4444;
    background: rgba(255,68,68,0.08);
}
.btn-danger:hover, .btn-danger:active {
    background: rgba(255,68,68,0.2);
    transform: scale(0.97);
}

.btn-safe {
    border-color: #4caf50;
    color: #4caf50;
    background: rgba(76,175,80,0.08);
}
.btn-safe:hover, .btn-safe:active {
    background: rgba(76,175,80,0.2);
    transform: scale(0.97);
}

.decision-btn:disabled {
    opacity: 0.4;
    cursor: default;
    pointer-events: none;
}

.decision-btn.flash-correct {
    animation: btnFlashCorrect 0.5s ease;
}
.decision-btn.flash-wrong {
    animation: btnFlashWrong 0.5s ease;
}

@keyframes btnFlashCorrect {
    0% { background: rgba(76,175,80,0.6); }
    100% { background: rgba(76,175,80,0.08); }
}
@keyframes btnFlashWrong {
    0% { background: rgba(255,68,68,0.6); }
    100% { background: rgba(255,68,68,0.08); }
}

/* Explanation Toast (game) */
.game-toast {
    padding: 0.8rem 1rem;
    background: rgba(255,255,255,0.08);
    border-left: 3px solid #FF9800;
    border-radius: 0 10px 10px 0;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.7);
    line-height: 1.4;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    min-height: 2.5rem;
}

.game-toast.visible {
    opacity: 1;
    transform: translateY(0);
}

.game-toast.toast-correct { border-left-color: #4caf50; }
.game-toast.toast-wrong { border-left-color: #ff4444; }
.game-toast.toast-timeout { border-left-color: #FF9800; }

/* Wave banner overlay */
.wave-banner {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0,16,32,0.9);
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.wave-banner.visible {
    opacity: 1;
    pointer-events: auto;
}

.wave-banner-title {
    font-size: 2rem;
    font-weight: 800;
    color: #FF9800;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.wave-banner-sub {
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255,255,255,0.6);
    margin-top: 0.3rem;
}

/* Collision animations */
@keyframes collisionShake {
    0%, 100% { transform: translateX(0); }
    10% { transform: translateX(-8px); }
    20% { transform: translateX(8px); }
    30% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    50% { transform: translateX(-4px); }
    60% { transform: translateX(4px); }
    70% { transform: translateX(-2px); }
    80% { transform: translateX(2px); }
}

.collision-shake {
    animation: collisionShake 0.5s ease;
}

@keyframes collisionFlash {
    0% { box-shadow: inset 0 0 60px rgba(255,68,68,0.6); }
    100% { box-shadow: inset 0 0 0 rgba(255,68,68,0); }
}

.collision-flash {
    animation: collisionFlash 0.4s ease;
}

/* Score float */
.score-float {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.2rem;
    font-weight: 700;
    color: #4caf50;
    pointer-events: none;
    z-index: 20;
    animation: floatUp 0.8s ease-out forwards;
}

.score-float.wrong { color: #ff4444; }

@keyframes floatUp {
    0% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-40px); }
}

/* ===== RESULTS PAGE ===== */
.results-title {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1.2rem;
}

/* Results stats row */
.results-stats {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.results-stat {
    text-align: center;
}

.results-stat-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.8rem;
    font-weight: 700;
}

.results-stat-value.stat-correct { color: #4caf50; }
.results-stat-value.stat-wrong { color: #ff4444; }
.results-stat-value.stat-missed { color: #FF9800; }

.results-stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Rank display */
.rank-display {
    text-align: center;
    margin-bottom: 0.5rem;
}

.rank-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: #FF9800;
}

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

.score-number {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.score-message {
    font-size: 1.05rem;
    font-weight: 500;
    margin-top: 0.6rem;
    color: rgba(255,255,255,0.8);
}

.score-orange .score-number { color: #FF9800; }
.score-green .score-number { color: #4caf50; }
.score-red .score-number { color: #ff4444; }

/* Score bar */
.score-bar {
    width: 80%;
    max-width: 240px;
    height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    overflow: hidden;
    margin: 0.6rem auto;
}
.score-bar-fill {
    height: 100%;
    width: 0%;
    border-radius: 10px;
    transition: width 0.8s ease;
}
.score-green .score-bar-fill { background: #4caf50; }
.score-orange .score-bar-fill { background: #FF9800; }
.score-red .score-bar-fill { background: #ff4444; }

/* Email Gate */
.email-gate {
    background: rgba(255,107,53,0.12);
    border: 2px solid rgba(255,107,53,0.5);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 0.8rem;
}

.email-gate h3 { font-size: 1.2rem; margin-bottom: 0.3rem; }

.email-gate .gate-subtext {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.6);
    margin-bottom: 1rem;
}

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

.email-gate #newsletter-form input {
    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 #newsletter-form input::placeholder { color: rgba(255,255,255,0.4); }

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

.subscribe-button:hover { background: #ff8555; }

.reassurance-text { font-size: 0.8rem; color: rgba(255,255,255,0.35); margin-top: 0.4rem; }
.reassurance-text a { color: rgba(255,255,255,0.4); }
.form-message { margin-top: 0.6rem; font-size: 0.9rem; }
.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.5); text-decoration: underline; font-size: 0.85rem; }
.skip-link a:hover { color: rgba(255,255,255,0.7); }

/* Score Reveal */
.score-reveal {
    animation: fadeIn 0.4s ease-in;
}

/* Answer Breakdown */
.answer-breakdown {
    margin-bottom: 1.5rem;
}

.breakdown-item {
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    border-left: 4px solid;
}

.breakdown-item.was-correct {
    border-left-color: #4caf50;
}

.breakdown-item.was-incorrect {
    border-left-color: #ff4444;
}

.breakdown-item.was-missed {
    border-left-color: #FF9800;
}

.breakdown-q {
    font-size: 0.85rem;
    font-weight: 700;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.3rem;
}

.breakdown-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    vertical-align: middle;
    margin-right: 6px;
}

.breakdown-answer {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.breakdown-explanation {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.55);
    line-height: 1.4;
}

/* Twist */
.twist {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1.5rem 1rem;
    background: rgba(255,107,53,0.08);
    border-radius: 14px;
    border: 1px solid rgba(255,107,53,0.2);
}

.twist-headline {
    font-size: 1.4rem;
    font-weight: 800;
    color: #FF9800;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.twist-body {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.6);
    line-height: 1.5;
}

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

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

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

.explanation h2 { color: #FF9800; margin-bottom: 0.8rem; font-size: 1.4rem; }
.explanation p { margin-bottom: 0.8rem; font-size: 0.95rem; line-height: 1.6; color: rgba(255,255,255,0.8); }

.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: #ffffff; }

/* Second Chance Signup */
.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: 2rem;
}

.second-chance h3 { font-size: 1.15rem; margin-bottom: 0.3rem; }

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

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

.second-chance input {
    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;
}

.second-chance input::placeholder { color: rgba(255,255,255,0.4); }

/* ===== GAMIFICATION ENHANCEMENTS ===== */

/* Streak counter */
@keyframes streakPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

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

/* Score title */
.score-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: #FF9800;
    margin-bottom: 0.3rem;
}

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

/* Mobile */
@media (max-width: 380px) {
    .container { padding: 1.2rem 1rem; }
    .landing-title { font-size: 1.8rem; }
    .landing-subtitle { font-size: 1.2rem; }
    .chart-display { height: 260px; }
    .decision-btn { min-height: 70px; padding: 0.8rem 0.4rem; }
    .decision-btn .btn-label { font-size: 0.95rem; }
    .hud-value { font-size: 1.1rem; }
    .game-hud { padding: 0.4rem 0.8rem; }
    .score-title { font-size: 1.3rem; }
}

@media (max-width: 480px) {
    .decision-btn { min-height: 72px; }
    .cta-button, .subscribe-button, .share-btn { min-height: 48px; }
}
