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

:root {
    --bg-night: #080b1a;
    --bg-deep: #1a1a2e;
    --panel-blue: #0f3460;
    --panel-navy: #16213e;
    --accent-red: #e94560;
    --accent-gold: #f9a826;
    --accent-link: #67b6ff;
    --accent-green: #6cf0a7;
    --text-main: #f4f7ff;
    --text-dim: #b7c3e2;
    --shadow-strong: rgba(3, 6, 19, 0.72);
}

body {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
    font-family: 'Press Start 2P', cursive;
    color: var(--text-main);
    background:
        radial-gradient(circle at top, rgba(233, 69, 96, 0.15), transparent 28%),
        radial-gradient(circle at bottom, rgba(249, 168, 38, 0.12), transparent 32%),
        linear-gradient(180deg, #0c1123 0%, #080b1a 100%);
}

button,
input,
textarea,
select {
    font: inherit;
}

[hidden] {
    display: none !important;
}

#game-shell {
    width: min(920px, 100%);
    display: flex;
    flex-direction: column;
    gap: 18px;
}

#game-header {
    padding: 14px 18px 18px;
    border: 4px solid var(--accent-red);
    background:
        linear-gradient(180deg, rgba(26, 26, 46, 0.96), rgba(15, 52, 96, 0.94)),
        var(--panel-blue);
    box-shadow:
        0 18px 35px var(--shadow-strong),
        0 0 0 4px rgba(249, 168, 38, 0.16);
    text-transform: uppercase;
}

.header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.header-copy {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hud-label {
    color: var(--accent-gold);
    font-size: 9px;
    letter-spacing: 1px;
}

#game-header h1 {
    max-width: 100%;
    font-size: clamp(16px, 2.3vw, 24px);
    line-height: 1.35;
    text-shadow: 4px 4px 0 rgba(0, 0, 0, 0.45);
}

#hud-bar {
    margin-top: 16px;
    display: grid;
    grid-template-columns: minmax(110px, 160px) minmax(220px, 1fr) minmax(140px, 180px);
    gap: 12px;
    align-items: stretch;
}

.hud-card {
    border: 2px solid rgba(249, 168, 38, 0.58);
    background: rgba(8, 11, 26, 0.48);
    box-shadow: inset 0 0 0 2px rgba(15, 52, 96, 0.92);
}

.hud-chip {
    min-height: 64px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
}

.hud-chip-label {
    color: var(--text-dim);
    font-size: 7px;
    line-height: 1.5;
    letter-spacing: 1px;
}

.header-branding {
    display: flex;
    align-items: center;
    gap: 12px;
}

#aiesec-logo {
    width: clamp(132px, 18vw, 170px);
    height: auto;
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(103, 182, 255, 0.18));
}

.hud-icon-btn {
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--accent-gold);
    cursor: pointer;
    display: grid;
    place-items: center;
    border-radius: 999px;
    transition: transform 0.18s ease, color 0.18s ease, filter 0.18s ease, background 0.18s ease;
}

.hud-icon-btn:hover,
.hud-icon-btn:focus-visible {
    color: #fff1b8;
    background: rgba(249, 168, 38, 0.08);
    transform: translateY(-1px) scale(1.04);
    outline: none;
}

.music-toggle-icon {
    width: 30px;
    height: 30px;
    overflow: visible;
    filter: drop-shadow(0 0 8px rgba(249, 168, 38, 0.2));
}

.music-toggle-speaker {
    fill: currentColor;
}

.music-toggle-wave,
.music-toggle-slash {
    fill: none;
    stroke: currentColor;
    stroke-width: 2.1;
    stroke-linecap: square;
    stroke-linejoin: miter;
    transition: opacity 0.18s ease;
}

.music-toggle-slash {
    opacity: 0;
}

.hud-icon-btn.is-muted {
    color: #ff98ab;
}

.hud-icon-btn.is-muted .music-toggle-wave {
    opacity: 0;
}

.hud-icon-btn.is-muted .music-toggle-slash {
    opacity: 1;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

#level-badge,
#score-value,
#progress-text {
    color: var(--text-main);
    font-size: 10px;
    line-height: 1.6;
}

#progress-panel {
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
}

.progress-panel-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

#progress-track {
    height: 14px;
    border: 2px solid rgba(249, 168, 38, 0.5);
    background:
        linear-gradient(180deg, rgba(8, 11, 26, 0.92), rgba(14, 21, 42, 0.92)),
        var(--bg-night);
    overflow: hidden;
}

#progress-fill {
    width: 0;
    height: 100%;
    background:
        linear-gradient(90deg, rgba(249, 168, 38, 1), rgba(233, 69, 96, 0.95)),
        var(--accent-gold);
    box-shadow:
        0 0 14px rgba(249, 168, 38, 0.45),
        inset 0 0 0 1px rgba(255, 255, 255, 0.2);
    transition: width 0.35s ease;
}

#score-card {
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

#score-card.is-bonus {
    border-color: rgba(108, 240, 167, 0.9);
    box-shadow:
        inset 0 0 0 2px rgba(21, 108, 68, 0.6),
        0 0 18px rgba(108, 240, 167, 0.35);
    animation: score-pop-green 0.45s ease;
}

#score-card.is-penalty {
    border-color: rgba(233, 69, 96, 0.92);
    box-shadow:
        inset 0 0 0 2px rgba(131, 22, 41, 0.62),
        0 0 18px rgba(233, 69, 96, 0.35);
    animation: score-pop-red 0.45s ease;
}

