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

body {
    font-family: system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    overflow: hidden;
    background: #0d1b2a;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* Virtual background: canvas composites ocean + person; video is capture-only */
.background-stack {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    background: #023047;
}

#camera-feed {
    position: absolute;
    left: -9999px;
    top: 0;
    width: 640px;
    height: 360px;
    opacity: 0;
    pointer-events: none;
}

#bg-composite {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    object-fit: cover;
    pointer-events: none;
}

#game-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    touch-action: none;
}

#ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    pointer-events: none;
}

.grip-hint {
    position: absolute;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
    max-width: min(520px, calc(100% - 32px));
    padding: 10px 18px;
    background: rgba(2, 48, 71, 0.88);
    border: 1px solid rgba(142, 202, 230, 0.35);
    border-radius: 12px;
    color: #caf0f8;
    font-size: clamp(16px, 2.8vw, 18px);
    line-height: 1.65;
    text-align: center;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
    animation: gripHintIn 0.5s ease;
    z-index: 4;
}

.grip-hint.hidden {
    display: none !important;
}

@keyframes gripHintIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

#score-board {
    position: absolute;
    top: 16px;
    left: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    background: rgba(4, 14, 30, 0.88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 12px 20px;
    border-radius: 14px;
    border: 1px solid rgba(100, 180, 255, 0.18);
    box-shadow: 0 2px 16px rgba(0,0,0,0.45);
    pointer-events: auto;
    max-width: calc(100% - 32px);
}

.score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 52px;
}

.score-item .label {
    color: #8ecae6;
    font-size: 15px;
    letter-spacing: 0.06em;
}

.score-item .value {
    color: #fff;
    font-size: 28px;
    font-weight: 700;
}

/* ── Shared game-screen backdrop ───────────────────────────────── */
#game-over-screen, #stage-complete-screen, #game-complete-screen {
    position: absolute;
    inset: 0;
    background: rgba(13, 27, 42, 0.92);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    padding: clamp(28px, 6vw, 56px);
    text-align: center;
    overflow-y: auto;
}

/* ═══════════════════════════════════════════════════════════════════
   Camera check screen
   Sits at z-index 15: above start-screen (10) below loading-overlay (20)
   Shown after model warms up; hidden when user clicks Continue.
   ═══════════════════════════════════════════════════════════════════ */
#camera-check-screen {
    position: absolute;
    inset: 0;
    z-index: 15;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    background:
        radial-gradient(ellipse 110% 55% at 50% 0%,
            rgba(2, 80, 120, 0.55) 0%, transparent 65%),
        linear-gradient(180deg,
            #020c1b 0%,
            #02304a 40%,
            #011a2e 70%,
            #020c1b 100%);
    padding: clamp(16px, 3vh, 36px) clamp(16px, 4vw, 60px);
    animation: fadeIn 0.35s ease;
}

.cc-inner {
    width: 100%;
    max-width: 1100px;
    display: flex;
    flex-direction: column;
    gap: clamp(18px, 2.8vh, 32px);
}

/* ── Header ── */
.cc-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.cc-label {
    font-size: clamp(13px, 1.5vw, 15px);
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #48cae4;
    margin: 0;
    opacity: 0.8;
}
.cc-title {
    font-size: clamp(28px, 4.5vw, 48px);
    font-weight: 900;
    color: #fff;
    margin: 0;
    letter-spacing: -0.02em;
    text-shadow: 0 0 32px rgba(72, 202, 228, 0.4);
}
.cc-sub {
    font-size: clamp(15px, 1.8vw, 18px);
    color: #8ecae6;
    margin: 0;
    opacity: 0.8;
    line-height: 1.5;
}

/* ── Body: preview + tips side-by-side ── */
.cc-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(16px, 2.5vw, 32px);
    align-items: start;
}

/* ── Preview panel ── */
.cc-preview-wrap {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: #010810;
    aspect-ratio: 4 / 3;
    border: 2px solid rgba(72, 202, 228, 0.15);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.55);
}
.cc-preview {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

/* Silhouette guide overlay */
.cc-guide {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    gap: 4px;
}
.cc-silhouette {
    width: clamp(70px, 22%, 120px);
    height: auto;
    color: rgba(72, 202, 228, 0.32);
    filter: drop-shadow(0 0 6px rgba(72, 202, 228, 0.2));
    animation: silhouettePulse 3s ease-in-out infinite;
}
@keyframes silhouettePulse {
    0%, 100% { opacity: 0.7; }
    50%       { opacity: 1;   }
}
.cc-guide-label {
    color: rgba(202, 240, 248, 0.5);
    font-size: clamp(13px, 1.4vw, 15px);
    letter-spacing: 0.08em;
    margin: 0;
    font-style: italic;
}

/* Status badge at bottom of preview */
.cc-status-badge {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 18px;
    border-radius: 999px;
    font-size: clamp(14px, 1.6vw, 16px);
    font-weight: 700;
    white-space: nowrap;
    backdrop-filter: blur(8px);
    transition: background 0.3s, border-color 0.3s;
}
.cc-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: background 0.3s;
}

/* Loading state — blue pulsing */
.cc-status--loading {
    background: rgba(2, 48, 71, 0.85);
    border: 1px solid rgba(72, 202, 228, 0.35);
    color: #8ecae6;
}
.cc-status--loading .cc-status-dot {
    background: #48cae4;
    animation: pulse-dot 1.4s ease-in-out infinite;
}

/* Searching state — amber pulsing */
.cc-status--searching {
    background: rgba(40, 30, 2, 0.85);
    border: 1px solid rgba(255, 180, 50, 0.4);
    color: #ffd166;
}
.cc-status--searching .cc-status-dot {
    background: #ffd166;
    animation: pulse-dot 0.9s ease-in-out infinite;
}

/* Found state — green solid */
.cc-status--found {
    background: rgba(2, 40, 30, 0.88);
    border: 1px solid rgba(6, 214, 160, 0.5);
    color: #06d6a0;
}
.cc-status--found .cc-status-dot {
    background: #06d6a0;
    box-shadow: 0 0 8px #06d6a0;
    animation: none;
}

/* Error state — red */
.cc-status--error {
    background: rgba(40, 5, 5, 0.88);
    border: 1px solid rgba(239, 68, 68, 0.45);
    color: #ef4444;
}
.cc-status--error .cc-status-dot {
    background: #ef4444;
    animation: none;
}

/* ── 3-step panel (replaces old tips panel) ── */
.cc-steps {
    display: flex;
    flex-direction: column;
    gap: 14px;
    justify-content: center;
}

.cc-step {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 20px 22px;
    background: rgba(2, 36, 58, 0.55);
    border: 1.5px solid rgba(142, 202, 230, 0.14);
    border-radius: 18px;
    backdrop-filter: blur(8px);
    transition: border-color 0.4s, background 0.4s, box-shadow 0.4s;
}

.cc-step-emoji {
    font-size: clamp(34px, 4vw, 44px);
    flex-shrink: 0;
    width: clamp(48px, 5.5vw, 58px);
    text-align: center;
    line-height: 1;
}

.cc-step-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cc-step-title {
    font-size: clamp(18px, 2.2vw, 23px);
    font-weight: 800;
    color: #fff;
    margin: 0;
    letter-spacing: -0.01em;
    line-height: 1.25;
}

.cc-step-sub {
    font-size: clamp(14px, 1.6vw, 17px);
    color: rgba(202, 240, 248, 0.72);
    margin: 0;
    line-height: 1.4;
}

/* Raise-arms step: amber pulse while camera is searching */
.cc-step--raise.cc-step--active {
    border-color: rgba(255, 185, 40, 0.6);
    background: rgba(48, 30, 0, 0.72);
    box-shadow: 0 0 0 0 rgba(255, 185, 40, 0.3);
    animation: raiseGlow 1.6s ease-in-out infinite;
}
.cc-step--raise.cc-step--active .cc-step-title {
    color: #ffd166;
}
.cc-step--raise.cc-step--active .cc-step-emoji {
    animation: armsUp 1.1s ease-in-out infinite;
}

/* Raise-arms step: green when found */
.cc-step--raise.cc-step--found {
    border-color: rgba(6, 214, 160, 0.55);
    background: rgba(0, 34, 24, 0.72);
    animation: none;
    box-shadow: none;
}
.cc-step--raise.cc-step--found .cc-step-title {
    color: #06d6a0;
}

@keyframes raiseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 185, 40, 0.3); }
    50%       { box-shadow: 0 0 0 10px rgba(255, 185, 40, 0); }
}
@keyframes armsUp {
    0%, 100% { transform: translateY(0);   }
    50%       { transform: translateY(-7px); }
}

/* ── CTA block ── */
.cc-cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.cc-feedback {
    font-size: clamp(17px, 2vw, 21px);
    color: #8ecae6;
    margin: 0;
    text-align: center;
    line-height: 1.5;
    min-height: 2em;
    transition: color 0.3s;
    font-weight: 500;
}
#cc-continue-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 18px 64px;
    font-size: clamp(20px, 2.5vw, 24px);
    font-weight: 800;
    background: linear-gradient(135deg, #06d6a0 0%, #0096c7 60%, #023e8a 100%);
    color: #fff;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    letter-spacing: 0.03em;
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
    box-shadow: 0 0 0 1px rgba(6, 214, 160, 0.3),
                0 8px 32px rgba(0, 150, 120, 0.4),
                0 2px 8px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}
