/* ============================================================
   Prey or Perish — dark neon UI
   IDs/classes referenced by app.js are preserved:
   #startMenuWrapper (max-height toggle), #settings (max-height toggle),
   #playerNameInput, #startButton, #spectateButton, #settingsButton,
   .input-error, #gameAreaWrapper, #status, .chatbox
   ============================================================ */

:root {
    --bg-0: #05060a;
    --bg-1: #0c0f16;
    --panel: rgba(16, 20, 28, 0.72);
    --panel-border: rgba(120, 255, 200, 0.18);
    --text: #e6edf3;
    --text-dim: #93a1b0;
    --green: #4a64ff;
    --green-2: #2740ff;
    --green-rgb: 74, 100, 255;
    --cyan: #8529fd;
    --red: #ff693c;
    --red-2: #e0511f;
    --red-rgb: 255, 105, 60;

    /* Start-menu accent palette (neon blue / violet / orange).
       Used ONLY by the registration/start screen, not the in-game HUD. */
    --m-blue: #2740ff;
    --m-blue-2: #1a2fd0;
    --m-blue-rgb: 39, 64, 255;
    --m-violet: #8529fd;
    --m-orange: #ff693c;
    --m-orange-2: #e0511f;
    --m-orange-rgb: 255, 105, 60;
}

* {
    font-family: 'Rubik', system-ui, -apple-system, Segoe UI, sans-serif;
    font-size: 14px;
    box-sizing: border-box;
}

html {
    height: 100%;
    background: var(--bg-0);
}
html, body {
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    color: var(--text);
}

body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    background: transparent;
}

/* When the soft keyboard is open (touch), lift the form to the top so the name
   field stays visible above the keyboard. */
body.kb {
    align-items: flex-start;
}
body.kb #brandLogo { display: none; }
body.kb #startMenuWrapper { margin-top: 10px; }

/* Full-screen fixed background layer (gradients + dot grid). Fixed so it always
   covers the visible viewport on mobile, regardless of content height. */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(1000px 700px at 16% 10%, rgba(var(--m-blue-rgb), 0.30), transparent 58%),
        radial-gradient(900px 700px at 86% 90%, rgba(var(--m-orange-rgb), 0.26), transparent 58%),
        radial-gradient(800px 600px at 82% 12%, rgba(155, 107, 255, 0.22), transparent 58%),
        radial-gradient(800px 600px at 12% 88%, rgba(var(--m-orange-rgb), 0.16), transparent 58%),
        radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: auto, auto, auto, auto, 26px 26px;
    pointer-events: none;
    z-index: 0;
}

canvas {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}

div {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* ---------- Start menu ---------- */

#startMenuWrapper {
    position: relative;
    z-index: 2;
    margin-top: -44px;
    transition: max-height 1s;
    overflow: hidden;
}

/* decorative floating blobs */
.blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(6px);
    opacity: 0.8;
    pointer-events: none;
    z-index: 0;
    animation: float 14s ease-in-out infinite;
}
.blob--green { width: 150px; height: 150px; left: 12%; top: 22%;
    background: radial-gradient(circle at 35% 32%, #c2c9ff, var(--m-blue));
    box-shadow: 0 0 90px 30px rgba(var(--m-blue-rgb), 0.45); }
.blob--red   { width: 200px; height: 200px; right: 10%; bottom: 16%;
    background: radial-gradient(circle at 35% 32%, #ffd0a8, var(--m-orange));
    box-shadow: 0 0 110px 40px rgba(var(--m-orange-rgb), 0.45);
    animation-delay: -4s; animation-duration: 18s; }
.blob--cyan  { width: 110px; height: 110px; right: 22%; top: 18%;
    background: radial-gradient(circle at 35% 32%, #d6c4ff, var(--m-violet));
    box-shadow: 0 0 80px 26px rgba(155, 107, 255, 0.4);
    animation-delay: -8s; animation-duration: 16s; }

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%      { transform: translate(20px, -26px) scale(1.08); }
    66%      { transform: translate(-18px, 16px) scale(0.94); }
}

/* Hide all menu decoration once the game is running */
body.in-game .blob { display: none; }
body.in-game::before { display: none; }
body.in-game { background: #05060a; height: var(--app-h, 100dvh); }

@property --angle {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}

#startMenu {
    position: relative;
    z-index: 1;
    margin: auto;
    width: 410px;
    max-width: calc(100vw - 32px);
    padding: 32px 28px 26px;
    border-radius: 20px;
    background: var(--panel);
    border: 1px solid transparent;
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    box-shadow:
        0 40px 100px rgba(0, 0, 0, 0.7),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset,
        0 0 90px rgba(var(--m-blue-rgb), 0.10) inset;
}

/* rotating neon gradient border */
#startMenu::before {
    content: "";
    position: absolute;
    inset: -1.5px;
    border-radius: inherit;
    padding: 1.5px;
    background: conic-gradient(from var(--angle),
        var(--m-blue), var(--m-violet), var(--m-orange), var(--m-blue));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
            mask-composite: exclude;
    animation: rotateBorder 7s linear infinite;
    pointer-events: none;
    z-index: 2;
    opacity: 0.9;
}
/* soft outer halo of the same gradient */
#startMenu::after {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: conic-gradient(from var(--angle),
        var(--m-blue), var(--m-violet), var(--m-orange), var(--m-blue));
    filter: blur(18px);
    opacity: 0.35;
    z-index: -1;
    animation: rotateBorder 7s linear infinite;
    pointer-events: none;
}
@keyframes rotateBorder {
    to { --angle: 360deg; }
}

/* ---------- Brand logo (above the card, on the background) ---------- */

#brandLogo {
    display: block;
    margin: 0 auto -10px;
    width: 250px;
    max-width: 64%;
    height: auto;
    pointer-events: none;
    filter: drop-shadow(0 6px 26px rgba(var(--m-blue-rgb), 0.45));
    position: relative;
    z-index: 1;
}

/* ---------- Brand title ---------- */

.brand {
    text-align: center;
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    font-size: 46px;
    line-height: 1;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 12px;
}
.brand .prey {
    background: linear-gradient(180deg, #dfe3ff 0%, var(--m-blue) 55%, var(--m-blue-2) 100%);
    -webkit-background-clip: text;
            background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--m-blue);
    filter: drop-shadow(0 0 10px rgba(var(--m-blue-rgb), 0.75));
    animation: pulseGreen 2.8s ease-in-out infinite;
}
.brand .perish {
    background: linear-gradient(180deg, #ffe6d0 0%, var(--m-orange) 55%, var(--m-orange-2) 100%);
    -webkit-background-clip: text;
            background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--m-orange);
    filter: drop-shadow(0 0 10px rgba(var(--m-orange-rgb), 0.75));
    animation: pulseRed 2.8s ease-in-out infinite;
}
.brand .orr {
    font-family: 'Rubik', sans-serif;
    font-weight: 500;
    font-style: italic;
    font-size: 17px;
    color: var(--text-dim);
    filter: none;
}
@keyframes pulseGreen {
    0%, 100% { filter: drop-shadow(0 0 8px rgba(var(--m-blue-rgb), 0.6)); }
    50%      { filter: drop-shadow(0 0 18px rgba(var(--m-blue-rgb), 1)) drop-shadow(0 0 36px rgba(var(--m-blue-rgb), 0.5)); }
}
@keyframes pulseRed {
    0%, 100% { filter: drop-shadow(0 0 8px rgba(var(--m-orange-rgb), 0.6)); }
    50%      { filter: drop-shadow(0 0 18px rgba(var(--m-orange-rgb), 1)) drop-shadow(0 0 36px rgba(var(--m-orange-rgb), 0.5)); }
}

.tagline {
    text-align: center;
    margin: 0 0 22px;
    font-family: 'Rubik', sans-serif;
    font-weight: 700;
    font-size: 16px;
    line-height: 1.35;
    letter-spacing: 0.3px;
    color: #ffd9a8;
    background: linear-gradient(90deg, var(--m-blue) 0%, #ffb877 50%, var(--m-orange) 100%);
    -webkit-background-clip: text;
            background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 10px rgba(var(--m-orange-rgb), 0.45));
}

/* ---------- Name input ---------- */

#playerNameInput {
    width: 100%;
    text-align: center;
    padding: 13px;
    color: var(--text);
    background: rgba(8, 11, 16, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    transition: box-shadow 0.25s, border 0.25s;
    margin-bottom: 6px;
    outline: none;
    font-size: 15px;
}
#playerNameInput::placeholder { color: #5e6b78; }
#playerNameInput:focus, #playerNameInput.focus {
    border-color: rgba(var(--m-blue-rgb), 0.7);
    box-shadow: 0 0 0 3px rgba(var(--m-blue-rgb), 0.16), 0 0 18px rgba(var(--m-blue-rgb), 0.25);
}

/* Name field + two cell-colour swatches (the two worm band colours) */
/* The row spans the full card width (same as the Play button): the name field
   takes all remaining space, the two colour swatches are square. */
.name-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
    width: 100%;
    margin: 0 0 6px;
}
.name-row #playerNameInput {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    margin-bottom: 0;
}
/* The colour inputs are the visible swatches (work on desktop + touch).
   aspect-ratio 1 + stretched height keeps them square at the field's height. */
.swatch {
    flex: 0 0 auto;
    box-sizing: border-box;
    height: 46px;
    width: 46px;
    align-self: center;
    padding: 4px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(8, 11, 16, 0.85);
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.2s ease;
}
.swatch:hover { transform: translateY(-1px); box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.22); }
.swatch::-webkit-color-swatch-wrapper { padding: 0; }
.swatch::-webkit-color-swatch { border: none; border-radius: 6px; }
.swatch::-moz-color-swatch { border: none; border-radius: 6px; }

/* Colour-preview worm strip (between the name row and Play). */
#wormPreviewWrap {
    width: 100%;
    margin: 10px 0 4px;
}
#wormPreview {
    display: block;
    width: 100%;
    height: 56px;
}

/* ---------- Buttons ---------- */

#startButton, #spectateButton, #settingsButton {
    position: relative;
    display: block;
    overflow: hidden;
    margin: 12px auto 0;
    width: 100%;
    height: 54px;
    font-family: 'Orbitron', sans-serif;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-align: center;
    color: #ffffff;
    border: 0;
    border-radius: 13px;
    cursor: pointer;
    transition: transform 0.14s ease, box-shadow 0.25s ease, filter 0.25s ease;
}

/* Play — neon blue-violet with idle glow pulse + running sheen */
#startButton {
    background: linear-gradient(135deg, #8a97ff, var(--m-blue) 45%, var(--m-blue-2));
    box-shadow: 0 10px 28px rgba(var(--m-blue-rgb), 0.45), 0 0 0 1px rgba(var(--m-blue-rgb), 0.6) inset;
    will-change: box-shadow;
    animation: playGlow 3.4s ease-in-out infinite;
}
#startButton::after {
    content: "";
    position: absolute;
    top: -20%;
    left: 0;
    width: 45%;
    height: 140%;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    transform: translateX(-260%) skewX(-22deg);
    will-change: transform;
    animation: sheen 4s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}
#startButton:hover { transform: translateY(-3px) scale(1.015); filter: brightness(1.1);
    box-shadow: 0 16px 38px rgba(var(--m-blue-rgb), 0.6), 0 0 30px rgba(var(--m-blue-rgb), 0.55); }
#startButton:active { transform: translateY(0) scale(1); }
@keyframes playGlow {
    0%, 100% { box-shadow: 0 10px 28px rgba(var(--m-blue-rgb), 0.42), 0 0 0 1px rgba(var(--m-blue-rgb), 0.6) inset; }
    50%      { box-shadow: 0 13px 34px rgba(var(--m-blue-rgb), 0.6), 0 0 22px rgba(var(--m-blue-rgb), 0.45), 0 0 0 1px rgba(var(--m-blue-rgb), 0.75) inset; }
}
@keyframes sheen {
    0%   { transform: translateX(-260%) skewX(-22deg); }
    45%  { transform: translateX(460%) skewX(-22deg); }
    100% { transform: translateX(460%) skewX(-22deg); }
}

/* Spectate — orange outline / ghost */
#spectateButton {
    color: var(--m-orange);
    background: rgba(var(--m-orange-rgb), 0.07);
    box-shadow: 0 0 0 1px rgba(var(--m-orange-rgb), 0.45) inset;
}
#spectateButton:hover { transform: translateY(-2px);
    background: rgba(var(--m-orange-rgb), 0.16);
    box-shadow: 0 8px 22px rgba(var(--m-orange-rgb), 0.25), 0 0 0 1px rgba(var(--m-orange-rgb), 0.7) inset; }
#spectateButton:active { transform: translateY(0); }

/* How to hunt — orange outline */
#settingsButton {
    color: var(--m-orange);
    background: rgba(var(--m-orange-rgb), 0.07);
    box-shadow: 0 0 0 1px rgba(var(--m-orange-rgb), 0.45) inset;
}
#settingsButton:hover { transform: translateY(-2px);
    background: rgba(var(--m-orange-rgb), 0.16);
    box-shadow: 0 8px 22px rgba(var(--m-orange-rgb), 0.25), 0 0 0 1px rgba(var(--m-orange-rgb), 0.7) inset; }
#settingsButton:active { transform: translateY(0); }

/* ---------- Settings + instructions panels ---------- */

#settings, #startMenuWrapper {
    -webkit-transition: max-height 1s;
    -moz-transition: max-height 1s;
    -o-transition: max-height 1s;
    transition: max-height 1s;
    overflow: hidden;
}
#settings { max-height: 0; }

#startMenu h3 {
    margin: 18px 0 6px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--m-blue);
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

#startMenu ul {
    margin: 8px 0 0;
    padding-left: 18px;
    color: var(--text-dim);
}
#startMenu #instructions li { margin-bottom: 6px; line-height: 1.45; }
#startMenu .hl-perish { color: var(--m-orange); font-weight: 600; }

#settings ul { list-style: none; padding-left: 0; }
#settings label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 6px 10px 6px 0;
    color: var(--text-dim);
    cursor: pointer;
}
#settings input[type="checkbox"] { accent-color: var(--m-blue); width: 15px; height: 15px; }

#startMenu .input-error {
    display: block;
    color: var(--m-orange);
    opacity: 0;
    font-size: 12px;
    text-align: center;
    margin-top: 4px;
    transition: opacity 0.2s;
}

/* ---------- Modal (How to hunt / Deposit SOL) ---------- */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(3, 5, 10, 0.7);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}
.modal-overlay.open { display: flex; }
.modal {
    position: relative;
    width: 460px;
    max-width: calc(100vw - 32px);
    padding: 28px 26px 24px;
    border-radius: 18px;
    background: rgba(16, 20, 28, 0.97);
    border: 1px solid rgba(var(--m-blue-rgb), 0.35);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7), 0 0 60px rgba(var(--m-blue-rgb), 0.12);
    color: var(--text);
    animation: modalIn 0.18s ease;
}
@keyframes modalIn {
    from { transform: translateY(10px) scale(0.98); opacity: 0; }
    to   { transform: none; opacity: 1; }
}
.modal h3 {
    margin: 0 0 14px;
    font-family: 'Orbitron', sans-serif;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--m-blue);
}
.modal ul { margin: 0; padding-left: 20px; color: var(--text-dim); }
.modal li { margin-bottom: 10px; line-height: 1.5; }
.modal p { margin: 0 0 12px; color: var(--text-dim); line-height: 1.55; }
.modal .modal-soon { color: var(--m-orange); font-weight: 500; }
.modal .hl-perish { color: var(--m-orange); font-weight: 600; }
.modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 34px;
    height: 34px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 9px;
    color: var(--text-dim);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.modal-close:hover { background: rgba(255, 255, 255, 0.12); color: var(--text); }

/* ---------- In-game HUD ---------- */

#gameAreaWrapper {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--app-h, 100dvh);
    opacity: 0;
    z-index: 1;
}

#hudLeft {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 2;
    width: 260px;            /* exit (52) + gap (8) + weight (200) */
    display: flex;
    flex-direction: column;
    gap: 8px;
}
#hudTopRow {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

#weight {
    width: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 2px;
    padding: 10px 16px;
    background: rgba(10, 13, 18, 0.72);
    border: 1px solid rgba(var(--green-rgb), 0.4);
    border-radius: 12px;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    box-shadow: 0 0 22px rgba(var(--green-rgb), 0.18);
}
#weight .w-label {
    font-family: 'Orbitron', sans-serif;
    font-size: 11px;
    letter-spacing: 2px;
    color: var(--text-dim);
}
#weight .w-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
    color: var(--green);
    text-shadow: 0 0 12px rgba(var(--green-rgb), 0.7);
}
#weight .w-place {
    font-family: 'Orbitron', sans-serif;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--red);
    text-shadow: 0 0 10px rgba(var(--red-rgb), 0.5);
    margin-top: 3px;
}
#weight .w-coords {
    font-family: 'Orbitron', sans-serif;
    font-size: 11px;
    letter-spacing: 1px;
    color: var(--text-dim);
    margin-top: 2px;
    font-variant-numeric: tabular-nums;
}

/* Narrow exit button — same height/style as the MASS box, just an icon */
#exitBtn {
    flex: 0 0 52px;
    width: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 13, 18, 0.72);
    border: 1px solid rgba(var(--green-rgb), 0.4);
    border-radius: 12px;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: var(--green);
    cursor: pointer;
    box-shadow: 0 0 22px rgba(var(--green-rgb), 0.12);
    transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.2s, transform 0.12s;
}
#exitBtn:hover {
    transform: translateY(-1px);
    color: var(--red);
    border-color: rgba(var(--red-rgb), 0.65);
    box-shadow: 0 0 24px rgba(var(--red-rgb), 0.28);
}
#exitBtn:active { transform: translateY(0); }

#status {
    position: absolute;
    min-width: 230px;
    width: 230px;
    padding: 12px 14px;
    background: rgba(10, 13, 18, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: var(--text);
    font-family: 'Orbitron', sans-serif;
    font-size: 13px;
    top: 14px;
    right: 14px;
    z-index: 2;
}
#status .title {
    display: block;
    text-align: center;
    font-family: 'Orbitron', sans-serif;
    font-size: 18px;
    font-weight: 800;
    color: var(--green);
    letter-spacing: 1px;
    text-shadow: 0 0 12px rgba(var(--green-rgb), 0.6);
    margin-bottom: 2px;
}
#status .lb-note {
    display: block;
    text-align: center;
    font-family: 'Orbitron', sans-serif;
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 8px;
}
#status .lb-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 3px 6px;
    border-radius: 6px;
    font-weight: 600;
}
#status .lb-name {
    display: flex;
    align-items: baseline;
    gap: 7px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
#status .lb-rank {
    color: var(--text-dim);
    font-size: 12px;
    min-width: 16px;
}
#status .lb-mass {
    color: var(--green);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}
#status .lb-row.me {
    background: rgba(var(--red-rgb), 0.14);
}
#status .lb-row.me .lb-name,
#status .lb-row.me .lb-rank { color: var(--red); }
#status .lb-row.me .lb-mass { color: var(--red); }

.chatbox {
    position: static;       /* docked under the MASS panel in the left HUD column */
    width: 100%;
    height: 240px;
    display: flex;
    flex-direction: column;
    background: rgba(10, 13, 18, 0.72);
    border: 1px solid rgba(var(--green-rgb), 0.4);
    border-radius: 12px;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    box-shadow: 0 0 22px rgba(var(--green-rgb), 0.12);
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
    transition: height 0.25s ease;
    font-family: 'Orbitron', sans-serif;
}
.chatbox .chat-header {
    pointer-events: all;
    cursor: pointer;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 12px;
    font-family: 'Orbitron', sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--green);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    user-select: none;
}
.chatbox .chat-toggle { color: var(--text-dim); font-size: 12px; }
.chatbox.collapsed { height: 34px; }
.chatbox.collapsed .chat-list,
.chatbox.collapsed .chat-input { display: none; }
.chatbox.collapsed .chat-header { border-bottom: none; }
.chatbox .chat-list {
    flex: 1 1 auto;
    min-height: 0;
    padding: 8px;
    margin: 0;
    list-style: none;
    overflow: hidden;
    color: var(--text);
}
.chatbox .chat-list,
.chatbox .chat-list li,
.chatbox .chat-list li b,
.chatbox .chat-input {
    font-family: 'Orbitron', sans-serif;
    font-size: 12px;
    letter-spacing: 0.3px;
}
.chatbox .chat-list li { padding: 2px; margin: 3px; }
.chatbox .chat-list li.me b { color: var(--red); }
.chatbox .chat-list li.friend b { color: var(--green); }
.chatbox .chat-list li.system { color: #b07cff; font-style: italic; }
.chatbox .chat-list li.system:before { content: "» "; }
.chatbox .chat-input {
    pointer-events: all;
    width: 100%;
    padding: 9px;
    color: var(--text);
    background: transparent;
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    outline: none;
}
.chatbox .chat-input::placeholder { color: #5e6b78; }

/* ---------- Reward drop timer + coin firework ---------- */

/* Top-centre HUD stack: narrow room badge above the reward timer.
   The badge stretches to the timer's (content-driven) width. */
#topCenterHud {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 18px;
}
#roomBadge {
    align-self: stretch;
    padding: 3px 24px;
    border-radius: 10px;
    background: rgba(10, 13, 18, 0.78);
    border: 1px solid rgba(var(--m-blue-rgb), 0.45);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    box-shadow: 0 0 22px rgba(var(--m-blue-rgb), 0.16);
    text-align: center;
    font-family: 'Orbitron', sans-serif;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 2px;
    line-height: 1.1;
    color: var(--m-blue);
    text-shadow: 0 0 10px rgba(var(--m-blue-rgb), 0.5);
}
#roomBadge .rb-cap {
    color: var(--text-dim);
    text-shadow: none;
}

#rewardTimer {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 8px 24px;
    border-radius: 14px;
    background: rgba(10, 13, 18, 0.78);
    border: 1px solid rgba(var(--green-rgb), 0.4);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    box-shadow: 0 0 26px rgba(var(--green-rgb), 0.18);
    text-align: center;
}
#rewardTimer .rt-label {
    font-family: 'Orbitron', sans-serif;
    font-size: 9px;
    letter-spacing: 2px;
    color: var(--text-dim);
}
#rewardTimer .rt-time {
    font-family: 'Orbitron', sans-serif;
    font-size: 26px;
    font-weight: 800;
    line-height: 1.05;
    color: var(--green);
    text-shadow: 0 0 12px rgba(var(--green-rgb), 0.6);
    font-variant-numeric: tabular-nums;
}
#rewardTimer .rt-msg {
    font-family: 'Orbitron', sans-serif;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: var(--red);
    text-shadow: 0 0 12px rgba(var(--red-rgb), 0.6);
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: opacity 0.4s ease, max-height 0.4s ease, margin-top 0.4s ease;
}
#rewardTimer .rt-msg.show { max-height: 22px; opacity: 1; margin-top: 4px; }

#fireworkLayer {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    z-index: 6;
    pointer-events: none;
}
/* CSS-drawn gold coin (no emoji — renders the same on every device) */
.coin {
    position: absolute;
    left: 0;
    top: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #fff3b0, #ffd54a 45%, #f0a51e 100%);
    border: 1px solid rgba(255, 240, 180, 0.9);
    box-shadow: 0 0 12px rgba(255, 200, 60, 0.8);
    transform: translate(-50%, -50%);
    animation: coinFly 2s ease-out forwards;
    will-change: transform, opacity;
}
@keyframes coinFly {
    0%   { transform: translate(-50%, -50%) scale(0.3); opacity: 0; }
    12%  { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
    100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.85) rotate(320deg); opacity: 0; }
}
/* Small inline gold coin for the "Check your wallet" message (no emoji). */
.coin-ic {
    display: inline-block;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #fff3b0, #ffd54a 45%, #f0a51e 100%);
    border: 1px solid rgba(255, 240, 180, 0.9);
    vertical-align: -2px;
}

/* ---------- Mobile control buttons (blue) ---------- */

.ctrl-btn {
    position: absolute;
    bottom: 12px;
    width: 92px;
    height: 92px;
    padding: 18px;
    border-radius: 50%;
    background: rgba(10, 13, 18, 0.78);
    border: 6px solid #ff2d95;
    color: #ff5fae;
    cursor: pointer;
    z-index: 2;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    box-shadow: 0 0 22px rgba(255, 45, 149, 0.3);
    transition: transform 0.1s ease, box-shadow 0.2s ease;
}
.ctrl-btn svg { width: 100%; height: 100%; display: block; }
.ctrl-btn:active { transform: scale(0.92); box-shadow: 0 0 28px rgba(255, 45, 149, 0.5); }
/* Boost button, bottom-right. */
#boost { right: 16px; bottom: 16px; }

/* ---------- Mobile steer pad / joystick (bottom-left) ---------- */
#joystick {
    position: absolute;
    left: 72px;
    bottom: 72px;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: rgba(10, 13, 18, 0.5);
    border: 1px solid rgba(var(--green-rgb), 0.4);
    box-shadow: 0 0 22px rgba(var(--green-rgb), 0.16), inset 0 0 30px rgba(var(--green-rgb), 0.06);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    z-index: 2;
    touch-action: none;       /* never let the pad scroll/zoom the page */
}
/* The knob marks the live touch point + heading; it's moved via inline transform
   from JS. Hidden (faded) while the open-area drag has steering instead. */
