/* WAZARDS - the look.
   Menus, panels and the HUD use a clean modern style (fonts: Oswald for titles and buttons, Inter for text).
   Pixel art is kept only for the spell and gear cards (and the little pixel icons). */
* { box-sizing: border-box; user-select: none; -webkit-user-select: none; margin: 0; padding: 0; }
:root {
    --ui-font: 'Oswald', 'Arial Narrow', Arial, sans-serif;     /* titles, buttons, labels */
    --body-font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;   /* everything you read */
    --pixel-font: 'Press Start 2P', 'Courier New', monospace;   /* only on the cards */
    --read-font: 'VT323', 'Menlo', 'Consolas', monospace;       /* only on the cards */
    /* colours from the WAZARDS logo */
    --purple: #9d4edd; --purple-hi: #b366f0; --purple-deep: #3c1f66;
    --blue: #4aa3e8; --gold: #f2c14e;
    --bg: #0e0b1c; --panel: rgba(20, 16, 36, 0.92); --panel-2: #241d3e; --panel-3: #2f2750;
    --line: rgba(255, 255, 255, 0.09); --line-2: rgba(255, 255, 255, 0.16);
    --text: #ece8f7; --muted: #9b94b8; --dim: #6d6690;
    --radius: 10px;
    /* (older names, still used in places) */
    --ui-dark: #141026; --ui-mid: #241d3e; --ui-light: #3a3160; --ui-gold: #f2c14e;
}
body {
    background: radial-gradient(ellipse at 50% 20%, #1d1538 0%, var(--bg) 60%);
    color: var(--text);
    font-family: var(--body-font);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-height: 100vh; overflow: hidden;
}
#game-container {
    position: relative;
    width: 1120px; height: 630px;
    overflow: hidden;
    border-radius: 14px;
    box-shadow: 0 0 0 1px var(--line-2), 0 30px 80px rgba(0, 0, 0, 0.7);
    background: #000;
}
canvas { display: block; }
#arena3d {
    position: absolute; top: 0; left: 0;
    width: 1120px; height: 630px;
    image-rendering: -moz-crisp-edges;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
}
#arena {
    position: absolute; top: 0; left: 0;
    width: 1120px; height: 630px;
    background: transparent;
    cursor: crosshair;
}
#webgl-error {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    text-align: center; font-size: 16px; line-height: 1.7; color: #fca5a5; background: var(--bg); padding: 40px; z-index: 30;
}
.hidden { display: none !important; }

