.lumen-game {
    --game-accent: #89ffd0;
    --game-accent-rgb: 137, 255, 208;
    --game-warm: #7bd7ff;
    --game-panel: rgba(2, 19, 28, 0.8);
}

.lumen-game .game-vignette {
    background:
        radial-gradient(circle at 50% 44%, transparent 30%, rgba(0, 8, 18, 0.18) 68%, rgba(0, 3, 10, 0.7) 100%),
        linear-gradient(180deg, rgba(24, 124, 142, 0.12), transparent 28%, transparent 68%, rgba(0, 4, 12, 0.52));
}

.lumen-game .hud-cluster {
    padding: 6px;
}

.lumen-game .hud-stat {
    min-width: 76px;
    padding-inline: 10px;
}

.lumen-game .hud-stat:first-child {
    min-width: 88px;
}

.reef-relaxed-badge {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 11px;
    border: 1px solid rgba(137, 255, 208, 0.2);
    border-radius: 10px;
    background: rgba(137, 255, 208, 0.08);
    color: #bfffe4;
    font: 700 0.56rem/1 "DM Mono", monospace;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.reef-memory-button {
    display: flex;
    width: auto;
    min-width: 74px;
    gap: 6px;
    padding-inline: 9px;
    color: #d9fff2;
    font: 700 0.58rem/1 "DM Mono", monospace;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.reef-memory-button b {
    padding: 4px 5px;
    border-radius: 99px;
    background: rgba(137, 255, 208, 0.13);
    color: var(--game-accent);
    font-size: 0.52rem;
}

.reef-mission {
    width: min(370px, 32vw);
    border-color: rgba(137, 255, 208, 0.24);
    background:
        radial-gradient(circle at 0 0, rgba(137, 255, 208, 0.13), transparent 46%),
        var(--game-panel);
}

.reef-mission small {
    display: block;
    margin-top: 8px;
    color: rgba(211, 237, 235, 0.58);
    font: 500 0.62rem/1.4 "DM Mono", monospace;
}

.reef-ability-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    max-width: 490px;
    gap: 12px;
}

.reef-ability-copy { display: grid; gap: 5px; }

.reef-ability-panel strong {
    color: #eafff7;
    font-size: 0.76rem;
}

.reef-echo-button {
    position: relative;
    min-width: 138px;
    min-height: 40px;
    overflow: hidden;
    border: 1px solid rgba(137, 255, 208, 0.32);
    border-radius: 10px;
    background: rgba(3, 28, 36, 0.88);
    color: #eafff7;
    cursor: pointer;
}

.reef-echo-button > span {
    position: absolute;
    inset: 0 auto 0 0;
    width: 100%;
    background: linear-gradient(90deg, rgba(40, 193, 153, .28), rgba(88, 255, 208, .16));
    transition: width .2s linear;
}

.reef-echo-button strong { position: relative; font: 800 .6rem/1 "DM Mono", monospace; letter-spacing: .04em; }
.reef-echo-button:disabled { cursor: default; opacity: .72; }

.reef-ability-panel span {
    color: rgba(211, 237, 235, 0.62);
    font: 500 0.61rem/1.35 "DM Mono", monospace;
}

.reef-wayfinder,
.guardian-status {
    position: fixed;
    z-index: 7;
    pointer-events: none;
    border: 1px solid rgba(137, 255, 208, 0.25);
    background: rgba(2, 18, 27, 0.78);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
    backdrop-filter: blur(16px) saturate(1.2);
}

.reef-wayfinder {
    top: 50%;
    right: 18px;
    display: flex;
    align-items: center;
    width: min(220px, 24vw);
    gap: 11px;
    padding: 10px 13px 10px 10px;
    border-radius: 16px;
    transform: translateY(-50%);
}

.reef-compass {
    display: grid;
    place-items: center;
    width: 43px;
    min-width: 43px;
    height: 43px;
    border: 1px solid rgba(137, 255, 208, 0.32);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(137, 255, 208, 0.14), transparent 65%);
}

.reef-compass i {
    color: var(--game-accent);
    font: normal 800 1.25rem/1 "DM Mono", monospace;
    text-shadow: 0 0 14px rgba(137, 255, 208, 0.9);
    transition: transform 180ms ease;
}

.reef-wayfinder small,
.reef-wayfinder strong,
.guardian-status span,
.guardian-status strong {
    display: block;
}