#cc-continue-btn::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, transparent 55%);
    pointer-events: none;
}
.cc-btn-maori {
    font-size: 0.58em;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    opacity: 0.75;
    display: block;
    font-weight: 700;
}
#cc-continue-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none;
}
#cc-continue-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 0 0 1px rgba(6, 214, 160, 0.5),
                0 14px 40px rgba(0, 150, 120, 0.55);
}
#cc-continue-btn:active:not(:disabled) {
    transform: translateY(-1px);
}

/* Narrow screens: stack preview and tips vertically */
@media (max-width: 720px) {
    .cc-body {
        grid-template-columns: 1fr;
    }
    .cc-preview-wrap {
        max-height: 50vw;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   Start screen — full-page immersive landing
   ═══════════════════════════════════════════════════════════════════ */
#start-screen {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background:
        radial-gradient(ellipse 120% 60% at 50% 0%,
            rgba(2, 80, 120, 0.55) 0%, transparent 65%),
        linear-gradient(180deg,
            #020c1b 0%,
            #02304780 35%,
            #011a2e 70%,
            #020c1b 100%);
    animation: fadeIn 0.4s ease;
}

/* Animated ocean wave layers in background */
.ss-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}
.ss-wave {
    position: absolute;
    left: -30%;
    width: 160%;
    border-radius: 50% 50% 0 0 / 30% 30% 0 0;
    opacity: 0;
    animation: waveRise 12s ease-in-out infinite;
}
.ss-wave-1 {
    bottom: -5%;
    height: 18%;
    background: radial-gradient(ellipse at 50% 100%,
        rgba(2, 62, 96, 0.35) 0%, transparent 70%);
    animation-delay: 0s;
    animation-duration: 11s;
    opacity: 0.6;
}
.ss-wave-2 {
    bottom: -8%;
    height: 22%;
    background: radial-gradient(ellipse at 50% 100%,
        rgba(33, 158, 188, 0.12) 0%, transparent 70%);
    animation-delay: 3.5s;
    animation-duration: 14s;
    opacity: 0.4;
}
.ss-wave-3 {
    bottom: -2%;
    height: 14%;
    background: radial-gradient(ellipse at 50% 100%,
        rgba(72, 202, 228, 0.08) 0%, transparent 65%);
    animation-delay: 7s;
    animation-duration: 9s;
    opacity: 0.5;
}
@keyframes waveRise {
    0%, 100% { transform: translateX(0) scaleY(1); }
    40%       { transform: translateX(3%) scaleY(1.06); }
    70%       { transform: translateX(-2%) scaleY(0.95); }
}

/* Scrollable content column */
.ss-scroll {
    position: relative;
    z-index: 1;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(20px, 3vh, 32px);
    padding: clamp(24px, 4vh, 48px) clamp(20px, 5vw, 60px) clamp(28px, 4vh, 48px);
    scrollbar-width: thin;
    scrollbar-color: rgba(142, 202, 230, 0.2) transparent;
}

/* ── Hero ── */
.ss-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    padding-bottom: 4px;
}
.ss-kia-ora {
    font-size: clamp(15px, 1.6vw, 17px);
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #48cae4;
    margin: 0;
    opacity: 0.8;
}
.ss-title {
    font-size: clamp(36px, 6.5vw, 68px);
    font-weight: 900;
    color: #fff;
    margin: 0;
    letter-spacing: -0.02em;
    line-height: 1.05;
    text-shadow:
        0 0 40px rgba(72, 202, 228, 0.45),
        0 0 80px rgba(2, 48, 71, 0.8);
}
.ss-maori-sub {
    font-size: clamp(15px, 1.8vw, 19px);
    color: #8ecae6;
    font-style: italic;
    margin: 0;
    opacity: 0.7;
    letter-spacing: 0.06em;
}
.ss-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 4px 0;
}
.ss-divider span:not(.ss-div-icon) {
    display: block;
    width: clamp(40px, 8vw, 80px);
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(142, 202, 230, 0.4), transparent);
}
.ss-div-icon {
    font-size: 18px;
    opacity: 0.6;
}
.ss-title-en {
    font-size: clamp(18px, 2.2vw, 24px);
    font-weight: 400;
    color: #8ecae6;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    margin: 0;
    opacity: 0.75;
}
.ss-tagline {
    font-size: clamp(19px, 2.2vw, 24px);
    color: #caf0f8;
    letter-spacing: 0.03em;
    margin: 6px 0 0;
    opacity: 0.85;
    font-weight: 500;
}

/* ── Feature pills ── */
.ss-features {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}
.ss-pill {
    padding: 7px 16px;
    border-radius: 999px;
    border: 1px solid rgba(72, 202, 228, 0.25);
    background: rgba(2, 48, 71, 0.45);
    backdrop-filter: blur(6px);
    color: #caf0f8;
    font-size: clamp(14px, 1.5vw, 16px);
    font-weight: 600;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

/* ── Sections ── */
.ss-section {
    width: 100%;
    max-width: 960px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.ss-section-label {
    margin: 0;
    color: #48cae4;
    font-size: clamp(16px, 1.8vw, 20px);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* ── Weapon grid — 3 large cards ── */
.weapon-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(10px, 1.8vw, 18px);
    width: 100%;
}

.weapon-card {
    --wc-accent: #48cae4;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    border: 2px solid rgba(142, 202, 230, 0.15);
    border-radius: 20px;
    background: rgba(2, 36, 58, 0.6);
    backdrop-filter: blur(10px);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, transform 0.18s, box-shadow 0.2s;
    overflow: hidden;
    text-align: left;
    color: #caf0f8;
    pointer-events: auto;
}

/* Image area */
.wc-img-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    height: clamp(130px, 22vh, 200px);
    background: linear-gradient(160deg,
        rgba(2, 48, 71, 0.4) 0%,
        rgba(2, 20, 40, 0.6) 100%);
    border-bottom: 1px solid rgba(142, 202, 230, 0.08);
    position: relative;
    overflow: hidden;
}
.wc-img-wrap::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 70%,
        color-mix(in srgb, var(--wc-accent) 14%, transparent) 0%,
        transparent 65%);
    pointer-events: none;
}
.wc-img {
    height: 75%;
    max-height: 120px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.55));
    pointer-events: none;
    transition: transform 0.22s ease;
}
.weapon-card:hover .wc-img {
    transform: translateY(-4px) scale(1.04);
}

/* Hands SVG placeholder */
.wc-img-hands {
    color: var(--wc-accent);
}
.wc-hands-svg {
    width: 64px;
    height: 78px;
    color: var(--wc-accent);
    opacity: 0.75;
    transition: transform 0.22s ease, opacity 0.2s;
    filter: drop-shadow(0 4px 10px rgba(72,202,228,0.25));
}
.weapon-card:hover .wc-hands-svg {
    transform: translateY(-4px) scale(1.06);
    opacity: 0.9;
}

/* Text body */
.wc-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: clamp(12px, 1.8vw, 18px) clamp(14px, 2vw, 20px);
    flex: 1;
}
.wc-maori {
    font-size: clamp(13px, 1.3vw, 15px);
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--wc-accent);
    opacity: 0.85;
}
.wc-name {
    font-size: clamp(22px, 2.6vw, 28px);
    font-weight: 800;
    color: #fff;
    line-height: 1.1;
}
/* Hide description text — keep UI clean for elderly users */
.wc-desc {
    display: none;
}

/* Selected checkmark */
.wc-check {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--wc-accent);
    color: #020c1b;
    font-size: 14px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.18s, transform 0.18s;
    pointer-events: none;
}

/* Hover / selected states */
.weapon-card:hover {
    border-color: rgba(var(--wc-accent), 0.45);
    border-color: color-mix(in srgb, var(--wc-accent) 50%, transparent);
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(0,0,0,0.35);
}
.weapon-card.selected {
    border-color: var(--wc-accent);
    background: color-mix(in srgb, var(--wc-accent) 10%, rgba(2, 36, 58, 0.7));
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--wc-accent) 30%, transparent),
                0 8px 32px rgba(0,0,0,0.4);
}
.weapon-card.selected .wc-check {
    opacity: 1;
    transform: scale(1);
}
.weapon-card:focus-visible {
    outline: 2px solid #219ebc;
    outline-offset: 3px;
}

/* ── How to play steps ── */
.ss-howto {
    max-width: 960px;
}
.ss-steps {
    display: flex;
    gap: clamp(10px, 2vw, 18px);
    flex-wrap: wrap;
}
.ss-step {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    flex: 1;
    min-width: 180px;
    padding: 16px 18px;
    background: rgba(2, 48, 71, 0.35);
    border: 1px solid rgba(142, 202, 230, 0.1);
    border-radius: 14px;
    backdrop-filter: blur(6px);
}
.ss-step-num {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #219ebc 0%, #023047 100%);
    color: #fff;
    font-size: 18px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 12px rgba(33, 158, 188, 0.35);
}
.ss-step-text {
    font-size: clamp(16px, 1.6vw, 18px);
    color: #caf0f8;
    line-height: 1.65;
    opacity: 0.85;
    padding-top: 6px;
}

/* ── CTA block ── */
.ss-cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding-bottom: 8px;
}