#joystickKnob {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 62px;
    height: 62px;
    margin: -31px 0 0 -31px;
    border-radius: 50%;
    background: rgba(var(--green-rgb), 0.30);
    border: 1.5px solid rgba(var(--green-rgb), 0.7);
    box-shadow: 0 0 16px rgba(var(--green-rgb), 0.35);
    transition: transform 0.05s linear, opacity 0.15s ease;
    will-change: transform;
}
#joystick.joy-hidden #joystickKnob { opacity: 0; }

/* ---------- In-game controls hint ---------- */

#controlsHint {
    position: absolute;
    bottom: 26px;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    z-index: 3;
    padding: 11px 22px;
    border-radius: 999px;
    background: rgba(10, 13, 18, 0.8);
    border: 1px solid rgba(var(--green-rgb), 0.45);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: var(--text-dim);
    font-family: 'Orbitron', sans-serif;
    font-size: 13px;
    letter-spacing: 0.5px;
    white-space: nowrap;
    box-shadow: 0 0 26px rgba(var(--green-rgb), 0.18);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s ease, transform 0.6s ease;
}
#controlsHint b { color: var(--green); font-weight: 800; }
#controlsHint.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Pointer-based controls:
   - fine pointer (mouse/trackpad → laptop/PC, incl. touchscreen laptops):
     text hint only, no on-screen buttons.
   - coarse pointer (finger → phone/tablet without trackpad):
     on-screen buttons only, no text hint, no chat. */
#mobile { display: none; }
@media (pointer: coarse) {
    #mobile { display: block; }
    #controlsHint { display: none !important; }
}

/* ---------- "You lose" overlay ---------- */

#loseOverlay {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(3, 5, 10, 0.82);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}
#loseOverlay.show { display: flex; }
.lose-card {
    text-align: center;
    padding: 38px 44px;
    border-radius: 20px;
    background: rgba(16, 20, 28, 0.96);
    border: 1px solid rgba(var(--red-rgb), 0.45);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7), 0 0 70px rgba(var(--red-rgb), 0.18);
    animation: modalIn 0.2s ease;
}
.lose-title {
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    font-size: 50px;
    letter-spacing: 3px;
    background: linear-gradient(180deg, #ffd9c8 0%, var(--red) 60%, var(--red-2) 100%);
    -webkit-background-clip: text;
            background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 16px rgba(var(--red-rgb), 0.7));
    margin-bottom: 8px;
}
.lose-sub { margin: 0 0 22px; color: var(--text-dim); font-size: 14px; }
.lose-sub b { color: var(--text); font-variant-numeric: tabular-nums; }
#loseBackBtn {
    font-family: 'Orbitron', sans-serif;
    font-weight: 800;
    font-size: 14px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #fff;
    padding: 13px 30px;
    border: 0;
    border-radius: 12px;
    cursor: pointer;
    background: linear-gradient(135deg, var(--green), var(--cyan));
    box-shadow: 0 8px 24px rgba(var(--green-rgb), 0.4);
    transition: transform 0.12s ease, filter 0.2s ease;
}
#loseBackBtn:hover { transform: translateY(-2px); filter: brightness(1.08); }

/* ---------- Room selection screen ---------- */

#roomSelectWrapper {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 30;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
#roomSelectWrapper.show { display: flex; }

#roomSelect {
    position: relative;
    z-index: 1;
    width: 460px;
    max-width: calc(100vw - 32px);
    max-height: calc(100dvh - 40px);
    display: flex;
    flex-direction: column;
    padding: 30px 26px 24px;
    border-radius: 20px;
    background: var(--panel);
    border: 1px solid transparent;
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    box-shadow:
        0 40px 100px rgba(0, 0, 0, 0.7),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset,
        0 0 90px rgba(var(--m-blue-rgb), 0.10) inset;
}
#roomSelect::before {
    content: "";
    position: absolute;
    inset: -1.5px;
    border-radius: inherit;
    padding: 1.5px;
    background: conic-gradient(from var(--angle),
        var(--m-blue), var(--m-violet), var(--m-orange), var(--m-blue));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
            mask-composite: exclude;
    animation: rotateBorder 7s linear infinite;
    pointer-events: none;
    z-index: 2;
    opacity: 0.9;
}

.rs-title {
    margin: 0 0 4px;
    text-align: center;
    font-family: 'Orbitron', sans-serif;
    font-weight: 800;
    font-size: 24px;
    letter-spacing: 1px;
    color: #fff;
    text-transform: uppercase;
}
.rs-note {
    margin: 0 0 18px;
    text-align: center;
    font-family: 'Rubik', sans-serif;
    font-size: 13px;
    color: var(--text-dim);
}

.room-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    /* Show up to ~5 rooms; beyond that the list scrolls internally.
       (row ~52px + 10px gap) * 5 - last gap = ~300px */
    max-height: 300px;
    overflow-x: hidden;
    overflow-y: auto;
    padding-right: 4px;
}

.room-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 15px 18px;
    border: 0;
    border-radius: 13px;
    cursor: pointer;
    font-family: 'Orbitron', sans-serif;
    color: #fff;
    background: linear-gradient(135deg, #8a97ff, var(--m-blue) 45%, var(--m-blue-2));
    box-shadow: 0 8px 22px rgba(var(--m-blue-rgb), 0.35), 0 0 0 1px rgba(var(--m-blue-rgb), 0.5) inset;
    transition: transform 0.14s ease, box-shadow 0.25s ease, filter 0.25s ease;
}
.room-btn:hover {
    transform: translateY(-2px) scale(1.01);
    filter: brightness(1.08);
    box-shadow: 0 14px 32px rgba(var(--m-blue-rgb), 0.55), 0 0 24px rgba(var(--m-blue-rgb), 0.4);
}
.room-btn:active { transform: translateY(0) scale(1); }
.room-btn .rb-num { font-size: 17px; font-weight: 800; letter-spacing: 0.5px; white-space: nowrap; }
.room-btn .rb-count {
    font-size: 14px;
    font-weight: 600;
    font-family: 'Rubik', sans-serif;
    opacity: 0.95;
    white-space: nowrap;
}

.room-btn.full {
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-dim);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
    filter: none;
    transform: none;
}
.room-btn.full .rb-count { color: var(--m-orange); font-weight: 800; }

.rs-back {
    margin: 18px auto 0;
    padding: 10px 26px;
    border: 0;
    border-radius: 11px;
    cursor: pointer;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--m-orange);
    background: rgba(var(--m-orange-rgb), 0.07);
    box-shadow: 0 0 0 1px rgba(var(--m-orange-rgb), 0.45) inset;
    transition: transform 0.14s ease, background 0.25s ease;
}
.rs-back:hover { transform: translateY(-2px); background: rgba(var(--m-orange-rgb), 0.16); }
.rs-back:active { transform: translateY(0); }

input[type="image"]:focus { border: none; outline: 1px solid transparent; border-style: none; }
*:focus { outline: 1px solid transparent; border-style: none; }

/* ============================================================
   REGISTRATION SCREEN — variant #2 "neon arcade".
   Structurally NEW background (sunburst rays, not radial blobs),
   dark glossy glass card, lime + magenta neon, Bungee / Fredoka.
   Only colours / fonts / backgrounds / borders / shadows change —
   layout, positions and element sizes are left untouched.
   ============================================================ */

/* Base layer: dark gradient + soft centre glow (no dot grid, no blobs). */
body::before {
    background:
        radial-gradient(620px 460px at 50% 31%, rgba(170, 255, 0, 0.18), transparent 62%),
        radial-gradient(900px 700px at 50% 31%, rgba(255, 45, 149, 0.20), transparent 70%),
        linear-gradient(180deg, #1b0c3a 0%, #0c0620 100%) !important;
    background-size: auto !important;
}

/* Rays layer: an oversized conic sunburst that slowly rotates. Sized in vmax
   and centred on the burst origin so spinning never reveals the edges. */
/* Registered so the wedge width (an <angle>) can be animated inside the
   conic gradient — plain CSS can't interpolate gradient stops, Houdini can. */
@property --rayw {
    syntax: '<angle>';
    initial-value: 9deg;
    inherits: false;
}
body::after {
    content: "";
    position: fixed;
    /* Burst origin tracks the logo's centre (set in JS from its real position so
       it follows the logo across resolutions). Falls back to 50%/31%. */
    left: var(--burst-x, 50%);
    top: var(--burst-y, 31%);
    width: 260vmax;
    height: 260vmax;
    transform: translate(-50%, -50%);
    transform-origin: center;
    /* 18° period divides 360° exactly -> 20 evenly-spaced rays, no seam overlap.
       The bright wedge is centred on each period's bisector (9°) and grows
       symmetrically to both sides as --rayw animates. */
    background: repeating-conic-gradient(
        #140829 0deg,
        #140829 calc(9deg - var(--rayw) / 2),
        #2e1866 calc(9deg - var(--rayw) / 2),
        #2e1866 calc(9deg + var(--rayw) / 2),
        #140829 calc(9deg + var(--rayw) / 2),
        #140829 18deg
    );
    opacity: 0.85;
    pointer-events: none;
    z-index: 0;
    animation: rayWidth 7s ease-in-out infinite;
}
body.in-game::after { display: none; }
@keyframes rayWidth {
    0%, 100% { --rayw: 5deg; }
    50%      { --rayw: 13deg; }
}

/* Remove the decorative background circles. */
.blob { display: none !important; }

/* Dark glossy glass card with a glowing lime edge */
#startMenu {
    background: rgba(22, 12, 44, 0.78) !important;
    border: 2px solid #aaff00 !important;
    -webkit-backdrop-filter: blur(14px) !important;
    backdrop-filter: blur(14px) !important;
    box-shadow:
        0 0 0 1px rgba(170, 255, 0, 0.25) inset,
        0 0 42px rgba(170, 255, 0, 0.22),
        0 30px 80px rgba(0, 0, 0, 0.6) !important;
}
#startMenu::before { display: none !important; }
#startMenu::after { display: none !important; }

/* Tagline — bright lime, rounded gamey font */
.tagline {
    font-family: 'Fredoka', sans-serif !important;
    font-weight: 700 !important;
    background: none !important;
    -webkit-text-fill-color: initial !important;
    color: #c6ff5a !important;
    filter: drop-shadow(0 0 10px rgba(170, 255, 0, 0.5)) !important;
}

/* Name field — dark glass, neon lime focus */
#playerNameInput {
    font-family: 'Fredoka', sans-serif !important;
    font-weight: 600 !important;
    background: rgba(10, 6, 22, 0.85) !important;
    color: #f0ffe0 !important;
    border: 2px solid rgba(170, 255, 0, 0.5) !important;
}
#playerNameInput::placeholder { color: #7c6a9c !important; }
#playerNameInput:focus, #playerNameInput.focus {
    border-color: #aaff00 !important;
    box-shadow: 0 0 0 3px rgba(170, 255, 0, 0.22), 0 0 18px rgba(170, 255, 0, 0.35) !important;
}

/* Colour swatches — neon lime edge */
.swatch {
    border: 2px solid rgba(170, 255, 0, 0.55) !important;
    background: rgba(10, 6, 22, 0.85) !important;
}

/* Buttons — glossy neon with a chunky 3D base, blocky Bungee font */
#startButton, #settingsButton {
    font-family: 'Bungee', cursive !important;
    letter-spacing: 1px !important;
    text-transform: none !important;
    border: 0 !important;
    animation: none !important;
}
#startButton {
    color: #14250a !important;
    background: linear-gradient(180deg, #c6ff5a, #8ed600) !important;
    box-shadow: 0 8px 0 #5a8a00, 0 12px 26px rgba(170, 255, 0, 0.4) !important;
}
#startButton::after { display: none !important; }
#startButton:hover {
    transform: translateY(-2px) !important;
    filter: brightness(1.05) !important;
    box-shadow: 0 10px 0 #5a8a00, 0 16px 30px rgba(170, 255, 0, 0.5) !important;
}
#startButton:active {
    transform: translateY(4px) !important;
    box-shadow: 0 4px 0 #5a8a00, 0 6px 16px rgba(170, 255, 0, 0.35) !important;
}
#settingsButton {
    color: #fff !important;
    background: linear-gradient(180deg, #ff5fae, #e0218a) !important;
    box-shadow: 0 8px 0 #8a1456, 0 12px 26px rgba(255, 45, 149, 0.4) !important;
}
#settingsButton:hover {
    transform: translateY(-2px) !important;
    filter: brightness(1.05) !important;
    box-shadow: 0 10px 0 #8a1456, 0 16px 30px rgba(255, 45, 149, 0.5) !important;
}
#settingsButton:active {
    transform: translateY(4px) !important;
    box-shadow: 0 4px 0 #8a1456, 0 6px 16px rgba(255, 45, 149, 0.35) !important;
}

.input-error { color: #ff5fae !important; }

/* ============================================================
   NEON ARCADE — room picker + in-game HUD.
   Repaints the shared accent variables to the lime/magenta theme
   (registration screen is unaffected — it uses hard-coded colours),
   then swaps fonts and restyles the room picker to match.
   ============================================================ */
:root {
    --green: #aaff00;
    --green-2: #8ed600;
    --green-rgb: 170, 255, 0;
    --red: #ff2d95;
    --red-2: #e0218a;
    --red-rgb: 255, 45, 149;
    --cyan: #ff5fae;
    --m-blue: #aaff00;
    --m-blue-2: #8ed600;
    --m-blue-rgb: 170, 255, 0;
    --m-violet: #ff5fae;
    --m-orange: #ff2d95;
    --m-orange-2: #e0218a;
    --m-orange-rgb: 255, 45, 149;
    --panel: rgba(22, 12, 44, 0.82);
}

/* Blocky Bungee for labels / numbers / headings */
#status, #status .title, #status .lb-note, .lb-row, .lb-rank, .lb-mass,
.rt-label, .rt-time, #roomBadge, #roomBadge .rb-cap,
.w-label, .w-value, .w-place, .w-coords,
.rs-title, .room-btn, .room-btn .rb-num, .room-btn .rb-count, .rs-back,
.lose-title, #loseBackBtn, .chat-title,
.rp-label, .rp-value,
.re-title, .re-rank, .re-name, .re-mass, #roundContinueBtn,
.buy-line, .buy-stepper #buyQtyNum, .buy-actions button {
    font-family: 'Bungee', cursive !important;
    letter-spacing: 0.3px !important;
}
/* Rounded Fredoka for running text */
.lb-name, .rt-msg, .lose-sub, .chat-input, #chatList, #chatList li, #controlsHint,
.re-sub, .re-newround, .ab .cap {
    font-family: 'Fredoka', sans-serif !important;
}