.reef-wayfinder small,
.guardian-status span {
    color: rgba(208, 235, 232, 0.56);
    font: 600 0.54rem/1 "DM Mono", monospace;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.reef-wayfinder strong {
    margin-top: 5px;
    color: #f0fff9;
    font-size: 0.72rem;
    line-height: 1.2;
}

.guardian-status {
    top: 106px;
    left: 50%;
    width: min(440px, calc(100vw - 40px));
    padding: 11px 14px 13px;
    border-color: rgba(220, 96, 255, 0.48);
    border-radius: 14px;
    transform: translateX(-50%);
}

.guardian-status > div:first-child {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 8px;
}

.guardian-status strong {
    color: #f5c8ff;
    font: 700 0.66rem/1 "DM Mono", monospace;
}

.guardian-status .progress-fill {
    background: linear-gradient(90deg, #b55cff, #89ffd0);
}

.reef-story-overlay {
    place-items: end start;
    padding: 28px;
    background: linear-gradient(90deg, rgba(0, 6, 15, 0.78), rgba(0, 8, 16, 0.14) 68%);
    backdrop-filter: blur(4px);
}

.reef-story-card {
    width: min(640px, 100%);
    padding: clamp(25px, 4vw, 42px);
    border-color: rgba(137, 255, 208, 0.36);
    background:
        radial-gradient(circle at 0 0, rgba(112, 255, 212, 0.19), transparent 40%),
        linear-gradient(145deg, rgba(4, 32, 40, 0.96), rgba(2, 10, 19, 0.98));
}

.reef-speaker {
    display: inline-flex;
    margin-top: 17px;
    padding: 6px 9px;
    border: 1px solid rgba(137, 255, 208, 0.24);
    border-radius: 99px;
    background: rgba(137, 255, 208, 0.08);
    color: #caffec;
    font: 700 0.59rem/1 "DM Mono", monospace;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.reef-story-card h2 {
    max-width: 16ch;
    margin-top: 12px;
    font-size: clamp(2rem, 5vw, 3.5rem);
}

.reef-story-card .primary-game-button {
    margin-top: 24px;
}

.reef-memory-card {
    width: min(720px, 100%);
}

.reef-memory-list {
    display: grid;
    gap: 9px;
    margin: 22px 0;
}

.reef-memory-entry {
    padding: 14px 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.035);
}

.reef-memory-entry.is-locked {
    opacity: 0.45;
}

.reef-memory-entry span,
.reef-memory-entry strong,
.reef-memory-entry p {
    display: block;
}

.reef-memory-entry span {
    color: var(--game-accent);
    font: 600 0.56rem/1 "DM Mono", monospace;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.reef-memory-entry strong {
    margin-top: 6px;
    color: #fff;
    font-size: 0.9rem;
}

.reef-memory-entry p {
    margin: 6px 0 0;
    color: rgba(218, 239, 236, 0.7);
    font-size: 0.76rem;
    line-height: 1.5;
}

.lumen-game.is-guardian .game-vignette {
    background:
        radial-gradient(circle at 50% 50%, transparent 20%, rgba(80, 0, 88, 0.2) 63%, rgba(0, 3, 10, 0.78) 100%),
        linear-gradient(180deg, rgba(100, 20, 126, 0.2), transparent 36%);
}

.lumen-game.is-victorious .game-vignette {
    background: radial-gradient(circle at 50% 50%, rgba(137, 255, 208, 0.1), transparent 65%);
}

@media (max-width: 1000px) {
    .lumen-game .hud-stat {
        min-width: 66px;
        padding-inline: 7px;
    }

    .lumen-game .hud-stat:first-child {
        min-width: 72px;
    }

    .reef-memory-button {
        min-width: 40px;
        font-size: 0;
    }

    .reef-memory-button b {
        font-size: 0.52rem;
    }
}

@media (max-width: 820px) {
    .lumen-game .hud-stat:nth-child(n + 4) {
        display: none;
    }

    .reef-mission {
        display: block;
        width: min(320px, 72vw);
        align-self: start;
        margin-top: 76px;
        padding: 11px 13px;
    }

    .reef-mission small {
        display: none;
    }

    .reef-wayfinder {
        top: auto;
        right: 10px;
        bottom: 82px;
        width: 160px;
        transform: none;
    }

    .reef-ability-panel {
        max-width: calc(100vw - 20px);
    }

    .reef-touch-controls {
        position: fixed;
        right: 10px;
        bottom: 10px;
        gap: 4px;
        padding: 5px;
    }

    .reef-touch-controls .touch-button {
        min-width: 42px;
        height: 42px;
        font-size: 0.58rem;
    }

    .reef-story-overlay {
        padding: 14px;
    }

    .reef-story-card {
        max-height: 66vh;
        padding: 23px;
    }
}

@media (max-width: 600px) {
    .lumen-game .game-brand-copy strong {
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .lumen-game .hud-stat:first-child {
        display: none;
    }

    .reef-ability-panel {
        grid-template-columns: 1fr;
        max-width: 55vw;
        padding: 9px 10px;
    }

    .reef-ability-copy span { display: none; }
    .reef-echo-button { min-width: 120px; }

    .reef-wayfinder {
        bottom: 114px;
    }

    .reef-touch-controls {
        display: grid;
        grid-template-columns: repeat(3, 42px);
    }

    #touchUp { grid-column: 2; }
    #touchLeft { grid-column: 1; grid-row: 2; }
    #touchDown { grid-column: 2; grid-row: 2; }
    #touchRight { grid-column: 3; grid-row: 2; }

    .guardian-status {
        top: 82px;
    }

    .lumen-game .result-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    .reef-compass i {
        transition: none;
    }
}