#combo-indicator {
    align-self: center;
    justify-self: end;
    min-width: 176px;
    padding: 12px 14px;
    border: 2px solid rgba(108, 240, 167, 0.82);
    background:
        linear-gradient(180deg, rgba(18, 62, 49, 0.96), rgba(9, 21, 19, 0.98)),
        #0c1f18;
    color: var(--accent-green);
    font-size: 8px;
    line-height: 1.6;
    text-align: center;
    opacity: 0;
    transform: translateY(8px) scale(0.96);
    transition: opacity 0.18s ease, transform 0.18s ease;
    box-shadow:
        inset 0 0 0 2px rgba(35, 113, 83, 0.52),
        0 0 18px rgba(108, 240, 167, 0.18);
}

#combo-indicator.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    animation: combo-pop 0.32s ease;
}

#game-container {
    width: 100%;
    min-height: 680px;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 6px solid var(--accent-red);
    background: var(--panel-blue);
    box-shadow:
        0 24px 45px var(--shadow-strong),
        0 0 30px rgba(233, 69, 96, 0.24);
    transition: opacity 0.25s ease, transform 0.25s ease;
    --scene-background: url("assets/backgrounds/01.webp");
}

#game-container.is-feedback-success {
    box-shadow:
        0 24px 45px var(--shadow-strong),
        0 0 34px rgba(108, 240, 167, 0.35);
}

#game-container.is-feedback-failure {
    box-shadow:
        0 24px 45px var(--shadow-strong),
        0 0 34px rgba(233, 69, 96, 0.4);
}

#game-container.is-shaking {
    animation: screen-shake 0.48s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes screen-shake {
    0%, 100% { transform: translateX(0); }
    12%  { transform: translateX(-7px) rotate(-0.4deg); }
    25%  { transform: translateX(7px)  rotate(0.4deg); }
    38%  { transform: translateX(-5px) rotate(-0.3deg); }
    52%  { transform: translateX(5px)  rotate(0.3deg); }
    65%  { transform: translateX(-3px); }
    80%  { transform: translateX(3px); }
    92%  { transform: translateX(-1px); }
}

#game-container.is-transitioning {
    opacity: 0;
    transform: scale(0.985);
}

#title-screen {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 28px;
    background:
        radial-gradient(circle at center, rgba(8, 11, 26, 0.08), rgba(8, 11, 26, 0.42) 55%, rgba(8, 11, 26, 0.76) 100%),
        linear-gradient(180deg, rgba(15, 52, 96, 0.08), rgba(8, 11, 26, 0.34));
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.title-panel {
    width: min(560px, 100%);
    padding: 24px 28px 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    text-align: center;
    border: 4px solid rgba(233, 69, 96, 0.78);
    background:
        linear-gradient(180deg, rgba(9, 18, 38, 0.86), rgba(6, 10, 23, 0.94)),
        var(--bg-night);
    box-shadow:
        0 18px 32px rgba(3, 6, 19, 0.5),
        0 0 0 3px rgba(249, 168, 38, 0.12);
}

.title-kicker {
    width: 100%;
    color: var(--accent-gold);
    font-size: 9px;
    line-height: 1.7;
    text-align: center;
}

#title-screen h2 {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    font-size: clamp(18px, 2.6vw, 26px);
    line-height: 1.35;
    text-align: center;
    text-shadow:
        4px 4px 0 rgba(0, 0, 0, 0.35),
        0 0 12px rgba(233, 69, 96, 0.26);
}

.title-copy {
    max-width: 500px;
    font-size: 9px;
    line-height: 1.9;
    color: var(--text-dim);
}

#game-container:not([data-mode="title"]) #title-screen {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#map-screen {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 28px;
    background: 
        radial-gradient(circle at center, rgba(15, 52, 96, 0.6), rgba(8, 11, 26, 0.95)),
        url('assets/backgrounds/08.webp') center/cover no-repeat;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

#game-container:not([data-mode="map"]) #map-screen {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.map-panel {
    width: min(540px, 100%);
    padding: 24px 24px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    border: 3px solid rgba(249, 168, 38, 0.4);
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(8, 11, 26, 0.95), rgba(15, 52, 96, 0.85));
    backdrop-filter: blur(12px);
    box-shadow: 
        0 0 0 1px rgba(255, 255, 255, 0.05),
        0 24px 48px rgba(0, 0, 0, 0.9),
        inset 0 0 40px rgba(103, 182, 255, 0.1);
}

.map-panel .title-kicker {
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 2px;
    color: var(--accent-gold);
    text-shadow: 0 0 12px rgba(249, 168, 38, 0.4);
    text-transform: uppercase;
}

.map-container {
    position: relative;
    width: 100%;
    height: 140px;
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.map-path-line {
    position: absolute;
    top: 50%;
    left: 8%;
    right: 8%;
    height: 6px;
    background: rgba(103, 182, 255, 0.3);
    box-shadow: 0 0 12px rgba(103, 182, 255, 0.3);
    transform: translateY(-50%);
    border-radius: 3px;
    z-index: 0;
}

.map-node {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    background: none;
    border: none;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.map-node:disabled {
    cursor: not-allowed;
}

.map-node:not(:disabled):hover {
    transform: translateY(-8px) scale(1.1);
}

.map-node-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 4px solid var(--text-dim);
    background: var(--bg-deep);
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 6px 12px rgba(0,0,0,0.6);
    transition: all 0.3s ease;
}

.map-node.is-cleared .map-node-icon {
    border-color: var(--accent-gold);
    background: rgba(249, 168, 38, 0.25);
    box-shadow: 0 0 24px rgba(249, 168, 38, 0.6);
}

.map-node.is-unlocked .map-node-icon {
    border-color: var(--accent-link);
    background: rgba(103, 182, 255, 0.25);
    box-shadow: 0 0 24px rgba(103, 182, 255, 0.6);
    animation: node-pulse 2.5s infinite ease-in-out;
}

.map-node.is-locked .map-node-icon {
    border-color: rgba(255,255,255,0.15);
    background: rgba(0,0,0,0.7);
    color: var(--text-dim);
}

.map-node-label {
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-main);
    text-shadow: 0 2px 4px rgba(0,0,0,1);
    background: rgba(8, 11, 26, 0.7);
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.1);
}