/* Start button — special design, different from end-screen buttons */
#start-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 22px 80px;
    font-size: clamp(24px, 3vw, 30px);
    font-weight: 800;
    background: linear-gradient(135deg, #48cae4 0%, #0096c7 45%, #023e8a 100%);
    color: #fff;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
    pointer-events: auto;
    letter-spacing: 0.03em;
    box-shadow: 0 0 0 1px rgba(72, 202, 228, 0.3),
                0 8px 32px rgba(0, 150, 199, 0.4),
                0 2px 8px rgba(0,0,0,0.4);
    min-width: 240px;
    position: relative;
    overflow: hidden;
}
#start-btn::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, transparent 60%);
    pointer-events: none;
}
.ss-btn-maori {
    font-size: 0.6em;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    opacity: 0.75;
    font-weight: 700;
    display: block;
}
#start-btn:disabled {
    opacity: 0.38;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
#start-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 0 0 1px rgba(72, 202, 228, 0.5),
                0 14px 40px rgba(0, 150, 199, 0.55),
                0 2px 8px rgba(0,0,0,0.4);
}
#start-btn:active:not(:disabled) {
    transform: translateY(-1px);
}

.ss-camera-status {
    color: #48cae4;
    font-size: clamp(17px, 1.8vw, 20px);
    margin: 0;
    opacity: 0.9;
    text-align: center;
    font-weight: 500;
}

.hidden {
    display: none !important;
}

/* ── Titles (end screens) ─────────────────────────────────────────── */
#game-over-screen h1, #stage-complete-screen h1, #game-complete-screen h1 {
    color: #fff;
    font-size: clamp(40px, 7.2vw, 64px);
    margin-bottom: 20px;
    text-shadow: 0 0 24px rgba(142, 202, 230, 0.45);
}

/* Fireworks canvas: sits above game-complete-screen (z-index 10), pointer-events none */
#fireworks-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 11;
    pointer-events: none;
}
#fireworks-canvas.hidden { display: none !important; }

#game-complete-screen {
    background-size: cover;
    background-position: center top;
    animation: gcEntrance 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
}
#game-complete-screen.hidden { animation: none; }

@keyframes gcEntrance {
    from { opacity: 0; transform: scale(0.96) translateY(18px); }
    to   { opacity: 1; transform: scale(1)    translateY(0);    }
}
#game-complete-screen::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom,
        rgba(2, 12, 27, 0.30) 0%,
        rgba(2, 12, 27, 0.70) 55%,
        rgba(2, 12, 27, 0.92) 100%);
    pointer-events: none;
    z-index: 0;
}
#game-complete-screen > * { position: relative; z-index: 1; }
#game-complete-screen h1 {
    text-shadow: 0 0 28px rgba(255, 209, 102, 0.5);
}

#game-over-screen p, #stage-complete-screen p, #game-complete-screen p {
    color: #caf0f8;
    font-size: clamp(22px, 3.6vw, 32px);
    margin-bottom: 14px;
    max-width: 32em;
    line-height: 1.5;
}

/* ── Buttons (end-game screens) ─────────────────────────────────── */
#restart-btn, #next-stage-btn, #play-again-btn {
    padding: 18px 56px;
    font-size: clamp(20px, 2.8vw, 26px);
    font-weight: 700;
    background: linear-gradient(135deg, #219ebc 0%, #023047 100%);
    color: #fff;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    pointer-events: auto;
    letter-spacing: 0.04em;
    width: 100%;
    max-width: 320px;
}
#next-stage-btn {
    background: linear-gradient(135deg, #fb8500 0%, #d62828 100%);
}
#play-again-btn {
    background: linear-gradient(135deg, #2a9d8f 0%, #264653 100%);
}
#restart-btn:hover, #next-stage-btn:hover, #play-again-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(33, 158, 188, 0.38);
}

.combo-text {
    position: absolute;
    font-size: clamp(38px, 8vw, 56px);
    font-weight: 900;
    color: #ffd166;
    letter-spacing: 0.04em;
    text-shadow:
        0 0 20px rgba(255, 209, 102, 0.85),
        0 3px 14px rgba(0, 0, 0, 0.55),
        0 0 2px rgba(0, 0, 0, 0.9);
    pointer-events: none;
    transform: translate(-50%, -50%);
    animation: comboFade 1.25s ease-out forwards;
    z-index: 5;
}

@keyframes comboFade {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.85);
    }
    18% {
        transform: translate(-50%, -50%) scale(1.08);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -65%) scale(1.55);
    }
}

/* #38 Combo colour tiers */
.combo-text--cyan {
    color: #90e0ef;
    text-shadow:
        0 0 22px rgba(144, 224, 239, 0.95),
        0 3px 14px rgba(0, 0, 0, 0.55);
}
.combo-text--gold {
    color: #ffd166;
    font-size: clamp(44px, 10vw, 66px);
    text-shadow:
        0 0 28px rgba(255, 209, 102, 0.98),
        0 0 8px rgba(255, 180, 0, 0.8),
        0 3px 14px rgba(0, 0, 0, 0.55);
    animation: comboFadeGold 1.6s ease-out forwards;
}
@keyframes comboFadeGold {
    0%   { opacity: 1; transform: translate(-50%, -50%) scale(0.75); }
    15%  { transform: translate(-50%, -50%) scale(1.15); }
    100% { opacity: 0; transform: translate(-50%, -70%) scale(1.7); }
}
.combo-text--rainbow {
    font-size: clamp(50px, 12vw, 78px);
    background: linear-gradient(90deg, #ff6b6b, #ffd166, #06d6a0, #90e0ef, #c77dff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 16px rgba(255,255,255,0.8));
    animation: comboFadeRainbow 1.8s ease-out forwards;
}
@keyframes comboFadeRainbow {
    0%   { opacity: 1; transform: translate(-50%, -50%) scale(0.7); filter: drop-shadow(0 0 24px white); }
    12%  { transform: translate(-50%, -50%) scale(1.22); }
    100% { opacity: 0; transform: translate(-50%, -75%) scale(1.9); }
}

/* ── Stage progress bar ─────────────────────────────────────── */
.stage-progress-item {
    min-width: 80px;
}

#stage-progress-track {
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.12);
    border-radius: 99px;
    margin-top: 4px;
    overflow: hidden;
}

#stage-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #219ebc, #ffd166);
    border-radius: 99px;
    transition: width 0.4s ease;
}

/* ── Camera active badge ────────────────────────────────────── */
.camera-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(13, 27, 42, 0.82);
    border: 1px solid rgba(142, 202, 230, 0.3);
    border-radius: 999px;
    padding: 6px 14px;
    color: #8ecae6;
    font-size: 16px;
    pointer-events: none;
}

.camera-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #06d6a0;
    box-shadow: 0 0 6px #06d6a0;
    animation: pulse-dot 1.6s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.35; }
}

/* ── Lives as heart icons ────────────────────────────────────── */
.score-item--lives {
    align-items: center;
}

.lives-hearts {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1px;
    max-width: 96px;   /* 5 per row → wraps to 2 rows for 9 lives */
    line-height: 1;
}

/* Individual heart spans */
.lh {
    font-size: 17px;
    line-height: 1;
    display: inline-block;
    transition: transform 0.15s ease, opacity 0.2s ease;
    user-select: none;
}

/* Lost hearts — dim white heart */
.lh--lost {
    opacity: 0.22;
    filter: grayscale(1);
}

/* Danger mode (≤ 2 lives): remaining hearts pulse red */
.lives-hearts.lives-danger .lh--full {
    animation: heart-pulse 0.65s ease-in-out infinite alternate;
    filter: drop-shadow(0 0 5px #ef4444);
}

@keyframes heart-pulse {
    from { transform: scale(1);    filter: drop-shadow(0 0 3px #ef4444); }
    to   { transform: scale(1.28); filter: drop-shadow(0 0 10px #ef4444); }
}

/* Tiny pop when a heart is gained (added via JS) */
@keyframes heart-gain {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.55); }
    100% { transform: scale(1); }
}
.lh--gain {
    animation: heart-gain 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ── Māori affirmation popup ────────────────────────────────── */
.affirmation-text {
    position: absolute;
    font-size: clamp(22px, 4vw, 34px);
    font-weight: 800;
    color: #06d6a0;
    letter-spacing: 0.03em;
    text-shadow:
        0 0 18px rgba(6, 214, 160, 0.8),
        0 2px 10px rgba(0, 0, 0, 0.6);
    pointer-events: none;
    transform: translate(-50%, -50%);
    animation: affirmFade 1.6s ease-out forwards;
    z-index: 6;
    white-space: nowrap;
}

@keyframes affirmFade {
    0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.7); }
    15%  { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
    70%  { opacity: 1; transform: translate(-50%, -72%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -90%) scale(0.9); }
}

/* ── Combo-break text ───────────────────────────────────────── */
.combo-break-text {
    position: absolute;
    font-size: clamp(18px, 3vw, 26px);
    font-weight: 700;
    color: #ef4444;
    text-shadow: 0 0 12px rgba(239, 68, 68, 0.7), 0 2px 8px rgba(0,0,0,0.5);
    pointer-events: none;
    transform: translate(-50%, -50%);
    animation: comboBreakFade 1s ease-out forwards;
    z-index: 6;
}

@keyframes comboBreakFade {
    0%   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -70%) scale(0.8); }
}

/* ── Loading overlay ────────────────────────────────────────── */
.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(13, 27, 42, 0.94);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    z-index: 20;
    color: #8ecae6;
    font-size: 21px;
}