/* ---------- shared pieces: panels, titles, buttons ---------- */
.panel-look, .fighter-hud, #round-tracker, .as-row, .fr-seat, .gear-row, .ps-line, .vs-col, #card-window, #training-menu,
#bingo-mini, #toast, #spell-tip, .loadout-slot.filled, .hi-item, .hg-slot {
    background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.big-btn, .small-btn, .menu-btn, .map-btn, .gear-arrow, .as-arrow, .cw-btn {
    font-family: var(--ui-font); font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase;
    border: 1px solid transparent; border-radius: 8px; cursor: pointer; color: #fff;
    transition: background 0.15s, border-color 0.15s, transform 0.15s, box-shadow 0.15s, color 0.15s;
}
.big-btn { padding: 13px 28px; font-size: 18px; background: var(--purple); box-shadow: 0 6px 18px rgba(157, 78, 221, 0.35); }
.big-btn:hover:not(:disabled) { background: var(--purple-hi); transform: translateY(-1px); box-shadow: 0 8px 24px rgba(157, 78, 221, 0.5); }
.big-btn:disabled { background: #3a3550; color: #8a84a3; cursor: not-allowed; box-shadow: none; }
.small-btn { padding: 10px 18px; font-size: 15px; background: var(--panel-2); border-color: var(--line-2); color: #d6d0ec; }
.small-btn:hover { background: var(--panel-3); color: #fff; }
.big-btn:active:not(:disabled), .small-btn:active, .menu-btn:active:not(:disabled), .map-btn:active, .gear-arrow:active, .as-arrow:active { transform: translateY(1px); }
.map-btn { padding: 9px 10px; font-size: 13px; background: var(--panel-2); color: var(--muted); }
.map-btn:hover { color: #fff; }
.map-btn.selected { background: #2f9e44; color: #fff; }

/* ---------- HUD (during play) ---------- */
.hud {
    position: absolute; top: 0; left: 0; width: 100%;
    padding: 12px 16px;
    display: flex; justify-content: space-between; align-items: flex-start;
    pointer-events: none;
}
.fighter-hud {
    width: 320px; display: flex; flex-direction: column; gap: 6px;
    background: rgba(16, 12, 30, 0.8); backdrop-filter: blur(4px);
    padding: 9px 11px 10px; position: relative;
}
.name-row { display: flex; justify-content: space-between; font-family: var(--ui-font); font-size: 15px; font-weight: 500; letter-spacing: 0.05em; text-shadow: 0 1px 2px #000; }
.bar-container { width: 100%; height: 14px; background: #3a1a26; border-radius: 7px; overflow: hidden; position: relative; }
.hp-bar { height: 100%; border-radius: 7px; transition: width 0.15s ease-out; background-image: linear-gradient(180deg, rgba(255,255,255,0.28), rgba(255,255,255,0) 60%); }
#player-hp { background-color: #3fbf5a; }
#ai-hp { background-color: #e5484d; float: right; }
.mana-bar-container { width: 100%; height: 12px; background: #161c40; border-radius: 6px; overflow: hidden; position: relative; }
.mana-bar { height: 100%; background-color: #3b82f6; border-radius: 6px; background-image: linear-gradient(180deg, rgba(255,255,255,0.28), rgba(255,255,255,0) 60%); }
.mana-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 600; color: #fff; text-shadow: 0 1px 2px #000; }
.status-row { position: absolute; top: calc(100% + 5px); left: 0; display: flex; gap: 4px; flex-wrap: wrap; }
#ai-status { left: auto; right: 0; }
.badge { font-family: var(--ui-font); font-size: 12px; letter-spacing: 0.04em; padding: 2px 8px; border-radius: 6px; color: #fff; text-shadow: 0 1px 1px #000; }
.badge-decay { background: #22603a; box-shadow: inset 0 0 0 1px #7fd49a; }
.badge-surge { background: #4c2fa8; box-shadow: inset 0 0 0 1px #b197fc; }
.badge-slow { background: #1c5d80; box-shadow: inset 0 0 0 1px #74c0fc; }
.badge-shield { background: #8a1c2f; box-shadow: inset 0 0 0 1px #ff8fa3; }
#round-tracker {
    text-align: center; font-family: var(--ui-font); font-size: 18px; font-weight: 500; letter-spacing: 0.08em; color: var(--gold);
    background: rgba(16, 12, 30, 0.8); backdrop-filter: blur(4px); padding: 8px 18px; margin-top: 4px; text-shadow: 0 1px 2px #000;
}
#round-tracker small { display: block; font-family: var(--body-font); font-size: 13px; font-weight: 600; letter-spacing: 0.04em; color: #c9c3e0; margin-top: 3px; }
#round-tracker small.last-minute { color: #ff6b6b; }   /* Hunt time limit: the last minute */

/* ---------- The monster spawner (§): its button shows in the Training Ground ---------- */
#debug-toggle-btn {
    position: absolute; top: 108px; right: 16px; z-index: 20; pointer-events: auto; display: none;
    padding: 6px 11px; font-family: var(--ui-font); font-size: 12px; letter-spacing: 0.05em; color: var(--gold);
    background: rgba(16, 12, 30, 0.85); border: 1px solid var(--line-2); border-radius: 7px; cursor: pointer;
}
#game-container.training-mode #debug-toggle-btn { display: block; }
#debug-toggle-btn:hover { background: var(--panel-3); }
#debug-panel {
    position: absolute; top: 140px; right: 16px; width: 290px; max-height: 470px; overflow-y: auto;
    background: rgba(18, 14, 34, 0.97); border: 1px solid var(--line-2); border-radius: var(--radius);
    padding: 14px; color: var(--text); font-size: 12px; font-family: var(--body-font);
    z-index: 20; pointer-events: auto; display: flex; flex-direction: column; gap: 8px;
}
#debug-panel h3 {
    font-family: var(--ui-font); font-size: 16px; font-weight: 500; letter-spacing: 0.06em; color: var(--gold); margin-bottom: 2px;
    border-bottom: 1px solid var(--line-2); padding-bottom: 6px; display: flex; justify-content: space-between; align-items: center;
}
#fps-counter { font-size: 10px; color: #a7f3d0; }
#spawn-note { display: none; font-size: 12px; color: var(--muted); }
#debug-panel.no-spawn #spawn-note { display: block; }
#debug-panel.no-spawn .spawn-btn, #debug-panel.no-spawn #spawn-clear { opacity: 0.35; pointer-events: none; }
.spawn-map { font-family: var(--ui-font); font-size: 12px; letter-spacing: 0.12em; color: var(--muted); margin-top: 4px; }
.spawn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.spawn-btn { padding: 7px 8px; font-family: var(--body-font); font-size: 12px; font-weight: 600; text-align: left; cursor: pointer;
    color: #f1f3f5; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); border-radius: 6px; }
.spawn-btn:hover { background: rgba(255, 255, 255, 0.11); border-color: rgba(179, 102, 240, 0.6); }
.spawn-btn.tier-tough { color: #ffa94d; }
.spawn-btn.tier-boss { color: #ff6b6b; }
#spawn-clear { margin-top: 6px; }

/* the fight HUD is hidden while a menu is open */
#game-container.in-menu .fighter-hud,
#game-container.in-menu #round-tracker { visibility: hidden; }
#game-container.in-menu #debug-toggle-btn { display: none; }

/* ---------- Screens (cover the game) ---------- */
.screen {
    position: absolute; inset: 0; z-index: 10;
    background: linear-gradient(180deg, rgba(14, 11, 28, 0.80), rgba(14, 11, 28, 0.88));
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.arena-title {
    font-family: var(--ui-font); font-size: 38px; font-weight: 600; letter-spacing: 0.08em; color: #fff;
    text-shadow: 0 2px 12px rgba(157, 78, 221, 0.6); margin-bottom: 24px;
}
.menu-buttons { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.menu-buttons.row { flex-direction: row; }
.menu-btn {
    width: 360px; padding: 14px 18px; font-size: 22px; background: var(--panel-2); border-color: var(--line-2);
    display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.menu-btn small { font-family: var(--body-font); font-size: 12px; font-weight: 500; letter-spacing: 0.02em; text-transform: none; color: #c5bfdc; }
.menu-btn:hover:not(:disabled) { background: var(--panel-3); border-color: rgba(179, 102, 240, 0.6); }
.menu-btn.locked { background: #2a2738; color: #7c7896; cursor: not-allowed; }
.menu-btn.locked small { color: var(--gold); }

/* ---------- The main menu: a panel on the left (logo, buttons, music), the game world behind it ---------- */
#screen-main { background: linear-gradient(90deg, rgba(10, 8, 20, 0.55) 0%, rgba(10, 8, 20, 0) 45%); align-items: stretch; justify-content: stretch; }
.main-panel {
    position: absolute; left: 0; top: 0; bottom: 0; width: 340px; z-index: 1;
    display: flex; flex-direction: column; align-items: center; padding: 26px 26px 18px;
    background: linear-gradient(180deg, rgba(22, 17, 40, 0.96), rgba(14, 11, 28, 0.97));
    border-right: 1px solid var(--line-2); box-shadow: 10px 0 40px rgba(0, 0, 0, 0.45);
    animation: panelIn 0.5s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes panelIn { from { transform: translateX(-40px); opacity: 0; } to { transform: none; opacity: 1; } }
.main-logo { width: 280px; margin: 6px 0 26px; filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.55)); pointer-events: none; }
.main-buttons { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.main-btn {
    position: relative; width: 100%; padding: 11px 36px; display: flex; flex-direction: column; align-items: center; gap: 2px;
    font-family: var(--ui-font); font-size: 19px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: #e9e4f7;
    background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line-2); border-radius: 8px; cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.main-btn small { font-family: var(--body-font); font-size: 11px; font-weight: 500; letter-spacing: 0.02em; text-transform: none; color: var(--muted); }
/* the little marks on both sides of a button */
.main-btn::before, .main-btn::after {
    content: ''; position: absolute; top: 50%; width: 7px; height: 7px; margin-top: -4px; transform: rotate(45deg);
    border: 1.5px solid currentColor; opacity: 0.45; transition: opacity 0.15s, transform 0.15s;
}
.main-btn::before { left: 16px; } .main-btn::after { right: 16px; }
.main-btn:hover { background: rgba(255, 255, 255, 0.11); border-color: rgba(179, 102, 240, 0.65); transform: translateX(3px); }
.main-btn:hover::before, .main-btn:hover::after { opacity: 1; }
.main-btn.primary { background: var(--purple); border-color: transparent; color: #fff; padding: 15px 36px; font-size: 22px; box-shadow: 0 8px 22px rgba(157, 78, 221, 0.45); }
.main-btn.primary small { color: #ecdcfa; }
.main-btn.primary::before, .main-btn.primary::after { opacity: 0.8; }
.main-btn.primary:hover { background: var(--purple-hi); }
.main-foot { margin-top: auto; width: 100%; display: flex; flex-direction: column; gap: 10px; }
/* the SETTINGS button (where the music slider used to be) */
.settings-btn { display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; padding: 10px; cursor: pointer;
    font-family: var(--ui-font); font-size: 15px; letter-spacing: 0.1em; color: #d6d0ec;
    background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); border-radius: 8px; transition: background 0.15s, border-color 0.15s; }
.settings-btn:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(179, 102, 240, 0.6); color: #fff; }
.sb-icon { font-size: 17px; line-height: 1; }

/* ---------- the SETTINGS window ---------- */
#settings-window { position: absolute; inset: 0; z-index: 45; display: flex; align-items: center; justify-content: center; background: rgba(8, 6, 16, 0.6); backdrop-filter: blur(3px); }
#settings-window.hidden { display: none; }
.sw-panel { width: 470px; max-height: 600px; overflow-y: auto; padding: 18px 22px 16px; display: flex; flex-direction: column; gap: 12px;
    background: rgba(20, 16, 36, 0.97); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    animation: swIn 0.18s ease-out both; }
@keyframes swIn { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
.sw-title { font-family: var(--ui-font); font-size: 26px; font-weight: 600; letter-spacing: 0.12em; color: #fff; text-align: center; }
.sw-game { display: none; flex-direction: column; gap: 8px; }
#settings-window.in-game .sw-game { display: flex; }
.sw-game .main-btn { padding: 9px 20px; font-size: 17px; }
.sw-sec { display: flex; flex-direction: column; gap: 6px; }
.sw-sec.hidden { display: none; }
.sw-head { font-family: var(--ui-font); font-size: 13px; letter-spacing: 0.14em; color: var(--gold); }
.sw-slider { display: flex; align-items: center; gap: 12px; padding: 7px 12px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); border-radius: 8px; }
.sw-slider span { width: 120px; font-family: var(--ui-font); font-size: 13px; letter-spacing: 0.08em; color: #d6d0ec; }
.sw-slider input { flex: 1; accent-color: var(--purple-hi); cursor: pointer; }
.sw-slider b { width: 38px; text-align: right; font-family: var(--ui-font); font-weight: 500; font-size: 13px; color: var(--muted); }
.sw-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; cursor: pointer; text-align: left;
    font-family: var(--body-font); font-size: 13px; font-weight: 600; color: #d6d0ec;
    background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); border-radius: 8px; }
.sw-toggle:hover { background: rgba(255, 255, 255, 0.09); }
/* the switch: a little pill with a knob that slides over */
.sw-toggle i { flex: none; position: relative; width: 36px; height: 20px; border-radius: 999px; background: #3a3355; transition: background 0.2s; }
.sw-toggle i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #cfc8e6; transition: transform 0.2s, background 0.2s; }
.sw-toggle.on i { background: var(--purple); }
.sw-toggle.on i::after { transform: translateX(16px); background: #fff; }
.sw-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
#sw-hint { display: none; font-size: 12px; color: var(--muted); }
#settings-window.in-game #sw-close { display: none; }
#settings-window.in-game #sw-hint { display: block; margin: 0 auto; }
.main-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--dim); }
#game-version { position: static; font-size: 11px; color: var(--dim); text-shadow: none; }

/* ---------- the ACCOUNT window (log in, create an account, your names) - js/account.js ---------- */
#account-window { position: absolute; inset: 0; z-index: 46; display: flex; align-items: center; justify-content: center; background: rgba(8, 6, 16, 0.6); backdrop-filter: blur(3px); }
#account-window.hidden, .aw-page.hidden, #account-window .hidden { display: none; }
.aw-panel { width: 440px; }
.aw-page { display: flex; flex-direction: column; gap: 9px; }
#account-window input[type=text], #account-window input[type=email], #account-window input[type=password] {
    width: 100%; box-sizing: border-box; font-family: var(--body-font); font-size: 15px; color: #fff; background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--line-2); border-radius: 8px; padding: 10px 12px; outline: none; user-select: text; -webkit-user-select: text; transition: border-color 0.15s;
}
#account-window input:focus { border-color: var(--purple-hi); }
.aw-providers { display: flex; flex-direction: column; gap: 7px; }
.aw-provider { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 10px 14px; cursor: pointer;
    font-family: var(--ui-font); font-size: 15px; letter-spacing: 0.08em; color: #fff; background: rgba(255, 255, 255, 0.07);
    border: 1px solid var(--line-2); border-radius: 8px; transition: background 0.15s, border-color 0.15s; }
.aw-provider:hover:not(:disabled) { background: rgba(255, 255, 255, 0.12); border-color: rgba(179, 102, 240, 0.65); }
.aw-g, .aw-d { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-family: var(--body-font); font-weight: 800; font-size: 13px; }
.aw-g { background: #fff; color: #4285f4; }
.aw-d { background: #5865f2; color: #fff; }
.aw-or { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.aw-or::before, .aw-or::after { content: ''; flex: 1; height: 1px; background: var(--line-2); }
.aw-label { font-family: var(--ui-font); font-size: 13px; letter-spacing: 0.1em; color: var(--gold); margin-top: 2px; }
.aw-label small { font-family: var(--body-font); font-size: 11px; letter-spacing: 0; color: var(--muted); margin-left: 6px; }
.aw-at { display: flex; align-items: center; gap: 0; }
.aw-at span { font-family: var(--ui-font); font-size: 18px; color: var(--muted); padding: 0 8px 0 2px; }
.aw-check { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; color: #d6d0ec; cursor: pointer; line-height: 1.35; }
.aw-check input { margin-top: 2px; accent-color: var(--purple-hi); width: 16px; height: 16px; flex: none; cursor: pointer; }
#account-window a { color: var(--purple-hi); }
.aw-go.main-btn { padding: 11px 20px; font-size: 18px; margin-top: 3px; }
.aw-links { display: flex; justify-content: space-between; gap: 10px; }
.aw-link { background: none; border: none; padding: 2px 0; cursor: pointer; font-family: var(--body-font); font-size: 13px; color: var(--muted); }
.aw-link:hover { color: #fff; }
.aw-link b { color: var(--purple-hi); }
.aw-guest { align-self: center; margin-top: 2px; }
.aw-text { font-size: 14px; color: #d6d0ec; line-height: 1.45; margin: 0; }
.aw-acct { font-family: var(--ui-font); font-size: 22px; letter-spacing: 0.04em; color: #fff; text-align: center; padding: 4px 0 2px; }
.aw-row { display: flex; gap: 8px; align-items: center; }
.aw-row input { flex: 1; }
.aw-row .main-btn { flex: 1; padding: 10px 14px; font-size: 16px; }
.aw-end { justify-content: space-between; margin-top: 6px; }
.aw-danger { color: #ffa8a8; border-color: rgba(255, 107, 107, 0.4); }
.aw-danger:hover { background: rgba(255, 107, 107, 0.15); color: #fff; }
.aw-guestbox { display: flex; flex-direction: column; gap: 9px; margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
#aw-msg { font-size: 13px; color: #ffd8a8; min-height: 18px; text-align: center; line-height: 1.4; }
#aw-msg.good { color: #b2f2bb; }
.aw-legal { font-size: 12px; color: var(--dim); }
.aw-legal a { color: var(--muted) !important; }

/* ---------- FRIENDS: the button (top right), the window, the invite popup - js/social.js ---------- */
#corner-row { position: absolute; top: 18px; right: 18px; z-index: 1; display: flex; align-items: center; gap: 10px; }
#corner-row #profile-corner { position: static; }
#friends-btn { position: relative; display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 16px; cursor: pointer;
    font-family: var(--ui-font); font-size: 15px; letter-spacing: 0.08em; color: #fff; background: rgba(20, 16, 36, 0.85); backdrop-filter: blur(4px);
    border: 1px solid var(--line-2); border-radius: 999px; transition: border-color 0.15s, background 0.15s; }
#friends-btn:hover { border-color: rgba(179, 102, 240, 0.65); background: rgba(30, 24, 52, 0.9); }
.fb-icon { font-size: 15px; }
#fb-online { font-family: var(--body-font); font-size: 11px; letter-spacing: 0; color: #8ce99a; }
#fb-online:empty { display: none; }
#fb-badge { position: absolute; top: -5px; right: -5px; min-width: 20px; height: 20px; padding: 0 5px; box-sizing: border-box; border-radius: 999px;
    display: flex; align-items: center; justify-content: center; font-family: var(--body-font); font-size: 11px; font-weight: 700; color: #fff; background: #e5484d; }
#fb-badge.hidden { display: none; }
#friends-window { position: absolute; inset: 0; z-index: 46; display: flex; align-items: center; justify-content: center; background: rgba(8, 6, 16, 0.6); backdrop-filter: blur(3px); }
#friends-window.hidden, #friends-window .hidden { display: none; }
.fw-panel { width: 520px; }
#friends-window input[type=text] { width: 100%; box-sizing: border-box; font-family: var(--body-font); font-size: 15px; color: #fff; background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--line-2); border-radius: 8px; padding: 10px 12px; outline: none; user-select: text; -webkit-user-select: text; }
#friends-window input:focus { border-color: var(--purple-hi); }
.fw-addname { flex: 1; }
#fw-list { display: flex; flex-direction: column; gap: 6px; max-height: 330px; overflow-y: auto; padding-right: 2px; }
#fw-list .sw-head { margin-top: 8px; }
#fw-list .sw-head small { font-family: var(--body-font); font-size: 11px; letter-spacing: 0; color: var(--muted); margin-left: 6px; }
.fw-row { display: flex; align-items: center; gap: 10px; padding: 7px 10px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); border-radius: 8px; }
.fw-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: #5c5578; }
.fw-dot.online { background: #51cf66; box-shadow: 0 0 6px rgba(81, 207, 102, 0.7); }
.fw-dot.room { background: #4dabf7; box-shadow: 0 0 6px rgba(77, 171, 247, 0.7); }
.fw-dot.arena, .fw-dot.hunt { background: #fcc419; box-shadow: 0 0 6px rgba(252, 196, 25, 0.6); }
.fw-dot.none { background: transparent; border: 1px solid var(--line-2); }
.fw-who { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; font-size: 14px; color: #fff; }
.fw-who small { font-size: 12px; color: var(--muted); }
.fw-who em { flex-basis: 100%; font-style: normal; font-size: 12px; color: var(--muted); }
.fw-btns { display: flex; gap: 5px; flex: none; }
.fw-b { padding: 5px 9px; font-size: 12px; }
.fw-go { background: var(--purple); border-color: transparent; color: #fff; }
.fw-go:hover:not(:disabled) { background: var(--purple-hi); }
.fw-danger { color: #ffa8a8; }
.fw-empty { font-size: 13px; color: var(--muted); padding: 6px 2px; }
#fw-msg { font-size: 13px; color: #ffd8a8; min-height: 18px; text-align: center; }
#fw-msg.good { color: #b2f2bb; }
#invite-pop { position: absolute; right: 18px; bottom: 18px; z-index: 47; width: 290px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px;
    background: rgba(20, 16, 36, 0.97); border: 1px solid rgba(179, 102, 240, 0.65); border-radius: 12px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6); animation: swIn 0.2s ease-out both; }
#invite-pop.hidden { display: none; }
#ip-text { font-size: 14px; color: #ece8f7; line-height: 1.4; }
#ip-text small { color: var(--muted); }
.ip-btns { display: flex; gap: 8px; }
.ip-btns .main-btn { flex: 1; padding: 8px 12px; font-size: 15px; }
.ip-btns .main-btn:disabled { opacity: 0.6; cursor: default; font-size: 12px; }

/* the profile corner (top right of the main menu): your wizard name - later also your rank */
#profile-corner {
    position: absolute; top: 18px; right: 18px; z-index: 1; display: flex; align-items: center; gap: 10px;
    padding: 6px 14px 6px 6px; background: rgba(20, 16, 36, 0.85); backdrop-filter: blur(4px);
    border: 1px solid var(--line-2); border-radius: 999px; cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
#profile-corner:hover { border-color: rgba(179, 102, 240, 0.65); background: rgba(30, 24, 52, 0.9); }
.pc-avatar { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-family: var(--ui-font); font-size: 17px; font-weight: 600; color: #fff; background: linear-gradient(135deg, var(--purple), var(--blue)); }
.pc-text { display: flex; flex-direction: column; line-height: 1.15; }
.pc-name { font-family: var(--ui-font); font-size: 16px; font-weight: 500; letter-spacing: 0.05em; color: #fff; }
.pc-sub { font-size: 11px; color: var(--muted); }
#pc-edit { width: 150px; font-family: var(--ui-font); font-size: 16px; letter-spacing: 0.05em; color: #fff; background: transparent; border: none; outline: none;
    border-bottom: 1px solid var(--purple-hi); padding: 1px 0; user-select: text; -webkit-user-select: text; }

/* ---------- Result screen ---------- */
#result-title { font-family: var(--ui-font); font-size: 56px; font-weight: 600; letter-spacing: 0.06em; margin-bottom: 12px; text-shadow: 0 4px 20px rgba(0, 0, 0, 0.6); }
#result-title.win { color: var(--gold); }
#result-title.lose { color: #ff6b6b; }
#result-title.draw { color: #d6d0ec; }
#result-desc { font-size: 19px; color: #d6d0ec; margin-bottom: 12px; }
#result-desc b { font-weight: 700; }
#result-ai { font-size: 15px; color: var(--muted); margin-bottom: 24px; text-align: center; line-height: 1.5; }
#result-ai b { color: #d6d0ec; font-weight: 600; }
#result-rounds { display: flex; gap: 8px; margin-bottom: 18px; }
.rd-dot { width: 16px; height: 16px; border-radius: 50%; background: var(--panel-3); border: 1px solid var(--line-2); }
.rd-dot.won { background: var(--seat); }
.menu-buttons .hidden { display: none; }

/* ---------- Arena setup (full page) ---------- */
#screen-setup {
    position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column;
    background: radial-gradient(ellipse at 50% 0%, #1d1538 0%, var(--bg) 70%);
    padding: 18px 28px 20px;
}
#screen-setup.hidden { display: none; }
body.setup-open #game-container, body.setup-open #spell-bar { visibility: hidden; }
.setup-top { display: grid; grid-template-columns: 190px 1fr 190px; align-items: center; margin-bottom: 14px; }
.setup-mid { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.setup-top h2 { text-align: center; font-family: var(--ui-font); font-size: 26px; font-weight: 600; letter-spacing: 0.08em; color: #fff; }
#setup-title { font-family: var(--ui-font); font-weight: 600; color: #fff; font-size: 26px; letter-spacing: 0.08em; }
.setup-body { flex: 1; display: flex; gap: 28px; min-height: 0; }
.setup-left { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.setup-right { width: 340px; display: flex; flex-direction: column; overflow-y: auto; padding-right: 4px; }
.section-title { font-family: var(--ui-font); font-size: 15px; font-weight: 500; letter-spacing: 0.08em; color: #d6d0ec; margin: 6px 0 10px;
    display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.section-title span { font-family: var(--body-font); font-size: 13px; letter-spacing: 0; color: var(--muted); }
#loadout-count { color: var(--gold) !important; font-weight: 700; }
#round-info { font-family: var(--ui-font); font-size: 16px; letter-spacing: 0.06em; color: #d6d0ec; display: flex; gap: 18px; align-items: baseline; }
#round-info b { font-weight: 600; }
.ri-score { font-family: var(--body-font); font-size: 14px; letter-spacing: 0; color: var(--muted); }
#phase-timer { justify-self: end; font-family: var(--ui-font); font-size: 34px; font-weight: 600; color: #fff; min-width: 60px; text-align: right; }
#phase-timer.low { color: #ff6b6b; }
/* ---------- Pixel spell card ---------- */
.pcard { position: relative; flex: none; width: calc(120px * var(--S)); height: calc(168px * var(--S)); perspective: 900px; cursor: pointer; }
.pfx { position: absolute; left: calc(-20px * var(--S)); top: calc(-20px * var(--S));
       width: calc(160px * var(--S)); height: calc(208px * var(--S)); pointer-events: none; image-rendering: pixelated; z-index: 3; }
.pcard-inner {
    position: absolute; inset: 0; transform-style: preserve-3d;
    transform: rotateX(var(--rx, 0deg)) rotateY(calc(var(--ry, 0deg) + var(--flip, 0deg)));
    transition: transform 0.12s ease-out;
}
.pcard.flipping .pcard-inner { transition: none; }   /* the flip is animated frame by frame from script */
.pface { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; }
/* which side is visible is switched by script halfway through the flip (prevents mirrored faces) */
.pback { visibility: hidden; }
.pcard.show-back .pfront { visibility: hidden; }
.pcard.show-back .pback { visibility: visible; }
.pback { transform: rotateY(180deg); }
.pface canvas { position: absolute; image-rendering: pixelated; }
.pframe { left: 0; top: 0; width: 100%; height: 100%; }
.part { left: calc(8px * var(--S)); top: calc(22px * var(--S)); width: calc(104px * var(--S)); height: calc(64px * var(--S)); }
.pgart { left: calc(8px * var(--S)); top: calc(24px * var(--S)); width: calc(104px * var(--S)); height: calc(80px * var(--S)); }
.pt { position: absolute; text-shadow: 2px 2px 0 #000; line-height: 1; }
.pname { left: calc(22px * var(--S)); top: calc(10px * var(--S)); font-size: calc(5px * var(--S)); color: #fff; }
.ptype { left: calc(21px * var(--S)); top: calc(91px * var(--S)); font-size: calc(3.5px * var(--S)); color: #fff; letter-spacing: 1px; }
.pcost { left: calc(2px * var(--S)); top: calc(3px * var(--S)); width: calc(17px * var(--S)); text-align: center; font-size: calc(5px * var(--S)); color: #fff; padding-top: calc(5px * var(--S)); }
.pdesc {
    left: calc(11px * var(--S)); top: calc(103px * var(--S)); width: calc(98px * var(--S)); height: calc(46px * var(--S)); overflow: hidden;
    font-family: var(--read-font); font-size: calc(10px * var(--S)); color: #e9ecef; line-height: 0.95; text-shadow: 1px 1px 0 #000;
}
.pbtn { right: calc(10px * var(--S)); top: calc(155px * var(--S)); font-size: calc(3.5px * var(--S)); color: #dee2e6; }
.ptitle { left: 0; width: 100%; text-align: center; top: calc(10px * var(--S)); font-size: calc(4.5px * var(--S)); color: #fff; }
.phow {
    left: calc(10px * var(--S)); top: calc(108px * var(--S)); width: calc(100px * var(--S));
    font-family: var(--read-font); font-size: calc(9.5px * var(--S)); color: #e9ecef; line-height: 0.95; text-shadow: 1px 1px 0 #000; text-align: center;
}
.pglare { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: overlay; opacity: 0; transition: opacity 0.2s;
          background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,0.55), transparent 55%); }
.pcard:hover .pglare { opacity: 1; }
.pcard.equipped .pfront::after {
    content: ''; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen;
    background: linear-gradient(115deg, transparent 30%, rgba(255,236,153,0.0) 38%, rgba(255,236,153,0.55) 45%,
                rgba(170,240,255,0.45) 50%, rgba(255,170,240,0.4) 55%, transparent 62%);
    background-size: 300% 100%; animation: foil 2.6s linear infinite;
}
@keyframes foil { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.pcard::before {
    content: ''; position: absolute; inset: -3px; pointer-events: none; opacity: 0; transition: opacity 0.2s;
    box-shadow: 0 0 0 3px #f2c94c, 0 0 18px 4px rgba(242,201,76,0.55);
}
.pcard.equipped::before { opacity: 1; animation: glow 1.2s ease-in-out infinite alternate; }
@keyframes glow { from { box-shadow: 0 0 0 3px #f2c94c, 0 0 12px 2px rgba(242,201,76,0.4); } to { box-shadow: 0 0 0 3px #ffe066, 0 0 22px 6px rgba(242,201,76,0.65); } }
.pcard.slam { animation: slam 0.32s ease-out; }
@keyframes slam { 0% { transform: scale(1); } 40% { transform: scale(1.08) translateY(-6px); } 70% { transform: scale(0.97); } 100% { transform: scale(1); } }
.pflip {
    position: absolute; right: calc(5px * var(--S)); top: calc(4px * var(--S)); z-index: 4;
    width: calc(13px * var(--S)); height: calc(13px * var(--S)); border: 2px solid #000; background: #23283d; color: #f2c94c;
    font-family: var(--pixel-font); font-size: calc(5px * var(--S)); cursor: pointer; padding: 0;
    box-shadow: inset -2px -2px 0 rgba(0,0,0,.4), inset 2px 2px 0 rgba(255,255,255,.2);
}
.pflip:hover { background: #3a4266; }


/* the card's own text stays pixel (everything on a card is pixel art) */
.pcard, .mini-card, .pstamp, .pflip { font-family: var(--pixel-font); }

/* ---------- Loadout slots ---------- */
#loadout-slots { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
#loadout-slots.shake { animation: shake 0.3s ease-in-out; }
@keyframes shake { 25% { transform: translateX(-6px); } 50% { transform: translateX(6px); } 75% { transform: translateX(-4px); } }
.loadout-slot {
    height: 42px; display: flex; align-items: center; gap: 10px; padding: 0 12px;
    background: rgba(255, 255, 255, 0.03); border: 1px dashed var(--line-2); border-radius: 8px;
    font-family: var(--ui-font); font-size: 15px; letter-spacing: 0.05em; color: var(--dim);
}
.loadout-slot.filled { border: 1px solid var(--line); box-shadow: inset 3px 0 0 var(--el); color: #fff; cursor: pointer; }
.loadout-slot.filled:hover .slot-x { color: #ff6b6b; }
.slot-icon { width: 18px; height: 18px; image-rendering: pixelated; }
.slot-num { color: var(--gold); }
.slot-name { flex: 1; line-height: 1.2; }
.slot-x { color: var(--dim); }
.loadout-slot .slot-buff { font-family: var(--body-font); font-size: 12px; font-weight: 600; letter-spacing: 0; color: var(--gold); margin-left: auto; white-space: nowrap; }
.loadout-slot.filled:not(.clickable) { cursor: default; }

/* ---------- Gear ---------- */
#gear-pickers { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.gear-row { padding: 8px 10px; }
.gear-row.buffed { border-color: rgba(242, 193, 78, 0.6); }
.gear-slot-name { font-family: var(--ui-font); font-size: 12px; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 5px; }
.gear-picker { display: flex; align-items: center; gap: 6px; }
.gear-arrow { flex: none; width: 32px; height: 40px; font-size: 14px; background: var(--panel-2); padding: 0; }
.gear-item { flex: 1; text-align: center; }
.gear-name { font-family: var(--ui-font); font-size: 15px; letter-spacing: 0.04em; color: #fff; margin-bottom: 3px; }
.gear-row.buffed .gear-name { color: var(--gold); }
.gear-desc { font-size: 12px; color: #c5bfdc; line-height: 1.35; }
#map-buttons { display: flex; gap: 6px; margin-bottom: 14px; }
#map-buttons .map-btn { flex: 1; }
#setup-start, #setup-next { margin-top: auto; width: 100%; padding: 14px; font-size: 19px; position: sticky; bottom: 0; flex: none; }
@media (max-height: 820px) {
    .loadout-slot { height: 34px; }
    .gear-row { padding: 5px 8px; }
    .gear-arrow { height: 32px; }
    #setup-start, #setup-next { padding: 11px; }
    .section-title { margin: 4px 0 6px; }
}
#gear-summary, #map-summary { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }

/* ---------- In-match spell bar ---------- */
#spell-bar {
    position: relative; margin-top: 16px; width: 1120px; display: flex; align-items: center; justify-content: center;
    background: var(--panel); padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px;
}
#spell-bar-cards { display: flex; gap: 12px; }
.mini-card { position: relative; width: 208px; height: 56px; }
.mini-card canvas { position: absolute; image-rendering: pixelated; }
.mini-bg { left: 0; top: 0; width: 208px; height: 56px; }
.mini-art { left: 10px; top: 10px; width: 54px; height: 36px; border: 2px solid #000; background: rgba(0,0,0,0.5); }
.mini-name { position: absolute; left: 72px; top: 12px; font-size: 7px; color: #fff; text-shadow: 2px 2px 0 #000; white-space: nowrap; }
.mini-btn { position: absolute; left: 72px; top: 32px; font-size: 6px; color: #ced4da; text-shadow: 1px 1px 0 #000; }
.mini-cost {
    position: absolute; right: 30px; top: 18px; min-width: 22px; height: 22px; display: flex; align-items: center; justify-content: center;
    background: #1c7ed6; border: 2px solid #000; box-shadow: inset 0 0 0 1px #74c0fc; font-size: 7px; color: #fff; text-shadow: 1px 1px 0 #000;
}
.mini-card.unaffordable { filter: grayscale(1) brightness(0.55); }
.mini-card.unaffordable .mini-cost { background: #c92a2a; box-shadow: inset 0 0 0 1px #ff8787; }

/* hovering a spell: what it does */
#spell-tip {
    position: absolute; bottom: calc(100% + 8px); transform: translateX(-50%); width: 270px; z-index: 30; pointer-events: none;
    background: rgba(20, 16, 36, 0.97); padding: 12px 14px; font-size: 13px; line-height: 1.45; color: var(--text);
}
#spell-tip .st-name { font-family: var(--ui-font); font-size: 18px; font-weight: 500; letter-spacing: 0.05em; margin-bottom: 2px; }
#spell-tip .st-type { font-family: var(--ui-font); font-size: 12px; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 8px; }
#spell-tip .st-desc { margin-bottom: 8px; }
#spell-tip .st-how { color: #b8b1d1; font-size: 12px; }

/* ---------- Setup steps ---------- */
#step-bar { display: flex; justify-content: center; align-items: center; gap: 12px; }
.step { font-family: var(--ui-font); font-size: 15px; letter-spacing: 0.08em; color: var(--dim); display: flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; border: 1px solid transparent; }
.step span { display: inline-flex; width: 22px; height: 22px; align-items: center; justify-content: center; border-radius: 50%; background: var(--panel-2); color: var(--muted); font-size: 12px; }
.step.active { color: #fff; background: rgba(157, 78, 221, 0.18); border-color: rgba(179, 102, 240, 0.6); }
.step.active span { background: var(--purple); color: #fff; }
.step.done { color: #8ce99a; }
.step.done span { background: #2f9e44; color: #fff; }
.step-arrow { color: var(--dim); font-size: 16px; }
.step.clickable { cursor: pointer; }
.step.clickable:hover { color: #fff; }
.step-page { flex: 1; min-height: 0; display: flex; }
.step-page.hidden { display: none; }
.card-grid {
    --S: 2;
    flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden;
    scrollbar-width: none;   /* no scrollbar: it stole width and pushed a card off each row (scrolling still works) */
    display: flex; flex-wrap: wrap; gap: 30px 34px; align-content: flex-start; justify-content: center;
    padding: 34px 30px 40px;
}
.card-grid::-webkit-scrollbar { display: none; }
@media (max-height: 820px), (max-width: 1250px) { .card-grid { --S: 1.5; gap: 22px 26px; } }
.gear-column { display: flex; flex-direction: column; align-items: center; gap: 28px; }
.gear-column-title { font-family: var(--ui-font); font-size: 16px; letter-spacing: 0.1em; color: #d6d0ec; margin-bottom: -10px; }
#map-grid { align-content: center; }
#phase-status { margin-bottom: 8px; display: flex; flex-direction: column; gap: 6px; }
.ps-line { font-size: 13px; color: #d6d0ec; padding: 9px 12px; line-height: 1.45; }
.ps-line b { font-weight: 700; }
.ps-line .your-turn { color: var(--gold); animation: yourTurn 0.8s ease-in-out infinite alternate; }
@keyframes yourTurn { from { opacity: 0.6; } to { opacity: 1; } }
.ps-bans { color: #ff8787; }
#draft-box.hidden { display: none; }
#draft-order { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 6px; }
.do-cell { display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 9px; font-family: var(--ui-font); font-size: 13px; letter-spacing: 0.04em; color: var(--dim);
           background: rgba(255, 255, 255, 0.04); border-radius: 6px; box-shadow: inset 3px 0 0 var(--seat); }
.do-cell.done { color: #fff; }
.do-cell.now { box-shadow: inset 3px 0 0 var(--seat), inset 0 0 0 1px var(--gold); color: var(--gold); }
.do-n { color: var(--dim); }
.do-who { color: var(--seat); }
.do-spell { margin-left: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* cards you can't take right now, and stamps on them (BAN, BANNED, who drafted it) */
.pcard.locked { cursor: default; }
.pcard.locked .pcard-inner { filter: saturate(0.35) brightness(0.55); transition: filter 0.2s; }
.pcard.locked.equipped .pcard-inner { filter: none; }
.pcard.locked .pflip { pointer-events: auto; }
.pstamp { display: none; position: absolute; left: 50%; top: 42%; z-index: 6; pointer-events: none;
          transform: translate(-50%, -50%) rotate(-12deg); padding: 6px 12px; font-size: 13px; letter-spacing: 1px;
          color: var(--stamp); border: 4px solid var(--stamp); background: rgba(10, 12, 22, 0.85); text-shadow: 2px 2px 0 #000; white-space: nowrap; }
.pcard.stamped .pstamp { display: block; animation: stampIn 0.25s ease-out; }
@keyframes stampIn { from { transform: translate(-50%, -50%) rotate(-12deg) scale(1.6); opacity: 0; } to { transform: translate(-50%, -50%) rotate(-12deg) scale(1); opacity: 1; } }


/* the bans revealed */
#ban-reveal { position: absolute; inset: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
              background: rgba(10, 8, 20, 0.9); animation: fadeIn 0.25s ease-out; }
#ban-reveal.hidden { display: none; }
.br-title { font-family: var(--ui-font); font-size: 44px; font-weight: 600; letter-spacing: 0.08em; color: #ff6b6b; }
.br-row { font-family: var(--ui-font); font-size: 22px; letter-spacing: 0.05em; color: #d6d0ec; opacity: 0; animation: brIn 0.35s ease-out forwards; }
.br-row b { font-weight: 600; }
@keyframes brIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ---------- VS screen ---------- */
#screen-versus { background: rgba(10, 8, 20, 0.7); }
#vs-columns { display: grid; grid-template-columns: 330px 1fr 330px; gap: 30px; align-items: center; width: 100%; padding: 0 40px; }
.vs-col { padding: 16px; box-shadow: inset 0 3px 0 var(--side), 0 8px 24px rgba(0, 0, 0, 0.4); }
.vs-col:first-child { animation: vsLeft 0.55s cubic-bezier(.2,.9,.3,1.15) both; }
.vs-col:last-child { animation: vsRight 0.55s cubic-bezier(.2,.9,.3,1.15) both; }
@keyframes vsLeft { from { transform: translateX(-420px); } to { transform: none; } }
@keyframes vsRight { from { transform: translateX(420px); } to { transform: none; } }
.vs-name { font-family: var(--ui-font); font-size: 24px; font-weight: 600; letter-spacing: 0.06em; color: var(--side); margin-bottom: 10px; text-align: center; }
.vs-sub { font-family: var(--ui-font); font-size: 12px; letter-spacing: 0.1em; color: var(--muted); margin: 8px 0 6px; }
.vs-sub-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.vs-sub-row .set-tag { font-size: 11px; color: var(--muted); }
.vs-list { display: flex; flex-direction: column; gap: 5px; }
.vs-list .loadout-slot { height: 32px; font-size: 14px; opacity: 0; animation: vsSlot 0.25s ease-out forwards; }
@keyframes vsSlot { 0% { opacity: 0; transform: scale(1.15); } 100% { opacity: 1; transform: scale(1); } }
.vs-mid { text-align: center; }
.vs-round { font-family: var(--ui-font); font-size: 16px; letter-spacing: 0.1em; color: #d6d0ec; margin-bottom: 12px; }
.vs-big { font-family: var(--ui-font); font-size: 96px; font-weight: 700; color: var(--gold); text-shadow: 0 6px 30px rgba(242, 193, 78, 0.45); animation: vsBig 0.6s cubic-bezier(.2,.9,.3,1.2) both; }
@keyframes vsBig { from { transform: scale(3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.vs-map { font-family: var(--ui-font); font-size: 16px; letter-spacing: 0.08em; color: #d6d0ec; margin: 10px 0 22px; }
.vs-count { font-family: var(--ui-font); font-size: 72px; font-weight: 600; color: #fff; min-height: 90px; }
.vs-count.pop { animation: vsPop 0.4s cubic-bezier(.3,1.6,.5,1); }
@keyframes vsPop { from { transform: scale(1.8); opacity: 0.3; } to { transform: scale(1); opacity: 1; } }
.vs-count.fight { color: #ff6b6b; font-size: 64px; }
#vs-columns, .vs-col, .vs-big, .vs-count { will-change: transform, opacity; }

/* fade used when the menu backdrop switches map */
#scene-fade { position: absolute; inset: 0; background: var(--bg); opacity: 0; pointer-events: none; transition: opacity 0.7s ease; z-index: 1; }
#scene-fade.on { opacity: 1; }

/* ---------- Achievement Hunt ---------- */
#game-container.hunt-mode #ai-hud { visibility: hidden; }
.hunt-gear { display: none; }
#game-container.hunt-mode .hunt-gear { display: flex; gap: 4px; position: absolute; top: calc(100% + 5px); left: 0; }
#game-container.hunt-mode .hunt-inv { top: calc(100% + 35px); }
#game-container.hunt-mode #player-status { top: calc(100% + 65px); }   /* under the gear and the gold dust */
.hg-slot { font-family: var(--ui-font); font-size: 12px; letter-spacing: 0.04em; padding: 3px 9px; border-radius: 6px; color: #fff; background: rgba(16, 12, 30, 0.85); border-color: var(--line-2); text-shadow: 0 1px 1px #000; }
.hg-slot.empty { color: var(--dim); border-style: dashed; }
.hi-item { font-family: var(--ui-font); font-size: 12px; letter-spacing: 0.04em; padding: 3px 9px; border-radius: 6px; background: rgba(16, 12, 30, 0.85); text-shadow: 0 1px 1px #000; white-space: nowrap; }
#card-window {
    position: absolute; right: 24px; top: 50%; transform: translateY(-50%); z-index: 20; pointer-events: auto;
    width: 310px; padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 10px;
    background: rgba(20, 16, 36, 0.96); border-color: rgba(242, 193, 78, 0.55);
    --S: 1.5;
}
#cw-title { font-family: var(--ui-font); font-size: 20px; font-weight: 600; letter-spacing: 0.08em; color: var(--gold); }
#cw-info { font-size: 13px; color: var(--text); text-align: center; line-height: 1.45; }
#cw-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.cw-btn { font-size: 14px; padding: 8px 12px; background: var(--panel-2); border-color: var(--line-2); }
.cw-btn:hover { filter: brightness(1.25); }
.cw-btn.take { background: #2f9e44; border-color: transparent; }
.cw-btn.swap { background: var(--panel-2); border-color: var(--gold); }
.cw-btn.leave { background: #3a3550; }
#cw-hint { font-size: 11px; color: var(--muted); }
#cw-set { font-size: 12px; color: var(--muted); text-align: center; }
/* Set bonus tag: "FIRE SET 2/3" (grey) / "FIRE SET 3/3 · +2 FIRE DMG" (element colour) */
.section-title .set-tag { font-family: var(--body-font); font-size: 12px; letter-spacing: 0; color: var(--muted); text-align: right; white-space: nowrap; }
.set-tag.set-done { text-shadow: 0 0 8px currentColor; }

/* ---------- Achievement Hunt: bingo, win ---------- */
.hunt-only { display: none; }
#game-container.hunt-mode .hunt-only { display: block; }
#game-container.hunt-mode #debug-toggle-btn { top: auto; bottom: 150px; }
#bingo-side { position: absolute; top: 12px; right: 16px; z-index: 5; pointer-events: none; flex-direction: column; align-items: flex-end; gap: 7px; }
#game-container.hunt-mode #bingo-side { display: flex; }
#bingo-mini { background: rgba(16, 12, 30, 0.82); backdrop-filter: blur(4px); padding: 7px 9px 9px; }
.bm-title { font-family: var(--ui-font); font-size: 14px; font-weight: 500; letter-spacing: 0.1em; color: var(--gold); margin-bottom: 5px; display: flex; justify-content: space-between; gap: 10px; }
.bm-title span { color: var(--dim); font-size: 11px; align-self: center; }
#bingo-mini-grid { display: grid; grid-template-columns: repeat(var(--bm-n, 5), var(--bm-s, 18px)); gap: 3px; }
.bm-cell { width: var(--bm-s, 18px); height: var(--bm-s, 18px); background: #2a2442; border-radius: 3px; pointer-events: auto; cursor: pointer; }
.bm-cell:hover { outline: 1px solid rgba(255, 255, 255, 0.5); }
.bm-cell.done { background: var(--gold); }
.bm-cell.mine { box-shadow: inset 0 0 0 2px #fff, 0 0 7px rgba(255, 255, 255, 0.55); }   /* yours: full colour and a bright border */
.bm-cell.win { background: #fff3bf; box-shadow: inset 0 0 0 2px #ff922b; }
/* the mouse over a square of the small card: what it is */
#cw-warn { max-width: 330px; text-align: center; font-size: 14px; font-weight: 600; line-height: 1.35; color: #ffa8a8; }
#cw-warn:empty { display: none; }
#cw-warn b { color: #fff; }
#bm-tip { position: absolute; z-index: 24; pointer-events: none; width: 230px; padding: 8px 10px; background: rgba(16, 12, 30, 0.94); border: 1px solid var(--line-2); border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45); font-size: 13px; font-weight: 600; line-height: 1.3; color: var(--text); }
#bm-tip.hidden { display: none; }
.bt-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 5px; }
.bt-foot span { display: flex; gap: 3px; }
.bt-foot i { width: 10px; height: 10px; border-radius: 50%; }
.bt-foot b { font-family: var(--ui-font); font-weight: 500; font-size: 12px; letter-spacing: 0.04em; color: #d6d0ec; }
.bm-cell.pop { animation: bm-pop 0.6s ease-out; }
@keyframes bm-pop { 0% { transform: scale(1.8); } 100% { transform: scale(1); } }
#bingo-full { position: absolute; inset: 0; z-index: 25; pointer-events: auto; display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: rgba(10, 8, 20, 0.95); }   /* nearly solid: the game doesn't show through the card */
.bf-title { font-family: var(--ui-font); font-size: 26px; font-weight: 600; letter-spacing: 0.1em; color: var(--gold); margin-bottom: 14px; text-align: center; }
.bf-title span { display: block; font-family: var(--body-font); font-size: 12px; font-weight: 500; letter-spacing: 0; color: var(--muted); margin-top: 4px; }
/* the card's size: --bf-w / --bf-h / --bf-font are set for 3x3, 4x4 or 5x5 (ui.js) */
#bingo-full-grid { display: grid; grid-template-columns: repeat(var(--bf-n, 5), var(--bf-w, 168px)); gap: 7px; }
.bf-cell { position: relative; height: var(--bf-h, 92px); background: #1c1730; border: 2px solid rgba(255, 255, 255, 0.1); border-radius: 9px;
    padding: 9px 28px 9px 10px; display: flex; flex-direction: column; justify-content: space-between; }
.bf-icon { position: absolute; top: 7px; right: 7px; width: 18px; height: 18px; image-rendering: pixelated; }
.bf-text { font-family: var(--body-font); font-weight: 600; font-size: calc(var(--bf-font, 17px) * 0.85); color: #ece8f7; line-height: 1.2; flex: 1; min-height: 0; overflow: hidden; }
/* the bottom of a square: who has it (a check in their colour) on the left, the progress on the right */
.bf-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 4px; }
.bf-owners { display: flex; gap: 3px; }
.bf-owner { width: 17px; height: 17px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; color: #000; border-radius: 4px; }
.bf-prog { font-family: var(--ui-font); font-size: 13px; letter-spacing: 0.04em; color: #d6d0ec; text-align: right; white-space: nowrap; }
.bf-bar { position: absolute; left: 8px; right: 8px; bottom: 5px; height: 3px; border-radius: 2px; background: #2f2850; overflow: hidden; }
.bf-bar i { display: block; height: 100%; background: var(--gold); }
/* yours: a border in your colour; someone else's (Block mode): dimmed */
.bf-cell.done { border-color: var(--owner); }
.bf-cell.done .bf-text { color: #ffffff; }
.bf-cell.done .bf-prog { color: var(--owner); }
.bf-cell.taken .bf-text { opacity: 0.4; }
.bf-cell.taken .bf-prog { color: var(--dim); }
.bf-cell.win { border-color: #fff; box-shadow: inset 0 0 0 2px var(--win, #ff922b); }
.bf-cell { cursor: pointer; transition: transform 0.12s; }
.bf-cell:hover { transform: translateY(-2px); }
/* a pinned square: a little pin in the corner */
.bf-cell.pinned::after { content: '📌'; position: absolute; left: -7px; top: -9px; font-size: 16px; filter: drop-shadow(0 2px 2px #000); }

/* ---------- Achievement Hunt: pinned squares (under the small card) ---------- */
#bingo-pins { display: flex; flex-direction: column; gap: 5px; width: 220px; }
#bingo-pins:empty { display: none; }
.bp-row { pointer-events: auto; cursor: pointer; padding: 6px 8px; background: rgba(16, 12, 30, 0.82); border: 1px solid var(--line); border-radius: 6px; backdrop-filter: blur(4px); }
.bp-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.bp-text { font-size: 11px; font-weight: 600; line-height: 1.25; color: var(--text); }
.bp-prog { flex: none; font-family: var(--ui-font); font-size: 12px; letter-spacing: 0.04em; color: #d6d0ec; }
.bp-row.done .bp-prog { color: #8ce99a; }
.bp-row.done .bp-text, .bp-row.taken .bp-text { opacity: 0.55; }
.bp-bar { height: 3px; margin-top: 5px; border-radius: 2px; background: #2f2850; overflow: hidden; }
.bp-bar i { display: block; height: 100%; background: var(--gold); transition: width 0.3s; }

/* ---------- Achievement Hunt: the news ---------- */
#hunt-news { position: absolute; top: 76px; left: 50%; transform: translateX(-50%); z-index: 6; pointer-events: none;
    display: flex; flex-direction: column; align-items: center; gap: 4px; }
.hn-line { padding: 5px 12px; font-size: 13px; color: #d6d0ec; background: rgba(16, 12, 30, 0.78); border-radius: 999px; white-space: nowrap;
    animation: newsIn 0.3s ease-out both; transition: opacity 0.5s, transform 0.5s; }
.hn-line b { font-family: var(--ui-font); font-weight: 500; letter-spacing: 0.04em; }
.hn-line span { color: #fff; font-weight: 600; }
.hn-line.out { opacity: 0; transform: translateY(-6px); }
@keyframes newsIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------- Achievement Hunt: someone is one square away ---------- */
#one-away { position: absolute; top: 34%; left: 50%; transform: translateX(-50%); z-index: 26; pointer-events: none;
    padding: 12px 28px; font-family: var(--ui-font); font-size: 30px; font-weight: 600; letter-spacing: 0.08em; color: #fff; white-space: nowrap;
    background: linear-gradient(90deg, rgba(150, 20, 40, 0), rgba(150, 20, 40, 0.88) 15%, rgba(150, 20, 40, 0.88) 85%, rgba(150, 20, 40, 0));
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6); }
#one-away.mine { background: linear-gradient(90deg, rgba(160, 110, 10, 0), rgba(160, 110, 10, 0.9) 15%, rgba(160, 110, 10, 0.9) 85%, rgba(160, 110, 10, 0)); }
#one-away.go { animation: oneAway 3.8s ease-out both; }
@keyframes oneAway { 0% { opacity: 0; transform: translateX(-50%) scale(1.25); } 8% { opacity: 1; transform: translateX(-50%) scale(1); }
    85% { opacity: 1; transform: translateX(-50%) scale(1); } 100% { opacity: 0; transform: translateX(-50%) scale(0.97); } }

/* ---------- Achievement Hunt: your own square (the screen glows in your colour) ---------- */
#sq-celebrate { position: absolute; inset: 0; z-index: 23; pointer-events: none; display: flex; align-items: flex-start; justify-content: center; }
#sq-celebrate.go { animation: scGlow 1.9s ease-out both; }
@keyframes scGlow { 0% { box-shadow: inset 0 0 0 0 transparent; } 12% { box-shadow: inset 0 0 120px 12px var(--c); } 100% { box-shadow: inset 0 0 0 0 transparent; } }
.sc-text { margin-top: 150px; padding: 12px 26px; display: flex; align-items: center; gap: 12px; max-width: 620px;
    font-size: 24px; font-weight: 700; color: #fff; background: rgba(16, 12, 30, 0.85); border: 2px solid var(--c); border-radius: 12px;
    box-shadow: 0 0 30px var(--c); }
#sq-celebrate.go .sc-text { animation: scPop 1.9s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes scPop { 0% { opacity: 0; transform: scale(0.6) translateY(10px); } 15% { opacity: 1; transform: scale(1.06); } 25% { transform: scale(1); }
    80% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-14px); } }
.sc-check { display: inline-flex; width: 34px; height: 34px; align-items: center; justify-content: center; border-radius: 50%; background: var(--c); color: #000; font-size: 20px; flex: none; }

/* ---------- Achievement Hunt: the recap on the end screen ---------- */
#hw-recap { display: flex; flex-direction: column; align-items: center; }
.hw-tables { max-width: 1060px; overflow-x: auto; }   /* very many kinds of monster: scroll sideways */
.hw-tables .hidden { display: none; }
.hw-toggle { margin-top: 4px; padding: 5px 14px; font-size: 12px; }
#hw-recap table { border-collapse: separate; border-spacing: 0 4px; font-size: 14px; color: #d6d0ec; }
#hw-recap th { font-family: var(--ui-font); font-weight: 500; font-size: 12px; line-height: 1.15; letter-spacing: 0.1em; color: var(--muted); padding: 0 12px; vertical-align: bottom; }
#hw-recap td { padding: 7px 14px; text-align: center; background: rgba(20, 16, 36, 0.85); font-weight: 600; }
#hw-recap td:first-child { text-align: left; border-radius: 8px 0 0 8px; font-family: var(--ui-font); font-size: 16px; letter-spacing: 0.04em; }
#hw-recap td:last-child { border-radius: 0 8px 8px 0; }
#hw-recap th.sortable { cursor: pointer; transition: color 0.15s; }
#hw-recap th.sortable:hover { color: #fff; }
#hw-recap th.sorted { color: var(--gold); }
#hw-recap th.sorted::after { content: ' ▼'; font-size: 9px; }
#hw-recap td.sorted { color: #fff; }
#hw-recap tr.me td { background: rgba(157, 78, 221, 0.25); }
#hw-recap td b { font-weight: 500; }
.hw-awards { display: flex; gap: 10px; justify-content: center; margin-top: 12px; }
.hw-award { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 14px; background: rgba(242, 193, 78, 0.1);
    border: 1px solid rgba(242, 193, 78, 0.45); border-radius: 10px; animation: awardIn 0.5s cubic-bezier(.2, 1.4, .4, 1) both; }
.hw-award:nth-child(2) { animation-delay: 0.15s; } .hw-award:nth-child(3) { animation-delay: 0.3s; } .hw-award:nth-child(4) { animation-delay: 0.45s; }
.hw-award small { font-family: var(--ui-font); font-size: 11px; letter-spacing: 0.12em; color: var(--gold); }
.hw-award b { font-family: var(--ui-font); font-size: 17px; font-weight: 500; letter-spacing: 0.04em; }
@keyframes awardIn { from { opacity: 0; transform: translateY(10px) scale(0.9); } to { opacity: 1; transform: none; } }
#bf-legend { font-family: var(--ui-font) !important; font-size: 13px !important; letter-spacing: 0.06em !important; margin-top: 8px !important; }
#bf-legend b { margin: 0 6px; font-weight: 500; }
#hunt-win { position: absolute; inset: 0; z-index: 30; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
    background: rgba(10, 8, 20, 0.78); }
.hw-title { font-family: var(--ui-font); font-size: 72px; font-weight: 700; letter-spacing: 0.06em; color: var(--gold); text-shadow: 0 6px 30px rgba(242, 193, 78, 0.45); }
.hw-title.lose { color: #ff6b6b; text-shadow: 0 6px 30px rgba(201, 42, 42, 0.5); font-size: 52px; }
#hw-time { font-size: 18px; color: var(--text); }
#hw-time b { color: var(--gold); }
.hw-actions { display: flex; gap: 14px; }
.hw-actions .menu-btn { width: 240px; }
.spell-mini.forgotten, .forgotten { filter: grayscale(1) brightness(0.45) !important; }

/* ---------- Achievement Hunt: the map (Space) ---------- */
#hunt-map { position: absolute; inset: 0; z-index: 24; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
    background: rgba(8, 6, 16, 0.75); pointer-events: none; }
#hunt-map.hidden { display: none; }
.hm-head { width: 560px; display: flex; justify-content: space-between; align-items: baseline; }
.hm-head b { font-family: var(--ui-font); font-size: 22px; font-weight: 600; color: var(--gold); letter-spacing: 0.12em; }
.hm-head span { font-size: 12px; color: var(--muted); }
#hm-canvas { width: 560px; height: 560px; border-radius: 10px; box-shadow: 0 0 0 1px var(--line-2), 0 10px 30px rgba(0, 0, 0, 0.5); image-rendering: pixelated; background: #06070c; }
.hm-legend { display: flex; gap: 16px; font-size: 12px; color: #d6d0ec; }
.hm-legend i { display: inline-block; width: 9px; height: 9px; margin-right: 5px; border: 1px solid #000; vertical-align: -1px; }
.lg-you { background: #4dabf7; border-radius: 50%; } .lg-card { background: #ffd43b; border-radius: 50%; } .lg-chest { background: #d08a4a; } .lg-well { background: #74c0fc; border-radius: 50%; }

/* ---------- Training ground ---------- */
#game-container.training-mode #ai-hud { visibility: hidden; }
#training-menu { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 22; pointer-events: auto; background: rgba(20, 16, 36, 0.96); padding: 16px 18px; }
.tm-title { font-family: var(--ui-font); font-size: 20px; font-weight: 600; letter-spacing: 0.08em; color: var(--gold); margin-bottom: 12px; display: flex; justify-content: space-between; gap: 20px; }
.tm-title span { color: var(--text); }
#tm-grid { display: grid; grid-template-columns: repeat(4, auto); gap: 6px; }
.tm-spell { cursor: pointer; opacity: 0.55; border: 2px solid transparent; border-radius: 4px; }
.tm-spell:hover { opacity: 0.85; }
.tm-spell.on { opacity: 1; border-color: var(--gold); }
.tm-spell.nope { animation: tm-nope 0.3s ease-in-out; }
@keyframes tm-nope { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.tm-hint { font-size: 11px; color: var(--muted); margin-top: 10px; text-align: center; }

/* ---------- Match settings (Arena, Hunt, the room) ---------- */
#arena-settings, #hunt-settings { display: flex; flex-direction: column; gap: 8px; margin-bottom: 26px; width: 640px; }
.as-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 10px 14px 10px 18px; }
.as-label { font-family: var(--ui-font); font-size: 18px; font-weight: 500; letter-spacing: 0.08em; color: #fff; display: flex; flex-direction: column; gap: 1px; }
.as-label small { font-family: var(--body-font); font-size: 12px; font-weight: 500; letter-spacing: 0; color: var(--muted); }
.as-step { display: flex; align-items: center; gap: 8px; flex: none; }
.as-arrow { width: 32px; height: 32px; padding: 0; font-size: 13px; background: var(--panel-2); border-color: var(--line-2); }
.as-arrow:hover { background: var(--panel-3); border-color: rgba(179, 102, 240, 0.65); }
.as-value { width: 150px; text-align: center; font-family: var(--ui-font); font-size: 17px; font-weight: 500; letter-spacing: 0.06em; color: var(--gold); }
.as-step.fixed .as-value { width: 214px; }

/* ---------- Play with friends ---------- */
#screen-friends .arena-title { margin-bottom: 16px; }
.fr-box { width: 640px; display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.fr-box.hidden { display: none; }
.fr-label { font-family: var(--ui-font); font-size: 14px; letter-spacing: 0.1em; color: var(--muted); }
#fr-name, #fr-code {
    font-family: var(--ui-font); font-size: 22px; letter-spacing: 0.04em; color: #fff; background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--line-2); border-radius: 8px; padding: 9px 14px; outline: none; user-select: text; -webkit-user-select: text;
    transition: border-color 0.15s;
}
#fr-name:focus, #fr-code:focus { border-color: var(--purple-hi); }
#fr-code { width: 150px; text-transform: uppercase; letter-spacing: 0.3em; text-align: center; }
.fr-or { font-size: 13px; color: var(--muted); text-align: center; margin-top: 4px; }
.fr-joinrow { display: flex; gap: 10px; justify-content: center; }
#fr-msg { font-size: 15px; color: #ffd8a8; min-height: 22px; margin-bottom: 10px; text-align: center; max-width: 700px; }
.fr-code-row { display: flex; align-items: center; justify-content: space-between; font-family: var(--ui-font); font-size: 18px; letter-spacing: 0.08em; color: #d6d0ec; }
.fr-code-row b { color: var(--gold); font-weight: 600; font-size: 28px; letter-spacing: 0.25em; margin-left: 10px; }
#fr-seats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fr-acct { font-family: var(--body-font); font-size: 12px; font-weight: 500; letter-spacing: 0; color: var(--muted); margin-left: 4px; }
.fr-seat { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; box-shadow: inset 3px 0 0 var(--seat), 0 8px 24px rgba(0, 0, 0, 0.3); }
.fr-seat.empty { opacity: 0.6; }
.fr-sname { font-family: var(--ui-font); font-size: 18px; letter-spacing: 0.05em; color: #fff; }
.fr-srole { font-size: 12px; color: var(--muted); }
#fr-link { font-size: 13px; color: #8ce99a; min-height: 18px; }
#fr-settings { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }   /* two columns: the lobby fits the window even with 4 players */
#fr-settings .as-row { min-width: 0; gap: 8px; padding: 8px 8px 8px 14px; }
#fr-settings .as-label small { display: none; }   /* two columns: no room for the hint, it shows when you hover the row */
#fr-settings .as-value { width: 128px; font-size: 15px; }
#fr-settings .as-step.fixed .as-value { width: 170px; }
/* safety net: if the lobby is ever taller than the window it scrolls, so START / READY can always be reached */
#screen-friends { justify-content: safe center; overflow-y: auto; }
#fr-settings .as-row { padding: 7px 12px 7px 16px; }
#fr-settings .as-label { font-size: 16px; }
#fr-seats.four { grid-template-columns: 1fr 1fr; }
#fr-seats.four .fr-seat { padding: 7px 12px; }

/* ---------- a short message at the top (someone lost connection, ...) ---------- */
#toast { position: absolute; top: 74px; left: 50%; transform: translateX(-50%); z-index: 40; pointer-events: none;
         padding: 9px 18px; font-size: 15px; font-weight: 600; color: #fff; background: rgba(20, 16, 36, 0.95); border-color: rgba(242, 193, 78, 0.55); white-space: nowrap; }
#toast.show { animation: toastIn 0.25s ease-out; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }
