/* ─────────────────────────────────────────────────────────────
   PILZPRAXIS HYPHAE SLOTS — casino cabinet stylesheet
   ───────────────────────────────────────────────────────────── */
:root {
    --velvet:        #14040c;
    --velvet-2:      #2a0a1a;
    --cabinet:       #0a0606;
    --cabinet-edge:  #1d0d10;
    --gold:          #d4a73c;
    --gold-bright:   #f5d76e;
    --gold-dark:     #8a6b1d;
    --chrome:        #d8d4cc;
    --chrome-dark:   #6b6862;
    --neon-pink:     #ff2a72;
    --neon-cyan:     #00f0ff;
    --neon-green:    #39ff14;
    --neon-red:      #ff3333;
    --led-on:        #ff3a3a;
    --led-off:       #4a0a0a;
    --led-bg:        #1a0202;
    --text:          #f5e9d3;
    --muted:         #b89c7b;
    --danger:        #ff4040;
    --win:           #39ff14;
    --shadow-glow:   0 0 12px rgba(255, 215, 110, 0.5);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
    background:
        radial-gradient(ellipse at top, #3a0d22 0%, #1a0612 40%, #0a0307 100%),
        var(--velvet);
    color: var(--text);
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Subtle velvet texture using repeating tiny dots */
body::before {
    content: "";
    position: fixed; inset: 0;
    background-image:
        radial-gradient(rgba(255, 200, 180, 0.03) 1px, transparent 1px);
    background-size: 6px 6px;
    pointer-events: none;
    z-index: 0;
}

/* ─── Marquee header ─── */
.marquee {
    position: relative;
    display: flex; align-items: center; justify-content: center;
    gap: 1rem;
    padding: 0.8rem 1.2rem;
    background: linear-gradient(180deg, #2a0a18 0%, #170610 100%);
    border-bottom: 4px solid var(--gold);
    box-shadow: 0 0 30px rgba(255, 100, 150, 0.2), inset 0 -3px 0 var(--gold-dark);
    z-index: 1;
}

.marquee h1.brand {
    margin: 0;
    text-align: center;
    line-height: 1;
    flex: 0 1 auto;
}
.brand-text {
    display: inline-block;
    font-family: "Bebas Neue", Impact, "Arial Narrow", Georgia, serif;
    font-size: clamp(2.4rem, 7vw, 4.6rem);
    font-weight: 900;
    letter-spacing: 0.08em;
    background: linear-gradient(180deg,
        #fff5c8 0%,
        var(--gold-bright) 25%,
        var(--gold) 50%,
        #b88a20 65%,
        var(--gold-bright) 85%,
        #fff5c8 100%);
    -webkit-background-clip: text;
            background-clip: text;
    color: transparent;
    text-shadow:
        0 0 14px rgba(255, 215, 110, 0.8),
        0 0 30px rgba(255, 42, 114, 0.55),
        0 2px 0 #1a0a05;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.7));
    /* "blink" — every 2.5s the whole sign brightens & glows harder, like a Vegas marquee */
    animation: brandBlink 2.4s ease-in-out infinite;
    position: relative;
}
/* second layer: same text behind, pure neon-pink outline that pulses on a slightly
   different rhythm — gives the chrome a "lit-from-behind" feel */
.brand-text::before {
    content: attr(data-text);
    position: absolute;
    inset: 0;
    z-index: -1;
    -webkit-text-stroke: 2px var(--neon-pink);
    color: transparent;
    text-shadow:
        0 0 14px var(--neon-pink),
        0 0 28px rgba(255, 42, 114, 0.7),
        0 0 50px rgba(255, 42, 114, 0.4);
    animation: brandNeon 1.3s ease-in-out infinite alternate;
}
@keyframes brandBlink {
    0%, 100% {
        filter: drop-shadow(0 4px 6px rgba(0,0,0,0.7));
        text-shadow:
            0 0 14px rgba(255, 215, 110, 0.8),
            0 0 30px rgba(255, 42, 114, 0.55),
            0 2px 0 #1a0a05;
    }
    48% {
        filter: drop-shadow(0 4px 6px rgba(0,0,0,0.7)) brightness(1.4);
        text-shadow:
            0 0 24px rgba(255, 245, 200, 1),
            0 0 50px rgba(255, 215, 110, 0.9),
            0 0 80px rgba(255, 42, 114, 0.7),
            0 2px 0 #1a0a05;
    }
    52% {
        filter: drop-shadow(0 4px 6px rgba(0,0,0,0.7)) brightness(0.6);
        text-shadow: 0 0 6px rgba(255, 215, 110, 0.3), 0 2px 0 #1a0a05;
    }
}
@keyframes brandNeon {
    from {
        opacity: 0.55;
        text-shadow:
            0 0 8px var(--neon-pink),
            0 0 18px rgba(255, 42, 114, 0.4),
            0 0 36px rgba(255, 42, 114, 0.2);
    }
    to {
        opacity: 1;
        text-shadow:
            0 0 18px var(--neon-pink),
            0 0 36px rgba(255, 42, 114, 0.85),
            0 0 64px rgba(255, 42, 114, 0.5);
    }
}

.marquee {
    padding-top: 1.1rem;
    padding-bottom: 1.1rem;
}

/* Marquee bulb strip */
.bulbs { display: flex; gap: 0.4rem; }
.bulbs span {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--gold-bright);
    box-shadow:
        0 0 6px var(--gold-bright),
        0 0 12px rgba(255, 215, 110, 0.7);
    animation: bulbBlink 1.4s infinite;
}
.bulbs span:nth-child(2n) { animation-delay: 0.7s; }
.bulbs span:nth-child(3n) { background: var(--neon-pink); box-shadow: 0 0 6px var(--neon-pink), 0 0 14px rgba(255, 42, 114, 0.7); }
@keyframes bulbBlink {
    0%, 49%   { opacity: 1; }
    50%, 100% { opacity: 0.25; }
}

.header-buttons {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 0.4rem;
}
.mute {
    background: transparent;
    border: 1px solid var(--gold-dark);
    border-radius: 6px;
    color: var(--gold-bright);
    font-size: 1.2rem;
    padding: 0.3rem 0.5rem;
    cursor: pointer;
    line-height: 1;
    min-width: 2.1rem;
}
.mute:hover { background: rgba(212, 167, 60, 0.15); }

/* ─── Layout ─── */
main {
    position: relative;
    z-index: 1;
    padding: 1.5rem;
    max-width: 1100px;
    margin: 0 auto;
}
.layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 1.25rem;
    align-items: start;
}
@media (max-width: 800px) {
    .layout { grid-template-columns: 1fr; }
    .leaderboard { order: 2; }
}

/* ─── Cabinet (the slot machine chassis) ─── */
.cabinet {
    position: relative;
    padding: 1.2rem;
    border-radius: 18px;
    background:
        linear-gradient(180deg, #1c0e0e 0%, #0a0606 100%);
    border: 3px solid var(--gold-dark);
    box-shadow:
        0 0 0 4px var(--cabinet) inset,
        0 0 0 6px var(--gold) inset,
        0 0 0 8px var(--cabinet-edge) inset,
        0 18px 40px rgba(0, 0, 0, 0.7),
        0 0 60px rgba(255, 42, 114, 0.15);
}
.cabinet::before, .cabinet::after {
    content: "★";
    position: absolute;
    top: 0.3rem;
    color: var(--gold-bright);
    text-shadow: 0 0 8px var(--gold-bright);
    font-size: 1rem;
}
.cabinet::before { left: 0.6rem; }
.cabinet::after  { right: 0.6rem; }

.cabinet.small {
    max-width: 28rem;
    margin: 3rem auto;
}
.cabinet-screen {
    padding: 1.5rem;
    text-align: center;
}
.cabinet-screen h2 { margin-top: 0; }

/* ─── HUD row (score / streak / xp) ─── */
.hud {
    display: grid;
    grid-template-columns: 1.3fr 0.8fr 1.4fr;
    gap: 0.75rem;
    padding: 0.7rem;
    margin-bottom: 0.9rem;
    background: linear-gradient(180deg, #050202, #0c0707);
    border: 2px solid var(--gold-dark);
    border-radius: 10px;
    box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.7);
}
.hud-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    min-width: 0;
}
.hud-label {
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    color: var(--gold);
    font-weight: 700;
    text-transform: uppercase;
}

/* 7-segment style score (using monospace + glow) */
.led-display {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--led-on);
    background: var(--led-bg);
    padding: 0.35rem 0.7rem;
    border-radius: 6px;
    border: 1px solid #2a0606;
    text-shadow:
        0 0 4px var(--led-on),
        0 0 12px rgba(255, 58, 58, 0.7);
    box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.8);
    min-width: 100%;
    text-align: center;
}
.led-display.flash { animation: ledFlash 0.4s ease-out; }
@keyframes ledFlash {
    0% { color: #fff; text-shadow: 0 0 16px #fff, 0 0 32px var(--gold-bright); transform: scale(1.08); }
    100% { color: var(--led-on); transform: scale(1); }
}

/* Streak display */
.streak-display {
    font-family: ui-monospace, monospace;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--gold-bright);
    text-shadow: 0 0 6px var(--gold-bright), 0 0 12px rgba(255, 215, 110, 0.5);
    display: inline-flex;
    align-items: baseline;
    gap: 0.25rem;
}
.streak-display .flames { font-size: 1.2rem; filter: drop-shadow(0 0 6px var(--neon-pink)); }
.streak-cell { position: relative; }
.multiplier-badge {
    position: absolute;
    bottom: -8px;
    background: var(--neon-pink);
    color: #fff;
    font-weight: 900;
    font-size: 0.85rem;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    box-shadow: 0 0 10px var(--neon-pink), 0 0 20px rgba(255, 42, 114, 0.7);
    animation: badgePulse 1s infinite;
}
@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.12); }
}