.loading-ring {
    width: 56px;
    height: 56px;
    border: 4px solid rgba(142, 202, 230, 0.2);
    border-top-color: #219ebc;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Story card overlay ─────────────────────────────────────── */
.story-card-overlay {
    position: absolute;
    inset: 0;
    background: #020c1b;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 12;
    animation: fadeIn 0.5s ease forwards;
    overflow: hidden;
    /* fade-out is driven by JS adding --fadeout class */
    transition: opacity 0.7s ease;
}
.story-card-overlay--fadeout {
    opacity: 0;
    pointer-events: none;
}

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

/* Full-screen background image */
.story-card-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    opacity: 0.88;
}

/* Dark gradient over the bottom half so text stays readable */
.story-card-overlay::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        transparent 30%,
        rgba(2, 12, 27, 0.55) 55%,
        rgba(2, 12, 27, 0.92) 75%,
        rgba(2, 12, 27, 0.98) 100%
    );
    pointer-events: none;
}

.story-card-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 14px;
    width: 100%;
    max-width: 700px;
    padding: 32px 40px 48px;
}

.story-card-stage {
    color: #8ecae6;
    font-size: clamp(16px, 2vw, 19px);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin: 0;
}

/* old .story-card-img rule replaced by .story-card-bg above */
.story-card-img { display: none; }

.story-card-title {
    color: #fff;
    font-size: clamp(28px, 5vw, 44px);
    text-shadow: 0 0 20px rgba(142, 202, 230, 0.4);
    margin: 0;
}

.story-card-desc {
    color: #caf0f8;
    font-size: clamp(18px, 2.6vw, 23px);
    line-height: 1.65;
    max-width: 38em;
    margin: 0;
}

/* ── Corner action bar (mute + skip, top-right) ─────────────── */
.sc-corner-actions {
    position: absolute;
    top: 18px;
    right: 22px;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Voice hint tooltip (one-time, fades in then out) ───────── */
.sc-voice-hint {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    white-space: nowrap;
    background: rgba(8, 28, 58, 0.90);
    color: rgba(202, 240, 248, 0.95);
    border: 1px solid rgba(142, 202, 230, 0.30);
    border-radius: 10px;
    padding: 7px 13px;
    font-size: clamp(12px, 1.6vw, 14px);
    font-weight: 500;
    pointer-events: none;
    animation: sc-hint-fade 4.5s ease forwards;
}
@keyframes sc-hint-fade {
    0%   { opacity: 0; transform: translateY(-6px); }
    12%  { opacity: 1; transform: translateY(0); }
    70%  { opacity: 1; }
    100% { opacity: 0; transform: translateY(-4px); }
}

/* ── Mute toggle button ─────────────────────────────────────── */
.sc-mute-btn {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: rgba(10, 35, 66, 0.45);
    border: 1px solid rgba(142, 202, 230, 0.30);
    border-radius: 50%;
    cursor: pointer;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: background 0.2s, border-color 0.2s, transform 0.1s;
    user-select: none;
    line-height: 1;
}
.sc-mute-btn:hover {
    background: rgba(10, 35, 66, 0.70);
    border-color: rgba(142, 202, 230, 0.65);
}
.sc-mute-btn:active  { transform: scale(0.92); }
.sc-mute-btn.muted   { opacity: 0.55; }

/* ── Skip button (top-right corner, subtle) ─────────────────── */
.sc-skip-btn {
    padding: 8px 18px;
    font-size: clamp(13px, 1.8vw, 15px);
    font-weight: 600;
    letter-spacing: 0.06em;
    color: rgba(202, 240, 248, 0.75);
    background: rgba(10, 35, 66, 0.45);
    border: 1px solid rgba(142, 202, 230, 0.30);
    border-radius: 30px;
    cursor: pointer;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: color 0.2s, background 0.2s, border-color 0.2s;
    user-select: none;
}
.sc-skip-btn:hover {
    color: #fff;
    background: rgba(10, 35, 66, 0.70);
    border-color: rgba(142, 202, 230, 0.65);
}
.sc-skip-btn:active { transform: scale(0.96); }

/* ── Narration waveform indicator ───────────────────────────── */
.sc-narration-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    animation: scNarFadeIn 0.4s ease both;
}
@keyframes scNarFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.sc-narration-hint {
    font-size: clamp(13px, 1.8vw, 15px);
    color: rgba(202, 240, 248, 0.65);
    letter-spacing: 0.04em;
    margin: 0;
}

/* Animated waveform bars — 7 bars with staggered heights */
.sc-waveform {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 32px;
}
.sc-wv-bar {
    display: block;
    width: 5px;
    border-radius: 3px;
    background: linear-gradient(to top, #219ebc, #90e0ef);
    animation: scWvPulse 0.85s ease-in-out infinite alternate;
    transform-origin: bottom;
}
.sc-wv-bar:nth-child(1) { animation-delay: 0.00s; }
.sc-wv-bar:nth-child(2) { animation-delay: 0.12s; }
.sc-wv-bar:nth-child(3) { animation-delay: 0.24s; }
.sc-wv-bar:nth-child(4) { animation-delay: 0.10s; }
.sc-wv-bar:nth-child(5) { animation-delay: 0.36s; }
.sc-wv-bar:nth-child(6) { animation-delay: 0.08s; }
.sc-wv-bar:nth-child(7) { animation-delay: 0.20s; }

@keyframes scWvPulse {
    from { height: 6px;  opacity: 0.5; }
    to   { height: 28px; opacity: 1.0; }
}

/* ── Stage-1 inline tips (inside story card) ────────────────── */
.sc-tips {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 480px;
    margin-top: 4px;
}
.sc-tips.hidden { display: none !important; }

.sc-tip {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(142, 202, 230, 0.18);
    border-radius: 12px;
    padding: 11px 16px;
    text-align: left;
    animation: scTipIn 0.4s ease both;
}
.sc-tip:nth-child(1) { animation-delay: 0.05s; }
.sc-tip:nth-child(2) { animation-delay: 0.15s; }
.sc-tip:nth-child(3) { animation-delay: 0.25s; }

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

.sc-tip-icon {
    font-size: 26px;
    flex-shrink: 0;
    width: 36px;
    text-align: center;
}

.sc-tip-text {
    color: #caf0f8;
    font-size: clamp(15px, 2.2vw, 18px);
    line-height: 1.4;
}
.sc-tip-text strong { color: #fff; }

/* ── Wave countdown bar at the bottom of story card ─────────── */
.sc-wave-countdown {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 72px;
    overflow: hidden;
    z-index: 3;
    pointer-events: none;
}

/* Ocean-water fill — grows left-to-right via JS width transition */
.sc-wave-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 100%;
    width: 0%;
    /* duration set by JS: element.style.transition */
    background: linear-gradient(
        to top,
        rgba(13, 60, 100, 0.82) 0%,
        rgba(0, 130, 180, 0.50) 55%,
        rgba(0, 191, 216, 0.18) 100%
    );
    /* flowing inner shimmer */
    background-size: 200% 100%;
    animation: waveFlow 2.2s ease-in-out infinite alternate;
}
@keyframes waveFlow {
    0%   { filter: brightness(1.0); }
    100% { filter: brightness(1.18); }
}

/* Crest blob — right edge of fill, bobs up and down */
.sc-wave-crest {
    position: absolute;
    bottom: 0;
    left: 0;           /* JS keeps this aligned to fill right edge */
    width: 56px;
    height: 100%;
    background: radial-gradient(
        ellipse 100% 55% at 50% 100%,
        rgba(0, 191, 216, 0.55) 0%,
        transparent 100%
    );
    transform: translateX(-50%);
    animation: waveCresting 1.4s ease-in-out infinite alternate;
    pointer-events: none;
}
@keyframes waveCresting {
    0%   { transform: translateX(-50%) scaleY(1.00); opacity: 0.8; }
    100% { transform: translateX(-50%) scaleY(1.28); opacity: 1.0; }
}

/* Thin bright top-edge line on the fill */
.sc-wave-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(to right,
        rgba(0, 191, 216, 0.0),
        rgba(0, 191, 216, 0.9) 50%,
        rgba(144, 224, 239, 0.4) 100%
    );
}

/* ── Error card ─────────────────────────────────────────────── */
.error-card {
    position: absolute;
    inset: 0;
    background: rgba(13, 27, 42, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 30;
}

.error-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    max-width: min(480px, 88vw);
    padding: 40px 36px;
    background: rgba(30, 10, 10, 0.9);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 20px;
    text-align: center;
}

.error-icon { font-size: 48px; }

.error-msg {
    color: #fff;
    font-size: clamp(16px, 2.5vw, 20px);
    font-weight: 600;
    margin: 0;
}

.error-hint {
    color: #8ecae6;
    font-size: clamp(13px, 2vw, 16px);
    margin: 0;
}

#error-dismiss {
    padding: 10px 36px;
    font-size: 16px;
    font-weight: 600;
    background: #ef4444;
    color: #fff;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    margin-top: 6px;
    transition: opacity 0.2s;
}

#error-dismiss:hover { opacity: 0.85; }

