/* ==========================================================
   LEAGUE OF LISTEN — flat, minimal, League-inspired
   ========================================================== */
:root {
    --bg: #0a0e14;
    --surface: #111822;
    --line: #2a3340;
    --gold: #c8aa6e;
    --gold-light: #f0e6d2;
    --gold-dim: #5c4b2c;
    --teal: #0ac8b9;
    --text: #a09b8c;
    --text-dim: #6b6a63;
    --red: #e84057;
    --green: #3ddc97;
    --display: 'Cinzel', 'Times New Roman', serif;
    --body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

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

body {
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--body);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* One quiet light source behind the abilities — no textures */
.bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: radial-gradient(ellipse 50% 40% at 50% 45%, rgba(200, 170, 110, 0.05), transparent 70%);
}

.app {
    max-width: 880px;
    margin: 0 auto;
    padding: 24px 16px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ---------- Main menu ---------- */
.menu {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 4vh;
}
.menu[hidden], .game[hidden] { display: none; }
.menu-logo { width: min(380px, 80vw); height: auto; display: block; }
.menu-title {
    margin-top: 36px;
    font-family: var(--body);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--text-dim);
}
.modes {
    width: 100%;
    max-width: 720px;
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}
.mode-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 22px 22px 18px;
    text-align: left;
    border: 1px solid var(--line);
    border-top: 2px solid var(--gold-dim);
    background: var(--surface);
    color: var(--text);
    font-family: var(--body);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.mode-card:hover { border-color: var(--gold-dim); border-top-color: var(--gold); background: #141d29; transform: translateY(-2px); }
.mode-card:focus-visible { outline: 1px solid var(--teal); outline-offset: 3px; }
.mode-card-title {
    font-family: var(--display);
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--gold-light);
    letter-spacing: 0.04em;
}
.mode-card-desc { font-size: 0.88rem; line-height: 1.5; }
.mode-card-rules { display: flex; flex-wrap: wrap; gap: 6px; }
.mode-card-rules span {
    padding: 3px 8px;
    font-size: 0.7rem;
    color: var(--gold);
    border: 1px solid var(--line);
}
.mode-card-foot {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    font-size: 0.75rem;
}
.mode-card-best { color: var(--text-dim); }
.mode-card-play {
    font-family: var(--display);
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--gold);
}
.mode-card:hover .mode-card-play { color: var(--gold-light); }

/* Logo copy that flies between the menu and the game header */
.logo-ghost {
    position: fixed;
    z-index: 60;
    margin: 0;
    transform-origin: 0 0;
    pointer-events: none;
}

/* ---------- Game bar (back to menu + mode name) ---------- */
.game { width: 100%; display: flex; flex-direction: column; align-items: center; }
.gamebar {
    width: 100%;
    max-width: 880px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.back-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px 4px 2px;
    border: none;
    background: none;
    color: var(--text);
    font-family: var(--body);
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    cursor: pointer;
}
.back-btn svg { width: 16px; height: 16px; }
.back-btn:hover { color: var(--gold-light); }
.back-btn:focus-visible { outline: 1px solid var(--teal); }
.mode-name {
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--gold);
}

/* ---------- Top bar: lives | logo | score + remaining ---------- */
.topbar {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 24px;
}

.logo {
    width: min(280px, 44vw);
    height: auto;
    display: block;
}

.stat-left { justify-self: end; align-items: flex-end; }
.stat-left[hidden] { display: none; }
.ability[hidden] { display: none; }
/* Ult Only: one bigger button with room to grow */
.abilities.single { margin-top: 56px; margin-bottom: 30px; }
.abilities.single .ability { --size: clamp(96px, 22vw, 140px); }
.stat-group { justify-self: start; display: flex; }
.stat-group .stat { align-items: flex-start; }
.stat-group .stat + .stat { border-left: 1px solid var(--line); }

.stat {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 4px 18px;
}