.map-node.is-locked .map-node-label {
    color: var(--text-dim);
    opacity: 0.7;
    background: transparent;
    border-color: transparent;
}

@keyframes node-pulse {
    0% { box-shadow: 0 0 12px rgba(103, 182, 255, 0.4); transform: scale(1); }
    50% { box-shadow: 0 0 32px rgba(103, 182, 255, 0.9); transform: scale(1.05); }
    100% { box-shadow: 0 0 12px rgba(103, 182, 255, 0.4); transform: scale(1); }
}

#game-container[data-mode="title"] {
    min-height: 0;
}

#scene-image {
    height: 336px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    overflow: hidden;
    border-bottom: 4px solid var(--accent-red);
    background-image:
        linear-gradient(180deg, rgba(8, 11, 26, 0.18), rgba(8, 11, 26, 0.08) 45%, rgba(8, 11, 26, 0.38) 100%),
        var(--scene-background);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

.scene-stars,
.scene-grid {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.scene-stars {
    background-image:
        radial-gradient(circle at 18% 22%, rgba(255, 255, 255, 0.85) 0 1px, transparent 1.5px),
        radial-gradient(circle at 72% 18%, rgba(255, 255, 255, 0.65) 0 1px, transparent 1.5px),
        radial-gradient(circle at 82% 56%, rgba(249, 168, 38, 0.7) 0 1px, transparent 1.5px),
        radial-gradient(circle at 28% 62%, rgba(233, 69, 96, 0.55) 0 1px, transparent 1.5px),
        radial-gradient(circle at 52% 40%, rgba(255, 255, 255, 0.45) 0 1px, transparent 1.5px);
    opacity: 0.1;
    animation: twinkle 5s linear infinite;
}

.scene-grid {
    top: auto;
    height: 48%;
    background:
        linear-gradient(rgba(249, 168, 38, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(249, 168, 38, 0.1) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.8) 35%, rgba(0, 0, 0, 1) 100%);
    opacity: 0.08;
}

#game-container[data-mode="title"] .scene-stars,
#game-container[data-scene="academy"] .scene-stars {
    opacity: 0.24;
}

#game-container[data-mode="title"] .scene-grid,
#game-container[data-scene="academy"] .scene-grid {
    opacity: 0.18;
}

#scene-caption {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 2;
    padding: 8px 10px;
    border: 2px solid rgba(249, 168, 38, 0.75);
    background: rgba(8, 11, 26, 0.58);
    color: var(--accent-gold);
    font-size: 10px;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.45);
}

#character-stage {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 30px;
    padding: 0 36px 12px;
    z-index: 1;
}

.character-card {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 0;
    width: min(40%, 250px);
    transition: transform 0.26s ease, opacity 0.26s ease, filter 0.26s ease;
}

#game-container[data-active-character="auditor"] .character-card[data-character="auditor"],
#game-container[data-active-character="recruit"] .character-card[data-character="recruit"],
#game-container[data-active-character="both"] .character-card {
    display: flex;
}

#game-container[data-active-character="both"] #character-stage {
    justify-content: space-between;
}

#game-container[data-active-character="auditor"] #character-stage {
    justify-content: flex-end;
    padding-right: 106px;
}

#game-container[data-active-character="recruit"] #character-stage {
    justify-content: flex-start;
    padding-left: 68px;
}

.character-card img {
    width: 188px;
    height: 282px;
    image-rendering: pixelated;
    display: block;
    filter:
        drop-shadow(0 16px 18px rgba(0, 0, 0, 0.34))
        drop-shadow(0 0 14px rgba(249, 168, 38, 0.16));
    transform-origin: center bottom;
    will-change: opacity, transform;
}

.character-label {
    display: none;
}

#game-container[data-active-character="auditor"] .character-card[data-character="auditor"],
#game-container[data-active-character="recruit"] .character-card[data-character="recruit"] {
    transform: translateY(0) scale(1);
}

#game-container[data-active-character="auditor"] .character-card[data-character="recruit"],
#game-container[data-active-character="recruit"] .character-card[data-character="auditor"] {
    display: none;
}

#game-container[data-active-character="both"] .character-card[data-character="recruit"],
#game-container[data-active-character="both"] .character-card[data-character="auditor"] {
    opacity: 1;
}

#game-container[data-active-character="none"] #character-stage {
    display: none;
}

#status-panel {
    padding: 14px 18px;
    border-bottom: 4px solid var(--bg-deep);
    background:
        linear-gradient(180deg, rgba(13, 26, 54, 0.96), rgba(8, 11, 26, 0.98)),
        var(--panel-navy);
    box-shadow: inset 0 1px 0 rgba(249, 168, 38, 0.08);
}

.status-panel-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.status-eyebrow {
    color: var(--accent-gold);
    font-size: 7px;
    line-height: 1.5;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 6px;
}

#checkpoint-label {
    color: var(--text-main);
    font-size: 11px;
    line-height: 1.5;
}

#checkpoint-progress {
    min-width: 92px;
    padding: 6px 8px;
    border: 2px solid rgba(249, 168, 38, 0.55);
    background: rgba(8, 11, 26, 0.45);
    color: var(--accent-gold);
    text-align: center;
    font-size: 8px;
    line-height: 1.4;
}

.status-grid {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.status-card {
    min-height: 74px;
    padding: 10px;
    border: 2px solid rgba(233, 69, 96, 0.38);
    background: rgba(8, 11, 26, 0.34);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.status-label {
    color: var(--text-dim);
    font-size: 7px;
    line-height: 1.5;
    text-transform: uppercase;
}

#status-scene,
#status-reference,
#status-note {
    color: var(--text-main);
    font-size: 8px;
    line-height: 1.7;
}

#dialogue-box {
    min-height: 174px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    background:
        linear-gradient(180deg, rgba(15, 52, 96, 0.98), rgba(8, 11, 26, 0.96)),
        var(--panel-blue);
    border-bottom: 4px solid var(--bg-deep);
}

#npc-role {
    color: var(--text-dim);
    font-size: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#npc-name {
    color: var(--accent-gold);
    font-size: clamp(13px, 1.7vw, 16px);
    text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.4);
}

#dialogue-text {
    max-width: 96%;
    min-height: 0;
    font-size: clamp(10px, 1.15vw, 11px);
    line-height: 2;
    white-space: pre-wrap;
    word-break: normal;
    overflow-wrap: anywhere;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.45);
}

#dialogue-hint {
    font-size: 7px;
    color: rgba(244, 247, 255, 0.7);
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

#dialogue-box.is-typing #dialogue-hint {
    opacity: 1;
    transform: translateY(0);
}

#choices-container {
    min-height: 146px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
    background:
        linear-gradient(180deg, rgba(26, 26, 46, 0.94), rgba(8, 11, 26, 1)),
        var(--bg-deep);
    overflow-y: auto;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

#fx-layer {
    position: absolute;
    inset: 0;
    z-index: 4;
    pointer-events: none;
    overflow: hidden;
}

#choices-container.is-hidden {
    opacity: 0;
    transform: translateY(6px);
    pointer-events: none;
}

#cutscene-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
    background:
        linear-gradient(180deg, rgba(4, 8, 20, 0.94), rgba(4, 8, 20, 0.9)),
        rgba(4, 8, 20, 0.92);
    opacity: 0;
    transition: opacity 0.2s ease;
}

#cutscene-overlay.is-visible {
    opacity: 1;
}

.cutscene-panel {
    width: min(100%, 840px);
    max-height: 100%;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px;
    overflow: hidden;
    border: 4px solid rgba(249, 168, 38, 0.74);
    background:
        linear-gradient(180deg, rgba(12, 26, 53, 0.98), rgba(6, 11, 24, 0.98)),
        var(--panel-blue);
    box-shadow:
        0 20px 36px rgba(3, 6, 19, 0.58),
        inset 0 0 0 3px rgba(233, 69, 96, 0.16);
}

.cutscene-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

#cutscene-label {
    color: var(--accent-gold);
    font-size: 8px;
    line-height: 1.8;
    text-transform: uppercase;
}

#cutscene-video {
    width: 100%;
    flex: 1;
    min-height: 0;
    max-height: min(520px, 52vh);
    display: block;
    border: 3px solid rgba(233, 69, 96, 0.68);
    background: #000;
}

.cutscene-btn {
    min-width: 0;
    text-align: center;
}

.choice-btn {
    font-family: 'Press Start 2P', cursive;
    border: 2px solid var(--accent-gold);
    padding: 12px 14px;
    background:
        linear-gradient(180deg, rgba(15, 52, 96, 0.95), rgba(10, 16, 38, 0.95)),
        var(--panel-blue);
    color: var(--text-main);
    font-size: 9px;
    line-height: 1.6;
    text-align: left;
    cursor: pointer;
    box-shadow: inset 0 0 0 2px rgba(15, 52, 96, 0.95);
    transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.choice-btn:hover,
.choice-btn:focus-visible {
    background:
        linear-gradient(180deg, rgba(249, 168, 38, 0.96), rgba(233, 69, 96, 0.9)),
        var(--accent-gold);
    color: #080b1a;
    transform: translateY(-2px);
    box-shadow:
        inset 0 0 0 2px rgba(8, 11, 26, 0.28),
        0 10px 14px rgba(8, 11, 26, 0.28);
    outline: none;
}

.choice-btn.is-success {
    border-color: rgba(108, 240, 167, 0.96);
    box-shadow:
        inset 0 0 0 2px rgba(12, 43, 30, 0.32),
        0 0 18px rgba(108, 240, 167, 0.28);
    animation: choice-success-pop 0.62s ease;
}

.choice-btn.is-failure {
    border-color: rgba(255, 128, 145, 0.96);
    box-shadow:
        inset 0 0 0 2px rgba(61, 12, 22, 0.26),
        0 0 18px rgba(233, 69, 96, 0.28);
    animation: choice-failure-shake 0.62s ease;
}

.feedback-burst {
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    height: 0;
    transform: translate(var(--burst-x), var(--burst-y));
}

.feedback-burst::before {
    content: "";
    position: absolute;
    left: -58px;
    top: -58px;
    width: 116px;
    height: 116px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.32) 0%, transparent 70%);
    opacity: 0;
    animation: feedback-flash 0.82s ease-out forwards;
}

.feedback-burst__ring {
    position: absolute;
    left: -48px;
    top: -48px;
    width: 96px;
    height: 96px;
    border: 4px solid currentColor;
    border-radius: 50%;
    opacity: 0;
    animation: feedback-ring-pop 0.9s ease-out forwards;
}