/* ── Bottom instruction bar ─────────────────────────────────── */
.instruction-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 4;
    background: linear-gradient(to top, rgba(2,30,50,0.88) 0%, transparent 100%);
    color: #8ecae6;
    font-size: clamp(17px, 2.5vw, 20px);
    text-align: center;
    padding: 20px 24px 16px;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.instruction-esc {
    font-size: 15px;
    color: rgba(142, 202, 230, 0.5);
    border: 1px solid rgba(142, 202, 230, 0.25);
    border-radius: 6px;
    padding: 2px 8px;
}

/* ── Empty-state between waves ──────────────────────────────── */
.empty-state {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
    z-index: 3;
    animation: emptyPulse 2s ease-in-out infinite;
}

.empty-title {
    color: #caf0f8;
    font-size: clamp(26px, 4.5vw, 38px);
    font-weight: 700;
    text-shadow: 0 0 20px rgba(202, 240, 248, 0.4);
    margin-bottom: 8px;
}

.empty-sub {
    color: #8ecae6;
    font-size: clamp(16px, 2.6vw, 22px);
}

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

/* ── Mobile responsive score-board ─────────────────────────── */
@media (max-width: 600px) {
    #score-board {
        gap: 10px;
        padding: 8px 12px;
    }
    .score-item .value { font-size: 22px; }
    .score-item .label { font-size: 14px; }
    .camera-badge      { font-size: 15px; padding: 4px 10px; }
    .instruction-bar   { font-size: 16px; padding: 14px 12px 12px; }
}

/* ── End screen ─────────────────────────────────────────────── */
.end-sub {
    color: #caf0f8;
    font-size: clamp(18px, 2.6vw, 24px) !important;
    margin-bottom: 6px !important;
    opacity: 0.9;
}

.end-whanau {
    color: #8ecae6;
    font-size: clamp(16px, 2.2vw, 20px) !important;
    margin-bottom: 20px !important;
    opacity: 0.75;
    font-style: italic;
}

/* ── Safety tip on start screen ────────────────────────────── */
.safety-tip {
    color: #8ecae6;
    font-size: clamp(14px, 1.6vw, 16px);
    margin: 10px 0 0;
    opacity: 0.6;
    line-height: 1.6;
}

/* ══════════════════════════════════════════════════════════════
   PLAYER BADGE — persistent top-right corner widget
   ══════════════════════════════════════════════════════════════ */
#player-badge {
    position: fixed;
    top: 18px;
    right: 22px;
    z-index: 120;
}
#player-badge.hidden { display: none; }

/* ── Trigger chip ────────────────────────────────────────────── */
.pb-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px 8px 8px;
    background: rgba(6, 22, 50, 0.82);
    border: 1px solid rgba(142, 202, 230, 0.30);
    border-radius: 50px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: border-color 0.2s, box-shadow 0.2s;
    color: inherit;
}
.pb-trigger:hover {
    border-color: rgba(142, 202, 230, 0.65);
    box-shadow: 0 0 0 3px rgba(72, 202, 228, 0.12);
}

.pb-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0077b6, #48cae4);
    display: flex; align-items: center; justify-content: center;
    font-size: 17px; font-weight: 800;
    color: #fff;
    flex-shrink: 0;
}

/* New-player state: amber border + pulsing glow on whole chip */
.player-badge--new .pb-trigger {
    border-color: rgba(255, 209, 102, 0.7);
    animation: pb-chip-pulse 2s ease-in-out infinite;
}
.player-badge--new .pb-avatar {
    background: linear-gradient(135deg, rgba(255,209,102,0.25), rgba(244,162,97,0.25));
    color: #ffd166;
}
@keyframes pb-chip-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 209, 102, 0.6); }
    50%       { box-shadow: 0 0 0 10px rgba(255, 209, 102, 0); }
}

.pb-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
}
.pb-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(142, 202, 230, 0.55);
}
.pb-name {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    max-width: 130px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.player-badge--new .pb-name {
    color: rgba(142, 202, 230, 0.65);
    font-weight: 500;
}
.pb-chevron {
    font-size: 12px;
    color: rgba(142, 202, 230, 0.55);
    transition: transform 0.2s;
}
.pb-trigger[aria-expanded="true"] .pb-chevron { transform: rotate(180deg); }

/* ── Callout bubble (new-user only) ─────────────────────────── */
.pb-callout {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    background: linear-gradient(135deg, #ffd166, #f4a261);
    color: #023047;
    font-size: 14px;
    font-weight: 700;
    padding: 10px 16px;
    border-radius: 14px;
    white-space: nowrap;
    pointer-events: none;
    animation: pb-callout-bounce 1.8s ease-in-out infinite;
    box-shadow: 0 4px 18px rgba(255, 180, 0, 0.45);
}
/* Arrow pointing up-right toward the badge */
.pb-callout::before {
    content: "";
    position: absolute;
    top: -7px;
    right: 22px;
    border: 7px solid transparent;
    border-bottom-color: #ffd166;
    border-top: none;
}
@keyframes pb-callout-bounce {
    0%, 100% { transform: translateY(0);    opacity: 1;    }
    45%       { transform: translateY(6px); opacity: 0.85; }
}

/* ── Popover ─────────────────────────────────────────────────── */
.pb-popover {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: clamp(280px, 32vw, 360px);
    background: rgba(6, 18, 44, 0.97);
    border: 1px solid rgba(142, 202, 230, 0.28);
    border-radius: 18px;
    padding: 18px 16px 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(16px);
    animation: pb-drop 0.18s ease;
    overflow: visible;  /* never clip the suggestions list */
}
@keyframes pb-drop {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.pb-popover.hidden { display: none; }

.pb-pop-label {
    font-size: 13px;
    font-weight: 600;
    color: rgba(142, 202, 230, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 10px;
}

.pb-input {
    width: 100%;
    padding: 13px 16px;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    background: rgba(3, 14, 34, 0.7);
    border: 1.5px solid rgba(142, 202, 230, 0.25);
    border-radius: 12px;
    outline: none;
    caret-color: #8ecae6;
}
.pb-input::placeholder { color: rgba(142, 202, 230, 0.30); }
.pb-input:focus {
    border-color: #8ecae6;
    box-shadow: 0 0 0 3px rgba(142, 202, 230, 0.15);
}

.pb-confirm-btn {
    margin-top: 10px;
    width: 100%;
    padding: 13px;
    font-size: 16px;
    font-weight: 700;
    color: #023047;
    background: linear-gradient(135deg, #ffd166, #f4a261);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}
.pb-confirm-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 180, 0, 0.45);
}
.pb-confirm-btn:active { transform: translateY(0); }

/* Suggestions inside the popover — flow inline, no absolute clipping */
.pb-popover .name-setup-field-wrap { margin-bottom: 0; }
.pb-popover .name-suggestions {
    position: static !important;
    top: unset !important;
    margin-top: 6px;
    border-radius: 12px;
    max-height: 220px;
    box-shadow: none;
    border-color: rgba(142, 202, 230, 0.20);
}
.pb-popover .name-suggestions li {
    padding: 12px 16px;
    font-size: clamp(15px, 1.8vw, 18px);
}
.pb-popover .name-suggestions li .ns-avatar {
    width: 32px; height: 32px;
    font-size: 14px;
}
.pb-popover .name-suggestions li .ns-score {
    font-size: 12px;
}

/* ══════════════════════════════════════════════════════════════
   NAME SETUP OVERLAY — legacy (kept but no longer used as modal)
   ══════════════════════════════════════════════════════════════ */
#name-setup-overlay {
    position: absolute;
    inset: 0;
    z-index: 50;
    background: rgba(2, 12, 27, 0.96);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.4s ease;
}
#name-setup-overlay.hidden { display: none; }

.name-setup-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    text-align: center;
    max-width: 520px;
    width: 90%;
    padding: 48px 40px 56px;
    background: rgba(6, 28, 52, 0.85);
    border: 1px solid rgba(142, 202, 230, 0.22);
    border-radius: 28px;
    backdrop-filter: blur(14px);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
}

.name-setup-ocean {
    font-size: 52px;
    line-height: 1;
    filter: drop-shadow(0 0 18px rgba(142, 202, 230, 0.5));
}

.name-setup-greeting {
    color: #8ecae6;
    font-size: clamp(16px, 2vw, 20px);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin: 0;
    opacity: 0.85;
}

.name-setup-title {
    color: #fff;
    font-size: clamp(28px, 4.5vw, 46px);
    font-weight: 800;
    margin: 0;
    line-height: 1.2;
    text-shadow: 0 0 24px rgba(142, 202, 230, 0.4);
}

.name-setup-sub {
    color: rgba(202, 240, 248, 0.7);
    font-size: clamp(16px, 2vw, 20px);
    margin: 0;
    font-style: italic;
}

/* Wrap input + dropdown together */
.name-setup-field-wrap {
    position: relative;
    width: 100%;
    margin-bottom: 6px;
}

/* Autocomplete dropdown */
.name-suggestions {
    position: absolute;
    top: calc(100% + 4px);
    left: 0; right: 0;
    z-index: 20;
    background: rgba(6, 20, 46, 0.97);
    border: 1px solid rgba(142, 202, 230, 0.35);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    max-height: 260px;
    overflow-y: auto;
    list-style: none;
    margin: 0; padding: 4px 0;
}
.name-suggestions li {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 22px;
    font-size: clamp(18px, 2.4vw, 22px);
    color: rgba(202, 240, 248, 0.9);
    cursor: pointer;
    border-bottom: 1px solid rgba(142, 202, 230, 0.08);
    transition: background 0.15s;
}
.name-suggestions li:last-child { border-bottom: none; }
.name-suggestions li:hover,
.name-suggestions li:focus,
.name-suggestions li.ns-active {
    background: rgba(72, 202, 228, 0.18);
    outline: none;
}
.name-suggestions li .ns-avatar {
    flex-shrink: 0;
    width: 40px; height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0077b6, #48cae4);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; font-weight: 700;
    color: #fff;
}
.name-suggestions li .ns-name {
    font-weight: 600;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.name-suggestions li .ns-score {
    margin-left: auto;
    font-size: clamp(12px, 1.5vw, 14px);
    color: #ffd166;
    white-space: nowrap;
    text-align: right;
}

.name-setup-input {
    width: 100%;
    padding: 18px 22px;
    font-size: clamp(22px, 3vw, 30px);
    font-weight: 600;
    text-align: center;
    color: #fff;
    background: rgba(8, 40, 72, 0.7);
    border: 2px solid rgba(142, 202, 230, 0.4);
    border-radius: 16px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    caret-color: #8ecae6;
}
.name-setup-input::placeholder { color: rgba(142, 202, 230, 0.35); }
.name-setup-input:focus {
    border-color: #8ecae6;
    box-shadow: 0 0 0 3px rgba(142, 202, 230, 0.18);
}

.name-setup-btn {
    width: 100%;
    padding: 18px 24px;
    font-size: clamp(18px, 2.4vw, 24px);
    font-weight: 700;
    color: #0d1b2a;
    background: linear-gradient(135deg, #ffd166 0%, #fb8500 100%);
    border: none;
    border-radius: 14px;
    cursor: pointer;
    letter-spacing: 0.03em;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 4px 18px rgba(255, 180, 0, 0.35);
    margin-top: 6px;
}
.name-setup-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(255, 180, 0, 0.5);
}
.name-setup-btn:active { transform: translateY(0); }

/* Returning player one-tap view */
#ns-returning {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    width: 100%;
}
.ns-returning-avatar {
    width: clamp(72px, 10vw, 96px);
    height: clamp(72px, 10vw, 96px);
    border-radius: 50%;
    background: linear-gradient(135deg, #0077b6 0%, #48cae4 100%);
    display: flex; align-items: center; justify-content: center;
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 800;
    color: #fff;
    box-shadow: 0 0 0 4px rgba(72, 202, 228, 0.25);
}
.ns-returning-name {
    color: #fff;
    font-size: clamp(30px, 5vw, 52px);
    font-weight: 700;
    letter-spacing: 0.02em;
    text-align: center;
}
.ns-switch-btn {
    background: none;
    border: none;
    color: rgba(142, 202, 230, 0.65);
    font-size: clamp(15px, 1.8vw, 18px);
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.15s;
    margin-top: -4px;
}
.ns-switch-btn:hover { color: #8ecae6; }

/* ══════════════════════════════════════════════════════════════
   GAME COMPLETE SCREEN — warrior badge + leaderboard
   ══════════════════════════════════════════════════════════════ */
.gc-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    width: 100%;
    max-width: 660px;
    padding: 32px 24px 40px;
    overflow-y: auto;
}

/* Warrior badge — name + title */
.gc-warrior-badge {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255, 209, 102, 0.12);
    border: 1px solid rgba(255, 209, 102, 0.35);
    border-radius: 20px;
    padding: 12px 24px;
    backdrop-filter: blur(8px);
}
.gc-warrior-icon { font-size: 36px; line-height: 1; }
.gc-warrior-info { display: flex; flex-direction: column; gap: 2px; text-align: left; }
.gc-warrior-name {
    color: #ffd166;
    font-size: clamp(20px, 2.8vw, 28px);
    font-weight: 800;
    line-height: 1.2;
}
.gc-warrior-title {
    color: rgba(255, 209, 102, 0.75);
    font-size: clamp(13px, 1.5vw, 16px);
    font-style: italic;
}

/* Score comparison row */
.gc-score-row {
    display: flex;
    gap: 16px;
    width: 100%;
    justify-content: center;
}
.gc-score-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 16px 28px;
    background: rgba(8, 40, 72, 0.65);
    border: 1px solid rgba(142, 202, 230, 0.18);
    border-radius: 16px;
    min-width: 140px;
    backdrop-filter: blur(6px);
}
.gc-score-box--best {
    border-color: rgba(255, 209, 102, 0.35);
    background: rgba(255, 209, 102, 0.08);
}
.gc-score-label {
    color: rgba(142, 202, 230, 0.7);
    font-size: clamp(12px, 1.3vw, 15px);
    text-transform: uppercase;
    letter-spacing: 0.07em;
}
.gc-score-val {
    color: #fff;
    font-size: clamp(28px, 4vw, 44px);
    font-weight: 800;
    line-height: 1.1;
}
.gc-score-box--best .gc-score-val { color: #ffd166; }

.gc-new-best {
    color: #ffd166;
    font-size: clamp(12px, 1.3vw, 15px);
    font-weight: 700;
    letter-spacing: 0.05em;
    animation: pulse 1.2s ease-in-out infinite;
}
.gc-new-best.hidden { display: none; }

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.6; transform: scale(0.95); }
}