/* ----- Room picker (matches the neon menu card) ----- */
#roomSelect {
    border: 2px solid #aaff00 !important;
    box-shadow:
        0 0 0 1px rgba(170, 255, 0, 0.25) inset,
        0 0 42px rgba(170, 255, 0, 0.22),
        0 30px 80px rgba(0, 0, 0, 0.6) !important;
}
#roomSelect::before { display: none !important; }
.rs-title { color: #c6ff5a !important; text-shadow: 0 0 12px rgba(170, 255, 0, 0.5) !important; }

.room-btn {
    color: #14250a !important;
    background: linear-gradient(180deg, #c6ff5a, #8ed600) !important;
    box-shadow: 0 6px 0 #5a8a00, 0 10px 22px rgba(170, 255, 0, 0.35) !important;
}
.room-btn .rb-count { color: #1c3a06 !important; }
.room-btn:hover {
    transform: translateY(-2px) !important;
    filter: brightness(1.05) !important;
    box-shadow: 0 8px 0 #5a8a00, 0 14px 26px rgba(170, 255, 0, 0.45) !important;
}
.room-btn:active { transform: translateY(3px) !important; box-shadow: 0 3px 0 #5a8a00 !important; }
.room-btn.full {
    background: rgba(255, 45, 149, 0.14) !important;
    color: #ff8fc0 !important;
    box-shadow: 0 0 0 1px rgba(255, 45, 149, 0.4) inset !important;
    transform: none !important;
}
.room-btn.full .rb-count { color: #ff2d95 !important; }
.rs-back {
    color: #ff5fae !important;
    background: rgba(255, 45, 149, 0.1) !important;
    box-shadow: 0 0 0 1px rgba(255, 45, 149, 0.5) inset !important;
}
.rs-back:hover { background: rgba(255, 45, 149, 0.2) !important; }

/* ----- In-game leaderboard accent ----- */
#status .lb-row.me { background: rgba(255, 45, 149, 0.16) !important; }

/* Top-3 podium highlight: gold / silver / bronze medal on the rank pill. */
#status .lb-top .lb-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    min-width: 18px;
    border-radius: 50%;
    color: #10141c !important;
    font-weight: 800;
    text-shadow: none;
}
#status .lb-top1 { background: linear-gradient(90deg, rgba(255, 213, 74, 0.20), transparent) !important; }
#status .lb-top1 .lb-rank { background: #ffd54a; box-shadow: 0 0 10px rgba(255, 213, 74, 0.75); }
#status .lb-top1 .lb-mass { color: #ffd54a !important; }
#status .lb-top2 { background: linear-gradient(90deg, rgba(213, 222, 235, 0.16), transparent) !important; }
#status .lb-top2 .lb-rank { background: #d5deeb; box-shadow: 0 0 10px rgba(213, 222, 235, 0.6); }
#status .lb-top3 { background: linear-gradient(90deg, rgba(232, 152, 94, 0.18), transparent) !important; }
#status .lb-top3 .lb-rank { background: #e8985e; box-shadow: 0 0 10px rgba(232, 152, 94, 0.65); }

/* ----- Reward pool HUD: neon lime instead of v1 gold ----- */
#rewardPool {
    border-color: rgba(170, 255, 0, 0.45) !important;
    box-shadow: 0 0 26px rgba(170, 255, 0, 0.18) !important;
}
#rewardPool .rp-value {
    color: #c6ff5a !important;
    text-shadow: 0 0 12px rgba(170, 255, 0, 0.55) !important;
}

/* ----- Round-end winners screen: candy neon (lime win + magenta/pink) ----- */
.re-card {
    border: 2px solid #aaff00 !important;
    box-shadow:
        0 0 0 1px rgba(170, 255, 0, 0.25) inset,
        0 0 48px rgba(170, 255, 0, 0.22),
        0 30px 80px rgba(0, 0, 0, 0.65) !important;
}
.re-title {
    background: linear-gradient(180deg, #eaffc0 0%, #c6ff5a 55%, #8ed600 100%) !important;
    -webkit-background-clip: text !important;
            background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    filter: drop-shadow(0 0 16px rgba(170, 255, 0, 0.6)) !important;
}
.re-mass { color: #c6ff5a !important; text-shadow: 0 0 10px rgba(170, 255, 0, 0.4) !important; }
.re-newround { color: #ff5fae !important; }
/* Podium accents in the game's palette: 1st lime, 2nd magenta, 3rd pink. */
.re-place-1 { border-color: rgba(170, 255, 0, 0.6) !important; box-shadow: inset 3px 0 0 #aaff00 !important; }
.re-place-1 .re-rank { color: #c6ff5a !important; }
.re-place-2 { border-color: rgba(255, 45, 149, 0.55) !important; box-shadow: inset 3px 0 0 #ff2d95 !important; }
.re-place-2 .re-rank { color: #ff2d95 !important; }
.re-place-3 { border-color: rgba(255, 95, 174, 0.55) !important; box-shadow: inset 3px 0 0 #ff5fae !important; }
.re-place-3 .re-rank { color: #ff5fae !important; }
/* Chunky 3D lime button, matching Play / room buttons. */
#roundContinueBtn {
    color: #14250a !important;
    background: linear-gradient(180deg, #c6ff5a, #8ed600) !important;
    box-shadow: 0 8px 0 #5a8a00, 0 12px 26px rgba(170, 255, 0, 0.4) !important;
    text-transform: none !important;
}
#roundContinueBtn:hover {
    transform: translateY(-2px) !important;
    filter: brightness(1.05) !important;
    box-shadow: 0 10px 0 #5a8a00, 0 16px 30px rgba(170, 255, 0, 0.5) !important;
}
#roundContinueBtn:active { transform: translateY(4px) !important; box-shadow: 0 4px 0 #5a8a00 !important; }

/* ============================================================
   Small screens (<768px): the game isn't playable on phones.
   On the start menu keep only the rewards tagline and replace the
   play controls (name field, colour swatches, both buttons) with a
   notice telling the player to use a bigger screen.
   ============================================================ */
.mobile-block-msg { display: none; }
@media (max-width: 767px) {
    #startMenu .name-row,
    #startMenu .input-error,
    #startMenu > a,
    #startMenu #startButton,
    #startMenu #settingsButton { display: none !important; }

    .mobile-block-msg {
        display: block;
        margin: 18px 0 4px;
        padding: 0 6px;
        text-align: center;
        font-family: 'Rubik', sans-serif;
        font-weight: 600;
        font-size: 16px;
        line-height: 1.5;
        color: #ffd9a8;
    }
}

/* ============================================================
   Paid abilities UI (ported from v1): action buttons, badges,
   countdown timers, buy-more modal, side banner, 3-column rules.
   ============================================================ */

/* ---------- Side banner (start screen) ---------- */
#sideBanner {
    position: fixed;
    right: 24px;
    top: 16%;
    width: 250px;
    z-index: 2;
    padding: 18px 20px;
    border-radius: 16px;
    background: rgba(10, 13, 18, 0.55);
    border: 1px solid rgba(var(--m-orange-rgb), 0.4);
    box-shadow: 0 12px 44px rgba(0, 0, 0, 0.5), 0 0 40px rgba(var(--m-orange-rgb), 0.12);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: var(--m-orange);
    /* Match the tagline typeface (rounded Fredoka). */
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
    font-size: 13px;
    line-height: 1.55;
}
@media (max-width: 767px) { #sideBanner { display: none; } }
body.in-game #sideBanner,
body.queueing #sideBanner { display: none; }

/* ---------- 3-column rules modal ---------- */
.modal-wide { width: 880px; }
.modal-cols {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 26px;
}
/* Match the candy buttons' typeface (PLAY / How to hunt). */
.modal-col h3 {
    margin: 0 0 12px;
    font-size: 18px;
    font-family: 'Bungee', cursive;
    letter-spacing: 1px;
    text-transform: none;
}
.modal-col.col-rules h3 { color: var(--green); }
.modal-col.col-rules li b.hl-top3 { color: #ff2d95; }
.modal-col.col-extra h3 { color: var(--m-orange); }
.modal-col.col-extra li b { color: var(--m-orange); }
.modal-col.col-extra .extra-note {
    margin: 14px 0 0;
    color: var(--m-orange);
    font-size: 13px;
    line-height: 1.5;
    font-weight: 700;
}
.modal-col-sub { margin: 0 0 12px; color: var(--text); font-weight: 600; font-size: 13px; }
@media (max-width: 820px) {
    .modal-cols { grid-template-columns: 1fr; gap: 18px; }
}

/* ---------- Action buttons (Rocket / Saw), bottom-right ---------- */
#actionBtns {
    position: absolute;
    right: 16px;
    bottom: 16px;
    z-index: 2;
    display: flex;
    align-items: flex-end;
    gap: 14px;
}
/* On touch the boost button sits bottom-right, so stack the abilities ABOVE it. */
@media (pointer: coarse) {
    #actionBtns { flex-direction: column; align-items: center; bottom: 124px; }
}
.ab {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
}
/* Hover tooltip for Rocket / Saw (desktop only — touch has no hover). */
.ab .tip {
    position: absolute;
    bottom: calc(100% + 10px);
    right: 0;
    width: 244px;
    padding: 10px 13px;
    border-radius: 10px;
    background: rgba(10, 13, 18, 0.96);
    border: 1px solid rgba(127, 119, 221, 0.5);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55), 0 0 18px rgba(127, 119, 221, 0.25);
    color: #eef1fb;
    font-family: 'Rubik', sans-serif;
    font-size: 13px;
    line-height: 1.45;
    text-align: left;
    opacity: 0;
    transform: translateY(4px);
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 5;
}
.ab:hover .tip { opacity: 1; transform: translateY(0); }
.ab .tip .tip-hl { color: #ff2d95; }
/* Countdown pill, shown above the button while the ability is active. */
.ab-timer {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(10, 13, 18, 0.92);
    border: 1px solid rgba(150, 240, 255, 0.6);
    color: #b6f4ff;
    font-family: 'Orbitron', sans-serif;
    font-size: 12px;
    letter-spacing: 0.5px;
    white-space: nowrap;
    box-shadow: 0 0 14px rgba(150, 240, 255, 0.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 6;
}
.ab-timer.on { opacity: 1; }
.ab-timer.vamp {
    border-color: rgba(255, 80, 80, 0.7);
    color: #ff8a8a;
    box-shadow: 0 0 14px rgba(255, 60, 60, 0.3);
}
.ab .cap {
    font-family: 'Orbitron', sans-serif;
    font-size: 12px;
    letter-spacing: 0.5px;
    color: #fff;
    padding: 3px 11px;
    border-radius: 999px;
    background: rgba(10, 13, 18, 0.8);
    border: 1px solid rgba(var(--green-rgb), 0.4);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}
/* Holo-gradient round button: conic ring with a dark inset face. */
/* Paid ability buttons: thick neon-green ring, dark face, green icon. */
.gbtn {
    width: 64px;
    height: 64px;
    padding: 0;
    border: 6px solid #aaff00;
    border-radius: 50%;
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #c6ff5a;
    background: radial-gradient(circle at 50% 35%, #10162a, #0a0e1a);
    box-shadow: 0 0 18px rgba(170, 255, 0, 0.45), inset 0 0 12px rgba(170, 255, 0, 0.12);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation; /* instant taps, even as a 2nd finger mid-steer */
    transition: transform 0.12s ease, box-shadow 0.2s ease;
}
.gbtn::before { display: none; }
.gbtn svg { width: 34px; height: 34px; display: block; position: relative; z-index: 1; }
/* Rocket pause/play overlay: darkens the button, green neon icon on top. */
.ab-control {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(3, 6, 12, 0.82);
    color: #ff5fae;
    pointer-events: none; /* taps pass through to the button (pause/resume toggle) */
    z-index: 3;
}
.ab-control.on { display: flex; }
.ab-control svg { width: 40px; height: 40px; filter: drop-shadow(0 0 7px rgba(255, 45, 149, 0.8)); }
.gbtn:hover { transform: translateY(-2px); }
.gbtn:active { transform: scale(0.92); box-shadow: 0 0 26px rgba(170, 255, 0, 0.6); }

.gbtn-wrap { position: relative; display: inline-flex; }
.ability-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 21px;
    height: 21px;
    padding: 0 4px;
    border-radius: 999px;
    background: #ff2d95;
    border: 2px solid #0a0d15;
    color: #fff;
    font-family: 'Rubik', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    font-size: 12px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---------- Buy-more modal (top of screen, non-blocking) ---------- */
#buyModal {
    position: absolute;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    display: none;
}
#buyModal.show { display: block; }
.buy-card {
    width: 280px;
    max-width: calc(100vw - 32px);
    padding: 18px 20px;
    border-radius: 16px;
    background: rgba(12, 16, 26, 0.97);
    border: 1px solid rgba(var(--red-rgb), 0.5);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.7), 0 0 50px rgba(var(--red-rgb), 0.18);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    text-align: center;
    font-family: 'Rubik', sans-serif;
}
.buy-line {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 16px;
    color: #fff;
}
.buy-line #buyTotal, .buy-line #buyQty { color: var(--m-orange); }
.buy-balance {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
    color: var(--text-dim);
    font-size: 13px;
}
.buy-balance .wallet-ic { width: 18px; height: 18px; color: var(--m-orange); }
.buy-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin: 16px 0;
}
.buy-stepper button {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}
.buy-stepper button:disabled { opacity: 0.3; cursor: default; }
.buy-stepper #buyQtyNum {
    min-width: 28px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 800;
    font-size: 22px;
    color: #fff;
}
.buy-actions { display: flex; gap: 10px; }
.buy-actions button {
    flex: 1;
    height: 40px;
    border-radius: 10px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
}
#buyCancel { background: transparent; border: 1px solid rgba(255, 255, 255, 0.25); color: var(--text-dim); }
#buyConfirm {
    background: var(--m-orange);
    border: 1px solid var(--m-orange);
    color: #1a0c06;
}
#buyConfirm:disabled { opacity: 0.4; cursor: default; }

/* ============================================================
   Reward pool HUD (center) + round-end winners screen (ported from v1).
   ============================================================ */

/* ---------- Reward pool block (top center, under the timer) ---------- */
#rewardPool {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 22px;
    border-radius: 14px;
    background: rgba(10, 13, 18, 0.78);
    border: 1px solid rgba(255, 210, 74, 0.45);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    box-shadow: 0 0 26px rgba(255, 200, 60, 0.16);
    text-align: center;
}
#rewardPool .rp-label {
    font-family: 'Orbitron', sans-serif;
    font-size: 9px;
    letter-spacing: 2px;
    color: var(--text-dim);
}
#rewardPool .rp-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 26px;
    font-weight: 800;
    line-height: 1.05;
    color: #ffd24a;
    text-shadow: 0 0 12px rgba(255, 200, 60, 0.6);
    font-variant-numeric: tabular-nums;
}
#rewardPool .rp-unit { font-size: 14px; opacity: 0.9; }

/* ---------- Round-end winners screen ---------- */
#roundEndOverlay {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(3, 5, 10, 0.88);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}
#roundEndOverlay.show { display: flex; }
#reFireworkLayer {
    position: absolute;
    top: 42%;
    left: 50%;
    width: 0;
    height: 0;
    z-index: 0;
    pointer-events: none;
}
.re-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 580px;
    text-align: center;
    padding: 34px 38px;
    border-radius: 22px;
    background: rgba(16, 20, 28, 0.97);
    border: 1px solid rgba(255, 210, 74, 0.5);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7), 0 0 80px rgba(255, 200, 60, 0.18);
    animation: modalIn 0.2s ease;
}
.re-title {
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    font-size: 40px;
    letter-spacing: 2px;
    text-transform: uppercase;
    background: linear-gradient(180deg, #fff3b0 0%, #ffd24a 55%, #f0a51e 100%);
    -webkit-background-clip: text;
            background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 16px rgba(255, 200, 60, 0.6));
    margin-bottom: 6px;
}
.re-sub { margin: 0 0 20px; color: var(--text); font-size: 15px; font-weight: 600; }
.re-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
    max-height: 46vh;
    overflow-y: auto;
}
.re-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.re-rank {
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    font-size: 24px;
    min-width: 34px;
    text-align: center;
    color: var(--text-dim);
}
.re-name {
    text-align: left;
    font-family: 'Orbitron', sans-serif;
    font-weight: 800;
    font-size: 20px;
    color: #fff;
    overflow-wrap: anywhere;
}
.re-mass {
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    font-size: 24px;
    color: var(--green);
    font-variant-numeric: tabular-nums;
}
.re-place-1 { border-color: rgba(255, 210, 74, 0.6); box-shadow: inset 3px 0 0 #ffd24a; }
.re-place-1 .re-rank { color: #ffd24a; }
.re-place-2 { border-color: rgba(207, 216, 230, 0.55); box-shadow: inset 3px 0 0 #cfd8e6; }
.re-place-2 .re-rank { color: #cfd8e6; }
.re-place-3 { border-color: rgba(224, 152, 90, 0.55); box-shadow: inset 3px 0 0 #e0985a; }
.re-place-3 .re-rank { color: #e0985a; }
.re-newround { margin: 0 0 22px; color: #ffd24a; font-weight: 700; font-size: 16px; line-height: 1.5; }
#roundContinueBtn {
    font-family: 'Orbitron', sans-serif;
    font-weight: 800;
    font-size: 15px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #14250a;
    padding: 14px 40px;
    border: 0;
    border-radius: 12px;
    cursor: pointer;
    background: linear-gradient(135deg, #ffd24a, #f0a51e);
    box-shadow: 0 8px 24px rgba(255, 200, 60, 0.4);
    transition: transform 0.12s ease, filter 0.2s ease;
}
#roundContinueBtn:hover { transform: translateY(-2px); filter: brightness(1.08); }

/* ===== Waiting queue ============================================== */
/* While queued we hide the in-game HUD so only the glassy queue overlay shows
   over the live-game canvas. */
body.queueing { background: #05060a; height: var(--app-h, 100dvh); }
body.queueing #hudLeft,
body.queueing #topCenterHud,
body.queueing #status,
body.queueing #actionBtns,
body.queueing #mobile,
body.queueing #controlsHint,
body.queueing #buyModal,
body.queueing #fireworkLayer { display: none !important; }

#queueWrapper {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 22px;
    overflow: hidden;                       /* the page itself never scrolls */
    /* Keep the live game SHARP — only a faint vignette, no full-screen blur.
       The frosting lives on the panels (see below). */
    background: radial-gradient(ellipse at center, rgba(6, 4, 16, 0.12) 0%, rgba(6, 4, 16, 0.42) 100%);
}
#queueWrapper.show { display: flex; }

/* Blinking LIVE light (top-left), like a recording indicator. */
.q-live {
    position: absolute;
    top: 18px;
    left: 18px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px 6px 10px;
    border-radius: 999px;
    background: rgba(10, 6, 16, 0.6);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 45, 149, 0.4);
    font-family: 'Bungee', cursive;
    font-size: 12px;
    letter-spacing: 1px;
    color: #fff;
}
.q-live-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ff2d40;
    box-shadow: 0 0 8px 2px rgba(255, 45, 64, 0.8);
    animation: qLiveBlink 1.1s steps(1, end) infinite;
}
@keyframes qLiveBlink { 0%, 60% { opacity: 1; } 61%, 100% { opacity: 0.18; } }

/* ===== Room-full modal ============================================ */
.full-card {
    width: 420px;
    text-align: center;
    border-color: rgba(255, 45, 149, 0.4) !important;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7), 0 0 60px rgba(255, 45, 149, 0.14) !important;
}
.full-card .full-title {
    font-family: 'Bungee', cursive;
    font-size: 26px;
    letter-spacing: 0.5px;
    color: #ff5fae;
    text-shadow: 0 0 16px rgba(255, 45, 149, 0.55);
}
.full-card .full-msg { margin: 0 0 20px; }
#fullOkBtn {
    font-family: 'Bungee', cursive;
    font-size: 14px;
    letter-spacing: 0.5px;
    color: #2a0716;
    padding: 12px 34px;
    border: 0;
    border-radius: 12px;
    cursor: pointer;
    background: linear-gradient(135deg, #ff5fae, #ff2d95);
    box-shadow: 0 8px 24px rgba(255, 45, 149, 0.4);
    transition: transform 0.12s ease, filter 0.2s ease;
}
#fullOkBtn:hover { transform: translateY(-2px); filter: brightness(1.07); }

.q-card {
    position: relative;
    width: min(980px, 95vw);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    gap: 14px;
    animation: modalIn 0.2s ease;
}

/* Frosted "glass" panels: see the game faintly through them. */
.q-head,
.q-listwrap,
.q-howto {
    background: rgba(16, 12, 30, 0.72);
    border: 1px solid rgba(255, 45, 149, 0.28);
    border-radius: 16px;
    -webkit-backdrop-filter: blur(7px);
    backdrop-filter: blur(7px);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5), 0 0 36px rgba(255, 45, 149, 0.1);
}

.q-head { padding: 18px 22px; text-align: center; }
.q-title {
    margin: 0 0 6px;
    font-family: 'Bungee', cursive;
    font-size: 26px;
    letter-spacing: 0.5px;
    color: #fff;
    text-shadow: 0 0 16px rgba(255, 45, 149, 0.55);
}
.q-sub { margin: 0 0 12px; color: var(--text-dim); font-family: 'Fredoka', sans-serif; font-size: 14px; }
.q-pos {
    font-family: 'Fredoka', sans-serif;
    font-size: 18px;
    color: var(--text);
    font-weight: 600;
}
.q-pos span {
    font-family: 'Bungee', cursive;
    font-size: 26px;
    color: #aaff00;
    text-shadow: 0 0 14px rgba(170, 255, 0, 0.55);
    margin-left: 4px;
}

/* Sponsor button — as wide as the list, bold pink. */
.q-sponsor {
    flex: 0 0 auto;
    width: 100%;
    padding: 15px 20px;
    border: 0;
    border-radius: 14px;
    cursor: pointer;
    font-family: 'Bungee', cursive;
    font-size: 17px;
    letter-spacing: 0.5px;
    color: #2a0716;
    background: linear-gradient(135deg, #ff5fae, #ff2d95);
    box-shadow: 0 8px 24px rgba(255, 45, 149, 0.4), 0 0 0 1px rgba(255, 120, 185, 0.6) inset;
    transition: transform 0.12s ease, filter 0.2s ease;
}
.q-sponsor b { color: #fff; }
.q-sponsor:hover { transform: translateY(-2px); filter: brightness(1.07); }
.q-sponsor:active { transform: translateY(1px); }

/* Body row: scrollable list on the left, fixed how-to box on the right. */
.q-body {
    flex: 1 1 auto;
    min-height: 0;                          /* lets the list scroll inside */
    display: flex;
    gap: 14px;
}
.q-listwrap {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 10px;
}
.q-list { display: flex; flex-direction: column; gap: 6px; }
.q-row {
    display: grid;
    grid-template-columns: 34px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.q-rank {
    font-family: 'Bungee', cursive;
    font-size: 14px;
    color: var(--text-dim);
    text-align: center;
}
.q-name {
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.q-bid {
    font-family: 'Bungee', cursive;
    font-size: 12px;
    letter-spacing: 0.5px;
    color: var(--text-dim);
}
/* Paid rows ride above the free crowd — tint them pink. */
.q-row.paid {
    background: rgba(255, 45, 149, 0.12);
    border-color: rgba(255, 45, 149, 0.4);
}
.q-row.paid .q-bid { color: #ff5fae; }
.q-row.paid .q-rank { color: #ff8fc0; }
/* Your own row stands out. */
.q-row.me {
    background: rgba(170, 255, 0, 0.14);
    border-color: rgba(170, 255, 0, 0.5);
}
.q-row.me .q-name { color: #c6ff5a; }
.q-row.me.paid { background: rgba(255, 45, 149, 0.22); border-color: rgba(255, 45, 149, 0.7); }

/* How-to box — the paid-jump rules, idiot-proof. */
.q-howto {
    flex: 0 0 264px;
    padding: 16px 18px;
    overflow-y: auto;
}
.q-howto h3 {
    margin: 0 0 10px;
    font-family: 'Bungee', cursive;
    font-size: 15px;
    color: #ff5fae;
}
.q-howto p {
    margin: 0 0 11px;
    font-family: 'Fredoka', sans-serif;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-dim);
}
.q-howto p b { color: var(--text); }
.q-howto .q-hl-free { color: #aaff00; }
.q-howto .q-hl-pay { color: #ff5fae; }
.q-howto-foot { margin-top: 14px !important; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, 0.1); }

.q-back {
    flex: 0 0 auto;
    align-self: center;
    padding: 10px 34px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-dim);
    font-family: 'Bungee', cursive;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.q-back:hover { background: rgba(255, 255, 255, 0.12); color: var(--text); }

/* Narrow screens: stack the how-to under the list. */
@media (max-width: 760px) {
    .q-body { flex-direction: column; }
    .q-howto { flex: 0 0 auto; }
}

/* ===== Token CA bar + wallet header (crypto layer) ================ */
#caBar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 30px;
    padding: 0 12px;
    background: rgba(10, 6, 16, 0.92);
    border-bottom: 1px solid rgba(255, 45, 149, 0.35);
    font-family: 'Rubik', sans-serif;
    font-size: 12px;
    color: var(--text);
}
#caBar .ca-label {
    font-family: 'Bungee', cursive;
    font-size: 11px;
    color: #ff5fae;
    letter-spacing: 1px;
}
#caBar #caValue { font-family: monospace; opacity: 0.9; overflow: hidden; text-overflow: ellipsis; max-width: 70vw; white-space: nowrap; }
#caBar #caClose {
    background: transparent; border: 0; color: var(--text-dim);
    font-size: 18px; line-height: 1; cursor: pointer; padding: 0 4px;
}
#caBar #caClose:hover { color: var(--text); }
body.ca-open #topRightBar { top: 38px; }

#topRightBar {
    position: fixed;
    top: 12px;
    right: 14px;
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 10px;
}
.x-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(16, 12, 30, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #fff;
    transition: background 0.15s ease, transform 0.1s ease;
}
.x-link:hover { background: rgba(255, 255, 255, 0.14); transform: translateY(-1px); }
#caBar #caValue a { color: #ff8fc0; text-decoration: none; }
#caBar #caValue a:hover { text-decoration: underline; }
.wallet-widget {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Rubik', sans-serif;
}
.wallet-widget button {
    cursor: pointer;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(16, 12, 30, 0.82);
    color: var(--text);
    font-family: 'Rubik', sans-serif;
    font-size: 13px;
    padding: 7px 11px;
    transition: background 0.15s ease, transform 0.1s ease;
}
.wallet-widget button:hover { background: rgba(255, 255, 255, 0.12); }
.ww-addr { display: flex; align-items: center; gap: 6px; }
.ww-sol-ic { width: 10px; height: 10px; border-radius: 50%; background: linear-gradient(135deg, #9945ff, #14f195); }
.ww-addr-text { font-family: monospace; }
.ww-caret { color: var(--text-dim); font-size: 11px; }
.ww-bal { font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.ww-bal i { font-style: normal; color: #ff5fae; }
.ww-export { color: #c6ff5a; border-color: rgba(170, 255, 0, 0.4) !important; }
.ww-logout { display: inline-flex; align-items: center; justify-content: center; color: var(--text-dim); padding: 7px 9px !important; }
.ww-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 280px;
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(16, 12, 30, 0.97);
    border: 1px solid rgba(255, 45, 149, 0.3);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
    text-align: left;
}
.ww-panel-head { font-family: 'Bungee', cursive; font-size: 13px; color: #ff5fae; margin-bottom: 10px; }
.ww-bal-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-dim); margin-bottom: 6px; }
.ww-bal-row b { color: var(--text); font-variant-numeric: tabular-nums; }
.ww-dep-label { font-size: 12px; color: var(--text-dim); margin: 10px 0 6px; }
.ww-dep-addr { width: 100%; word-break: break-all; font-family: monospace; font-size: 11px; text-align: left; }
.ww-qr { display: block; width: 150px; height: 150px; margin: 10px auto 0; border-radius: 10px; background: #fff; padding: 6px; }

/* Touch / small screens: keep the wallet header compact. */
@media (max-width: 640px) {
    .ww-bal, .ww-deposit { display: none; }
}