/* XP bar */
.xp-bar-wrap {
    position: relative;
    width: 100%;
    height: 22px;
    background: var(--led-bg);
    border: 1px solid var(--gold-dark);
    border-radius: 11px;
    overflow: hidden;
    box-shadow: inset 0 0 8px rgba(0,0,0,0.8);
}
.xp-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--gold-dark), var(--gold), var(--gold-bright));
    box-shadow: 0 0 12px var(--gold-bright);
    transition: width 600ms cubic-bezier(0.3, 1, 0.3, 1);
}
.xp-text {
    position: absolute;
    inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #000;
    text-shadow: 0 0 3px var(--gold-bright);
    letter-spacing: 0.05em;
}
.level-cell .hud-label {
    color: var(--neon-cyan);
    text-shadow: 0 0 6px rgba(0, 240, 255, 0.6);
    font-size: 0.75rem;
}

/* ─── Reel window ─── */
.reel-window {
    position: relative;
    aspect-ratio: 4 / 3;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    border: 3px solid var(--gold);
    box-shadow:
        0 0 0 3px var(--cabinet) inset,
        0 0 25px rgba(255, 215, 110, 0.25),
        0 0 0 4px var(--gold-dark);
    isolation: isolate;
}
.reel-window::after {
    /* slim inner gold ring for that extra chrome feel */
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    box-shadow: inset 0 0 0 1px rgba(255, 215, 110, 0.4);
}
#image-frame {
    position: absolute;
    inset: 0;
    transition: transform 250ms ease, filter 250ms ease;
}
#image, #overlay, .reel-ticker {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}
#image { object-fit: contain; transition: opacity 200ms ease; }
#overlay { pointer-events: none; }