/* Leaderboard */
.gc-leaderboard {
    width: 100%;
    background: rgba(6, 22, 44, 0.7);
    border: 1px solid rgba(142, 202, 230, 0.14);
    border-radius: 18px;
    padding: 16px 20px;
    backdrop-filter: blur(6px);
}
.gc-lb-title {
    color: #8ecae6;
    font-size: clamp(14px, 1.5vw, 17px);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 12px;
    text-align: center;
}
.gc-lb-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.gc-lb-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(8, 36, 64, 0.5);
    transition: background 0.15s;
}
.gc-lb-row--current {
    background: rgba(255, 209, 102, 0.12);
    border: 1px solid rgba(255, 209, 102, 0.3);
}
.gc-lb-rank {
    font-size: clamp(18px, 2vw, 22px);
    min-width: 32px;
    text-align: center;
    line-height: 1;
}
.gc-lb-name {
    flex: 1;
    color: rgba(202, 240, 248, 0.9);
    font-size: clamp(15px, 1.8vw, 19px);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gc-lb-row--current .gc-lb-name { color: #ffd166; }
.gc-lb-default-tag {
    font-size: 11px;
    font-weight: 600;
    color: rgba(202, 240, 248, 0.5);
    background: rgba(255,255,255,0.08);
    border-radius: 4px;
    padding: 1px 5px;
    margin-left: 6px;
    vertical-align: middle;
    letter-spacing: 0.04em;
}
.gc-lb-name-hint {
    margin-top: 14px;
    font-size: 13px;
    color: rgba(202, 240, 248, 0.55);
    text-align: center;
    line-height: 1.5;
    padding: 0 8px;
}
.gc-lb-score {
    color: #fff;
    font-size: clamp(16px, 2vw, 22px);
    font-weight: 700;
    white-space: nowrap;
}
.gc-lb-row--current .gc-lb-score { color: #ffd166; }
.gc-lb-date {
    color: rgba(142, 202, 230, 0.5);
    font-size: clamp(12px, 1.2vw, 14px);
    white-space: nowrap;
}

/* ── Kupe boss kill popup ────────────────────────────────────── */
.kupe-victory {
    font-size: clamp(18px, 3.5vw, 28px) !important;
    color: #ffd166 !important;
    text-shadow: 0 0 18px rgba(255, 180, 0, 0.7),
                 0 2px 8px rgba(0,0,0,0.6) !important;
    background: rgba(2, 48, 71, 0.75) !important;
    border: 1px solid rgba(255, 209, 102, 0.35) !important;
    padding: 8px 18px !important;
    border-radius: 12px !important;
    animation-duration: 2.2s !important;
}

/* ═══════════════════════════════════════════════════════════════════
   Stage journey overview screen
   ═══════════════════════════════════════════════════════════════════ */

#stage-overview-screen {
    position: absolute;
    inset: 0;
    z-index: 11;
    background: radial-gradient(ellipse 90% 80% at 50% 30%,
        #02304a 0%,
        #020c1b 100%);
    overflow-y: auto;
    /* column flex so inner can stretch to fill the full height */
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: clamp(20px, 3vh, 40px) clamp(16px, 3vw, 48px);
    animation: fadeIn 0.35s ease;
}

.ov-inner {
    width: 100%;
    max-width: 1280px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    /* stretch to fill whatever height the screen gives */
    flex: 1;
    min-height: 0;
}

/* ── Header row ─────────────────────────────────────────────────── */
.ov-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.ov-label {
    color: #8ecae6;
    font-size: clamp(13px, 1.4vw, 15px);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin: 0 0 8px;
}

.ov-title {
    color: #fff;
    font-size: clamp(28px, 4.5vw, 48px);
    font-weight: 800;
    margin: 0;
    text-shadow: 0 0 28px rgba(142, 202, 230, 0.4);
    letter-spacing: -0.01em;
    line-height: 1.1;
}

.ov-em {
    font-style: italic;
    color: #ffd166;
    font-weight: 800;
    text-shadow: 0 0 24px rgba(255, 209, 102, 0.45);
}

.ov-header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    min-width: 180px;
}

.ov-prog-bar {
    width: 180px;
    height: 7px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 99px;
    overflow: hidden;
}

.ov-prog-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #219ebc, #06d6a0);
    border-radius: 99px;
    transition: width 0.6s cubic-bezier(.4,0,.2,1);
}

.ov-prog-text {
    color: #8ecae6;
    font-size: 15px;
    letter-spacing: 0.1em;
    margin: 0;
}

/* ── Overview header buttons row (mute + change weapon) ─────────── */
.ov-header-btns {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

/* Wrapper so hint tooltip is positioned relative to mute btn */
.ov-mute-wrap {
    position: relative;
}

/* ── Overview mute button ───────────────────────────────────────── */
.ov-mute-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: rgba(144, 224, 239, 0.10);
    border: 1px solid rgba(144, 224, 239, 0.35);
    border-radius: 50%;
    color: rgba(202, 240, 248, 0.85);
    cursor: pointer;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: background 0.18s, border-color 0.18s, transform 0.12s;
    user-select: none;
    line-height: 1;
    flex-shrink: 0;
}
.ov-mute-btn:hover {
    background: rgba(144, 224, 239, 0.22);
    border-color: rgba(144, 224, 239, 0.75);
}
.ov-mute-btn:active  { transform: scale(0.92); }
.ov-mute-btn.muted   { opacity: 0.50; }

/* ── Overview voice hint tooltip (one-time, auto-fades) ─────────── */
.ov-voice-hint {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    white-space: nowrap;
    background: rgba(8, 28, 58, 0.92);
    color: rgba(202, 240, 248, 0.95);
    border: 1px solid rgba(142, 202, 230, 0.30);
    border-radius: 10px;
    padding: 7px 13px;
    font-size: clamp(12px, 1.5vw, 14px);
    font-weight: 500;
    pointer-events: none;
    animation: sc-hint-fade 4.5s ease forwards;
}
/* Reuses the same keyframe defined in the story-card section */

/* ── Change Weapon button (stage overview header) ───────────────── */
.ov-change-weapon-btn {
    padding: 9px 18px;
    background: rgba(144, 224, 239, 0.10);
    border: 1.5px solid rgba(144, 224, 239, 0.45);
    border-radius: 8px;
    color: #90e0ef;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: background 0.18s, border-color 0.18s, transform 0.12s;
    white-space: nowrap;
}
.ov-change-weapon-btn:hover {
    background: rgba(144, 224, 239, 0.22);
    border-color: rgba(144, 224, 239, 0.75);
    transform: translateY(-1px);
}
.ov-change-weapon-btn:active {
    transform: translateY(0);
}

/* ── Weapon picker modal ─────────────────────────────────────────── */
#ov-weapon-modal {
    position: fixed;
    inset: 0;
    z-index: 320;
    display: flex;
    align-items: center;
    justify-content: center;
}
#ov-weapon-modal.hidden { display: none; }

.ovm-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(1, 18, 36, 0.80);
    backdrop-filter: blur(4px);
}

.ovm-panel {
    position: relative;
    background: linear-gradient(160deg, #02304a 0%, #020c1b 100%);
    border: 1px solid rgba(144, 224, 239, 0.22);
    border-radius: 18px;
    padding: 28px 28px 24px;
    width: min(620px, 92vw);
    max-height: 88vh;
    overflow-y: auto;
    box-shadow: 0 0 60px rgba(0,0,0,0.7);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ovm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ovm-title {
    color: #90e0ef;
    font-size: clamp(16px, 2.4vw, 22px);
    font-weight: 700;
    letter-spacing: 0.04em;
    margin: 0;
}

.ovm-close {
    background: rgba(144, 224, 239, 0.08);
    border: 1px solid rgba(144, 224, 239, 0.30);
    border-radius: 8px;
    color: #90e0ef;
    font-size: 18px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s;
}
.ovm-close:hover { background: rgba(144, 224, 239, 0.20); }

.ovm-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
@media (max-width: 480px) {
    .ovm-grid { grid-template-columns: 1fr; }
}

/* Re-use existing .weapon-card styles — just constrain image height */
.ovm-grid .weapon-card { width: 100%; }
.ovm-grid .wc-img-wrap { height: 100px; }

.ovm-confirm {
    align-self: center;
    padding: 13px 36px;
    background: linear-gradient(135deg, #0096c7, #0077b6);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-family: inherit;
    font-size: clamp(15px, 1.8vw, 18px);
    font-weight: 700;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: filter 0.15s, transform 0.12s;
    min-width: 200px;
    min-height: 52px;
}
.ovm-confirm:hover { filter: brightness(1.15); transform: translateY(-1px); }
.ovm-confirm:active { transform: translateY(0); }

/* ── Story narrative band ───────────────────────────────────────── */
.ov-story {
    margin: 0;
    padding: 14px 24px;
    color: #caf0f8;
    font-size: clamp(15px, 1.6vw, 18px);
    line-height: 1.75;
    font-style: italic;
    text-align: center;
    opacity: 0.82;
    border-top: 1px solid rgba(142, 202, 230, 0.12);
    border-bottom: 1px solid rgba(142, 202, 230, 0.12);
    position: relative;
}

/* Decorative wave quotes */
.ov-story::before,
.ov-story::after {
    content: "〰";
    display: inline-block;
    color: rgba(142, 202, 230, 0.35);
    font-style: normal;
    font-size: 14px;
    vertical-align: middle;
    margin: 0 10px;
}

/* ── Cards grid ─────────────────────────────────────────────────── */
.ov-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    /* grow to fill the remaining vertical space after the header */
    flex: 1;
    min-height: 0;
    /* so cards inside stretch to equal height */
    align-items: stretch;
}

@media (max-width: 900px) {
    .ov-cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 500px) {
    .ov-cards { grid-template-columns: 1fr 1fr; gap: 10px; }
    #stage-overview-screen { padding: 16px 10px; }
}

/* ── Individual card ────────────────────────────────────────────── */
.ov-card {
    display: flex;
    flex-direction: column;
    border-radius: 20px;
    overflow: hidden;
    border: 1.5px solid rgba(142, 202, 230, 0.18);
    background: rgba(2, 30, 50, 0.65);
    backdrop-filter: blur(8px);
    transition: transform 0.18s, box-shadow 0.18s;
}

/* Done — green accent */
.ov-card--done {
    border-color: rgba(6, 214, 160, 0.45);
}

/* Active (current stage) — gold left accent line + glow */
.ov-card--active {
    border-color: rgba(255, 209, 102, 0.5);
    border-left: 3px solid #ffd166;
    box-shadow: 0 0 32px rgba(255, 209, 102, 0.18),
                0 8px 32px rgba(0, 0, 0, 0.45);
}
.ov-card--active:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 40px rgba(255, 209, 102, 0.25),
                0 14px 40px rgba(0, 0, 0, 0.5);
}
/* (active card body accent handled by gold border on card) */

/* Locked — muted */
.ov-card--locked {
    opacity: 0.82;
    filter: grayscale(0.15);
}

/* ── Card image panel ────────────────────────────────────────────── */
.ov-img {
    position: relative;
    height: clamp(130px, 18vw, 190px);
    background-size: cover;
    background-position: center center;
    flex-shrink: 0;
    overflow: hidden;
}

/* Subtle bottom vignette to blend into card body */
.ov-img::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom,
        transparent 55%,
        rgba(2, 10, 22, 0.55) 100%);
    pointer-events: none;
}