.stat-label {
    white-space: nowrap;
    font-size: 0.62rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--text-dim);
}
.stat-value {
    font-family: var(--display);
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--gold-light);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.lives { display: flex; gap: 6px; height: 1.4rem; align-items: center; }
.life {
    width: 22px;
    height: 22px;
    fill: var(--gold);
    stroke: var(--gold);
    stroke-width: 1.5;
    transition: fill 0.3s, stroke 0.3s, transform 0.3s;
}
.life.lost { fill: transparent; stroke: var(--gold-dim); transform: scale(0.85); }

.bump { animation: bump 0.45s ease; }
@keyframes bump { 35% { transform: scale(1.2); } }
.lives.bump { animation: livesHit 0.45s ease; }
@keyframes livesHit {
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}

/* ---------- Abilities ---------- */
.abilities {
    display: flex;
    justify-content: center;
    gap: clamp(18px, 5vw, 48px);
    margin-top: 40px;
}

.ability {
    --size: clamp(68px, 15vw, 118px);
    width: var(--size);
    height: var(--size);
    padding: 0;
    border: none;
    border-radius: 50%;
    background: none;
    cursor: pointer;
    position: relative;
    transition: transform 0.25s ease;
    -webkit-tap-highlight-color: transparent;
}
.ability.playing { transition: none; z-index: 1; }

/* The circle and the sound ring are drawn with SVG instead of CSS borders.
   Firefox draws rounded CSS borders in four quarters, and while scaling them
   the seams showed up as lines through the middle of the button. */
.ability-shape {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
}
.disc {
    fill: var(--surface);
    stroke: var(--gold);
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
    transition: fill 0.2s, stroke 0.2s;
}
.ability:hover .disc { fill: #16202c; }
.ability.playing .disc { stroke: var(--teal); }
/* Thin ring that expands with the sound (size/opacity set from script.js) */
.ring {
    fill: none;
    stroke: var(--teal);
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
    opacity: 0;
    transform-box: fill-box;
    transform-origin: center;
}

.ability-core { display: grid; place-items: center; width: 100%; height: 100%; }

.key {
    font-family: var(--display);
    font-weight: 600;
    font-size: calc(var(--size) * 0.32);
    color: var(--gold);
    user-select: none;
    transition: color 0.2s;
}

.ability:hover .key { color: var(--gold-light); }
.ability.playing .key { color: var(--gold-light); }
.ability:focus-visible { outline: 1px solid var(--teal); outline-offset: 6px; }

/* Variant dots: shown when an ability has several sounds (q, q1, q2 …) */
.ability-core { position: relative; z-index: 1; }
.variants {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 16%;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 3px;
    padding: 0 22%;
    pointer-events: none;
}
.variants span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    border: 1px solid var(--gold-dim);
}
.variants span.on { background: var(--gold-dim); }
.variants span.now { background: var(--teal); border-color: var(--teal); }

/* Ability with no recording */
.ability.unavailable { cursor: not-allowed; }
.ability.unavailable .disc { stroke: var(--gold-dim); stroke-dasharray: 5 5; }
.ability.unavailable .key { color: var(--gold-dim); }
.ability.unavailable:hover .disc { fill: var(--surface); }

/* ---------- Scoreboard (under the abilities) ---------- */
.scoreboard {
    display: flex;
    align-items: stretch;
    justify-content: center;
    margin-top: 26px;
}
.score-main,
.score-round {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    padding: 0 28px;
}
.score-round { border-left: 1px solid var(--line); }
.score-round[hidden] { display: none; }
.score-value {
    font-family: var(--display);
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
    color: var(--gold-light);
    font-variant-numeric: tabular-nums;
    display: inline-block;
}
.round-value {
    font-family: var(--display);
    font-size: 1.6rem;
    font-weight: 600;
    line-height: 1;
    color: var(--teal);
    font-variant-numeric: tabular-nums;
    display: inline-block;
    padding-bottom: 4px;
}

/* Ability cost tag (Fewest Abilities mode) */
.cost {
    position: absolute;
    top: -4px;
    right: -4px;
    padding: 2px 6px;
    font-family: var(--body);
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--gold-light);
    background: var(--bg);
    border: 1px solid var(--gold-dim);
    pointer-events: none;
}
.cost[hidden] { display: none; }

.drop { animation: drop 0.4s ease; }
@keyframes drop { 30% { transform: translateY(3px); color: var(--red); } }

/* ---------- Waveform ---------- */
.wave {
    display: block;
    width: min(640px, 100%);
    height: 76px;
    margin-top: 10px;
}

.file-notice {
    width: 100%;
    max-width: 640px;
    margin-bottom: 16px;
    padding: 10px 14px;
    font-size: 0.8rem;
    color: var(--gold-light);
    border-left: 2px solid var(--gold);
    background: var(--surface);
}
.file-notice[hidden] { display: none; }
.file-notice strong { color: var(--gold); font-weight: 600; }

/* ---------- Volume (under the abilities) ---------- */
.volume {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 14px;
    padding: 10px 18px;
    border: 1px solid var(--line);
    background: var(--surface);
}
.volume-btn {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    color: var(--gold);
    cursor: pointer;
}
.volume-btn:hover { color: var(--gold-light); }
.volume-btn:focus-visible { outline: 1px solid var(--teal); }
.volume-btn svg { width: 22px; height: 22px; }
.volume-btn .cross { display: none; }
.volume-btn.muted { color: var(--text-dim); }
.volume-btn.muted .wave { display: none; }
.volume-btn.muted .cross { display: inline; }
.volume-value {
    width: 2.2em;
    text-align: right;
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
    color: var(--gold-light);
}

.hint {
    margin-top: 14px;
    font-size: 0.75rem;
    color: var(--text-dim);
    text-align: center;
}
kbd {
    display: inline-block;
    min-width: 1.6em;
    padding: 0 4px;
    font-family: var(--body);
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 2px;
}

/* ---------- Reveal ---------- */
.reveal-slot {
    height: 56px;
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.reveal {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-right: 18px;
    border-left: 2px solid var(--gold);
    background: var(--surface);
    animation: revealIn 0.25s ease;
}
.reveal[hidden] { display: none; }
.reveal.correct { border-left-color: var(--green); }
.reveal.wrong { border-left-color: var(--red); }
.reveal-img { width: 48px; height: 48px; object-fit: cover; display: block; }
.reveal-title { font-size: 0.62rem; letter-spacing: 0.2em; text-transform: uppercase; }
.reveal.correct .reveal-title { color: var(--green); }
.reveal.wrong .reveal-title { color: var(--red); }
.reveal-name { font-family: var(--display); font-size: 1.1rem; font-weight: 600; color: var(--gold-light); }
@keyframes revealIn { from { opacity: 0; transform: translateY(-6px); } }

/* ---------- Guess ---------- */
.guess {
    width: 100%;
    max-width: 560px;
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.search {
    position: relative;
    display: flex;
    align-items: center;
    border: 1px solid var(--line);
    background: var(--surface);
    transition: border-color 0.2s;
}
.search:focus-within { border-color: var(--gold); }
.search.correct { animation: flashGood 0.6s ease; }
.search.wrong { animation: shake 0.35s ease, flashBad 0.6s ease; }
@keyframes flashGood { 20% { border-color: var(--green); } }
@keyframes flashBad { 20% { border-color: var(--red); } }
@keyframes shake {
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.search-icon {
    flex: none;
    width: 40px;
    height: 40px;
    margin: 7px 0 7px 7px;
    display: grid;
    place-items: center;
    color: var(--text-dim);
    overflow: hidden;
}
.search-icon img { width: 100%; height: 100%; object-fit: cover; animation: iconIn 0.2s ease; }
.search-icon svg { width: 18px; height: 18px; }
@keyframes iconIn { from { opacity: 0; } }

#userInput {
    flex: 1;
    min-width: 0;
    height: 54px;
    padding: 0 14px 0 12px;
    border: none;
    outline: none;
    background: transparent;
    color: var(--gold-light);
    font-family: var(--body);
    font-size: 1.05rem;
}
#userInput::placeholder { color: var(--text-dim); }

/* Suggestions dropdown */
.suggestions {
    list-style: none;
    position: absolute;
    left: -1px;
    right: -1px;
    top: calc(100% + 4px);
    z-index: 20;
    max-height: 312px;
    overflow-y: auto;
    overscroll-behavior: contain; /* scrolling the list never scrolls the page */
    border: 1px solid var(--line);
    background: var(--surface);
}
.suggestions[hidden] { display: none; }
.suggestions.above { top: auto; bottom: calc(100% + 4px); }

.suggestion {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 5px 12px 5px 5px;
    cursor: pointer;
    color: var(--text);
    border-left: 2px solid transparent;
}
.suggestion.active {
    background: #19222e;
    border-left-color: var(--gold);
    color: var(--gold-light);
}
.suggestion img { width: 34px; height: 34px; object-fit: cover; flex: none; }
.suggestion mark { background: none; color: var(--gold); font-weight: 600; }
.suggestion.guessed { opacity: 0.4; }
.suggestion.guessed img { filter: grayscale(1); }
.suggestion .tag {
    margin-left: auto;
    font-size: 0.6rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-dim);
}
.suggestion-empty { padding: 12px 14px; font-size: 0.9rem; cursor: default; color: var(--text-dim); }

/* Buttons */
.actions { display: flex; gap: 12px; }

.btn {
    height: 48px;
    padding: 0 26px;
    font-family: var(--display);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 0;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn:focus-visible { outline: 1px solid var(--teal); outline-offset: 3px; }

.btn-primary {
    flex: 1;
    color: var(--bg);
    border: 1px solid var(--gold);
    background: var(--gold);
}
.btn-primary:hover { background: var(--gold-light); border-color: var(--gold-light); }

.btn-ghost {
    color: var(--text);
    border: 1px solid var(--line);
    background: transparent;
}
.btn-ghost:hover { color: var(--gold-light); border-color: var(--gold); }

/* ---------- Footer ---------- */
.footer {
    display: flex;
    justify-content: center;
    padding: 0 16px 24px;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: clamp(160px, 40vw, 320px);
    height: 4px;
    background: linear-gradient(90deg, var(--gold) var(--fill, 50%), var(--line) var(--fill, 50%));
    cursor: pointer;
}
input[type="range"]:focus-visible { outline: 1px solid var(--teal); outline-offset: 8px; }
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px; height: 14px;
    background: var(--gold-light);
    border: 2px solid var(--gold);
    transform: rotate(45deg);
}
input[type="range"]::-moz-range-thumb {
    width: 12px; height: 12px;
    background: var(--gold-light);
    border: 2px solid var(--gold);
    border-radius: 0;
    transform: rotate(45deg);
}

.donate {
    font-size: 0.8rem;
    color: var(--text);
    text-decoration: none;
    transition: color 0.15s;
}
.donate:hover { color: var(--gold-light); }

/* ---------- Browse button (inside the search field) ---------- */
.browse-btn {
    flex: none;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    margin-right: 7px;
    padding: 0 12px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--text);
    font-family: var(--body);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}
.browse-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.browse-btn:hover,
.browse-btn[aria-expanded="true"] { color: var(--gold-light); border-color: var(--gold); }
.browse-btn:focus-visible { outline: 1px solid var(--teal); outline-offset: 2px; }

/* ---------- Champion browser ---------- */
.browser { z-index: 40; align-items: start; padding-top: 6vh; }
.browser-panel {
    width: min(760px, 100%);
    max-height: 86vh;
    display: flex;
    flex-direction: column;
    border-top: 2px solid var(--gold);
    background: var(--surface);
}
.browser-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 8px;
}
.browser-head h2 {
    font-family: var(--display);
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--gold-light);
}
.icon-btn {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    color: var(--text);
    cursor: pointer;
}
.icon-btn:hover { color: var(--gold-light); }
.icon-btn svg { width: 20px; height: 20px; }

.roles {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 20px 14px;
    border-bottom: 1px solid var(--line);
}
.role-btn {
    padding: 7px 14px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--text);
    font-family: var(--body);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.role-btn:hover { color: var(--gold-light); border-color: var(--gold-dim); }