/* spin: image fades out / blurs while reel-ticker scrolls */
.reel-ticker {
    display: none;
    background:
        repeating-linear-gradient(
            0deg,
            #2a1818 0px,
            #2a1818 18px,
            #401818 18px,
            #401818 36px,
            #682424 36px,
            #682424 54px,
            #401818 54px,
            #401818 72px
        );
    background-size: 100% 144px;
    z-index: 2;
}
.reel-window.spinning .reel-ticker {
    display: block;
    animation: reelScroll 0.35s linear infinite;
}
.reel-window.spinning #image { opacity: 0.0; }
@keyframes reelScroll {
    from { background-position-y: 0; }
    to   { background-position-y: 144px; }
}

#feedback {
    position: absolute;
    top: 0.6rem; left: 50%;
    transform: translateX(-50%);
    padding: 0.35rem 0.9rem;
    border-radius: 8px;
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: 0.05em;
    background: rgba(0, 0, 0, 0.78);
    border: 2px solid var(--gold);
    z-index: 3;
    text-transform: uppercase;
}
#feedback.correct { color: var(--win); border-color: var(--win); box-shadow: 0 0 18px rgba(57, 255, 20, 0.6); }
#feedback.wrong   { color: var(--danger); border-color: var(--danger); box-shadow: 0 0 18px rgba(255, 64, 64, 0.6); }