.feedback-burst__mark {
    position: absolute;
    left: -42px;
    top: -42px;
    width: 84px;
    height: 84px;
    display: grid;
    place-items: center;
    border: 4px solid currentColor;
    background: rgba(8, 11, 26, 0.8);
    box-shadow:
        inset 0 0 0 4px rgba(255, 255, 255, 0.08),
        0 0 24px rgba(8, 11, 26, 0.18);
    font-size: 38px;
    line-height: 1;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.35);
    opacity: 0;
    animation: feedback-mark-pop 0.96s cubic-bezier(0.2, 0.9, 0.25, 1) forwards;
}

.feedback-burst__particle {
    position: absolute;
    left: -5px;
    top: -5px;
    width: 10px;
    height: 10px;
    background: currentColor;
    box-shadow: 0 0 12px currentColor;
    opacity: 0;
    transform: rotate(var(--particle-angle)) translateX(0) scale(0.7);
    animation: feedback-particle-burst 1.08s ease-out forwards;
    animation-delay: var(--particle-delay);
}

.feedback-burst--success {
    color: #6cf0a7;
}

.feedback-burst--success .feedback-burst__mark {
    border-radius: 18px;
}

.feedback-burst--failure {
    color: #ff718b;
}

.feedback-burst--failure .feedback-burst__mark {
    border-radius: 50%;
}

.start-btn {
    min-width: 220px;
    text-align: center;
}

#title-screen .start-btn {
    animation: blink 0.95s steps(2, end) infinite;
}

#results-screen {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 22px;
    background:
        linear-gradient(180deg, rgba(8, 11, 26, 0.42), rgba(8, 11, 26, 0.7)),
        radial-gradient(circle at top, rgba(249, 168, 38, 0.16), transparent 30%),
        url("assets/backgrounds/07.webp"),
        var(--bg-night);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

.results-panel {
    width: min(100%, 580px);
    padding: 24px 22px 26px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
    border: 4px solid rgba(249, 168, 38, 0.72);
    background:
        linear-gradient(180deg, rgba(16, 31, 61, 0.96), rgba(8, 11, 26, 0.98)),
        var(--panel-blue);
    box-shadow:
        0 20px 38px rgba(3, 6, 19, 0.5),
        inset 0 0 0 3px rgba(233, 69, 96, 0.16);
}

.results-kicker {
    color: var(--accent-gold);
    font-size: 8px;
    line-height: 1.6;
    text-transform: uppercase;
}

.result-badge {
    width: 102px;
    height: 102px;
    display: grid;
    place-items: center;
    border: 4px solid rgba(249, 168, 38, 0.78);
    font-size: 30px;
    text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.35);
    box-shadow:
        inset 0 0 0 4px rgba(8, 11, 26, 0.24),
        0 14px 28px rgba(3, 6, 19, 0.35);
}

.result-badge--gold {
    background: linear-gradient(180deg, #ffdc88 0%, #f9a826 100%);
    color: #3d2200;
}

.result-badge--silver {
    background: linear-gradient(180deg, #f3f7ff 0%, #aebfd9 100%);
    color: #18243f;
}

.result-badge--bronze {
    background: linear-gradient(180deg, #f5c98a 0%, #b87333 100%);
    color: #2e1500;
}

.result-badge--red {
    background: linear-gradient(180deg, #ff96a9 0%, #e94560 100%);
    color: #320811;
}

#result-tier {
    font-size: clamp(16px, 2.2vw, 22px);
    line-height: 1.5;
    color: var(--text-main);
}

#result-score,
#result-summary {
    font-size: 9px;
    line-height: 1.9;
    color: var(--text-dim);
}

#game-container[data-mode="title"] #status-panel,
#game-container[data-mode="title"] #dialogue-box,
#game-container[data-mode="title"] #choices-container,
#game-container[data-mode="title"] #results-screen,
#game-container[data-mode="results"] #title-screen,
#game-container[data-mode="results"] #scene-image,
#game-container[data-mode="results"] #status-panel,
#game-container[data-mode="results"] #dialogue-box,
#game-container[data-mode="results"] #choices-container {
    display: none;
}

#game-container[data-mode="title"] #scene-image {
    height: 520px;
}

#game-container[data-mode="title"] #title-screen {
    justify-content: center;
    align-items: center;
    padding: 28px 28px 42px;
}

#game-container[data-mode="title"] #character-stage,
#game-container[data-mode="title"] #scene-caption {
    display: none;
}

#scene-image::before,
#scene-image::after {
    content: none;
}

#game-container[data-scene="academy"] {
    --scene-background: url("assets/backgrounds/01.webp");
}

#game-container[data-scene="review"] {
    --scene-background: url("assets/backgrounds/02.webp");
}

#game-container[data-scene="privacy"] {
    --scene-background: url("assets/backgrounds/03.webp");
}

#game-container[data-scene="consent"] {
    --scene-background: url("assets/backgrounds/04.webp");
}

#game-container[data-scene="register"] {
    --scene-background: url("assets/backgrounds/05.webp");
}

#game-container[data-scene="breach"] {
    --scene-background: url("assets/backgrounds/06.webp");
}

#game-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border: 4px solid rgba(233, 69, 96, 0.72);
    background:
        linear-gradient(180deg, rgba(14, 18, 38, 0.98), rgba(8, 11, 26, 1)),
        var(--bg-night);
    box-shadow:
        0 14px 28px rgba(3, 6, 19, 0.45),
        0 0 0 3px rgba(249, 168, 38, 0.12);
    color: rgba(244, 247, 255, 0.8);
    font-size: 11px;
    line-height: 1.5;
    text-align: center;
}

#game-footer a {
    color: var(--accent-link);
    text-decoration: none;
}

#game-footer a:hover,
#game-footer a:focus-visible {
    color: #9ad2ff;
    text-decoration: underline;
    outline: none;
}

@keyframes twinkle {
    0%,
    100% {
        opacity: 0.7;
    }
    50% {
        opacity: 0.96;
    }
}

@keyframes blink {
    0%,
    49% {
        opacity: 1;
    }
    50%,
    100% {
        opacity: 0.38;
    }
}

@keyframes score-pop-green {
    0% {
        transform: scale(1);
    }
    35% {
        transform: scale(1.03);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes score-pop-red {
    0% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-2px);
    }
    50% {
        transform: translateX(2px);
    }
    100% {
        transform: translateX(0);
    }
}

@keyframes combo-pop {
    0% {
        transform: translateY(10px) scale(0.94);
    }
    60% {
        transform: translateY(-2px) scale(1.02);
    }
    100% {
        transform: translateY(0) scale(1);
    }
}

@keyframes choice-success-pop {
    0% {
        transform: scale(1);
    }
    45% {
        transform: scale(1.03);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes choice-failure-shake {
    0% {
        transform: translateX(0);
    }
    20% {
        transform: translateX(-4px);
    }
    45% {
        transform: translateX(4px);
    }
    70% {
        transform: translateX(-2px);
    }
    100% {
        transform: translateX(0);
    }
}

@keyframes feedback-mark-pop {
    0% {
        opacity: 0;
        transform: scale(0.4) rotate(-14deg);
    }
    36% {
        opacity: 1;
        transform: scale(1.08) rotate(4deg);
    }
    100% {
        opacity: 0;
        transform: scale(1.02) rotate(0deg);
    }
}

@keyframes feedback-ring-pop {
    0% {
        opacity: 0.95;
        transform: scale(0.3);
    }
    100% {
        opacity: 0;
        transform: scale(1.6);
    }
}

@keyframes feedback-flash {
    0% {
        opacity: 0.28;
        transform: scale(0.4);
    }
    100% {
        opacity: 0;
        transform: scale(1.9);
    }
}

@keyframes feedback-particle-burst {
    0% {
        opacity: 0;
        transform: rotate(var(--particle-angle)) translateX(0) scale(0.7);
    }
    20% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: rotate(var(--particle-angle)) translateX(var(--particle-distance)) scale(1);
    }
}

@media (max-width: 850px) {
    body {
        padding: 0;
        align-items: stretch;
    }

    #game-shell {
        width: 100vw;
        gap: 0;
    }

    #game-header {
        padding: 14px 16px 16px;
        border-width: 0 0 4px;
        box-shadow: none;
    }

    .header-top {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
    }

    .header-branding {
        justify-content: space-between;
    }

    #hud-bar {
        grid-template-columns: 1fr;
    }

    #combo-indicator {
        justify-self: stretch;
        min-width: 0;
    }

    #game-container {
        min-height: calc(100vh - 226px);
        border-width: 0;
        box-shadow: none;
    }

    #scene-image {
        height: 290px;
    }

    #character-stage {
        padding: 0 20px 12px;
    }

    #status-panel,
    #dialogue-box,
    #choices-container {
        padding-left: 16px;
        padding-right: 16px;
    }

    #dialogue-box {
        min-height: 188px;
    }

    .status-grid {
        grid-template-columns: 1fr;
    }

    #cutscene-overlay {
        padding: 14px;
    }

    .cutscene-panel {
        padding: 14px;
    }

    .cutscene-header {
        flex-direction: column;
        align-items: stretch;
    }

    .cutscene-btn {
        width: 100%;
    }

    #game-container[data-mode="title"] #scene-image {
        height: 430px;
    }

    #game-container[data-mode="title"] #title-screen {
        padding-bottom: 28px;
    }

    #result-tier {
        font-size: 18px;
    }

    #game-footer {
        padding: 10px 12px;
        font-size: 9px;
    }
}

@media (max-width: 560px) {
    #game-header h1,
    #title-screen h2 {
        font-size: 17px;
    }

    .title-copy,
    #result-score,
    #result-summary {
        font-size: 8px;
    }

    #level-badge,
    #score-value,
    #progress-text,
    #scene-caption,
    .character-label {
        font-size: 8px;
    }

    .character-card img {
        width: 148px;
        height: 222px;
    }

    #character-stage {
        padding: 0 12px 10px;
    }

    #scene-image,
    #game-container[data-mode="title"] #scene-image {
        height: 250px;
    }

    #title-screen {
        padding: 16px;
    }

    #game-container[data-mode="title"] #title-screen {
        padding: 16px 16px 18px;
    }

    .title-panel {
        padding: 20px 18px 24px;
    }

    #dialogue-text {
        min-height: 96px;
        font-size: 9px;
        line-height: 1.95;
    }

    #status-scene,
    #status-reference,
    #status-note,
    #checkpoint-progress,
    #combo-indicator {
        font-size: 7px;
    }

    .result-badge {
        width: 88px;
        height: 88px;
        font-size: 24px;
    }

    .start-btn {
        min-width: 0;
        width: 100%;
    }

    #aiesec-logo {
        width: 132px;
    }

    .title-panel,
    .results-panel {
        padding: 18px 16px 22px;
    }

    #game-footer {
        gap: 6px;
        padding: 10px 12px;
        font-size: 7px;
    }
}

/* ── Phone Layout (≤560px): compact HUD, page scrolls naturally ── */
@media (max-width: 560px) {
    /* Override the 850px stretch so game-shell sizes to content,
       not forced to 100vh — this is what allows the page to scroll */
    body {
        align-items: flex-start;
    }

    /* ── Compact HUD: single horizontal row instead of 3 stacked cards ── */
    #hud-bar {
        grid-template-columns: auto 1fr auto;
        gap: 6px;
    }

    .hud-chip {
        min-height: 46px;
        padding: 7px 10px;
        gap: 4px;
    }

    #progress-panel {
        padding: 7px 10px;
        gap: 5px;
    }

    /* Combo banner spans full row when it appears */
    #combo-indicator {
        grid-column: 1 / -1;
        justify-self: stretch;
    }

    /* height:auto means overflow:hidden won't clip content —
       container grows to match its children, nothing gets cut off */
    #game-container {
        height: auto;
        min-height: 0;
    }

    /* Scene proportional to viewport, not a fixed pixel value */
    #scene-image {
        height: 25dvh;
        flex-shrink: 0;
    }

    #game-container[data-mode="title"] #scene-image {
        height: 40dvh;
    }

    /* Status panel is supplemental info — HUD already shows score + progress */
    #status-panel {
        display: none;
    }

    /* Dialogue: sizes to content, page scrolls if needed */
    #dialogue-box {
        min-height: 120px;
        padding: 12px 16px;
    }

    /* All choices fully visible — no artificial cap */
    #choices-container {
        max-height: none;
        overflow-y: visible;
    }

    /* Bigger touch targets */
    .choice-btn {
        padding: 13px 12px;
        min-height: 44px;
    }

    /* Slightly smaller sprites on the smallest phones */
    .character-card img {
        width: 130px;
        height: 196px;
    }

    /* ── Map: 3-column grid (2 rows of 3) instead of 6 crammed in a line ── */
    .map-path-line {
        display: none;
    }

    .map-container {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        height: auto;
        gap: 12px 8px;
        padding: 4px 0 8px;
    }

    .map-node-icon {
        width: 42px;
        height: 42px;
    }

    .map-panel {
        padding: 16px 16px 20px;
        gap: 16px;
    }
}

/* ── Registration Overlay ── */

#register-overlay {
    position: absolute;
    inset: 0;
    z-index: 12;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 28px;
    background:
        radial-gradient(circle at center, rgba(15, 52, 96, 0.5), rgba(8, 11, 26, 0.96)),
        rgba(8, 11, 26, 0.98);
}

.register-panel {
    width: min(440px, 100%);
    padding: 28px 28px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
    border: 3px solid rgba(249, 168, 38, 0.5);
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(8, 11, 26, 0.95), rgba(15, 52, 96, 0.85));
    backdrop-filter: blur(12px);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.05),
        0 24px 48px rgba(0, 0, 0, 0.9),
        inset 0 0 40px rgba(103, 182, 255, 0.08);
}

.register-title {
    font-size: clamp(14px, 2vw, 18px);
    color: var(--accent-gold);
    text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.4);
}

.register-subtitle {
    font-size: 9px;
    line-height: 1.9;
    color: var(--text-dim);
    max-width: 360px;
}

#register-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 4px;
}

.register-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}

.register-field label {
    font-size: 8px;
    color: var(--accent-gold);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.register-field input,
.register-field select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid rgba(249, 168, 38, 0.45);
    border-radius: 6px;
    background: rgba(8, 11, 26, 0.7);
    color: var(--text-main);
    font-size: 10px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.register-field input::placeholder {
    color: var(--text-dim);
    opacity: 0.6;
}

.register-field input:focus,
.register-field select:focus {
    border-color: var(--accent-gold);
    box-shadow: 0 0 12px rgba(249, 168, 38, 0.25);
}

.register-field select option {
    background: var(--bg-deep);
    color: var(--text-main);
}

/* ── Leaderboard Button ── */

/* ── Leaderboard Overlay ── */

#leaderboard-overlay {
    position: absolute;
    inset: 0;
    z-index: 11;
    display: flex;
    justify-content: center;
    align-items: stretch;
    background:
        radial-gradient(circle at center, rgba(15, 52, 96, 0.5), rgba(8, 11, 26, 0.96)),
        rgba(8, 11, 26, 0.98);
}

.leaderboard-panel {
    width: 100%;
    display: flex;
    flex-direction: column;
}