.role-btn.active { color: var(--bg); background: var(--gold); border-color: var(--gold); }
.role-btn:focus-visible { outline: 1px solid var(--teal); outline-offset: 2px; }

.browser-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
    gap: 10px;
    padding: 16px 20px;
    overflow-y: auto;
}
.tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: none;
    background: none;
    color: var(--text);
    font-family: var(--body);
    font-size: 0.7rem;
    cursor: pointer;
}
.tile[hidden] { display: none; }
.tile img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
    border: 1px solid var(--line);
    transition: border-color 0.15s, transform 0.15s;
}
.tile span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tile:hover img { border-color: var(--gold); transform: translateY(-2px); }
.tile:hover span { color: var(--gold-light); }
.tile:focus-visible { outline: 1px solid var(--teal); outline-offset: 2px; }
.tile.guessed { cursor: default; opacity: 0.3; }
.tile.guessed img { filter: grayscale(1); }
.tile.guessed:hover img { border-color: var(--line); transform: none; }
.tile.guessed:hover span { color: var(--text); }

.browser-empty { padding: 0 20px 16px; font-size: 0.85rem; color: var(--text-dim); }
.browser-empty[hidden] { display: none; }
.browser-foot {
    padding: 12px 20px;
    font-size: 0.72rem;
    color: var(--text-dim);
    border-top: 1px solid var(--line);
}

/* ---------- End screen ---------- */
.overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(10, 14, 20, 0.92);
    animation: fadeIn 0.3s ease;
}
.overlay[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } }

.end-card {
    width: min(380px, 100%);
    text-align: center;
    padding: 40px 36px;
    border-top: 2px solid var(--red);
    background: var(--surface);
}
.overlay.won .end-card { border-top-color: var(--gold); }
.end-title {
    font-family: var(--display);
    font-size: 2.4rem;
    font-weight: 600;
    color: var(--red);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.overlay.won .end-title { color: var(--gold); }
.end-card p { margin-top: 10px; font-size: 0.9rem; }
.end-score {
    margin: 22px 0 26px !important;
    font-size: 0.62rem !important;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--text-dim);
}
.end-score span {
    display: block;
    margin-top: 6px;
    font-family: var(--display);
    font-size: 2rem;
    letter-spacing: 0;
    color: var(--gold-light);
}
.end-card .btn { width: 100%; }
.end-card .btn + .btn { margin-top: 10px; }
.end-best { margin: -14px 0 22px !important; font-size: 0.75rem !important; color: var(--text-dim); }
.end-best.new { color: var(--gold); letter-spacing: 0.14em; text-transform: uppercase; }

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

/* ---------- Small screens ---------- */
@media (max-width: 600px) {
    .app { padding-top: 16px; }
    .topbar {
        grid-template-columns: 1fr 1fr;
        gap: 14px 8px;
    }
    .logo { grid-column: 1 / -1; grid-row: 1; justify-self: center; width: min(240px, 70vw); }
    .stat-left { justify-self: start; align-items: flex-start; padding-left: 0; }
    .stat-group { justify-self: end; }
    .stat { padding: 4px 12px; }
    .stat-group .stat { padding: 4px 8px; }
    .stat-label { letter-spacing: 0.14em; }
    .stat-value { font-size: 1.2rem; }
    .life { width: 20px; height: 20px; }
    .abilities { margin-top: 28px; }
    .volume { margin-top: 12px; }
    .wave { height: 52px; margin-top: 12px; }
    .scoreboard { margin-top: 20px; }
    .score-value { font-size: 2.4rem; }
    .hint { font-size: 0.7rem; }
    .actions { flex-direction: column; }
    .btn-primary { flex: none; }
    .browse-btn span { display: none; }
    .menu { padding-top: 2vh; }
    .menu-title { margin-top: 24px; }
    .browser { padding: 0; }
    .browser-panel { max-height: 100vh; height: 100%; }
    .browser-grid { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); padding: 12px 16px; }
    .roles { padding: 8px 16px 12px; }
}

@media (prefers-reduced-motion: reduce) {
    .search.wrong, .search.correct, .bump, .reveal, .overlay { animation: none; }
}