#reshuffle-banner {
    position: absolute;
    inset: auto 0 0.6rem 0;
    text-align: center;
    color: var(--neon-cyan);
    font-weight: 800;
    letter-spacing: 0.15em;
    background: rgba(0,0,0,0.75);
    padding: 0.4rem;
    text-shadow: 0 0 8px var(--neon-cyan);
    animation: cyanBlink 0.6s infinite;
    z-index: 3;
}
@keyframes cyanBlink {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.4; }
}

/* shake on wrong */
.reel-window.shake { animation: shake 0.4s; }
@keyframes shake {
    0%   { transform: translate(0,0); }
    20%  { transform: translate(-6px, 2px); }
    40%  { transform: translate(6px, -2px); }
    60%  { transform: translate(-4px, 1px); }
    80%  { transform: translate(4px, -1px); }
    100% { transform: translate(0,0); }
}

/* ─── Action buttons ─── */
.actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.7rem;
    margin-top: 0.9rem;
}
#actions-next { grid-template-columns: 1fr; }
.big-btn {
    cursor: pointer;
    position: relative;
    padding: 1rem 0.9rem 0.8rem;
    font: inherit;
    font-weight: 900;
    font-size: 1rem;
    letter-spacing: 0.12em;
    border-radius: 10px;
    border: 2px solid var(--gold-dark);
    background:
        linear-gradient(180deg, #2a2018 0%, #14100a 100%);
    color: var(--gold-bright);
    text-transform: uppercase;
    box-shadow:
        inset 0 1px 0 rgba(255, 215, 110, 0.25),
        inset 0 -2px 0 rgba(0,0,0,0.7),
        0 4px 0 var(--gold-dark),
        0 5px 14px rgba(0,0,0,0.5);
    transform: translateY(0);
    transition: transform 80ms ease, box-shadow 80ms ease, filter 120ms;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.6rem;
}
.big-btn:hover { filter: brightness(1.15); }
.big-btn:active {
    transform: translateY(3px);
    box-shadow:
        inset 0 1px 0 rgba(255, 215, 110, 0.25),
        inset 0 -2px 0 rgba(0,0,0,0.7),
        0 1px 0 var(--gold-dark),
        0 2px 6px rgba(0,0,0,0.5);
}
.big-btn .btn-emoji { font-size: 1.4rem; }
.big-btn .btn-label { text-align: center; }
.big-btn .btn-key {
    font-family: ui-monospace, monospace;
    font-size: 0.7rem;
    color: var(--muted);
    border: 1px solid var(--gold-dark);
    border-radius: 4px;
    padding: 0.1rem 0.35rem;
}
.big-btn.neg  {
    color: #1a1a1a;
    border-color: var(--chrome);
    background: linear-gradient(180deg, var(--chrome) 0%, #8d8a85 50%, var(--chrome-dark) 100%);
    text-shadow: 0 1px 0 rgba(255,255,255,0.4);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.55),
        inset 0 -2px 0 rgba(0,0,0,0.35),
        0 4px 0 #3a3833,
        0 6px 14px rgba(0,0,0,0.55);
}
.big-btn.neg .btn-key { color: #2a2a2a; border-color: #6b6862; }
.big-btn.pos  {
    color: #1a0a05;
    border-color: var(--gold-bright);
    background: linear-gradient(180deg, var(--gold-bright) 0%, var(--gold) 50%, var(--gold-dark) 100%);
    text-shadow: 0 1px 0 rgba(255,255,255,0.4);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.45),
        inset 0 -2px 0 rgba(0,0,0,0.3),
        0 4px 0 #5a4515,
        0 6px 16px rgba(212, 167, 60, 0.5);
}
.big-btn.pos .btn-key { color: #2a1a05; border-color: #5a4515; }
.big-btn.next { color: #fff; border-color: var(--gold-bright); background: linear-gradient(180deg, var(--gold) 0%, var(--gold-dark) 100%); text-shadow: 0 1px 0 rgba(0,0,0,0.5); box-shadow: inset 0 1px 0 rgba(255,255,255,0.35), inset 0 -2px 0 rgba(0,0,0,0.6), 0 4px 0 #5a4515, 0 6px 18px rgba(212, 167, 60, 0.45); animation: nextPulse 1.4s infinite; }
@keyframes nextPulse {
    0%, 100% { box-shadow: inset 0 1px 0 rgba(255,255,255,0.35), inset 0 -2px 0 rgba(0,0,0,0.6), 0 4px 0 #5a4515, 0 6px 18px rgba(212, 167, 60, 0.45); }
    50%      { box-shadow: inset 0 1px 0 rgba(255,255,255,0.35), inset 0 -2px 0 rgba(0,0,0,0.6), 0 4px 0 #5a4515, 0 6px 28px rgba(255, 215, 110, 0.85); }
}

/* ─── Deck status row ─── */
.deck-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.7rem;
    padding-top: 0.6rem;
    border-top: 1px dashed var(--gold-dark);
    font-size: 0.8rem;
}
.deck-status .sep { opacity: 0.4; margin: 0 0.4rem; }
.muted { color: var(--muted); }
.small { font-size: 0.8rem; }
.error { color: var(--danger); }

.link {
    background: none; border: none; padding: 0;
    color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit;
}

/* ─── Splash / nickname screen ─── */
.nick-wrap { padding: 1rem 0; }
.splash {
    position: relative;
    max-width: 1100px;
    margin: 1.5rem auto;
    border-radius: 14px;
    overflow: hidden;
    border: 3px solid var(--gold);
    box-shadow:
        0 0 0 3px var(--cabinet) inset,
        0 0 0 6px var(--gold-dark) inset,
        0 18px 40px rgba(0, 0, 0, 0.7),
        0 0 60px rgba(255, 42, 114, 0.25);
}
.splash-art {
    display: block;
    width: 100%;
    height: auto;
}
.splash-overlay {
    position: absolute;
    left: 50%;
    bottom: 4%;
    transform: translateX(-50%);
    width: min(92%, 36rem);
    text-align: center;
    padding: 1rem 1.2rem 1.1rem;
    background: rgba(8, 4, 12, 0.78);
    backdrop-filter: blur(10px);
    border: 2px solid var(--gold);
    border-radius: 12px;
    box-shadow: 0 0 24px rgba(255, 215, 110, 0.35);
}
.splash-overlay h2 { margin: 0 0 0.3rem; font-size: 1.05rem; letter-spacing: 0.2em; }
.splash-overlay .muted { font-size: 0.82rem; margin: 0; }
.splash-overlay #nick-form { margin-top: 0.7rem; }
#splash-howto {
    margin-top: 0.55rem;
    color: var(--muted);
}
#splash-howto:hover { color: var(--gold-bright); }

/* On narrow screens, stop trying to overlay — stack the form below the art. */
@media (max-width: 560px) {
    .splash-overlay {
        position: static;
        transform: none;
        width: auto;
        margin: 0;
        border: none;
        border-radius: 0;
        border-top: 2px solid var(--gold);
        background: rgba(8, 4, 12, 0.92);
    }
}
.neon-text {
    font-family: Georgia, serif;
    color: var(--neon-pink);
    text-shadow:
        0 0 6px var(--neon-pink),
        0 0 14px rgba(255, 42, 114, 0.7);
    letter-spacing: 0.12em;
    margin: 0 0 0.5rem;
}
#nick-form {
    margin-top: 1.2rem;
    display: flex; gap: 0.5rem;
}
#nick-input {
    flex: 1;
    font: inherit;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.7rem 0.9rem;
    background: var(--led-bg);
    color: var(--led-on);
    border: 2px solid var(--gold-dark);
    border-radius: 8px;
    text-shadow: 0 0 4px var(--led-on);
    box-shadow: inset 0 0 12px rgba(0,0,0,0.8);
    text-align: center;
}
.btn-chrome {
    font: inherit;
    font-weight: 900;
    letter-spacing: 0.12em;
    padding: 0.7rem 1.4rem;
    border-radius: 8px;
    border: 2px solid var(--gold-bright);
    color: #1a0a05;
    background: linear-gradient(180deg, var(--gold-bright), var(--gold) 60%, var(--gold-dark));
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.5),
        inset 0 -2px 0 rgba(0,0,0,0.3),
        0 4px 0 #5a4515;
    cursor: pointer;
}