/* Stage number badge — top-left of image */
.ov-num {
    position: absolute;
    top: 10px;
    left: 12px;
    z-index: 2;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    background: rgba(2, 16, 30, 0.78);
    border: 1.5px solid rgba(142, 202, 230, 0.4);
    backdrop-filter: blur(4px);
}
.ov-card--done .ov-num   { background: rgba(6, 214, 160, 0.3); border-color: #06d6a0; }
.ov-card--active .ov-num { background: rgba(255, 209, 102, 0.3); border-color: #ffd166; }

/* Duration badge — top-right of image */
.ov-duration {
    position: absolute;
    top: 10px;
    right: 12px;
    z-index: 2;
    background: rgba(2, 16, 30, 0.75);
    border: 1px solid rgba(142, 202, 230, 0.28);
    border-radius: 20px;
    padding: 3px 10px;
    color: #8ecae6;
    font-size: clamp(11px, 1vw, 13px);
    backdrop-filter: blur(4px);
}

.ov-lock {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -60%);
    font-size: 30px;
    z-index: 2;
    filter: drop-shadow(0 2px 10px rgba(0,0,0,0.7));
}

.ov-check {
    position: absolute;
    top: 10px;
    right: 50px;   /* shifted left of the duration badge */
    z-index: 2;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #06d6a0;
    color: #012a20;
    font-size: 13px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px rgba(6, 214, 160, 0.6);
}

/* Locked card — image is fogged */
.ov-card--locked .ov-img {
    filter: brightness(0.78) saturate(0.70);
}

/* ── Card body panel ─────────────────────────────────────────────── */
.ov-body {
    display: flex;
    flex-direction: column;
    padding: 16px 16px 14px;
    flex: 1;
    min-height: 0;
    gap: 10px;
    overflow: hidden;
}

.ov-top {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.ov-name {
    color: #fff;
    font-size: clamp(18px, 2vw, 23px);
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
}

.ov-subtitle {
    color: rgba(202, 240, 248, 0.8);
    font-size: clamp(14px, 1.3vw, 16px);
    font-style: italic;
    margin: 0;
    line-height: 1.4;
}

.ov-desc {
    color: rgba(202, 240, 248, 0.65);
    font-size: clamp(12px, 1vw, 14px);
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Icon stats grid — 2 columns, stacks vertically ─────────────── */
.ov-icon-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    padding: 10px 0 6px;
    border-top: 1px solid rgba(142, 202, 230, 0.15);
}


.ov-istat {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 7px;
    cursor: help;
    padding: 5px 9px;
    border-radius: 8px;
    background: rgba(142, 202, 230, 0.06);
    border: 1px solid rgba(142, 202, 230, 0.1);
    transition: background 0.15s, border-color 0.15s;
}
.ov-istat:hover {
    background: rgba(142, 202, 230, 0.14);
    border-color: rgba(142, 202, 230, 0.25);
}

.ov-istat-icon { font-size: 18px; line-height: 1; flex-shrink: 0; }

.ov-istat-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.ov-istat-val {
    color: #caf0f8;
    font-size: clamp(13px, 1.2vw, 15px);
    font-weight: 700;
    line-height: 1.2;
}

.ov-istat-lbl {
    color: rgba(142, 202, 230, 0.6);
    font-size: clamp(10px, 0.9vw, 12px);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    line-height: 1;
}

/* ── Card action area (pinned to bottom) ─────────────────────────── */
.ov-action {
    margin-top: auto;
    padding-top: 10px;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════
   PAUSE BUTTON
   ═══════════════════════════════════════════════════════════════════ */
.pause-btn {
    position: absolute;
    top: 68px;
    right: 16px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid rgba(142, 202, 230, 0.5);
    background: rgba(4, 14, 30, 0.80);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #caf0f8;
    font-size: 22px;
    cursor: pointer;
    pointer-events: auto;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, transform 0.12s, border-color 0.15s;
    box-shadow: 0 2px 12px rgba(0,0,0,0.4);
}
.pause-btn:hover {
    background: rgba(2, 48, 71, 0.95);
    border-color: rgba(142, 202, 230, 0.85);
    transform: scale(1.08);
}
.pause-btn:active { transform: scale(0.96); }
.pause-btn.hidden { display: none !important; }

/* ═══════════════════════════════════════════════════════════════════
   PAUSE OVERLAY
   ═══════════════════════════════════════════════════════════════════ */
.pause-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pauseFadeIn 0.18s ease;
}
.pause-overlay.hidden { display: none !important; }

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

.pause-inner {
    text-align: center;
    padding: 48px 40px;
    background: rgba(4, 20, 42, 0.92);
    border: 1px solid rgba(142, 202, 230, 0.3);
    border-radius: 28px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.6);
    max-width: 420px;
    width: calc(100% - 48px);
}

.pause-label {
    font-size: 12px;
    letter-spacing: 0.18em;
    color: #48cae4;
    text-transform: uppercase;
    margin-bottom: 10px;
    font-weight: 600;
}

.pause-title {
    font-size: clamp(28px, 5vw, 42px);
    font-weight: 800;
    color: #e0f4ff;
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.pause-sub {
    font-size: clamp(15px, 2.2vw, 18px);
    color: #90c8e0;
    margin-bottom: 36px;
    line-height: 1.6;
}

.pause-buttons {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.pause-resume-btn {
    width: 100%;
    padding: 18px 24px;
    border-radius: 16px;
    border: none;
    background: linear-gradient(135deg, #0096c7, #0077b6);
    color: #fff;
    font-size: clamp(18px, 3vw, 22px);
    font-weight: 700;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: transform 0.12s, box-shadow 0.15s;
    box-shadow: 0 6px 24px rgba(0, 119, 182, 0.45);
}
.pause-resume-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 32px rgba(0, 119, 182, 0.6);
}
.pause-resume-btn:active { transform: translateY(0); }

.pause-btn-maori {
    font-size: clamp(11px, 1.6vw, 13px);
    font-weight: 400;
    opacity: 0.8;
    letter-spacing: 0.05em;
}

.pause-exit-btn {
    width: 100%;
    padding: 14px 24px;
    border-radius: 14px;
    border: 1px solid rgba(142, 202, 230, 0.35);
    background: transparent;
    color: #90c8e0;
    font-size: clamp(15px, 2.2vw, 17px);
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.pause-exit-btn:hover {
    background: rgba(142, 202, 230, 0.12);
    color: #caf0f8;
    border-color: rgba(142, 202, 230, 0.6);
}

/* ═══════════════════════════════════════════════════════════════════
   TUTORIAL OVERLAY
   ═══════════════════════════════════════════════════════════════════ */
.tutorial-overlay {
    position: fixed;
    inset: 0;
    z-index: 600;
    background: rgba(1, 8, 20, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pauseFadeIn 0.3s ease;
}
.tutorial-overlay.hidden { display: none !important; }

.tut-inner {
    text-align: center;
    padding: 44px 40px 36px;
    background: rgba(4, 20, 42, 0.94);
    border: 1px solid rgba(142, 202, 230, 0.28);
    border-radius: 28px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.65);
    max-width: 520px;
    width: calc(100% - 48px);
}

.tut-label {
    font-size: 11px;
    letter-spacing: 0.2em;
    color: #48cae4;
    text-transform: uppercase;
    margin-bottom: 8px;
    font-weight: 700;
}

.tut-title {
    font-size: clamp(24px, 4vw, 36px);
    font-weight: 800;
    color: #e0f4ff;
    margin-bottom: 28px;
    letter-spacing: -0.01em;
}

.tut-steps {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 28px;
    text-align: left;
}

.tut-step {
    display: flex;
    align-items: center;
    gap: 18px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(142, 202, 230, 0.15);
    border-radius: 16px;
    padding: 16px 20px;
}

.tut-icon {
    font-size: 36px;
    flex-shrink: 0;
    width: 52px;
    text-align: center;
    /* subtle pulse animation on each icon */
    animation: tutIconPop 0.5s ease both;
}
.tut-step:nth-child(1) .tut-icon { animation-delay: 0.1s; }
.tut-step:nth-child(2) .tut-icon { animation-delay: 0.25s; }
.tut-step:nth-child(3) .tut-icon { animation-delay: 0.4s; }

@keyframes tutIconPop {
    from { transform: scale(0.5); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

.tut-text { flex: 1; }

.tut-step-title {
    font-size: clamp(16px, 2.6vw, 20px);
    font-weight: 700;
    color: #caf0f8;
    margin-bottom: 4px;
}

.tut-step-sub {
    font-size: clamp(13px, 1.9vw, 15px);
    color: #7ab8d4;
    line-height: 1.5;
}

.tut-cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.tut-go-btn {
    width: 100%;
    padding: 18px 24px;
    border-radius: 16px;
    border: none;
    background: linear-gradient(135deg, #0096c7, #0077b6);
    color: #fff;
    font-size: clamp(18px, 3vw, 22px);
    font-weight: 700;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: transform 0.12s, box-shadow 0.15s;
    box-shadow: 0 6px 24px rgba(0, 119, 182, 0.45);
}
.tut-go-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 32px rgba(0, 119, 182, 0.6);
}
.tut-btn-maori {
    font-size: clamp(11px, 1.6vw, 13px);
    font-weight: 400;
    opacity: 0.8;
    letter-spacing: 0.05em;
}

.tut-countdown-wrap {
    width: 100%;
    height: 5px;
    background: rgba(142, 202, 230, 0.15);
    border-radius: 3px;
    overflow: hidden;
}
.tut-countdown-bar {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #48cae4, #0096c7);
    border-radius: 3px;
    transform-origin: left center;
    transition: transform linear;
}

/* ── Stat tooltip popup ─────────────────────────────────────────── */
#ov-tip {
    position: fixed;
    z-index: 9999;
    max-width: 240px;
    padding: 11px 18px;
    background: rgba(3, 16, 34, 0.97);
    border: 1px solid rgba(142, 202, 230, 0.45);
    border-radius: 14px;
    color: #caf0f8;
    font-size: clamp(14px, 1.4vw, 16px);
    line-height: 1.55;
    text-align: center;
    pointer-events: none;
    backdrop-filter: blur(10px);
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}
#ov-tip.ov-tip--on {
    opacity: 1;
    transform: translateY(0);
}

/* ── Footer action elements ─────────────────────────────────────── */

.ov-begin-btn {
    width: 100%;
    padding: 10px 16px;
    font-size: clamp(14px, 1.3vw, 16px);
    font-weight: 700;
    color: #0d1b2a;
    background: linear-gradient(135deg, #ffd166 0%, #fb8500 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    letter-spacing: 0.03em;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 3px 12px rgba(255, 180, 0, 0.3);
}
.ov-begin-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 180, 0, 0.45);
}
.ov-begin-btn:active { transform: translateY(0); }

/* Done checkmark — centered in action area */
.ov-complete-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #06d6a0;
    color: #012a20;
    font-size: 16px;
    font-weight: 900;
    box-shadow: 0 0 10px rgba(6, 214, 160, 0.5);
    margin: 0 auto;
}

/* Locked — unlock hint */
.ov-unlock-hint {
    display: block;
    text-align: center;
    color: rgba(142, 202, 230, 0.55);
    font-size: clamp(11px, 1vw, 13px);
    font-style: italic;
}