@keyframes rgbGlow {
    0% { color: #ff0000; filter: drop-shadow(0 0 6px #ff0000); }
    20% { color: #ff00ff; filter: drop-shadow(0 0 6px #ff00ff); }
    40% { color: #0000ff; filter: drop-shadow(0 0 6px #0000ff); }
    60% { color: #00ffff; filter: drop-shadow(0 0 6px #00ffff); }
    80% { color: #00ff00; filter: drop-shadow(0 0 6px #00ff00); }
    100% { color: #ff0000; filter: drop-shadow(0 0 6px #ff0000); }
}

.lb-trophy-btn {
    animation: rgbGlow 4s infinite linear;
}

.lb-trophy-icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.leaderboard-top {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px 20px 12px;
    overflow: hidden;
}

.leaderboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.leaderboard-title {
    font-size: clamp(12px, 1.8vw, 16px);
    color: var(--accent-gold);
    text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.4);
}

.leaderboard-header .cutscene-btn {
    min-width: 36px;
    padding: 6px 10px;
    font-size: 14px;
    line-height: 1;
}

.leaderboard-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.lb-filter-pill {
    padding: 5px 10px;
    border: 2px solid rgba(103, 182, 255, 0.3);
    border-radius: 20px;
    background: rgba(8, 11, 26, 0.5);
    color: var(--text-dim);
    font-size: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lb-filter-pill:hover {
    border-color: rgba(103, 182, 255, 0.6);
    color: var(--text-main);
}

.lb-filter-pill.is-active {
    border-color: var(--accent-gold);
    background: rgba(249, 168, 38, 0.15);
    color: var(--accent-gold);
    box-shadow: 0 0 10px rgba(249, 168, 38, 0.2);
}

.leaderboard-table-wrap {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: auto;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 9px;
}

.leaderboard-table thead th {
    padding: 8px 8px;
    text-align: left;
    color: var(--accent-gold);
    font-size: 7px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid rgba(249, 168, 38, 0.35);
    position: sticky;
    top: 0;
    background: rgba(8, 11, 26, 0.95);
    z-index: 1;
}

.leaderboard-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: background 0.15s ease;
}

.leaderboard-table tbody tr:hover {
    background: rgba(103, 182, 255, 0.06);
}

.leaderboard-table tbody tr.is-self {
    background: rgba(249, 168, 38, 0.08);
    border-left: 3px solid var(--accent-gold);
}

.leaderboard-table td {
    padding: 8px 8px;
    color: var(--text-main);
    white-space: nowrap;
}

.leaderboard-table td:first-child {
    color: var(--text-dim);
    font-weight: bold;
}

.lb-tier {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 8px;
    font-weight: bold;
}

.lb-tier--s { background: rgba(249, 168, 38, 0.25); color: var(--accent-gold); }
.lb-tier--a { background: rgba(108, 240, 167, 0.2); color: var(--accent-green); }
.lb-tier--b { background: rgba(103, 182, 255, 0.2); color: var(--accent-link); }
.lb-tier--c { background: rgba(233, 69, 96, 0.2); color: var(--accent-red); }

.leaderboard-empty {
    text-align: center;
    padding: 24px 16px;
    color: var(--text-dim);
    font-size: 9px;
    line-height: 2;
}

/* ── Leaderboard Bottom (Team Photo) ── */

@keyframes subtlePulse {
    0% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.015); filter: brightness(1.1); }
    100% { transform: scale(1); filter: brightness(1); }
}

.leaderboard-bottom {
    position: relative;
    height: 50%;
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-top: 2px solid var(--accent-gold);
    box-shadow: 0 -10px 30px rgba(249, 168, 38, 0.15);
}



.leaderboard-team-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
    animation: subtlePulse 6s ease-in-out infinite;
    z-index: 1;
}


/* ── Confetti ── */

.confetti-piece {
    position: absolute;
    top: -12px;
    left: var(--confetti-x);
    width: var(--confetti-size);
    height: var(--confetti-size);
    background: var(--confetti-color);
    opacity: 0;
    pointer-events: none;
    animation: confetti-fall var(--confetti-duration) var(--confetti-delay) ease-in forwards;
}

@keyframes confetti-fall {
    0%   { transform: translateY(0)       rotate(0deg);                    opacity: 1; }
    70%  { opacity: 1; }
    100% { transform: translateY(110dvh)  rotate(var(--confetti-spin));    opacity: 0; }
}

/* ══ Visual Polish ══ */

:root {
    --font-sans: 'Segoe UI', system-ui, sans-serif;
}

/* CRT scanlines — retro monitor texture over the entire game frame */
#game-container::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 20;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        transparent 0px,
        transparent 2px,
        rgba(0, 0, 0, 0.035) 2px,
        rgba(0, 0, 0, 0.035) 4px
    );
}

/* Map path line — gentle glow pulse to make the pathway feel alive */
.map-path-line {
    animation: path-pulse 3.5s ease-in-out infinite;
}

@keyframes path-pulse {
    0%, 100% {
        box-shadow: 0 0 8px rgba(103, 182, 255, 0.22);
        opacity: 0.7;
    }
    50% {
        box-shadow: 0 0 22px rgba(103, 182, 255, 0.7), 0 0 44px rgba(103, 182, 255, 0.18);
        opacity: 1;
    }
}

/* Cleared map node — breathing gold glow + prominent gold checkmark */
.map-node.is-cleared .map-node-icon {
    color: var(--accent-gold);
    font-size: 20px;
    text-shadow: 0 0 10px rgba(249, 168, 38, 0.9);
    animation: cleared-glow 2.6s ease-in-out infinite;
}

@keyframes cleared-glow {
    0%, 100% { box-shadow: 0 0 18px rgba(249, 168, 38, 0.5); }
    50% { box-shadow: 0 0 38px rgba(249, 168, 38, 0.9), 0 0 64px rgba(249, 168, 38, 0.28); }
}

/* Choice buttons — shine sweep on hover */
.choice-btn {
    position: relative;
    overflow: hidden;
}

.choice-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -80%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        105deg,
        transparent 25%,
        rgba(255, 255, 255, 0.07) 50%,
        transparent 75%
    );
    transform: skewX(-10deg);
    transition: left 0s;
    pointer-events: none;
}

.choice-btn:not(:disabled):hover::before,
.choice-btn:not(:disabled):focus-visible::before {
    left: 160%;
    transition: left 0.42s ease;
}

/* Dialogue — blinking gold block cursor while text is typing */
#dialogue-box.is-typing #dialogue-text::after {
    content: '';
    display: inline-block;
    width: 0.65em;
    height: 1em;
    background: var(--accent-gold);
    margin-left: 3px;
    vertical-align: text-bottom;
    animation: cursor-blink 0.65s steps(2, end) infinite;
}

@keyframes cursor-blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

/* Title panel — smooth slide-up entrance on load */
.title-panel {
    animation: panel-enter 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes panel-enter {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.975);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Progress bar fill — gradient subtly pulses between gold-dominant and red-dominant */
#progress-fill {
    background-size: 200% 100%;
    animation: fill-pulse 3s ease-in-out infinite;
}

@keyframes fill-pulse {
    0%, 100% { background-position: 0% center; }
    50% { background-position: 100% center; }
}