/* ─── Leaderboard ─── */
.leaderboard {
    background: linear-gradient(180deg, #1c0e14 0%, #0a0506 100%);
    border: 2px solid var(--gold-dark);
    border-radius: 12px;
    padding: 0.9rem 1rem;
    box-shadow: 0 0 0 3px var(--cabinet) inset, 0 0 0 4px var(--gold-dark) inset;
}
.leaderboard h3 {
    margin: 0 0 0.3rem;
    color: var(--gold-bright);
    text-shadow: 0 0 8px var(--gold);
    letter-spacing: 0.05em;
    font-size: 1.05rem;
}
.leaderboard ol {
    padding-left: 0;
    margin: 0.7rem 0;
    list-style: none;
}
.leaderboard li {
    display: grid;
    grid-template-columns: 1.6rem 1fr auto;
    align-items: baseline;
    gap: 0.3rem;
    padding: 0.35rem 0.3rem;
    border-bottom: 1px solid rgba(212, 167, 60, 0.15);
    font-size: 0.88rem;
}
.leaderboard li:last-child { border-bottom: none; }
.leaderboard .rank { color: var(--muted); font-weight: 700; text-align: right; }
.leaderboard .rank.gold { color: var(--gold-bright); }
.leaderboard .nick { color: var(--text); font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.leaderboard .xp { color: var(--neon-pink); font-weight: 800; font-variant-numeric: tabular-nums; text-shadow: 0 0 4px rgba(255,42,114,0.6); }
.leaderboard li.me { background: rgba(255, 215, 110, 0.08); border-radius: 4px; }
.leaderboard li.me .nick { color: var(--gold-bright); }
.leaderboard-foot {
    margin-top: 0.8rem;
    padding-top: 0.6rem;
    border-top: 1px dashed var(--gold-dark);
    text-align: center;
    line-height: 1.5;
}

/* ─── FX layer (confetti, popups, toasts) ─── */
#fx-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1000;
}
#confetti { width: 100vw; height: 100vh; display: block; }
#popups, #toasts {
    position: absolute;
    inset: 0;
}
.popup {
    position: absolute;
    font-family: ui-monospace, monospace;
    font-weight: 900;
    font-size: 2rem;
    color: var(--gold-bright);
    text-shadow: 0 0 8px var(--gold-bright), 0 0 18px rgba(255,215,110,0.7), 0 2px 0 #000;
    transform: translate(-50%, -50%);
    animation: popupRise 1100ms cubic-bezier(0.3, 1, 0.5, 1) forwards;
    pointer-events: none;
}
.popup.big {
    font-size: 3rem;
    color: var(--neon-pink);
    text-shadow: 0 0 10px var(--neon-pink), 0 0 24px rgba(255,42,114,0.7);
}
@keyframes popupRise {
    0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.4); }
    15%  { opacity: 1; transform: translate(-50%, -55%) scale(1.2); }
    30%  { transform: translate(-50%, -60%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -120%) scale(1); }
}

.toast {
    position: absolute;
    top: 80px; left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(180deg, #4a1010 0%, #1a0606 100%);
    border: 2px solid var(--gold);
    color: var(--gold-bright);
    font-weight: 900;
    letter-spacing: 0.1em;
    padding: 0.7rem 1.4rem;
    border-radius: 999px;
    text-transform: uppercase;
    text-shadow: 0 0 6px var(--gold-bright);
    box-shadow: 0 0 22px rgba(255, 215, 110, 0.6), 0 6px 18px rgba(0,0,0,0.6);
    animation: toastIn 2400ms ease forwards;
}
@keyframes toastIn {
    0%   { opacity: 0; transform: translate(-50%, -20px) scale(0.8); }
    10%  { opacity: 1; transform: translate(-50%, 0) scale(1.05); }
    20%  { transform: translate(-50%, 0) scale(1); }
    85%  { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, -10px); }
}

/* JACKPOT full-screen overlay */
#jackpot-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, rgba(255, 42, 114, 0.25) 0%, transparent 70%);
    z-index: 5;
}
#jackpot-overlay.hidden { display: none; }
.jackpot-text {
    font-family: Georgia, serif;
    font-size: clamp(3rem, 12vw, 8rem);
    font-weight: 900;
    color: var(--gold-bright);
    letter-spacing: 0.1em;
    text-shadow:
        0 0 12px var(--gold-bright),
        0 0 30px var(--neon-pink),
        0 0 60px var(--neon-pink),
        0 4px 0 #000;
    animation: jackpotPop 1.4s ease-out forwards;
}
@keyframes jackpotPop {
    0%   { opacity: 0; transform: scale(0.4) rotate(-8deg); }
    20%  { opacity: 1; transform: scale(1.15) rotate(3deg); }
    40%  { transform: scale(1) rotate(-2deg); }
    60%  { transform: scale(1.05) rotate(1deg); }
    100% { opacity: 0; transform: scale(1.2) rotate(0); }
}

.hidden { display: none !important; }

/* ─── Difficulty pill ─── */
.difficulty-pill {
    display: inline-block;
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    font-weight: 800;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    border: 1px solid currentColor;
    background: rgba(0,0,0,0.4);
    text-shadow: 0 0 6px currentColor;
}
.difficulty-pill.easy     { color: var(--win); }
.difficulty-pill.medium   { color: var(--gold-bright); }
.difficulty-pill.hard     { color: var(--neon-pink); }
.difficulty-pill.expert   { color: #ff6f3a; }
.difficulty-pill.full     { color: var(--neon-cyan); }

/* ─── Round progress dots ─── */
.round-dots {
    display: flex;
    justify-content: center;
    gap: 0.45rem;
    margin: 0.75rem 0 0.2rem;
}
.round-dots .dot {
    width: 12px; height: 12px;
    border-radius: 50%;
    background: var(--led-bg);
    border: 1px solid var(--gold-dark);
    box-shadow: inset 0 0 4px rgba(0,0,0,0.7);
    transition: background-color 200ms, box-shadow 200ms, transform 200ms;
}
.round-dots .dot.correct {
    background: var(--win);
    border-color: var(--win);
    box-shadow: 0 0 8px var(--win), 0 0 14px rgba(57, 255, 20, 0.6);
    transform: scale(1.15);
}
.round-dots .dot.wrong {
    background: var(--danger);
    border-color: var(--danger);
    box-shadow: 0 0 8px var(--danger), 0 0 14px rgba(255, 64, 64, 0.6);
}
.round-dots .dot.current {
    animation: dotPulse 0.9s infinite;
}
@keyframes dotPulse {
    0%, 100% { box-shadow: 0 0 4px var(--gold-bright); }
    50%      { box-shadow: 0 0 12px var(--gold-bright), 0 0 20px rgba(255, 215, 110, 0.5); }
}

/* ─── End-of-round summary ─── */
.summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.6rem;
    margin: 1.2rem 0;
}
.summary-cell {
    background: var(--led-bg);
    border: 1px solid var(--gold-dark);
    border-radius: 8px;
    padding: 0.7rem 0.4rem;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.8);
}
.summary-num {
    font-family: ui-monospace, monospace;
    font-size: 1.7rem;
    font-weight: 900;
    color: var(--led-on);
    text-shadow: 0 0 6px var(--led-on);
}
.summary-num.gold { color: var(--gold-bright); text-shadow: 0 0 6px var(--gold-bright); }
.summary-num.cyan { color: var(--neon-cyan); text-shadow: 0 0 6px var(--neon-cyan); }
.summary-label {
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    color: var(--muted);
    margin-top: 0.2rem;
}

/* ─── Tutorial / how-to modal ─── */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(5, 2, 5, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 2000;
    overflow-y: auto;
    backdrop-filter: blur(4px);
}
.modal-inner {
    position: relative;
    max-width: 36rem;
    width: 100%;
    margin: auto;
    padding: 1.5rem 1.5rem 1.2rem;
    text-align: center;
}
.modal-close {
    position: absolute;
    top: 0.5rem; right: 0.7rem;
    background: transparent;
    color: var(--gold-bright);
    border: 1px solid var(--gold-dark);
    border-radius: 6px;
    font: inherit;
    padding: 0.2rem 0.5rem;
    cursor: pointer;
}
.example-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.7rem;
    margin: 1rem 0;
}
@media (max-width: 480px) {
    .example-grid { grid-template-columns: 1fr; }
}
.example-grid figure { margin: 0; }
.example-wrap {
    position: relative;
    aspect-ratio: 4 / 3;
    background: #000;
    border: 2px solid var(--gold);
    border-radius: 6px;
    overflow: hidden;
}
.example-wrap img, .example-wrap canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.example-grid figcaption {
    margin-top: 0.4rem;
    font-size: 0.78rem;
    color: var(--muted);
}
.badge {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    font-weight: 800;
    margin-right: 0.3rem;
    font-size: 0.75rem;
}
.badge.pos { background: rgba(255, 42, 114, 0.2); color: var(--neon-pink); border: 1px solid var(--neon-pink); }
.badge.neg { background: rgba(0, 240, 255, 0.15); color: var(--neon-cyan); border: 1px solid var(--neon-cyan); }

.tutorial-rules { font-size: 0.9rem; }
.tutorial-rules kbd {
    display: inline-block;
    background: var(--led-bg);
    color: var(--led-on);
    text-shadow: 0 0 4px var(--led-on);
    border: 1px solid var(--gold-dark);
    padding: 0.05rem 0.4rem;
    margin: 0 0.1rem;
    border-radius: 4px;
    font-family: ui-monospace, monospace;
    font-weight: 700;
}
.tutorial-roadmap { margin: 1rem 0 1.2rem; }

/* ─── Slot symbol mini-reels (above image) ─── */
.symbol-reels {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.4rem;
    margin-bottom: 0.6rem;
    background: linear-gradient(180deg, #050202, #0c0707);
    border: 2px solid var(--gold-dark);
    border-radius: 8px;
    padding: 0.35rem;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.8);
}
.sym-reel {
    position: relative;
    height: 56px;
    overflow: hidden;
    background: var(--led-bg);
    border: 1px solid var(--gold-dark);
    border-radius: 5px;
    box-shadow: inset 0 0 8px rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
}
.sym-face {
    font-size: 36px;
    line-height: 1;
    text-align: center;
    /* emoji rendering */
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
    transform: translateY(0);
    transition: transform 180ms cubic-bezier(0.3, 1.6, 0.4, 1);
}
/* spinning: snap up/down rapidly while JS swaps the emoji */
.sym-reel.spinning .sym-face {
    animation: symBounce 0.12s linear infinite;
    transition: none;
}
@keyframes symBounce {
    0%   { transform: translateY(-28px); }
    50%  { transform: translateY(28px); }
    100% { transform: translateY(-28px); }
}
.sym-reel.match {
    box-shadow: inset 0 0 18px rgba(57, 255, 20, 0.7), 0 0 12px var(--win);
    border-color: var(--win);
}
.sym-reel.match .sym-face {
    animation: symPop 0.35s ease-out;
    filter: drop-shadow(0 0 6px var(--win));
}
.sym-reel.mismatch {
    box-shadow: inset 0 0 18px rgba(255, 64, 64, 0.5);
    border-color: var(--danger);
}
.sym-reel.mismatch .sym-face {
    filter: grayscale(0.6) brightness(0.7);
}
@keyframes symPop {
    0%   { transform: scale(0.6); }
    60%  { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* ─── WIN / LOSE stamp ─── */
.stamp {
    position: fixed;
    top: 50%; left: 50%;
    font-family: Georgia, serif;
    font-size: clamp(3rem, 10vw, 7rem);
    font-weight: 900;
    letter-spacing: 0.1em;
    padding: 0.3rem 1.5rem;
    border: 8px solid currentColor;
    border-radius: 12px;
    text-transform: uppercase;
    opacity: 0;
    pointer-events: none;
    z-index: 1100;
    animation: stampThump 1.2s ease-out forwards;
}
.stamp.win  { color: var(--win); text-shadow: 0 0 12px var(--win); box-shadow: 0 0 24px rgba(57,255,20,0.6); }
.stamp.lose { color: var(--danger); text-shadow: 0 0 12px var(--danger); box-shadow: 0 0 24px rgba(255,64,64,0.6); }
@keyframes stampThump {
    0%   { opacity: 0; transform: translate(-50%, -50%) scale(3.5) rotate(-25deg); }
    20%  { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(-8deg); }
    30%  { transform: translate(-50%, -50%) scale(1.08) rotate(-8deg); }
    40%  { transform: translate(-50%, -50%) scale(1) rotate(-8deg); }
    85%  { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.4) rotate(-8deg); }
}

/* ─── Coin shower canvas (separate from confetti) ─── */
#coinshower {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

/* Glitch flash on the reel when wrong */
.reel-window.glitch::after {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(255,0,0,0.35), transparent 30%, rgba(255,0,0,0.35) 60%, transparent);
    mix-blend-mode: screen;
    pointer-events: none;
    animation: glitchFlash 0.45s ease-out;
    z-index: 4;
}
@keyframes glitchFlash {
    0%   { opacity: 0; }
    20%  { opacity: 1; transform: translateX(-4px); }
    40%  { transform: translateX(4px); }
    60%  { transform: translateX(-2px); }
    100% { opacity: 0; }
}
