/* osu!gang: dark aubergine, osu! hit circles, one big approach-circle moment. */

/* Typography like osu.ppy.sh: Quicksand, the rounded free typeface osu-web itself uses as the
   stand-in for its licensed font (OFL licence, see fonts/QUICKSAND-LICENSE.txt).
   Weights as on osu!: 400 text, 500 the menu, 600 labels and tabs, 700 "bold" (titles, buttons,
   names) which is SemiBold like osu's, 800 the real Bold for the biggest headlines. */
@font-face { font-family: "Quicksand"; font-weight: 300; font-display: swap; src: url("../fonts/quicksand-300.woff") format("woff"); }
@font-face { font-family: "Quicksand"; font-weight: 400; font-display: swap; src: url("../fonts/quicksand-400.woff") format("woff"); }
@font-face { font-family: "Quicksand"; font-weight: 500; font-display: swap; src: url("../fonts/quicksand-500.woff") format("woff"); }
@font-face { font-family: "Quicksand"; font-weight: 600; font-display: swap; src: url("../fonts/quicksand-600.woff") format("woff"); }
@font-face { font-family: "Quicksand"; font-weight: 700; font-display: swap; src: url("../fonts/quicksand-600.woff") format("woff"); }
@font-face { font-family: "Quicksand"; font-weight: 800; font-display: swap; src: url("../fonts/quicksand-700.woff") format("woff"); }
@font-face { font-family: "Quicksand"; font-weight: 900; font-display: swap; src: url("../fonts/quicksand-700.woff") format("woff"); }
/* the 3, 2, 1, Go on the table (OFL licence, see fonts/MONTSERRAT-LICENSE.txt) */
@font-face { font-family: "Montserrat"; font-weight: 900; font-display: swap; src: url("../fonts/montserrat-900.woff") format("woff"); }

:root {
  /* Every page has its own hue, like on osu.ppy.sh (purple home, blue map pool, green history, pink
     multiplayer, gold results): the box, its sections and the accent colours are mixed from it. */
  --hue: 333;
  --bg: hsl(var(--hue) 10% 10%);
  --surface: hsl(var(--hue) 10% 14%);
  --surface-2: hsl(var(--hue) 10% 19%);
  --line: hsl(var(--hue) 10% 26%);
  --accent: hsl(var(--hue) 75% 72%);
  --text: #f4edfb;
  --muted: hsl(var(--hue) 12% 70%);
  --pink: #ff66aa;
  --gold: #ffcc4d;
  --cyan: #4dd8ff;
  --good: #7ee08a;
  --bad: #ff7a7a;
  --radius: 0; /* flat edges everywhere, like osu.ppy.sh's panels */
  --font: "Quicksand", "Inter", "Helvetica Neue", Tahoma, Arial, "Hiragino Kaku Gothic ProN", Meiryo, "Microsoft YaHei", "Apple SD Gothic Neo", sans-serif;
  /* the osu! website's dark greys: a pink-tinted hue 333 */
  --nav-bg: hsl(var(--hue) 10% 13%);
  --nav-bg-2: hsl(var(--hue) 10% 18%);
  --nav-line: hsl(var(--hue) 10% 22%);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --name-default: #b4aec2; /* names are grey until a player picks a colour */
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font: 16px/1.5 var(--font);
  font-feature-settings: "kern", "liga";
  color: var(--text);
  background-color: var(--bg);
}
h1, h2 { line-height: 1.15; margin: 0 0 0.6rem; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); font-weight: 700; }
h2 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 0.8rem; }
a { color: var(--accent); }
ul, ol { list-style: none; margin: 0; padding: 0; }
.hidden { display: none !important; }

:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }

/* ---------- layout ----------
   Four screen widths, and only these: 960px (two columns become one), 900px (osu's phone cut-off:
   the slim top bar), 760px (phone spacing) and 600px (narrow phones). */
#app { max-width: 1100px; margin: 0 auto; padding: 0 16px 64px; }
/* Above Full HD the whole site scales up (v4.22), so a 1440p or 4K screen doesn't show the same
   small page in a sea of background. Full HD itself is unchanged; the steps leave more room than
   Full HD has, so the game fits without scrolling. (Media queries still go by the real width.) */
@media (min-width: 2300px) { html { zoom: 1.25; } } /* 1440p and up (a 1440p screen Windows already scales to 125% reports 2048px and stays as it is) */
@media (min-width: 3300px) and (min-height: 1700px) { html { zoom: 1.6; } } /* 4K; not an ultrawide 1440p, which has no room for it */
/* the top bar, like osu.ppy.sh's: the logo, lowercase menu links with a pink bar under the current
   one, and you on the right. Two parts, as on osu:
   - the banner (.topbar, 160px tall) scrolls with the page: osu's dark triangle pattern across the
     width, your profile cover in the middle with blurred edges, and the page's box starting over its
     bottom 60px (see .page);
   - the menu row (.topbar-bar) is fixed to the top of the window. Over the banner it is see-through
     and 100px tall; once the page is scrolled past 30px (osu's cut-off, see pinTopbar in main.js) it
     is "pinned": a 50px bar in the page's colour, the logo and your picture smaller, the change
     animated over 300ms exactly as osu does it.
   Under 900px wide (osu's phone cut-off) there is no banner: the slim bar all the time, and the
   links fold out from a menu button, like osu's phone bar. */
.topbar { position: relative; min-height: 160px; background-color: hsl(var(--hue) 14% 12%); background-image: linear-gradient(to bottom, hsl(var(--hue) 45% 34%), hsl(var(--hue) 30% 20%) 55%, hsl(var(--hue) 14% 12%)); } /* the page's colour, brightest at the top, fading into the dark (v4.22.2) */
/* the banner's pattern: our own drift of triangles hanging from the top (static/img/header-pattern.svg),
   white and black on transparent, so the page's own hue shows through it; it repeats sideways without a seam */
.topbar::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: url("../img/header-pattern.svg") center top / auto 100% repeat-x;
  opacity: 0.9;
}
/* the fixed menu row: under the pop-ups and modals (they dim it too), over everything on the page */
.topbar-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 10; height: 100px; background-color: hsl(var(--hue) 50% 45% / 0); }
/* sizes as on osu.ppy.sh: a 100px bar, a big logo circle, 15px links, a 60px picture */
.topbar-inner { position: relative; display: flex; align-items: center; gap: 8px; height: 100%; max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.brand { display: inline-flex; align-items: center; gap: 12px; margin-right: 10px; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.35rem; letter-spacing: -0.01em; white-space: nowrap; }
.brand-dot { width: 56px; height: 56px; border-radius: 50%; background: var(--pink); border: 5px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.4); }
.topbar-toggle { display: none; }
/* pinned: the slim bar in the page's colour (osu's "h2" colour), the logo and the picture at 40px */
.topbar.is-pinned .topbar-bar { height: 50px; background-color: hsl(var(--hue) 50% 45%); box-shadow: 0 1px 8px rgba(0, 0, 0, 0.35); }
.topbar.is-pinned .brand-dot { width: 40px; height: 40px; border-width: 4px; }
.topbar.is-pinned .me-avatar .avatar { width: 40px; height: 40px; font-size: 1rem; }
/* the 300ms slide, switched on after the first paint so a page opened half-way down does not start
   with one; none at all for people who asked their system for less motion */
.topbar-animate .topbar-bar { transition: height 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease; }
.topbar-animate .brand-dot { transition: width 0.3s ease, height 0.3s ease, border-width 0.3s ease; }
.topbar-animate .me-avatar .avatar { transition: width 0.3s ease, height 0.3s ease, font-size 0.3s ease; }
@media (prefers-reduced-motion: reduce) {
  .topbar-animate .topbar-bar, .topbar-animate .brand-dot, .topbar-animate .me-avatar .avatar { transition: none; }
}

.view { position: relative; z-index: 1; }
/* the page's box: sharp corners, over the bottom of the banner, everything on the page inside it */
.page { margin: -60px 0 0; background: var(--surface); box-shadow: 0 0 20px rgba(0, 0, 0, 0.45); }
.page-head { display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 10px 40px; background: var(--surface-2); }
.page-icon { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex: none; border: 2px solid #fff; border-radius: 10px; }
.page-icon .ico { width: 20px; height: 20px; fill: #fff; }
.page-title { margin: 0; font-size: 1.5rem; font-weight: 600; letter-spacing: 0; }
.page-tabs { display: flex; gap: 6px; padding: 0 40px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.page-tab { position: relative; padding: 12px 10px 14px; font-size: 0.9rem; font-weight: 600; color: var(--text); text-decoration: none; }
.page-tab.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; border-radius: 4px 4px 0 0; background: var(--accent); }
.page-body { padding: 24px 40px 32px; }
.page-room .page-body { padding: 16px 24px 28px; }
@media (max-width: 760px) {
  .page-head { padding: 8px 16px; min-height: 52px; }
  .page-title { font-size: 1.25rem; }
  .page-tabs { padding: 0 16px; }
  .page-body { padding: 16px 14px 24px; }
}
.stage { max-width: 760px; margin: 0 auto; padding-top: 8px; }
.screen-results .stage, .screen-playing .stage { max-width: none; }
.lede { color: var(--muted); max-width: 60ch; }
.hint { color: var(--muted); font-size: 0.9rem; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 18px 0 8px; }

/* ---------- controls ---------- */
.btn {
  appearance: none;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.55rem 1rem;
  font: inherit; font-weight: 700;
  color: var(--text); text-decoration: none;
  background: var(--surface-2);
  border: 2px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.12s var(--ease), background 0.12s, border-color 0.12s;
}
.btn:hover:not(:disabled) { border-color: var(--accent); }
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary { background: hsl(var(--hue) 60% 52%); border-color: hsl(var(--hue) 60% 52%); color: #fff; }
.btn.primary:hover:not(:disabled) { background: hsl(var(--hue) 65% 60%); border-color: hsl(var(--hue) 65% 60%); }
.btn.big { padding: 0.8rem 1.6rem; font-size: 1.1rem; }
.btn.small { padding: 0.25rem 0.7rem; font-size: 0.85rem; }
.btn.quiet { background: transparent; border-color: transparent; color: var(--muted); }
.btn.quiet:hover:not(:disabled) { color: var(--text); border-color: var(--line); }

.field {
  width: 100%; min-width: 0;
  padding: 0.6rem 0.8rem;
  font: inherit; color: var(--text);
  background: var(--bg);
  border: 2px solid var(--line);
  border-radius: 10px;
}
.field::placeholder { color: hsl(var(--hue) 10% 50%); }
.code-input { text-transform: uppercase; letter-spacing: 0.08em; }
.code-input::placeholder { text-transform: none; letter-spacing: 0; } /* the code itself is upper case, the hint is not */

.segmented { display: inline-flex; background: var(--bg); border: 2px solid var(--line); border-radius: 999px; padding: 2px; }
.seg { appearance: none; border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 600; padding: 0.3rem 0.9rem; border-radius: 999px; cursor: pointer; }
.seg.on { background: hsl(var(--hue) 60% 52%); color: #fff; }
.seg:disabled { cursor: default; }
.seg:disabled:not(.on) { opacity: 0.5; }

.panel { background: var(--surface-2); border: 0; border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; flex-wrap: wrap; }
.setting-name { color: var(--muted); }
.invite-row { display: flex; gap: 8px; margin-bottom: 10px; }
.code-line { color: var(--muted); }
.code { color: var(--text); letter-spacing: 0.14em; font-size: 1.15rem; }

.notice { padding: 0.7rem 1rem; border-radius: var(--radius); border: 2px solid var(--line); background: var(--surface-2); }
.notice.warn { border-color: var(--gold); }
.notice.error { border-color: var(--bad); }
.notice.info { border-color: var(--cyan); display: block; text-decoration: none; color: var(--text); }

/* ---------- players ---------- */
.avatar { display: inline-flex; width: 40px; height: 40px; border-radius: 50%; overflow: hidden; background: var(--surface-2); border: 2px solid var(--line); flex: none; }
.avatar.sm { width: 32px; height: 32px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.initial { margin: auto; font-weight: 700; }
.avatar-slot { display: inline-flex; }
.roster { display: grid; gap: 8px; margin: 14px 0; }
.player, .lobby-row, .edit-row {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 0;
}
.player.offline { opacity: 0.55; }
.p-main { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.p-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.p-name { font-weight: 700; overflow-wrap: anywhere; color: var(--name-color, var(--name-default)); }
a.p-name { text-decoration: none; }
a.p-name:hover { text-decoration: underline; }
.p-rank { color: var(--muted); font-size: 0.85rem; }
.p-end { display: inline-flex; align-items: center; gap: 10px; }
.tag { white-space: nowrap; font-size: 0.72rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.tag.host { background: var(--gold); color: #3a2a00; }
.tag.you { background: var(--cyan); color: #00323f; }

/* ---------- coins: poker chips with a striped edge, stars in a ring = the place ---------- */
.coin {
  --size: 46px;
  appearance: none;
  display: inline-flex; flex: none;
  width: var(--size); height: var(--size);
  padding: 0; margin: 0;
  color: inherit; background: none; border: 0; border-radius: 50%;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}
.coin.xs { --size: 22px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5)); }
.coin.sm { --size: 30px; }
.coin.md { --size: 46px; }
.coin.lg { --size: 72px; }
.coin-svg { width: 100%; height: 100%; display: block; }
.coin-body { fill: var(--coin); }
.coin-edge { fill: none; stroke: #fff; stroke-width: 9; opacity: 0.92; }
.coin-rim { fill: none; stroke: rgba(0, 0, 0, 0.45); stroke-width: 1.4; }
.coin-face { fill: color-mix(in srgb, var(--coin) 22%, #120a1a); }
.coin-ring { fill: none; stroke: color-mix(in srgb, var(--coin) 70%, white); stroke-width: 1.6; }
.coin-star { fill: var(--coin); stroke: rgba(0, 0, 0, 0.35); stroke-width: 0.6; stroke-linejoin: round; }
.coin-num { fill: color-mix(in srgb, var(--coin) 62%, #120a1a); font-family: var(--font); } /* a little lighter than the face, nothing loud */
.coin.xs .coin-num, .coin.sm .coin-num, .seat-history .coin-num, .help-coin .coin-num { font-size: 24px; }
.medal-num { fill: var(--coin); font-family: var(--font); paint-order: stroke; stroke: rgba(0, 0, 0, 0.35); stroke-width: 1.2; } /* the place, in the medal's metal */
button.coin { cursor: default; transition: transform 0.14s var(--ease), filter 0.14s; }
button.coin.can { cursor: pointer; }
button.coin.can:hover { transform: scale(1.1) rotate(-4deg); filter: drop-shadow(0 4px 10px rgba(255, 255, 255, 0.35)); }
button.coin.can:active { transform: scale(0.95); }
button.coin:disabled { opacity: 1; }
.coin.mine { filter: drop-shadow(0 0 8px var(--gold)); }

/* ---------- the round table ---------- */
.round-screen { display: flex; flex-direction: column; align-items: center; }
/* v4.22: what the coins mean, above the round the whole time: a strip in the osu! grade colours (D
   red on the left, S gold on the right), under it the 1-star coin (last place) and the most-starred
   coin (first place). */
.round-top { display: flex; align-items: stretch; justify-content: center; gap: 8px; width: min(100%, 820px); margin: 0 0 12px; }
.round-bubble { display: flex; flex-direction: column; justify-content: center; flex: none; min-width: 96px; padding: 6px 14px; text-align: center; line-height: 1.15; background: var(--surface-2); border: 1px solid var(--line); }
.round-no { font-size: 1rem; font-weight: 800; white-space: nowrap; }
.round-kind { font-size: 0.7rem; color: var(--muted); white-space: nowrap; }
.coin-legend { display: flex; flex-direction: column; justify-content: center; gap: 8px; flex: 1 1 auto; min-width: 0; padding: 8px 12px 9px; background: var(--surface-2); border: 1px solid var(--line); }
.legend-bar { display: block; height: 8px; border-radius: 999px; background: linear-gradient(to right, #ff5c5c, #c47bff, #4fb3ea, #88da20, #ffcc22); }
.legend-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.legend-end { display: inline-flex; align-items: center; gap: 8px; flex: none; }
.legend-end .coin { --size: 42px; }
.legend-words { display: flex; flex-direction: column; line-height: 1.15; }
.legend-end.right .legend-words { text-align: right; }
.legend-words b { font-size: 0.85rem; font-weight: 800; }
.legend-words small { font-size: 0.7rem; color: var(--muted); white-space: nowrap; }
.legend-middle { flex: 1 1 auto; text-align: center; font-size: 0.75rem; color: var(--muted); }
@media (max-width: 760px) {
  .round-top { flex-wrap: wrap; margin-bottom: 10px; }
  .round-bubble { flex-direction: row; align-items: baseline; justify-content: center; gap: 8px; width: 100%; min-width: 0; padding: 4px 10px; }
  .coin-legend { gap: 6px; padding: 6px 10px 7px; }
  .legend-bar { height: 6px; }
  .legend-end .coin { --size: 32px; }
  .legend-words small { display: none; }
  .legend-middle { display: none; }
}
.round-title { font-size: clamp(1.1rem, 3vw, 1.35rem); margin-bottom: 0.1rem; text-align: center; max-width: 100%; }
.round-hint { text-align: center; min-height: 2.6em; margin-bottom: 0.3rem; font-size: 0.85rem; color: var(--muted); max-width: 60ch; }
/* the table: one big round poker felt that takes the whole box (as big as the column and the screen
   allow). Everything is on the felt: the seats along its rim, engraved into it, each seat's held
   coin just inside its seat, and the free coins with the timer in the middle. */
/* the felt takes the page's colour (the lobby's osu! pink): a lighter cloth than the box behind it,
   the engravings a much darker shade of the same colour with a faint light edge, and a thin
   modern rim: a bright ring in the page's colour with a soft dark halo */
.table { position: relative; width: min(100%, calc(100vh - 250px)); min-width: min(100%, 420px); aspect-ratio: 1; margin: 0 auto; container-type: inline-size; }
/* scaled-up screens (v4.22): the table sized so the whole round fits the window. (Under zoom, 100vh is
   still the window's real height, so it is divided by the zoom.) */
@media (min-width: 2300px) { .table { width: min(100%, calc(100vh / 1.25 - 490px)); } }
@media (min-width: 3300px) and (min-height: 1700px) { .table { width: min(100%, calc(100vh / 1.6 - 490px)); } }
.felt {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, hsl(var(--hue) 28% 38%), hsl(var(--hue) 26% 32%) 60%, hsl(var(--hue) 26% 29%) 100%);
  border: 3px solid hsl(var(--hue) 70% 62% / 0.75);
  box-shadow: inset 0 0 0 1px hsl(var(--hue) 60% 75% / 0.2), inset 0 0 90px hsl(var(--hue) 40% 10% / 0.55), 0 0 0 8px hsl(var(--hue) 20% 15%), 0 14px 44px rgba(0, 0, 0, 0.55);
}
.table-center {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 46%;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.round-screen .word, .round-screen .timer-text { color: #fff; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6); }
.round-screen .timer .bar { background: hsl(var(--hue) 40% 14% / 0.5); }
.round-screen .timer .fill { background: var(--accent); }
.seat-card.me { border-color: hsl(var(--hue) 70% 72% / 0.7); }
.table.stage-pick .felt { border-color: hsl(var(--hue) 75% 66%); box-shadow: inset 0 0 0 1px hsl(var(--hue) 60% 75% / 0.3), inset 0 0 90px hsl(var(--hue) 40% 10% / 0.55), 0 0 0 8px hsl(var(--hue) 20% 15%), 0 0 28px hsl(var(--hue) 70% 60% / 0.35), 0 14px 44px rgba(0, 0, 0, 0.55); }
/* the countdown and timer live ABOVE the coins and never cover them */
.call { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; min-height: 6rem; width: 100%; }
.word { font-family: "Montserrat", "Quicksand", sans-serif; font-size: clamp(2.6rem, 8vw, 4.6rem); font-weight: 900; letter-spacing: 0.02em; line-height: 1; opacity: 0; }
.word.fade { animation: fade 0.95s ease-out forwards; }
.timer { width: min(170px, 100%); text-align: center; }
.timer-text { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.timer.urgent .timer-text { color: var(--bad); }
.bar { display: block; height: 6px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.fill { display: block; height: 100%; width: 100%; background: var(--pink); transform-origin: left center; transform: scaleX(var(--p, 1)); }
.timer.urgent .fill { background: var(--bad); }
.tray { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; max-width: 100%; min-height: 72px; }
.tray.pop-in .coin { animation: pop-in 0.35s var(--ease) backwards; }
/* v4.22: every coin has a fixed place on the table. While it is in somebody's hands, its place stays
   as a faint outline with the number, so the other coins never shift and nobody grabs the wrong one. */
.tray-slot { position: relative; display: inline-flex; align-items: center; justify-content: center; width: var(--size, 72px); height: var(--size, 72px); border-radius: 50%; } /* --size: the same rules as the coins below */
.tray-slot.empty { border: 2px dashed hsl(var(--hue) 50% 80% / 0.35); }
.tray-slot.empty::after { content: attr(data-n); font-weight: 800; font-size: 1rem; color: hsl(var(--hue) 50% 85% / 0.4); }
/* "Rubik took your coin 3!" above the coins, and the steals you have left under them */
.stolen { margin: 4px 0 0; padding: 4px 12px; font-weight: 800; color: #fff; background: var(--bad); border-radius: 999px; text-shadow: none; font-size: 0.9rem; }
.stolen.shake { animation: shake 0.5s var(--ease); }
@keyframes shake { 0%, 100% { transform: none; } 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }
.steals-left { display: inline-flex; align-items: center; gap: 5px; margin: 2px 0 0; padding: 2px 10px; font-size: 0.8rem; font-weight: 700; color: hsl(var(--hue) 30% 90%); background: rgba(0, 0, 0, 0.28); border-radius: 999px; }
.steals-left.none { color: hsl(var(--hue) 20% 72%); }
.steal-dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--gold); opacity: 0.45; }
.steal-dot.on { background: var(--gold); opacity: 1; }

/* a seat: name, rank and tags straight on the cloth, in their own colours (no card around them); a
   soft ring appears under the pointer, since clicking opens the menu */
.seat { position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 3px; width: max-content; max-width: 210px; z-index: 2; }
.seat-card {
  appearance: none; display: flex; align-items: center; gap: 7px;
  max-width: 100%; padding: 4px 10px 4px 5px;
  font: inherit; color: var(--text); text-align: left;
  background: transparent; border: 2px solid transparent; border-radius: 999px;
  cursor: pointer; transition: border-color 0.12s, background-color 0.12s;
}
.seat-card:hover:not(:disabled), .seat-card:focus-visible { border-color: rgba(255, 255, 255, 0.35); background: rgba(0, 0, 0, 0.14); }
.seat-card:disabled { cursor: default; opacity: 1; }
.seat-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.seat-name, .seat-sub { text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55); }
.seat-name { color: var(--name-color, #fff); font-weight: 700; font-size: 0.95rem; letter-spacing: 0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat-sub { color: hsl(var(--hue) 30% 88%); font-size: 0.78rem; font-weight: 700; white-space: nowrap; opacity: 0.95; }
.seat-tags { display: inline-flex; gap: 4px; }
.seat-tags:empty { display: none; }
.seat-say { max-width: 200px; padding: 5px 10px; font-size: 0.8rem; font-weight: 600; line-height: 1.25; color: #2a1a24; background: #fff; border-radius: 12px; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35); text-align: center; }
.seat-say.pop { animation: pop-in 0.25s var(--ease); }
.seat-steals { display: inline-flex; gap: 3px; margin-top: 2px; }
.seat-steals:empty { display: none; }
.seat-steals .steal-dot { width: 8px; height: 8px; border-width: 1.5px; }
.seat-history { display: flex; gap: 3px; min-height: 26px; }
.seat-history .coin { --size: clamp(20px, 4.4cqw, 28px); } /* earlier rounds: small, next to the name */
.seat .avatar { width: 32px; height: 32px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45); }
.spot { position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%); z-index: 1; display: flex; }
.table .coin.lg, .table .tray-slot { --size: clamp(44px, 11cqw, 72px); }
.table .spot .coin.lg { --size: clamp(34px, 8.5cqw, 56px); }

.flag { width: 20px; height: 15px; border-radius: 2px; vertical-align: -2px; object-fit: cover; }
.avatar.anon { border-style: dashed; color: var(--muted); }
.avatar.anon .initial { font-size: 0.8rem; }

/* intro popup and confirmation */
.popup, .modal { position: fixed; inset: 0; z-index: 15; display: grid; place-items: center; padding: 16px; background: rgba(10, 5, 16, 0.6); }
.modal { z-index: 25; }
.popup-card, .modal-card { width: min(480px, 100%); max-height: 90vh; overflow: auto; padding: 22px; background: var(--surface); border: 2px solid var(--pink); border-radius: 0; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6); }
.popup-card.pop-in, .modal-card { animation: pop-in 0.3s var(--ease); }
.pop-round { color: var(--muted); font-size: 0.85rem; margin-bottom: 2px; }
.pop-title { font-size: 1.6rem; }
.pop-big { font-size: 2.6rem; font-weight: 800; color: var(--gold); margin-bottom: 0.2rem; }
.pop-list { display: grid; gap: 6px; margin: 10px 0; }
.pop-player { display: flex; align-items: center; gap: 10px; padding: 4px 8px; background: var(--surface-2); border-radius: 0; }
.pop-player .p-name { flex: 1; }
.pop-sample { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 0.85rem; margin: 8px 0; }
/* the tutorial's part of a round popup (v4.22): the coach's words, marked like the coach panel */
.pop-coach { margin: 10px 0 0; padding: 8px 12px; font-size: 0.95rem; background: color-mix(in srgb, var(--gold) 8%, var(--surface)); border-left: 4px solid var(--gold); }
.pop-coach + .pop-coach { margin-top: 0; padding-top: 0; }
.pop-coach-steps { padding-left: 32px; list-style: decimal; }
.pop-coach-steps li { margin: 3px 0; }
.popup .bar { margin-top: 12px; }

.menu { position: fixed; z-index: 30; width: 190px; padding: 6px; background: var(--nav-bg-2); border: 1px solid var(--nav-line); border-radius: 0; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
.menu-title { margin: 4px 8px 6px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item { appearance: none; display: block; width: 100%; padding: 8px 10px; font: inherit; text-align: left; color: var(--text); background: transparent; border: 0; border-radius: 0; cursor: pointer; }
.menu-item:hover:not(:disabled) { background: hsl(var(--hue) 60% 52%); color: #fff; }
.menu-item:disabled { opacity: 0.45; cursor: not-allowed; }

.vote { position: fixed; top: 50%; left: 16px; transform: translateY(-50%); z-index: 12; width: min(380px, calc(100vw - 32px)); padding: 12px 16px; background: var(--surface-2); border: 2px solid var(--gold); border-radius: 0; }
.vote-title { font-weight: 700; margin-bottom: 0.2rem; }
.vote-tally { color: var(--muted); font-size: 0.9rem; margin-bottom: 0.4rem; }
.vote .actions { margin: 6px 0 0; }
.btn.on { border-color: var(--accent); }

/* ---------- lobby extras ---------- */
.clickable { cursor: pointer; }
.clickable:hover { border-color: var(--accent); }
.setting.stack { flex-direction: column; align-items: stretch; }
.slider-row { display: flex; align-items: center; gap: 12px; }
.slider { flex: 1; accent-color: hsl(var(--hue) 60% 55%); }
.timer-value { min-width: 3.2em; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- play the map ---------- */
.map-card { text-align: left; }
.map-slot { display: inline-block; padding: 1px 10px; margin-bottom: 6px; font-weight: 700; color: #3a2a00; background: var(--gold); border-radius: 999px; }
.map-title { margin-bottom: 0.1rem; overflow-wrap: anywhere; }
.map-meta { color: var(--muted); margin-bottom: 0.3rem; }
.map-stars { font-size: 1.4rem; font-weight: 700; color: var(--gold); margin-bottom: 0.2rem; }
.lineup { display: grid; gap: 8px; margin: 14px 0; }
.lineup-row { display: flex; align-items: center; gap: 12px; padding: 6px 12px; background: var(--surface); border: 2px solid var(--line); border-radius: 0; }
.coin-slot { display: inline-flex; min-width: 46px; justify-content: center; }

/* ---------- map pool page ---------- */
.pool { max-width: 860px; margin: 0 auto; }
.select { appearance: auto; width: auto; flex: none; }
.pool-form .invite-row { flex-wrap: wrap; }
.pool-form .invite-row .field:first-child { flex: 1 1 280px; }
.manual { margin-top: 6px; }
.manual summary { cursor: pointer; color: var(--muted); }
.manual-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 8px; }
.missing-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 14px; }
.missing-list li { padding: 2px 10px; font-size: 0.9rem; background: color-mix(in srgb, var(--bad) 18%, var(--surface)); border: 2px solid color-mix(in srgb, var(--bad) 50%, var(--line)); border-radius: 999px; }
.coverage { width: 100%; border-collapse: separate; border-spacing: 3px; text-align: center; font-variant-numeric: tabular-nums; }
.coverage th { color: var(--muted); font-weight: 600; font-size: 0.85rem; }
.coverage tbody th { text-align: left; color: var(--text); }
.coverage td { padding: 3px 0; border-radius: 0; font-weight: 700; }
.c-none { background: color-mix(in srgb, var(--bad) 25%, var(--surface)); color: var(--bad); }
.c-thin { background: color-mix(in srgb, var(--gold) 22%, var(--surface)); color: var(--gold); }
.c-ok { background: color-mix(in srgb, var(--good) 22%, var(--surface)); color: var(--good); }
.c-total { color: var(--muted); }
.pool-list { display: grid; gap: 8px; margin: 12px 0; }
.pool-row { display: flex; align-items: center; gap: 12px; padding: 6px 12px; background: var(--surface-2); border: 2px solid var(--line); border-radius: 0; }
.pool-slot { min-width: 3.2em; font-weight: 700; color: var(--gold); }
.pool-stars { font-weight: 700; white-space: nowrap; }

/* ---------- results ---------- */
.winners { font-size: 1.25rem; font-weight: 700; color: var(--gold); }
.results { display: grid; gap: 10px; margin: 16px 0; }
.result-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--surface); border: 2px solid var(--line); border-radius: 0; flex-wrap: wrap; }
.r-rank { min-width: 1.6em; text-align: center; font-weight: 700; font-size: 1.3rem; }
.r-detail { color: var(--muted); font-size: 0.85rem; }
.r-compare { display: inline-flex; align-items: center; gap: 6px; }
.arrow { color: var(--muted); font-size: 0.75rem; }
.chip { display: inline-flex; min-width: 3.4em; justify-content: center; padding: 2px 10px; border-radius: 999px; font-weight: 700; font-size: 0.9rem; color: #111; }
.chip.j300 { background: #66ccff; }
.chip.j100 { background: #88da20; }
.chip.j50 { background: #ffcc22; }
.chip.jmiss { background: #ed1121; color: #fff; }
.legend { color: var(--muted); font-size: 0.85rem; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }

/* ---------- room chrome ---------- */
.room-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 12px; }
.room .notice { margin-bottom: 12px; }
.stepper { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-left: auto; font-size: 0.8rem; counter-reset: s; }
.step { padding: 2px 10px; border-radius: 999px; color: var(--muted); border: 2px solid transparent; }
.step.past { color: var(--text); }
.step.now { border-color: var(--pink); color: var(--text); font-weight: 700; }

.lobby { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 24px; align-items: start; }
.home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.lobby-list { display: grid; gap: 8px; margin: 10px 0; }
.dev { max-width: 420px; margin: 24px auto; }

.hero { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 48px 0 24px; }
.hero .lede { text-align: center; margin-bottom: 1.4rem; }

#toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 10; width: min(92vw, 420px); }
.toast { padding: 0.7rem 1rem; border-radius: 0; background: var(--surface-2); border: 2px solid var(--line); animation: pop-in 0.25s var(--ease); }
.toast.ok { border-color: var(--good); }
.toast.error { border-color: var(--bad); }

/* ---------- motion ---------- */
@keyframes pop-in { from { transform: scale(0.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes reveal-in { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { 0% { opacity: 0; transform: scale(0.8); } 28% { opacity: 1; transform: scale(1); } 70% { opacity: 1; } 100% { opacity: 0; transform: scale(1.08); } }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.22); } 100% { transform: scale(1); } }
.reveal-in { animation: reveal-in 0.45s var(--ease) var(--delay, calc(var(--i, 0) * 70ms)) backwards; }
.bump { animation: bump 0.3s var(--ease); }

@media (max-width: 760px) {
  .lobby, .home-grid, .queue-grid, .room-body, .teams { grid-template-columns: 1fr; }
  .stepper { margin-left: 0; width: 100%; }
  .coin.lg { --size: 44px; }
  .tray { gap: 6px; }
  .spot .coin { --size: 34px; }
  .table { width: 100%; min-width: 0; }
  .felt { box-shadow: inset 0 0 0 1px hsl(var(--hue) 60% 75% / 0.2), inset 0 0 60px hsl(var(--hue) 40% 10% / 0.55), 0 0 0 5px hsl(var(--hue) 20% 15%), 0 10px 30px rgba(0, 0, 0, 0.55); }
  .seat { max-width: 120px; }
  .seat-sub { display: none; }
  .seat .avatar { width: 28px; height: 28px; }
  .seat-history .coin { --size: 22px; }
  .seat-history { min-height: 22px; gap: 2px; }
  .lobby-main { order: -1; }
  .table-center { width: 58%; }
  .manual-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ======================= v3 additions ======================= */

/* ---------- top bar: your picture opens the settings ---------- */


/* ---------- room: game on the left, chat on the right ---------- */
.room-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
.room-main { min-width: 0; }
/* the chat: a window floating in the bottom right corner of the screen, the bottom half at most,
   outside the page's box; it stays put when the page scrolls */
.chat { position: fixed; right: 16px; bottom: 16px; z-index: 14; display: flex; flex-direction: column; width: min(360px, calc(100vw - 32px)); height: min(50vh, 560px); background: var(--surface-2); border: 1px solid var(--line); border-radius: 0; overflow: hidden; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5); }
.chat-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 2px solid var(--line); }
.chat-title { flex: 1; margin: 0; font-size: 1rem; }
.chat-unread { min-width: 1.5em; padding: 0 6px; text-align: center; font-size: 0.75rem; font-weight: 700; color: #2a0d1c; background: var(--pink); border-radius: 999px; }
.chat-body { display: flex; flex-direction: column; min-height: 0; flex: 1; padding: 10px 14px 14px; }
/* hidden: the window folds into a round button with a chat bubble in the same corner, with the
   count of new messages on it */
.chat-toggle .chat-toggle-icon { display: none; width: 24px; height: 24px; }
.chat.collapsed { width: 56px; height: 56px; border-radius: 50%; border: 0; background: transparent; box-shadow: none; overflow: visible; }
.chat.collapsed .chat-body { display: none; }
.chat.collapsed .chat-head { border-bottom: 0; padding: 0; height: 100%; background: transparent; }
.chat.collapsed .chat-tabs { display: none; }
.chat.collapsed .chat-toggle { position: relative; width: 56px; height: 56px; padding: 0; border-radius: 50%; justify-content: center; color: #fff; background: hsl(var(--hue) 60% 52%); border-color: hsl(var(--hue) 60% 52%); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); }
.chat.collapsed .chat-toggle:hover { background: hsl(var(--hue) 65% 58%); border-color: hsl(var(--hue) 65% 58%); }
.chat.collapsed .chat-toggle-icon { display: block; }
.chat.collapsed .chat-toggle-text { display: none; }
.chat.collapsed .chat-toggle .chat-unread { position: absolute; top: -4px; right: -4px; margin: 0; border: 2px solid var(--bg); }
.chat-toggle .chat-unread { margin-left: 6px; }
.chat-list { display: flex; flex-direction: column; gap: 4px; min-height: 160px; max-height: 46vh; overflow-y: auto; margin-bottom: 10px; overflow-wrap: anywhere; }
.chat-empty { margin: 0 0 8px; }
/* replies: click a message for its menu; a reply carries a one-line quote of what it answers */
.chat-msg { position: relative; border-radius: 0; margin: 0 -6px; padding: 1px 6px; cursor: default; }
.chat-msg.kind-chat:hover, .chat-msg.kind-roll:hover { background: rgba(255, 255, 255, 0.04); }
.chat-msg.flash { animation: quote-flash 1.2s ease-out; }
@keyframes quote-flash { 0%, 40% { background: hsl(var(--hue) 60% 52% / 0.35); } 100% { background: transparent; } }
.chat-menu .menu-title { font-weight: 700; }
.chat-menu .menu-title::after { content: ""; }
.chat-quote { appearance: none; display: flex; align-items: center; gap: 5px; max-width: 100%; margin: 0 0 1px; padding: 0 4px 0 2px; font: inherit; font-size: 0.78rem; line-height: 1.3; color: var(--muted); background: transparent; border: 0; border-left: 2px solid var(--line); border-radius: 0; cursor: pointer; text-align: left; }
.chat-quote:hover { color: var(--text); border-left-color: var(--accent); }
.chat-quote .ico { width: 12px; height: 12px; flex: none; opacity: 0.7; }
.chat-quote .chat-name { font-size: 0.78rem; flex: none; }
.chat-quote .chat-name::after { content: ""; }
.chat-quote-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.chat-reply-bar { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; padding: 5px 8px 5px 10px; font-size: 0.82rem; color: var(--muted); background: var(--surface); border-radius: 0; }
.chat-reply-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-reply-text .chat-name::after { content: ""; }
.chat-reply-stop { appearance: none; width: 26px; height: 26px; padding: 0; font: inherit; font-size: 1.35rem; line-height: 1; color: var(--muted); background: transparent; border: 0; border-radius: 50%; cursor: pointer; }
.chat-reply-stop:hover { color: #fff; background: rgba(255, 255, 255, 0.12); }
.osu-link { color: inherit; text-decoration: none; }
.osu-link:hover { text-decoration: underline; }
.me-items a.me-item { text-decoration: none; }
.menu a.menu-item { text-decoration: none; }
.chat-msg { line-height: 1.35; }
.chat-name { font-weight: 700; color: var(--name-color, var(--name-default)); }
.chat-name::after { content: ":"; }
.chat-text { color: var(--text); }
.chat-msg.mine .chat-text { color: #fff; }
.chat-form { display: flex; gap: 6px; }
.chat-input { padding: 0.45rem 0.7rem; }

/* ---------- info strip above the table ---------- */
.info-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 14px; padding: 8px 12px; background: var(--surface); border: 2px solid var(--line); border-radius: 0; }
.info-chip { padding: 2px 12px; font-weight: 700; color: var(--muted); background: var(--bg); border: 2px dashed var(--line); border-radius: 999px; font-variant-numeric: tabular-nums; }
.info-chip.known { color: var(--gold); border-style: solid; border-color: color-mix(in srgb, var(--gold) 55%, var(--line)); }
.info-chip.glow { animation: chip-glow 1.4s ease-out; } /* v4.22: the chip a round just filled in */
@keyframes chip-glow { 0% { box-shadow: 0 0 0 0 var(--gold); } 25% { box-shadow: 0 0 22px 6px color-mix(in srgb, var(--gold) 70%, transparent); } 100% { box-shadow: 0 0 0 0 transparent; } }
.info-chip.info-map.known { max-width: 100%; overflow-wrap: anywhere; }
.info-chip a { color: var(--gold); text-decoration: none; }
.info-chip a:hover { text-decoration: underline; }
.info-team { color: var(--cyan); border-style: solid; border-color: var(--cyan); }
.info-team.team-b { color: var(--pink); border-color: var(--pink); }

/* ---------- popup buttons ---------- */
.popup-card .actions { margin: 14px 0 6px; }
.pop-wait { margin: 0 0 4px; }
.pop-big a { color: inherit; text-decoration: none; }
.pop-big a:hover { text-decoration: underline; }
.popup-card .pop-big a { font-size: 1.5rem; overflow-wrap: anywhere; }

/* ---------- lobby ---------- */
.you-line { padding: 6px 12px; color: var(--cyan); border-left: 4px solid var(--cyan); background: var(--surface); border-radius: 0; }
.check { display: flex; align-items: flex-start; gap: 10px; margin: 4px 0; cursor: pointer; }
.check input { margin-top: 0.3rem; accent-color: hsl(var(--hue) 60% 55%); width: 1.05rem; height: 1.05rem; flex: none; }
.teams { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin: 10px 0; } /* side by side when there is room, else stacked */
.team-col { padding: 12px; background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); }
.team-col.team-a { border-color: color-mix(in srgb, var(--cyan) 60%, var(--line)); }
.team-col.team-b { border-color: color-mix(in srgb, var(--pink) 60%, var(--line)); }
.team-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.team-head h2 { margin: 0; flex: 1; }
.team-size { color: var(--muted); font-size: 0.85rem; }
.team-col .roster { margin: 10px 0 0; }

/* ---------- queue (home) ---------- */
.queue-panel { margin-bottom: 18px; }
.queue-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.queue-card { margin-bottom: 0; display: flex; flex-direction: column; }
.queue-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 6px; }
.queue-count { color: var(--cyan); font-weight: 700; }
.queue-waiting { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 12px; padding: 10px 14px; background: var(--surface); border: 2px solid var(--cyan); border-radius: 0; }
.queue-status { margin: 0; }
.modal-card .bar { margin: 12px 0 4px; }
.modal-card .fill { transition: transform 0.25s linear; }

/* ---------- settings ---------- */
.modal-card.settings { width: min(560px, 100%); border-color: var(--line); }
.settings-preview { font-size: 1.2rem; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.swatch { appearance: none; width: 30px; height: 30px; padding: 0; background: var(--swatch); border: 3px solid transparent; border-radius: 50%; cursor: pointer; }
.swatch:hover { transform: scale(1.1); }
.swatch.on { border-color: #fff; }
.swatch-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.color-input { width: 40px; height: 28px; padding: 0; vertical-align: middle; background: none; border: 2px solid var(--line); border-radius: 10px; cursor: pointer; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.stat { display: flex; flex-direction: column; padding: 8px 10px; background: var(--surface-2); border-radius: 0; }
.stat.wide { grid-column: 1 / -1; }
.stat-value { font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--muted); font-size: 0.8rem; }
.coin-counts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.coin-count { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; }

/* ---------- play the map ---------- */
.req-mods { font-weight: 700; color: var(--cyan); margin: 0.2rem 0 0.6rem; }
.map-card .actions { margin: 8px 0; }
.play-clock { margin: 4px 0 0; color: var(--muted); font-variant-numeric: tabular-nums; }
.play-clock.urgent { color: var(--bad); }
.rules-list { display: grid; gap: 2px; margin: 0 0 12px 1.1rem; list-style: disc; }
.play-list { display: grid; gap: 8px; margin: 12px 0; }
.play-row { display: flex; align-items: center; gap: 12px; padding: 6px 12px; background: var(--surface); border: 2px solid var(--line); border-radius: 0; }
.chip.play-wait { background: var(--surface-2); color: var(--muted); }
.chip.play-ok { background: var(--good); }
.chip.play-bad { background: var(--bad); }

/* ---------- results ---------- */
.scoreboard { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 10px 0 14px; font-size: 1.5rem; font-weight: 700; }
.scoreboard .dash { color: var(--muted); font-size: 0.85rem; font-weight: 600; }
.scoreboard .score { padding: 6px 18px; border: 2px solid var(--line); border-radius: 999px; background: var(--surface); }
.scoreboard .score.team-a b { color: var(--cyan); }
.scoreboard .score.team-b b { color: var(--pink); }
.scoreboard .score.won { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 12%, var(--surface)); }
.result-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 18px; }
.group-title { margin: 12px 0 0; }
.result-row { display: grid; grid-template-columns: auto auto auto minmax(0, 1fr) auto; grid-template-areas: "rank avatar main main chip" ". . compare play play" ". . history history history"; align-items: center; gap: 6px 12px; }
.result-row .r-rank { grid-area: rank; }
.result-row .avatar-slot { grid-area: avatar; }
.result-row .p-main { grid-area: main; }
.result-row .chip:not(.client) { grid-area: chip; }
.result-row .r-compare { grid-area: compare; }
.result-row .r-play { grid-area: play; display: inline-flex; align-items: center; gap: 8px; justify-content: flex-end; flex-wrap: wrap; min-width: 0; }
.result-row .r-history { grid-area: history; display: flex; gap: 3px; flex-wrap: wrap; }
.r-score { font-weight: 700; font-variant-numeric: tabular-nums; }
.chip.client { min-width: 0; padding: 0 8px; font-size: 0.75rem; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); }
.chip.client.lazer { border-color: var(--cyan); }
.chip.client.stable { border-color: var(--gold); }

/* ---------- tiebreaker ---------- */
.tiebreak { border-color: var(--gold); }
.tb-pair { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; margin: 10px 0; }
.tb-player { display: flex; align-items: center; gap: 8px; padding: 6px 12px; background: var(--surface-2); border: 2px solid var(--line); border-radius: 0; }
.tb-player.team-a { border-color: var(--cyan); }
.tb-player.team-b { border-color: var(--pink); }
.tb-team { font-size: 0.75rem; font-weight: 700; color: var(--muted); }
.vs { color: var(--muted); font-weight: 700; }
.tb-map { display: block; font-weight: 700; color: var(--gold); text-decoration: none; overflow-wrap: anywhere; }
.tb-map:hover { text-decoration: underline; }

/* ---------- map pool: draft, n/a cells ---------- */
.draft-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; position: sticky; top: 58px; /* under the pinned top bar */ z-index: 5; margin-bottom: 16px; }
.draft-banner p, .draft-banner .actions { margin: 0; }
.c-na { background: transparent; color: #5d4f78; font-weight: 600; font-size: 0.8rem; }
.pool-row .p-name { color: var(--text); }
.pool-row .p-name:hover { color: var(--accent); }

@media (max-width: 960px) {
  .room-body { grid-template-columns: minmax(0, 1fr); }
  .chat { right: 12px; bottom: 12px; width: calc(100vw - 24px); height: 55vh; }
}
@media (max-width: 760px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .result-row { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "rank main chip" ". compare compare" ". play play" ". history history"; }
  .result-row .avatar-slot { display: none; }
  .result-row .r-play { justify-content: flex-start; flex-wrap: wrap; }
}

.check + h2 { margin-top: 18px; }
.team-col .p-rank { font-size: 0.78rem; }
@media (max-width: 760px) {
  /* phones: the table breaks out of the page's padding to use the whole screen width; smaller coins */
  .table { width: calc(100vw - 12px); margin-inline: calc(50% - 50vw + 6px); }
  .table .coin.lg, .table .tray-slot { --size: clamp(34px, 11cqw, 72px); }
  .table .spot .coin.lg { --size: clamp(28px, 8cqw, 56px); }
  .tray.many .coin.lg, .tray.many .tray-slot { --size: clamp(28px, 8.5cqw, 56px); }
  .table .timer { width: min(120px, 100%); }
  .table .timer-text { font-size: 1.1rem; }
  .table { --seat-w: min(96px, 30%); }
}

/* ---------- v3.2: anonymous tag, mods, grades, co-op verdict ---------- */
.tag.anon { background: color-mix(in srgb, var(--cyan) 22%, var(--surface-2)); color: var(--cyan); }

.req-mods { display: flex; align-items: flex-start; gap: 14px; margin: 0.4rem 0 0.8rem; }
.req-label { color: var(--muted); font-size: 0.9rem; padding-top: 14px; }
.mod-squares { display: flex; flex-wrap: wrap; gap: 10px; }
.mod-item { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.mod-square {
  --fill: #ccc; --edge: #666;
  display: grid; place-items: center;
  width: 52px; height: 52px;
  font-weight: 700; font-size: 1.15rem; letter-spacing: 0.02em;
  color: var(--edge); background: var(--fill);
  border: 3px solid var(--edge); border-radius: 11px;
}
.mod-nf { --fill: #8fe6a1; --edge: #2c8442; }
.mod-hd { --fill: #ffe066; --edge: #9c7a06; }
.mod-hr, .mod-dt { --fill: #ff7d7d; --edge: #ad2828; }
.mod-cl { --fill: #c6a5ff; --edge: #6538bf; }
.mod-tb { --fill: #ffb169; --edge: #ad5a0a; }
.mod-note { font-size: 0.75rem; font-weight: 700; color: #c6a5ff; }
.mod-item.mod-classic { flex-direction: row; align-items: center; gap: 10px; margin-left: 10px; padding-left: 16px; border-left: 2px dashed var(--line); } /* v4.22: Classic apart, with its line */
.mod-item.mod-classic .mod-note { font-size: 0.8rem; max-width: 118px; line-height: 1.2; }
.map-buttons { display: flex; flex-wrap: wrap; gap: 10px; }

.score-cell { display: inline-flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.score-cell.none { color: var(--muted); font-weight: 700; }
.score-num { font-weight: 700; color: var(--text); }
a.score-num { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--pink) 60%, transparent); text-underline-offset: 3px; }
a.score-num:hover { color: var(--pink); }
.score-acc { color: var(--muted); font-size: 0.85rem; font-weight: 700; }
.grade { min-width: 2.1em; padding: 0 6px; text-align: center; font-weight: 900; font-style: italic; border-radius: 6px; background: var(--bg); border: 2px solid currentColor; line-height: 1.35; }
.grade-x, .grade-s { color: #ffcc22; }
.grade-xh, .grade-sh { color: #dfe6ef; }
.grade-a { color: #88da20; }
.grade-b { color: #4fb3ea; }
.grade-c { color: #c47bff; }
.grade-d { color: #ff5c5c; }
.grade-f { color: var(--muted); }

.verdict { margin: 4px 0 16px; padding: 16px 20px; border-radius: var(--radius); border: 3px solid var(--line); background: var(--surface); }
.verdict-title { font-size: 1.7rem; margin: 0 0 4px; }
.verdict-text { margin: 0; }
.verdict.win { border-color: var(--good); background: color-mix(in srgb, var(--good) 12%, var(--surface)); }
.verdict.win .verdict-title { color: var(--good); }
.verdict.loss { border-color: color-mix(in srgb, var(--bad) 70%, var(--line)); }
.verdict.loss .verdict-title { color: var(--bad); }
.result-row .chip:not(.client) { justify-self: end; }

/* ---------- overflow guards: long names, map titles and words never leave their box ---------- */
body { overflow-wrap: anywhere; } /* a word too long for its box breaks instead of sticking out */
.btn, .seg, .tag, .chip, .info-chip:not(.info-map), .mod-square, .grade, .timer-value, .score-num, .score-acc,
.pool-stars, .pool-slot, .r-rank, .queue-count, .team-size, .step, .code, .stat-value { white-space: nowrap; overflow-wrap: normal; }
.btn { max-width: 100%; }
.home-grid, .queue-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.queue-foot, .pool-row, .invite-row, .team-head, .actions, .map-buttons, .scoreboard { flex-wrap: wrap; }
.invite-row .field { flex: 1 1 150px; }
.pool-row .p-main { flex: 1 1 160px; }
.result-groups { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.segmented { max-width: 100%; }
.setting > * { min-width: 0; }
.info-chip.info-map { min-width: 0; }
@media (max-width: 960px) {
  .room-body { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .lobby { grid-template-columns: minmax(0, 1fr); }
  .scoreboard { font-size: 1.15rem; gap: 8px; }
}
/* seats never stick out of the table: the side seats are pulled in by half a seat width */
.table { --seat-w: min(200px, 26%); }
.seat { left: clamp(calc(var(--seat-w) / 2), var(--x), calc(100% - var(--seat-w) / 2)); max-width: var(--seat-w); }
.seat-history { flex-wrap: wrap; justify-content: center; max-width: 100%; }
@media (max-width: 760px) {
  .table { --seat-w: min(120px, 34%); }
}
/* a long map title in the strip: two lines at most, in a box with soft corners instead of a pill */
.info-chip.info-map { border-radius: 12px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.pop-big.pop-map { font-size: 1.35rem; line-height: 1.3; }
/* exactly 4 coins: a 2 x 2 square (v4.22: fixed places, and a row of four would reach the held coins
   beside the seats, which is why it used to split 3 + 1) */
.tray.four { max-width: calc(2 * clamp(44px, 11cqw, 72px) + 10px); }
/* 7 or 8 coins: smaller coins in two rows of four, so the tray stays clear of the seats */
.tray.many { gap: 8px; max-width: calc(4 * 56px + 3 * 8px); }
.tray.many .coin.lg, .tray.many .tray-slot { --size: clamp(34px, 9cqw, 56px); }
@media (max-width: 760px) {
  /* phones: the middle of the table is what is left between the side seats */
  .table { --seat-w: min(104px, 32%); }
  .table-center { width: calc(100% - 2 * var(--seat-w) - 6px); }
  .call { min-height: 3.6rem; }
  .word { font-size: 2.2rem; }
  .tray { gap: 6px; }
  .tray.four { max-width: calc(2 * clamp(34px, 11cqw, 72px) + 6px); }
  .tray.many { gap: 5px; max-width: none; }
  .tray.many .coin.lg, .tray.many .tray-slot { --size: 34px; }
}

/* ---------- v3.4: rows never wider than their column, blurred invite, presence, home banner ---------- */
.roster { grid-template-columns: minmax(0, 1fr); }
.player { min-width: 0; }
.p-tags { display: inline-flex; flex-wrap: wrap; gap: 4px; }

.secret {
  appearance: none; display: flex; align-items: center; gap: 10px;
  width: 100%; min-width: 0; margin: 0 0 10px; padding: 0.55rem 0.8rem;
  font: inherit; color: var(--text); text-align: left;
  background: var(--bg); border: 2px solid var(--line); border-radius: 10px; cursor: pointer;
}
.secret:hover { border-color: var(--accent); }
.secret-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; filter: blur(6px); user-select: none; transition: filter 0.15s; }
.secret.revealed .secret-text { filter: none; user-select: text; }
.secret-hint { flex: none; font-size: 0.75rem; color: var(--muted); white-space: nowrap; }
.share-label { display: block; margin: 2px 0 6px; }
.code-line { display: flex; align-items: stretch; gap: 8px; flex-wrap: nowrap; margin: 0 0 6px; }
.code-line .secret { flex: 1 1 auto; width: auto; margin: 0; }
.code-line .icon-btn { flex: none; }
.secret-code .secret-text { letter-spacing: 0.14em; font-weight: 700; font-size: 1.05rem; }
.icon-btn { padding: 0.5rem 0.65rem; }
.icon { display: block; }
.invite-hint { margin: 2px 0 14px; }
.check.muted { opacity: 0.5; }

.tag.away { color: var(--gold); background: color-mix(in srgb, var(--gold) 14%, var(--surface-2)); }
.tag.offline { color: var(--bad); background: color-mix(in srgb, var(--bad) 16%, var(--surface-2)); }

.notice.back-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 10px 0 0; }
.back-link { flex: 1; min-width: 0; padding: 0.7rem 1rem; color: var(--text); text-decoration: none; }
.back-link:hover { text-decoration: underline; }

.warn-card { border-color: var(--gold); }

/* v3.5: results show the guess and the real place as captioned coins; the host can end the
   waiting for players who left */
.cmp { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; }
.cmp-cap { font-size: 0.68rem; line-height: 1; color: var(--muted); white-space: nowrap; }
.r-compare { flex: none; }
.cmp.real .cmp-cap { color: var(--text); }
.r-compare .arrow { align-self: flex-start; margin-top: 0.55em; }
.notice.end-early { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-color: var(--gold); }
.notice.end-early .hint { margin: 0; }

/* v3.6: ready up, lobby names, give host, sharing results, the "recently left" banner */
/* the tutorial's buttons (v4.22): gold like the coach card */
.btn.gold { background: var(--gold); border-color: var(--gold); color: #2a1a24; }
.btn.gold:hover:not(:disabled) { background: #ffd970; border-color: #ffd970; }
.btn.go { background: var(--good); border-color: #fff; color: #10240f; }
.btn.go:hover:not(:disabled) { background: #98eaa2; }
.btn.idle { background: var(--surface-2); border-color: var(--line); color: var(--muted); }
.btn.idle:hover:not(:disabled) { color: var(--text); border-color: var(--muted); }
.chip.ready-chip { min-width: 0; padding: 1px 9px; font-size: 0.75rem; }
.chip.ready-chip.on { background: var(--good); color: #10240f; }
.chip.ready-chip.off { background: transparent; color: var(--muted); border: 1px solid var(--line); font-weight: 600; }
.player.is-ready { border-color: color-mix(in srgb, var(--good) 55%, var(--line)); }

.name-line { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; min-width: 0; }
.lobby-name { margin: 0; overflow-wrap: anywhere; min-width: 0; }
.lobby-sub { margin: 4px 0 10px; color: var(--muted); font-weight: 600; }
.name-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.name-form .field { flex: 1 1 220px; font-size: 1.2rem; font-weight: 700; }
.host-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.host-line .field { flex: 1 1 140px; min-width: 0; padding-top: 0.45rem; padding-bottom: 0.45rem; }
.host-setting .hint { margin: 0 0 6px; }

.results-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.results-head h1 { margin: 0; }
.share { position: relative; }
.share-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: 220px; padding: 6px; background: var(--nav-bg-2); border: 1px solid var(--nav-line); border-radius: 0; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
.share-hint { margin: 4px 10px 6px; font-size: 0.8rem; color: var(--muted); }
.group-points { margin-top: 8px; }
.results-timer { margin-top: 6px; }
.result-row .r-rank { min-width: 1.6em; text-align: center; font-variant-numeric: tabular-nums; }
.r-compare { cursor: help; }

.notice.back-banner { margin-bottom: 16px; }
.notice.back-banner.left { border-color: var(--good); }
.back-link.inert { cursor: default; }
.back-link.inert:hover { text-decoration: none; }
.back-name { color: var(--text); }
.back-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.back-main .back-link { flex: none; }
.back-why { padding: 0 1rem 0.7rem; margin-top: -0.4rem; color: var(--muted); font-size: 0.85rem; }
.notice-card { border-color: var(--cyan); }

.match-page { max-width: 1100px; margin: 0 auto; }
.match-head { margin-bottom: 10px; }
.match-name { margin-bottom: 4px; overflow-wrap: anywhere; }
.match-meta { margin: 0 0 4px; color: var(--muted); }
.match-map { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.match-map a { color: var(--text); }
.match-rating { margin-left: 10px; color: var(--gold); }

/* v3.7: the site-wide chat (#general / #multiplayer) and lobby invites */
.home-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }
.home-layout > .home { min-width: 0; }
@media (max-width: 960px) {
  .home-layout { grid-template-columns: minmax(0, 1fr); }
}
.chat-head { gap: 6px; padding: 8px 10px 8px 8px; }
.chat-tabs { flex: 1; display: flex; gap: 4px; min-width: 0; }
.chat-tab { appearance: none; display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; font: inherit; font-size: 0.9rem; font-weight: 700; color: var(--muted); background: transparent; border: 2px solid transparent; border-radius: 10px; cursor: pointer; white-space: nowrap; }
.chat-tab:hover { color: var(--text); }
.chat-tab.on { color: var(--text); background: var(--surface-2); border-color: var(--line); }
.chat-tab:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; }
.chat-sub { margin: 0 0 8px; font-size: 0.8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-lists { display: flex; flex-direction: column; min-height: 0; }
.chat-msg.kind-bot .chat-name, .chat-name.bot { color: var(--pink); }
.chat-msg.kind-bot .chat-text { color: #ffd6ea; }
.chat-msg.kind-roll .chat-name::after { content: ""; }
.chat-msg.kind-roll .chat-text { color: #ffd6ea; font-style: italic; }
.chat-msg.private { opacity: 0.8; }
.chat-msg.private .chat-text { font-style: italic; }
.chat-msg.private.mine .chat-text { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-style: normal; font-size: 0.85rem; }

.invites { position: fixed; top: 70px; right: 16px; z-index: 40; display: grid; gap: 10px; width: min(320px, calc(100vw - 32px)); }
.invite-card { position: relative; overflow: hidden; padding: 14px 16px 16px; background: var(--surface); border: 2px solid var(--pink); border-radius: 0; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55); animation: pop-in 0.3s var(--ease); }
.invite-kicker { margin: 0 0 2px; font-size: 0.8rem; font-weight: 700; color: var(--pink); }
.invite-name { margin: 0 0 4px; font-size: 1.2rem; overflow-wrap: anywhere; }
.invite-meta { margin: 0 0 10px; font-size: 0.85rem; color: var(--muted); }
.invite-actions { display: flex; gap: 8px; }
.invite-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--surface-2); }
.invite-fill { display: block; height: 100%; background: var(--pink); transform-origin: left; transform: scaleX(var(--left, 1)); transition: transform 0.25s linear; }
@media (prefers-reduced-motion: reduce) { .invite-card { animation: none; } .invite-fill { transition: none; } }

/* v3.8: dev tools (developers with Dev mode on) */
.dev-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; padding: 8px 10px; border: 2px dashed var(--cyan); border-radius: 0; background: color-mix(in srgb, var(--cyan) 6%, var(--surface)); }
.dev-label { font-size: 0.8rem; font-weight: 700; color: var(--cyan); margin-right: 4px; }
.dev-hint { flex-basis: 100%; margin: 0; font-size: 0.8rem; }
.dev-card { margin-bottom: 16px; }
.menu-item.dev { color: var(--cyan); }
.dev-setting .hint { margin: 2px 0 0; }
.tag.bot { color: var(--cyan); background: color-mix(in srgb, var(--cyan) 14%, var(--surface-2)); }
.dev-setting { margin-top: 14px; }
.queue-line { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.queue-line .queue-status { margin: 0; }
.queue-time { font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--cyan); }
.back-time { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--muted); font-size: 0.85rem; }
.back-close { padding: 0.15rem 0.55rem; font-size: 1.2rem; line-height: 1; }
.chat-lists { flex: 1; min-height: 0; }
.chat-lists .chat-list { flex: 1; max-height: none; min-height: 0; }
/* v3.9: the ready counter next to the lobby's name */
.name-line { align-items: center; }
.ready-count { padding: 2px 12px; border-radius: 999px; font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--muted); background: var(--surface-2); border: 2px solid var(--line); white-space: nowrap; }
.ready-count.enough { color: #10240f; background: var(--good); border-color: var(--good); }
/* v4.0: the ready counter on the far right of the middle column, "Required mods" with a warning
   sign, the chat when it is off during the rounds, clickable rows on the play and results screens */
.name-line { flex-wrap: nowrap; }
.name-line .lobby-name { flex: 0 1 auto; min-width: 0; }
.name-line > .btn { flex: none; }
.name-line .ready-count { margin-left: auto; flex: none; }
.req-label { display: inline-flex; align-items: center; gap: 7px; padding-top: 12px; font-size: 1.05rem; font-weight: 700; color: var(--text); white-space: nowrap; }
.warn-icon { width: 24px; height: 24px; flex: none; }
.warn-fill { fill: var(--gold); }
.warn-mark { fill: #2a1d00; }
@media (max-width: 600px) {
  .req-mods { flex-direction: column; gap: 6px; }
  .req-label { padding-top: 0; }
}
.chat.chat-off .chat-input { border-style: dashed; }
.chat.chat-off .chat-input::placeholder { color: var(--gold); opacity: 0.85; }
.play-row.clickable:hover, .result-row.clickable:hover { border-color: var(--accent); }
.preview-list { display: grid; gap: 4px; margin: 10px 0 0; padding-left: 1.4em; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
/* v4.2: the top tabs (Home, History) and the match history page */
.topnav { display: flex; align-items: center; gap: 2px; }
.topnav-link { position: relative; display: inline-flex; align-items: center; padding: 8px 10px; color: rgba(255, 255, 255, 0.9); font-size: 0.95rem; font-weight: 500; text-decoration: none; transition: color 0.12s; }
.topnav-link::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 3px; border-radius: 3px; background: var(--accent); transform: scaleY(0); transform-origin: bottom; transition: transform 0.15s var(--ease), opacity 0.15s; opacity: 0.6; }
.topnav-link:hover { color: #fff; }
.topnav-link:hover::after { transform: scaleY(1); }
.topnav-link.on { color: #fff; }
.topnav-link.on::after { transform: scaleY(1); opacity: 1; }
.history-list { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 8px; }
.history-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 16px; background: var(--surface); border: 2px solid var(--line); border-radius: 0; color: var(--text); text-decoration: none; }
.history-row:hover { border-color: var(--accent); }
.h-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.h-name { font-weight: 700; font-size: 1.05rem; }
.h-meta, .h-map { color: var(--muted); font-size: 0.85rem; overflow-wrap: anywhere; }
.h-side { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; font-size: 0.9rem; }
.h-points { font-weight: 700; font-variant-numeric: tabular-nums; }
.h-me { display: inline-flex; align-items: center; gap: 6px; color: #fff; font-variant-numeric: tabular-nums; }
.h-me.none { color: var(--muted); }
.h-score { color: #fff; }
.h-date { font-weight: 400; color: #fff; white-space: nowrap; } /* plain white, regular weight: it was bold gold */
.chip.outcome.won { background: var(--good); color: #10240f; }
.chip.outcome.lost { background: var(--bad, #ff7a7a); color: #2a0f0f; }
.chip.outcome.tie { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
@media (max-width: 760px) {
  .history-row { flex-wrap: wrap; }
  .h-side { flex-basis: 100%; justify-content: flex-start; }
}
/* narrow screens: no banner, the slim bar all the time, the links behind the menu button */
@media (max-width: 900px) {
  .topbar { min-height: 50px; }
  .topbar::before, .topbar::after, .topbar .cover { display: none; }
  .topbar .topbar-bar { height: 50px; background-color: hsl(var(--hue) 50% 45%); box-shadow: 0 1px 8px rgba(0, 0, 0, 0.35); }
  .topbar .brand-dot { width: 40px; height: 40px; border-width: 4px; }
  .topbar .me-avatar .avatar { width: 40px; height: 40px; font-size: 1rem; }
  .brand { font-size: 1.15rem; margin-right: 0; gap: 10px; }
  .topbar .me { gap: 6px; }
  .topbar-toggle { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin-left: -8px; padding: 0; color: #fff; background: transparent; border: 0; border-radius: 50%; cursor: pointer; }
  .topbar-toggle .ico { width: 22px; height: 22px; transition: transform 0.2s var(--ease); }
  .topbar-toggle[aria-expanded="true"] .ico { transform: rotateX(0.5turn); }
  .topbar-toggle:hover, .topbar-toggle[aria-expanded="true"] { background: rgba(255, 255, 255, 0.12); }
  .topnav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; padding: 6px 0; background: var(--nav-bg-2); border-bottom: 1px solid var(--nav-line); box-shadow: 0 12px 34px rgba(0, 0, 0, 0.55); }
  .topbar.menu-open .topnav { display: flex; animation: roll-out 0.2s var(--ease); }
  .topnav-link { padding: 11px 20px; font-size: 1rem; }
  .topnav-link::after { display: none; }
  .topnav-link:hover { background: rgba(255, 255, 255, 0.08); }
  .topnav-link.on { background: rgba(255, 255, 255, 0.1); box-shadow: inset 4px 0 0 var(--accent); }
  .page { margin-top: 0; }
  /* phones (v4.22): no box floating in a sea of background. The page fills the screen edge to edge
     and down to the bottom of the window; the background shows only under it, around the footer. */
  #app { padding: 0 0 36px; }
  .view { padding-top: 0; min-height: calc(100dvh - 50px); display: flex; flex-direction: column; }
  .view > .page { flex: 1 0 auto; box-shadow: none; overflow-x: clip; } /* (one too-wide element never makes the whole page scroll sideways) */
  .view > .stage.offline { padding: 24px 16px; }
  .site-footer { margin-top: 22px; }
  /* a row of tabs stays on one line: it scrolls sideways when it must */
  .page-tabs { overflow-x: auto; scrollbar-width: none; }
  .page-tabs::-webkit-scrollbar { display: none; }
  .page-tab { flex: none; white-space: nowrap; }
}
/* phones: just the logo, as on osu's bar (the beta tag is in the footer too) */
@media (max-width: 600px) {
  .topbar .beta-tag { display: none; }
  .topbar .nav-icons { margin-right: 4px; }
  /* the chat / mentions / notifications panels: centred under the bar, not hanging off the left edge */
  .nav-slot .nav-panel { position: fixed; top: 58px; left: 12px; right: 12px; width: auto; max-height: calc(100dvh - 70px); overflow: auto; }
  .page-tab { padding: 10px 8px 12px; font-size: 0.84rem; }
}
.view { padding-top: 18px; }
@media (max-width: 900px) { .view { padding-top: 0; } } /* phones: the page starts right under the bar */

/* ---------- v4.4: the osu.ppy.sh-style top bar: your profile cover behind the menu (blurred edges), the
   chat bubble and the bell with number badges, your round picture with a menu, the settings page ---------- */
.cover { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
/* the cover sits in the middle (as wide as the page's box), sharp inside, blurred and fading out at
   the sides over the pattern: a blurred copy a bit wider than the sharp one */
.cover::before, .cover::after { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; transform: translateX(-50%); background: var(--cover) center / cover no-repeat; }
.cover::before { width: min(100%, 1300px); filter: blur(18px) brightness(0.75); -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 18%, #000 82%, transparent 100%); mask-image: linear-gradient(to right, transparent 0%, #000 18%, #000 82%, transparent 100%); }
.cover::after { width: min(100%, 1100px); -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 14%, #000 86%, transparent 100%); mask-image: linear-gradient(to right, transparent 0%, #000 14%, #000 86%, transparent 100%); }
.cover-default::before, .cover-default::after { background: linear-gradient(100deg, hsl(var(--hue) 45% 30%), hsl(calc(var(--hue) + 30) 40% 24%) 55%, hsl(var(--hue) 20% 18%)); }
.topbar .cover { opacity: 0.9; }
.topbar .cover::after { box-shadow: inset 0 -60px 60px -30px rgba(20, 14, 24, 0.9); }
.topbar::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, transparent, hsl(var(--hue) 20% 10% / 0.35)); pointer-events: none; }
.topbar-inner .brand, .topbar-inner .topnav-link { text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); }

.me { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.nav-slot { position: relative; display: flex; align-items: center; }
.nav-icons { display: flex; align-items: stretch; height: 34px; margin-right: 10px; border-radius: 999px; background: rgba(0, 0, 0, 0.4); border: 1.5px solid rgba(255, 255, 255, 0.9); }
/* (no overflow: hidden here: the panels open from inside these slots) */
.nav-icons .nav-slot { align-self: stretch; }
.nav-icons .nav-icon { height: 100%; }
.nav-icon { position: relative; appearance: none; display: inline-flex; align-items: center; gap: 6px; padding: 0 11px; font: inherit; color: #fff; background: transparent; border: 0; cursor: pointer; }
.nav-count { font-size: 0.85rem; font-weight: 700; line-height: 1; }
.nav-count.some { color: var(--pink); }
.nav-icons .nav-slot:first-child .nav-icon { border-radius: 999px 0 0 999px; }
.nav-icons .nav-slot:last-child .nav-icon { border-radius: 0 999px 999px 0; }
.nav-icon:hover, .nav-icon[aria-expanded="true"] { background: rgba(255, 255, 255, 0.12); }
.ico { width: 16px; height: 16px; fill: currentColor; display: block; }
.me-avatar { appearance: none; padding: 0; background: transparent; border: 0; border-radius: 50%; cursor: pointer; }
.me-avatar .avatar { width: 60px; height: 60px; font-size: 1.4rem; border: 0; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45); }
.me-avatar:hover .avatar, .me-avatar[aria-expanded="true"] .avatar { box-shadow: 0 0 0 3px var(--pink), 0 3px 10px rgba(0, 0, 0, 0.45); }
.avatar.lg { width: 44px; height: 44px; font-size: 1.1rem; }

.nav-panel { position: absolute; top: calc(100% + 10px); right: 0; z-index: 40; width: min(340px, calc(100vw - 24px)); padding: 10px; background: var(--nav-bg-2); border: 1px solid var(--nav-line); border-radius: 0; box-shadow: 0 12px 34px rgba(0, 0, 0, 0.55); }
.nav-panel-title { margin: 2px 4px 8px; font-weight: 700; color: #fff; }
.note-list { display: grid; gap: 6px; max-height: 60vh; overflow: auto; }
.note { display: flex; flex-direction: column; gap: 3px; padding: 8px 10px; background: var(--nav-bg); border-radius: 0; font-size: 0.9rem; }
.note-head { display: flex; flex-wrap: wrap; gap: 4px; align-items: baseline; color: rgba(255, 255, 255, 0.75); font-size: 0.82rem; }
.note-head b { color: #fff; }
.note-when { margin-left: auto; color: rgba(255, 255, 255, 0.45); font-size: 0.75rem; }
.note-text { color: #fff; overflow-wrap: anywhere; }
.note-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.me-panel { padding: 0; overflow: hidden; width: 280px; }
.me-panel-head { position: relative; height: 150px; }
.me-cover { position: absolute; inset: 0; }
.me-cover::before, .me-cover::after { content: ""; position: absolute; inset: 0; background: var(--cover) center / cover no-repeat; }
.me-cover::before { filter: blur(10px) brightness(0.7); transform: scale(1.1); }
.me-cover::after { -webkit-mask-image: linear-gradient(to bottom, #000 40%, transparent 100%); mask-image: linear-gradient(to bottom, #000 40%, transparent 100%); }
.me-cover.cover-default::before, .me-cover.cover-default::after { background: linear-gradient(100deg, hsl(333 45% 32%), hsl(280 40% 28%) 55%, hsl(333 10% 16%)); }
.me-panel-id { position: absolute; left: 0; right: 0; bottom: 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.me-panel-id .avatar { width: 64px; height: 64px; font-size: 1.5rem; border: 3px solid #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5); }
.me-panel-name { font-weight: 700; font-size: 1.05rem; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7); }
.me-items { display: grid; padding: 6px; }
.me-item { appearance: none; display: flex; align-items: center; gap: 10px; padding: 9px 12px; font: inherit; font-weight: 600; color: #fff; background: transparent; border: 0; border-radius: 0; cursor: pointer; text-align: left; }
.me-item:hover { background: hsl(var(--hue) 60% 52%); }
.me-item .ico { width: 16px; height: 16px; opacity: 0.8; }

/* a chat message that names you */
.chat-msg.mention { background: color-mix(in srgb, var(--pink) 18%, transparent); border-left: 3px solid var(--pink); border-radius: 0; margin-left: -6px; padding-left: 6px; }

/* the settings page, like osu's account settings */
.settings-page { margin: -24px -40px -32px; background: var(--surface); }
@media (max-width: 760px) { .settings-page { margin: -16px -14px -24px; } }
.set-head { display: flex; align-items: center; gap: 14px; padding: 18px 24px; background: var(--nav-bg-2); }
.set-head h1 { margin: 0; font-size: 1.5rem; font-weight: 600; letter-spacing: 0; }
.set-head-icon { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 2px solid #fff; border-radius: 10px; }
.set-head-icon .ico { width: 20px; height: 20px; }
.set-tabs { display: flex; gap: 6px; padding: 0 24px; background: var(--nav-bg-2); border-bottom: 1px solid var(--nav-line); }
.set-tab { position: relative; padding: 12px 10px 14px; font-size: 0.9rem; font-weight: 700; color: #fff; }
.set-tab.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; border-radius: 4px 4px 0 0; background: var(--pink); }
.set-section { display: grid; grid-template-columns: 240px minmax(0, 1fr); border-bottom: 1px solid var(--line); }
.set-section:last-child { border-bottom: 0; }
.set-title { margin: 0; padding: 22px 40px; font-size: 1.15rem; font-weight: 600; background: var(--surface-2); }
.set-body { padding: 14px 24px 18px; }
.set-block { display: grid; gap: 12px; padding: 8px 0; }
.set-block + .set-block { border-top: 1px solid var(--line); }
.set-row { display: grid; grid-template-columns: 150px minmax(0, 1fr); align-items: start; gap: 12px; }
.set-label { padding-top: 3px; text-align: right; font-size: 0.82rem; font-weight: 600; color: rgba(255, 255, 255, 0.6); }
.set-value { min-width: 0; font-size: 0.92rem; }
.set-value .check { margin: 0; }
.set-name { font-weight: 700; }
.set-hint { margin: 6px 0 0; }
.set-color { display: grid; gap: 6px; }
.settings-page .stats { padding: 10px 0 0; }
@media (max-width: 760px) {
  .set-section { grid-template-columns: 1fr; }
  .set-title { padding: 14px 18px; }
  .set-body { padding: 10px 18px 14px; }
  .set-row { grid-template-columns: 1fr; gap: 4px; }
  .set-label { text-align: left; padding-top: 0; }
  .nav-icons { height: 32px; }
}

/* ---------- v4.7: the osu.ppy.sh page structure: flat sections inside the page's box ---------- */
.home h2, .pool h2, .history h2 { font-size: 1.05rem; font-weight: 600; margin: 18px 0 10px; }
.home-grid, .queue-grid { gap: 12px; }
.team-col, .verdict, .popup-card, .modal-card { border-radius: 0; }
.chat-head { background: hsl(var(--hue) 10% 23%); border-bottom: 0; }
.hero { padding: 24px 0 8px; }
.hero-title { font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 700; margin-bottom: 0.4rem; }
.match-head { margin-bottom: 12px; }
.match-name { font-size: 1.5rem; margin: 0 0 2px; }
.lobby-name { font-size: clamp(1.4rem, 3vw, 1.9rem); }
.lobby { grid-template-columns: 290px minmax(0, 1fr); gap: 20px; }
@media (max-width: 760px) { .lobby { grid-template-columns: minmax(0, 1fr); } }
/* v4.8: greyed-out cards and buttons while you are in a lobby (the reason on hover), the Dev mode
   box in the avatar menu like osu's "Lazer mode" box */
.queue-card.locked { opacity: 0.55; cursor: not-allowed; }
.queue-card.locked .btn { pointer-events: none; }
.locked-wrap { display: inline-block; }
.locked-wrap .btn:disabled { opacity: 0.5; pointer-events: none; }
.me-options { display: grid; gap: 4px; padding: 10px 14px 6px; border-bottom: 1px solid var(--line); }
.me-option { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 0.95rem; color: #fff; cursor: pointer; }
.me-option input { appearance: none; width: 16px; height: 16px; margin: 0; flex: none; background: #fff; border-radius: 3px; cursor: pointer; position: relative; }
.me-option input:checked::after { content: ""; position: absolute; left: 5px; top: 1px; width: 4px; height: 9px; border: solid #1b1418; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.table { margin-top: 14px; }
.seat:has(> .seat-card.me) { max-width: 240px; } /* your own seat sits at the bottom middle: room for the full name */

/* ---------- v4.12: mentions by person, the bell like osu!'s, the notifications page ---------- */
.nav-panel-head { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; }
.nav-panel-head .nav-panel-title { flex: 1; margin: 2px 4px; }
.nav-panel-action { appearance: none; padding: 3px 10px; font: inherit; font-size: 0.8rem; font-weight: 700; color: rgba(255, 255, 255, 0.8); background: transparent; border: 1px solid var(--nav-line); border-radius: 999px; cursor: pointer; }
.nav-panel-action:hover { color: #fff; border-color: #fff; }
.nav-panel-back { appearance: none; width: 28px; height: 28px; padding: 0 0 3px; font: inherit; font-size: 1.5rem; line-height: 1; color: #fff; background: transparent; border: 0; border-radius: 50%; cursor: pointer; }
.nav-panel-back:hover { background: rgba(255, 255, 255, 0.12); }
.nav-panel-empty { margin: 4px 4px 6px; color: rgba(255, 255, 255, 0.6); }
.nav-panel-chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 4px; font-size: 0.85rem; color: rgba(255, 255, 255, 0.75); }
.nav-panel-chip b { min-width: 1.8em; padding: 1px 8px; text-align: center; color: #fff; background: hsl(var(--hue) 10% 30%); border-radius: 999px; }
.nav-panel-link { display: block; margin: 0 4px 8px; font-size: 0.9rem; color: var(--accent); text-decoration: none; }
.nav-panel-link:hover { text-decoration: underline; }
/* who wrote your name */
.people-list { display: grid; gap: 4px; max-height: 60vh; overflow: auto; margin: 0; padding: 0; list-style: none; }
.person-row { appearance: none; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1px 10px; width: 100%; padding: 8px 10px; font: inherit; text-align: left; color: #fff; background: var(--nav-bg); border: 0; border-radius: 0; cursor: pointer; }
.person-row:hover { background: hsl(var(--hue) 10% 30%); }
.person-name { grid-column: 1; grid-row: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-count { grid-column: 1; grid-row: 2; font-size: 0.78rem; color: rgba(255, 255, 255, 0.55); }
.person-row .note-when { grid-column: 2; grid-row: 1 / 3; align-self: center; margin: 0; }
/* one person's messages, like a chat log: a line per day, "time name: text" */
.thread { display: flex; flex-direction: column; gap: 2px; max-height: 60vh; overflow: auto; margin: 0; padding: 2px 4px; list-style: none; font-size: 0.88rem; }
.thread-day { display: flex; align-items: center; gap: 8px; margin: 8px 0 4px; font-size: 0.75rem; font-weight: 700; color: rgba(255, 255, 255, 0.5); }
.thread-day::before, .thread-day::after { content: ""; flex: 1; height: 1px; background: var(--nav-line); }
.thread-line { display: flex; flex-wrap: wrap; gap: 0 6px; line-height: 1.4; overflow-wrap: anywhere; }
.thread-time { color: rgba(255, 255, 255, 0.45); font-variant-numeric: tabular-nums; font-size: 0.8rem; }
.thread-name { color: var(--accent); }
.thread-name::after { content: ":"; }
.thread-text { color: #fff; }
/* the notifications page */
.notifications { margin: -24px -40px 0; }
.note-tabs { margin: 0; }
.note-bar { display: flex; justify-content: flex-end; padding: 10px 40px 0; }
.note-cards { display: grid; gap: 6px; margin: 10px 0 0; padding: 10px 40px 30px; list-style: none; }
.note-card { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 12px 10px 0; background: var(--surface-2); border-radius: 0; }
.note-mark { display: flex; align-items: center; justify-content: center; align-self: stretch; font-size: 1.4rem; font-weight: 700; color: hsl(var(--hue) 70% 72%); background: hsl(var(--hue) 10% 16%); border-radius: 0; }
.note-card-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.note-kind { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.note-title { font-weight: 600; overflow-wrap: anywhere; }
.note-ago { font-size: 0.8rem; color: var(--muted); }
.note-card .btn { align-self: flex-start; margin-top: 4px; }
.note-bin { appearance: none; width: 34px; height: 34px; padding: 0; font: inherit; font-size: 1.05rem; color: var(--muted); background: transparent; border: 0; border-radius: 50%; cursor: pointer; }
.note-bin:hover { color: var(--bad); background: rgba(255, 255, 255, 0.06); }
.note-empty { padding: 20px 40px 30px; }
.notifications > .hint:not(.note-empty) { padding: 20px 40px; }
@media (max-width: 760px) {
  .notifications { margin: -16px -14px 0; }
  .note-bar, .note-cards, .note-empty { padding-left: 14px; padding-right: 14px; }
  .note-card { grid-template-columns: 44px minmax(0, 1fr) auto; }
}

/* ---------- v4.13: paged lists, the lobby banner on every page, the dev panel, pictures in the bubble ---------- */
.pager-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 12px; }
.pager-search { flex: 1 1 200px; min-width: 160px; padding: 0.45rem 0.8rem; }
.pager-sortgroup { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.pager-sort { flex: 0 0 auto; width: auto; padding: 0.45rem 0.8rem; }
.pager-sort-label { font-size: 0.9rem; font-weight: 600; color: var(--muted); }
.pager-dir { flex: 0 0 auto; min-width: 2.4rem; padding: 0.45rem 0.5rem; font-size: 1rem; line-height: 1; text-align: center; border-color: var(--line); }
.btn.pager-dir.on { color: #fff; background: hsl(var(--hue) 60% 52%); border-color: hsl(var(--hue) 60% 52%); } /* reversed: lit like a picked chip, not just a different arrow */
/* the chevrons (v4.22): the direction button's turns up when the order is reversed, the "Filters" one when the panel is open */
.chev { width: 18px; height: 18px; display: block; transition: transform 0.2s var(--ease); }
.pager-dir.on .chev, .pager-more-button.on .chev { transform: rotate(180deg); }
.pager-more-button { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 2.6rem; min-height: 2.4rem; margin-left: auto; padding: 0; border-color: var(--line); }
.funnel { width: 18px; height: 18px; display: block; }
.pager-more-button.on { color: var(--text); border-color: var(--accent); }
.pager-more-count { position: absolute; top: -7px; right: -7px; min-width: 18px; height: 18px; padding: 0 5px; font-size: 0.7rem; font-weight: 700; line-height: 18px; color: #fff; background: hsl(var(--hue) 60% 52%); border-radius: 999px; text-align: center; }
/* the fold-out panel (v4.22): sections, one per filter, a small uppercase label over its chips, and a reset at the bottom */
.pager-more { margin: -4px 0 14px; background: var(--surface-2); border: 1px solid var(--line); }
.pager-more-body { display: flex; flex-direction: column; }
.pager-more .pager-filter { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.pager-more .pager-filter-name { margin: 0; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.pager-chips { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pager-more .pager-fields { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pager-more .pager-fields .pager-filter-name { text-transform: none; letter-spacing: 0; font-weight: 600; }
.pager-reset { appearance: none; display: block; width: 100%; padding: 10px 14px; font: inherit; font-size: 0.9rem; font-weight: 600; color: var(--text); background: transparent; border: 0; text-align: left; cursor: pointer; }
.pager-reset:hover { background: rgba(255, 255, 255, 0.05); }
/* the two-handle range: one track, both sliders on top of it, only their thumbs catch the pointer */
.range { position: relative; display: block; width: 100%; height: 28px; }
.range-track { position: absolute; left: 0; top: 50%; width: 100%; height: 6px; transform: translateY(-50%); background: var(--line); border-radius: 999px; }
.range-fill { position: absolute; top: 0; bottom: 0; background: hsl(var(--hue) 60% 52%); border-radius: 999px; }
.range-in { position: absolute; left: 0; top: 0; width: 100%; height: 100%; margin: 0; appearance: none; -webkit-appearance: none; background: transparent; pointer-events: none; }
.range-in::-webkit-slider-runnable-track { background: transparent; height: 100%; }
.range-in::-moz-range-track { background: transparent; }
.range-in::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; pointer-events: auto; width: 20px; height: 20px; margin-top: 4px; border-radius: 50%; background: #fff; border: 3px solid hsl(var(--hue) 60% 52%); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4); cursor: grab; }
.range-in::-moz-range-thumb { pointer-events: auto; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid hsl(var(--hue) 60% 52%); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4); cursor: grab; }
.range-in:focus-visible { outline: none; }
.range-in:focus-visible::-webkit-slider-thumb { outline: 3px solid var(--cyan); outline-offset: 2px; }
.pager-filter-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; width: 100%; }
.range-text { font-size: 0.82rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.range-text.on { color: var(--text); }
.pager-filter-range { align-self: stretch; }
.pager-more .pager-filter-range .range { width: 100%; }
@media (max-width: 600px) {
  .pager-more-button { margin-left: 0; }
}
}
.pager-filter { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.pager-filter-name { margin-right: 4px; font-size: 0.8rem; color: var(--muted); }
.chip-btn { appearance: none; padding: 3px 10px; font: inherit; font-size: 0.8rem; font-weight: 600; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
.chip-btn:hover { color: var(--text); }
.chip-btn.on { color: #fff; background: hsl(var(--hue) 60% 52%); border-color: hsl(var(--hue) 60% 52%); }
/* the page numbers, like osu.ppy.sh's: centred, "prev" and "next" pills with chevrons, plain numbers
   with the current page in a filled circle of the page's colour (v4.22) */
.pager-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 10px; margin: 18px 0 4px; }
.pager-numbers { display: inline-flex; align-items: center; gap: 2px; }
.pager-page { appearance: none; min-width: 34px; height: 34px; padding: 0 6px; font: inherit; font-size: 0.9rem; font-weight: 700; color: var(--text); background: transparent; border: 0; border-radius: 50%; cursor: pointer; }
.pager-page:hover { color: hsl(var(--hue) 75% 78%); }
.pager-page.on { color: #1a1020; background: hsl(var(--hue) 70% 70%); }
.pager-gap { color: var(--muted); padding: 0 4px; }
.pager-step { appearance: none; display: inline-flex; align-items: center; gap: 2px; height: 32px; padding: 0 14px 0 10px; font: inherit; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
.pager-step.pager-next { padding: 0 10px 0 14px; }
.pager-step:hover:not(:disabled) { border-color: hsl(var(--hue) 70% 70%); }
.pager-step:disabled { opacity: 0.4; cursor: default; }
.pager-step .chev { width: 16px; height: 16px; }
.chev-left { transform: rotate(90deg); }
.chev-right { transform: rotate(-90deg); }
.pager-info { display: none; } /* (the pages say their own counts) */
.pager-list { margin: 0; padding: 0; list-style: none; }
.pager-empty { margin: 8px 0; }
/* Fingers instead of a mouse pointer: a quick second tap on a control is a tap, not a zoom, and the
   small controls grow to a size a thumb can hit and show their edges, since there is no hover to
   find them by. (v4.21: the sort arrow in particular was a 25px grey glyph on a phone.) */
.btn, .chip-btn, .pager-page, .beatmap-play, .preview-stop, .seg, .topbar-toggle, .topnav a, .nav-icon, .me-item, .me-option { touch-action: manipulation; }
@media (pointer: coarse) {
  .btn.pager-dir { min-width: 44px; min-height: 40px; color: var(--text); border-color: var(--line); }
  .pager-sort { min-height: 40px; }
  .chip-btn { min-height: 34px; padding: 4px 12px; }
  .pager-page { min-width: 36px; height: 36px; }
  .btn.small { min-height: 36px; }
  .round-move { min-width: 40px; }
  .beatmap-cover:not(.is-sm) .beatmap-play { width: 34px; height: 34px; }
  .beatmap-cover.is-sm .beatmap-play { width: 26px; height: 26px; }
}
.note-cards.pager-list { padding: 0; }
.notifications .pager { padding: 10px 40px 30px; }
.note-face .avatar { width: 36px; height: 36px; }
.person-row { grid-template-columns: auto minmax(0, 1fr) auto; }
.person-pic { grid-column: 1; grid-row: 1 / 3; align-self: center; }
.person-pic .avatar { width: 32px; height: 32px; }
.person-name { grid-column: 2; }
.person-count { grid-column: 2; }
.person-row .note-when { grid-column: 3; }
/* the lobby banner above every page's body */
.site-banner { margin: 16px 40px 0; }
.page-room .site-banner { display: none; }
/* the dev tools, fixed top left */
.dev-panel { position: fixed; top: 12px; left: 12px; z-index: 35; display: flex; flex-direction: column; gap: 6px; width: 180px; padding: 8px 10px; border: 2px dashed var(--cyan); border-radius: 0; background: color-mix(in srgb, var(--cyan) 8%, hsl(var(--hue) 10% 12%)); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45); }
.dev-row, .dev-page .dev-bar { display: flex; flex-direction: column; align-items: stretch; gap: 5px; }
.dev-panel .btn { justify-content: flex-start; }
.dev-page .dev-bar { margin: 0; padding: 6px 0 0; border: 0; border-top: 1px dashed var(--cyan); border-radius: 0; background: transparent; }
.dev-page .dev-bar .dev-label { display: none; }
.dev-page:empty { display: none; }
.dev-panel .btn.small { padding: 0.3rem 0.7rem; font-size: 0.8rem; }
.stats-page .stats { margin-top: 12px; }
@media (max-width: 760px) {
  .site-banner { margin: 12px 14px 0; }
  .notifications .pager { padding: 10px 14px 24px; }
  .dev-panel { top: auto; bottom: 84px; left: 8px; max-width: 200px; }
}
/* v4.14: map suggestions */
.suggest-form .invite-row { margin-bottom: 8px; }
.suggest-list { display: grid; gap: 8px; margin: 10px 0 0; padding: 0; list-style: none; }
.suggest-row { flex-wrap: wrap; }
.suggest-actions { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.suggest-actions .select.small { padding: 0.3rem 0.6rem; }
.chip.sug-pending { background: color-mix(in srgb, var(--gold) 22%, var(--surface)); color: var(--gold); }
.chip.sug-approved { background: color-mix(in srgb, var(--good) 22%, var(--surface)); color: var(--good); }
.chip.sug-denied { background: color-mix(in srgb, var(--bad) 22%, var(--surface)); color: var(--bad); }
.suggest-queue .manual { margin-top: 10px; }
/* v4.15: the tiebreaker's map on the results, the share picture like the screen */
.tb-done-map { margin: 4px 0 8px; text-align: center; font-size: 0.95rem; }
.tb-done-map .tb-map { display: inline; font-weight: 700; color: var(--accent); }
/* v4.16 (beta): the beta tag, the footer, the plain 404 / error page */
.beta-tag { display: inline-block; margin-left: 8px; padding: 1px 8px; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: #fff; background: var(--pink); border-radius: 999px; vertical-align: middle; }
.site-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 22px; max-width: 1100px; margin: 28px auto 30px; padding: 0 16px; font-size: 0.82rem; color: var(--muted); }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); text-decoration: underline; }
.foot-brand { font-weight: 700; color: var(--text); }
.foot-brand .beta-tag { margin-left: 6px; }
.foot-version { margin-left: 8px; font-weight: 500; color: var(--muted); }
.foot-note { flex-basis: 100%; text-align: center; font-size: 0.78rem; }
.plain-page { max-width: 520px; margin: 80px auto; padding: 0 20px; text-align: center; }
.plain-page .brand { justify-content: center; font-size: 1.4rem; }
.plain-page .brand-dot { width: 32px; height: 32px; border-width: 4px; }
.plain-page h1 { margin: 24px 0 8px; }
.plain-page .btn { display: inline-flex; margin-top: 10px; }
.dev-fold { appearance: none; padding: 0; font: inherit; font-size: 0.8rem; font-weight: 700; color: var(--cyan); background: transparent; border: 0; cursor: pointer; text-align: left; }
.dev-panel.folded { width: auto; }
.dev-panel.folded .dev-row, .dev-panel.folded .dev-page { display: none; }
/* the head: the fold label, a grip to drag by, the lock and the reset (v4.22) */
.dev-head { display: flex; align-items: center; gap: 6px; }
.dev-head .dev-label { margin-right: auto; }
.dev-panel:not(.locked) .dev-head { cursor: grab; touch-action: none; user-select: none; }
.dev-panel.dragging .dev-head { cursor: grabbing; }
.dev-panel.dragging { opacity: 0.9; box-shadow: 0 14px 34px rgba(0, 0, 0, 0.6); }
.dev-panel.moved { bottom: auto; right: auto; } /* placed by its left / top once it was dragged */
.dev-tool { appearance: none; display: inline-flex; padding: 2px; line-height: 0; color: var(--cyan); background: transparent; border: 0; cursor: pointer; opacity: 0.75; }
.dev-tool:hover { opacity: 1; }
.dev-ico { width: 15px; height: 15px; display: block; }
.dev-panel.folded .dev-tool { display: none; }
.dev-panel.locked .dev-lock { opacity: 1; }
/* v4.17: the help pages (like osu!'s wiki) and the legal pages */
.help { max-width: 820px; margin: 0 auto; }
.help-title { margin: 0 0 6px; font-size: 1.9rem; }
.help .lede { font-size: 1.05rem; }
/* the landing page (/help) reads like a little welcome screen, so its text is centred; an article
   page (/help/<slug>) keeps the default left alignment, better for reading paragraphs and lists */
.help-home { text-align: center; }
.help-home > .lede { margin-left: auto; margin-right: auto; }
.help-home .help-h2 { margin-top: 28px; }
/* a wrapping flex row rather than a grid, so a lone card on the last row (Rules) sits in the
   middle instead of hanging on the left; the max-width keeps every card the width of a column */
.help-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 18px 0 26px; }
.help-card { flex: 1 1 240px; max-width: calc((100% - 24px) / 3); display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 18px; color: var(--text); text-decoration: none; text-align: center; background: var(--surface-2); border: 2px solid transparent; border-radius: 0; transition: border-color 0.12s, transform 0.12s var(--ease); }
@media (max-width: 760px) { .help-card { max-width: calc((100% - 12px) / 2); } }
@media (max-width: 600px) { .help-card { max-width: 100%; } }
.help-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.help-card-title { font-size: 1.1rem; font-weight: 700; color: var(--accent); }
.help-card-text { font-size: 0.92rem; color: var(--muted); }
.help-crumb { margin: 0 0 4px; font-size: 0.85rem; color: var(--muted); }
.help-crumb a { color: var(--accent); text-decoration: none; }
.help-h2 { margin: 28px 0 8px; font-size: 1.3rem; }
.help-h3 { margin: 18px 0 6px; font-size: 1.05rem; }
.help-article p, .help-list li, .help-steps li, .legal p, .legal li { line-height: 1.55; }
.help-list, .help-steps { margin: 8px 0 12px; padding-left: 22px; }
.help-list li, .help-steps li { margin: 4px 0; }
.help-code { padding: 1px 6px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.88em; color: #fff; background: var(--surface-2); border-radius: 6px; }
.help-tip { margin: 14px 0; padding: 10px 14px; background: color-mix(in srgb, var(--accent) 10%, var(--surface)); border-left: 3px solid var(--accent); border-radius: 0; }
.help-tip p { margin: 2px 0 0; }
.help-tip-label { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent); }
.help-note { background: color-mix(in srgb, var(--gold) 10%, var(--surface)); border-left-color: var(--gold); }
.help-note .help-tip-label { color: var(--gold); }
.help-figure { margin: 16px 0; padding: 14px; background: var(--surface-2); border-radius: 0; }
.help-figure figcaption { margin-top: 8px; font-size: 0.85rem; color: var(--muted); text-align: center; }
.help-coins { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; }
.help-coin { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 0.82rem; color: var(--muted); }
.help-svg { display: block; width: min(100%, 360px); height: auto; margin: 0 auto; }
.help-svg.wide { width: 100%; max-width: 640px; }
.help-table { width: 100%; border-collapse: collapse; }
.help-table th, .help-table td { padding: 6px 10px; text-align: left; border-bottom: 1px solid var(--line); }
.help-table th { font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.help-next { display: flex; justify-content: space-between; gap: 10px; margin: 30px 0 0; }
.help-next .btn { text-decoration: none; }
.help a:not(.btn):not(.help-card) { color: var(--accent); }
.legal-contents { margin: 6px 0 10px; padding-left: 26px; line-height: 1.7; list-style: decimal; }
.legal-contents ol { padding-left: 22px; list-style: decimal; }
.legal-contents a { color: var(--accent); text-decoration: none; }
.legal-contents a:hover { text-decoration: underline; }
/* 50px of pinned top bar plus a breath */
.legal-h2, .legal-h3, .news-row { scroll-margin-top: 62px; }
/* v4.18: player reports, the moderators' review page, the bell's moderation notes, blocking */
.topnav-count { display: inline-block; margin-left: 5px; padding: 0 6px; font-size: 0.68rem; font-weight: 700; color: #fff; background: hsl(0 65% 52%); border-radius: 999px; vertical-align: 2px; }
.blocked-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.blocked-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 10px; background: var(--surface-2); border-radius: 0; }
.blocked-name { font-weight: 600; }
.report-side { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.foot-credit { flex-basis: 100%; text-align: center; font-size: 0.72rem; color: var(--muted); opacity: 0.7; }
.report-card { width: min(520px, 100%); border-color: var(--line); }
.report-card h2 { margin-top: 0; }
.report-card .hint { margin: 6px 0 12px; }
.report-reasons { display: grid; gap: 6px; margin: 10px 0; }
.report-reason { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 0; cursor: pointer; }
.report-reason:has(input:checked) { border-color: hsl(var(--hue) 60% 52%); background: hsl(var(--hue) 20% 20%); }
.report-reason.is-off { opacity: 0.5; cursor: not-allowed; }
.report-reason input { margin-top: 4px; accent-color: hsl(var(--hue) 60% 52%); }
.report-reason-text { display: grid; gap: 2px; }
.report-reason-text small { color: var(--muted); }
.report-suggested { font-weight: 500; color: var(--accent); }
.report-text { width: 100%; min-height: 70px; padding: 10px 12px; font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; resize: vertical; }
.report-error { margin: 8px 0 0; color: var(--gold); }
.report-quote { margin: 6px 0 10px; padding: 8px 12px; color: var(--muted); border-left: 3px solid hsl(var(--hue) 60% 52%); background: var(--surface-2); border-radius: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.reports { display: grid; gap: 16px; }
.page-tab-count:not(:empty) { margin-left: 6px; padding: 0 7px; font-size: 0.72rem; color: #fff; background: hsl(var(--hue) 60% 52%); border-radius: 999px; }
.report-rows { display: grid; gap: 8px; padding: 0; list-style: none; }
.report-row-main { appearance: none; display: grid; gap: 4px; width: 100%; padding: 10px 14px; font: inherit; text-align: left; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: 0; cursor: pointer; }
.report-row-main:hover { border-color: hsl(var(--hue) 60% 52%); }
.report-row-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.report-row-sub { font-size: 0.85rem; color: var(--muted); overflow-wrap: anywhere; }
.report-chip { display: inline-block; padding: 1px 9px; font-size: 0.74rem; font-weight: 700; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; }
.report-chip.is-pending { color: var(--gold); border-color: var(--gold); }
.report-chip.is-approved, .report-chip.act-timeout, .report-chip.act-ban { color: #fff; background: hsl(0 60% 48%); border-color: hsl(0 60% 48%); }
.report-chip.is-denied, .report-chip.act-warning { color: var(--muted); }
.report-open { display: grid; gap: 14px; }
.report-head { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.report-head h2 { margin: 0; font-size: 1.2rem; }
.report-box { padding: 14px 16px; background: var(--surface-2); border-radius: 0; }
.report-box h3 { margin: 0 0 8px; font-size: 1rem; }
.report-box .hint { margin: 4px 0 8px; }
.report-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; margin: 0; }
.report-facts dt { font-weight: 700; color: var(--muted); }
.report-facts dd { margin: 0; overflow-wrap: anywhere; }
.report-message { white-space: pre-wrap; }
.report-restricted { color: var(--gold); }
.report-offences { display: grid; gap: 4px; margin: 6px 0; padding: 0; list-style: none; font-size: 0.9rem; }
.linkish { appearance: none; padding: 0; font: inherit; color: var(--accent); background: none; border: 0; cursor: pointer; text-decoration: underline; }
.report-chat { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.report-chat li { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 10px; font-size: 0.92rem; }
.report-chat-when { color: var(--muted); font-size: 0.8rem; white-space: nowrap; }
.report-chat-text { overflow-wrap: anywhere; }
.report-chat-text.is-roll { font-style: italic; color: var(--muted); }
.report-table-wrap { overflow-x: auto; }
.report-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.report-table th, .report-table td { padding: 5px 8px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.report-table td.num { text-align: center; font-variant-numeric: tabular-nums; }
.report-table tr.is-target td { background: hsl(0 50% 30% / 0.45); font-weight: 700; }
.report-events summary { cursor: pointer; color: var(--muted); }
.report-events ol { display: grid; gap: 2px; margin: 8px 0 0; padding: 0; list-style: none; font-size: 0.85rem; }
.report-event-when { display: inline-block; min-width: 86px; color: var(--muted); font-variant-numeric: tabular-nums; }
.report-review .field { width: 100%; margin: 8px 0; }
.report-days { display: block; margin: 4px 0 8px; }
.report-days .field { width: auto; margin-left: 6px; }
.note-card.is-notice .note-mark { color: var(--gold); }
.notice-warning .note-head b, .notice-timeout .note-head b, .notice-ban .note-head b { color: var(--gold); }
@media (max-width: 600px) {
  .report-facts { grid-template-columns: 1fr; gap: 2px; }
  .report-facts dt { margin-top: 6px; }
}
/* v4.19: the home page (osu dashboard style), the news, follows, coloured notification headings */
.dash { display: grid; gap: 18px; }
.dash-hello h2 { margin: 0 0 6px; font-size: 1.5rem; }
.dash-hello .lede { max-width: 60ch; }
.dash-hello .actions { margin-top: 12px; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr); gap: 18px; align-items: start; }
.dash-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 0 8px; }
.dash-head h2 { margin: 0; font-size: 1.05rem; font-weight: 600; }
.dash-link { font-size: 0.85rem; color: var(--accent); text-decoration: none; }
.dash-link:hover { text-decoration: underline; }
.dash-side { display: grid; gap: 14px; }
.dash-card { padding: 14px 16px; background: var(--surface-2); border-radius: 0; }
.dash-numbers { display: flex; gap: 18px; flex-wrap: wrap; }
.dash-number { display: grid; }
.dash-number b { font-size: 1.4rem; line-height: 1.1; }
.dash-number small { color: var(--muted); font-size: 0.72rem; text-transform: lowercase; }
.dash-graph { margin: 10px 0 4px; }
.spark { display: block; width: 100%; height: 56px; }
.spark-online { stroke: hsl(var(--hue) 75% 72%); stroke-width: 2; stroke-linejoin: round; }
.spark-games { stroke: var(--gold); stroke-width: 1.5; stroke-linejoin: round; opacity: 0.9; }
.spark-dot { fill: hsl(var(--hue) 75% 72%); }
.dash-legend { margin: 0; font-size: 0.74rem; color: var(--muted); }
.dash-key { display: inline-block; width: 14px; height: 3px; margin: 0 2px 3px 0; vertical-align: middle; border-radius: 2px; background: hsl(var(--hue) 75% 72%); }
.dash-key.games { background: var(--gold); }
.dash-match { display: grid; gap: 4px; color: var(--text); text-decoration: none; }
.dash-match:hover b { text-decoration: underline; }
.dash-match-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.dash-match-when { margin-left: auto; font-size: 0.8rem; color: var(--muted); }
.dash-match-line { font-size: 0.88rem; color: var(--muted); }
.dash-stats { margin: 10px 0 0; font-size: 0.85rem; color: var(--muted); }
.dash-map-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.dash-map { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.dash-map-text { display: grid; min-width: 0; font-size: 0.86rem; }
.dash-map-text b, .dash-map-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-map-sub, .dash-map-meta { color: var(--muted); font-size: 0.78rem; }
.dash-map-link { padding: 4px 10px; font-size: 1.2rem; color: var(--muted); text-decoration: none; border-radius: 10px; }
.dash-map-link:hover { background: var(--surface); color: var(--text); }
.news { display: grid; gap: 14px; }
.news-follow-row { display: flex; flex-wrap: wrap; gap: 8px; }
.news-follow { display: inline-flex; align-items: center; gap: 2px; padding: 4px 4px 4px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 0.85rem; }
.news-bell { color: var(--muted); }
.news-bell.on { color: #fff; border-color: transparent; }
.news-bell-icon { width: 16px; height: 16px; }
.news-bell-slash { stroke: currentColor; stroke-width: 2; stroke-linecap: round; opacity: 0; transition: opacity 120ms ease; }
.news-bell.off .news-bell-slash { opacity: 1; }
.news-list { display: grid; gap: 10px; }
.news-card { padding: 12px 16px; background: var(--surface-2); border-radius: 0; border-left: 4px solid var(--news-colour, var(--accent)); }
/* The home page's news widget: one sharp-edged rectangle holding the filter tabs (with a follow
   bell on each real category) and the matching posts, instead of a separate pill row above a list. */
.news-panel { border: 1px solid var(--line); border-radius: 0; overflow: hidden; }
.news-tabs { display: flex; flex-wrap: wrap; background: var(--bg); border-bottom: 1px solid var(--line); }
.news-tab { display: flex; align-items: center; border-right: 1px solid var(--line); }
.news-tab:last-child { border-right: 0; }
.news-tab-label { padding: 9px 14px; font: inherit; font-size: 0.88rem; font-weight: 600; color: var(--muted); background: transparent; border: 0; cursor: pointer; }
.news-tab-label:hover { color: var(--text); }
.news-tab.on { background: var(--surface-2); box-shadow: inset 0 -2px 0 hsl(var(--hue) 60% 52%); } /* highlight covers the whole tab, bell included */
.news-tab.on .news-tab-label { color: var(--text); }
.news-tab .news-bell { margin-right: 4px; }
.news-tab.on .news-bell-icon { filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.55)); } /* a highlighted tab's background can wash the bell out */
.news-panel .news-list { gap: 0; padding: 0; margin: 0; background: var(--surface-2); }
.news-panel .news-card { border-radius: 0; border-left: 0; border-top: 1px solid var(--line); }
.news-panel .news-card:first-child { border-top: 0; }
.news-card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 0.8rem; color: var(--muted); }
.news-cat { display: inline-block; padding: 1px 9px; font-size: 0.72rem; font-weight: 700; color: #fff; background: var(--news-colour, var(--accent)); border-radius: 999px; }
.news-version { font-weight: 700; color: var(--text); }
.news-when { margin-left: auto; }
.news-title { margin: 6px 0 4px; font-size: 1.1rem; }
.news-title a { color: var(--text); text-decoration: none; }
.news-title a:hover { text-decoration: underline; }
.news-summary { margin: 0 0 6px; color: var(--muted); }
.news-more { font-size: 0.85rem; color: var(--accent); text-decoration: none; }
.news-post .news-post-title { margin: 6px 0 12px; font-size: 1.5rem; }
.news-body { max-width: 72ch; }
.news-body .md-h { margin: 18px 0 6px; font-size: 1.05rem; }
.news-body p { margin: 0 0 10px; line-height: 1.55; }
.md-list { margin: 0 0 10px; padding-left: 22px; }
.md-list li { margin: 3px 0; line-height: 1.5; }
.news-source { margin-top: 18px; }
/* a colour per kind of news and of note: updates purple, map pool blue, announcements teal; invites green,
   mentions blue, "your report was reviewed" yellow, warnings orange, timeouts and bans red */
.is-updates { --news-colour: hsl(270 60% 62%); }
.is-pool { --news-colour: hsl(200 70% 55%); }
.is-announcements { --news-colour: hsl(170 60% 45%); }
.note-head b { color: var(--note-colour, var(--text)); }
.note-invite { --note-colour: hsl(120 55% 62%); }
.notice-report { --note-colour: var(--gold); }
.notice-warning { --note-colour: hsl(28 95% 62%); }
.notice-timeout, .notice-ban { --note-colour: hsl(0 80% 66%); }
.notice-news { --note-colour: var(--news-colour, var(--accent)); }
.notice-news .note-text { color: var(--text); text-decoration: none; }
.notice-news .note-text:hover { text-decoration: underline; }
.note-kind.is-invite { color: hsl(120 55% 62%); }
.note-kind.is-mention { color: hsl(200 70% 62%); }
.note-kind.notice-report { color: var(--gold); }
.note-kind.notice-warning { color: hsl(28 95% 62%); }
.note-kind.notice-timeout, .note-kind.notice-ban { color: hsl(0 80% 66%); }
.note-kind.notice-news { color: var(--news-colour, var(--accent)); }
.note-card a.note-title { color: var(--text); text-decoration: none; }
.note-card a.note-title:hover { text-decoration: underline; }
@media (max-width: 960px) {
  .dash-grid { grid-template-columns: 1fr; }
}
/* v4.19.1: the news like osu's beatmap packs (bars that roll out), difficulty circles */
.diff-circle { display: inline-block; width: 16px; height: 16px; border-radius: 50%; background: var(--diff, #aaa); box-shadow: inset 0 0 0 3px rgba(0, 0, 0, 0.35); vertical-align: -3px; }
.diff-circle.sm { width: 12px; height: 12px; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.35); vertical-align: -1px; }
.diff-circle.lg { width: 22px; height: 22px; box-shadow: inset 0 0 0 4px rgba(0, 0, 0, 0.35); }
.news-rows { display: grid; gap: 8px; }
.news-row { border-radius: 0; background: var(--surface-2); border-left: 4px solid var(--news-colour, var(--accent)); overflow: hidden; }
.news-row-head { appearance: none; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 14px; width: 100%; padding: 12px 16px; font: inherit; color: var(--text); text-align: left; background: transparent; border: 0; cursor: pointer; }
.news-row-head:hover { background: hsl(var(--hue) 12% 22%); }
.news-row.open .news-row-head { background: hsl(var(--hue) 12% 22%); }
.news-row-title { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.news-row-title b { font-size: 1rem; }
.news-row-meta { font-size: 0.88rem; color: var(--muted); white-space: nowrap; }
.news-row-meta b { color: var(--text); }
.news-row-body { padding: 4px 16px 14px 20px; border-top: 1px solid var(--line); animation: roll-out 0.25s var(--ease); }
@keyframes roll-out { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.news-row-body p { margin: 8px 0; line-height: 1.55; max-width: 72ch; }
.news-row-body .md-h { margin: 14px 0 4px; font-size: 1rem; }
.news-maps-title { margin: 10px 0 6px; font-size: 0.9rem; color: var(--muted); }
.news-maps { display: grid; gap: 6px; margin: 0 0 8px; padding: 0; list-style: none; }
.news-map { display: flex; align-items: center; gap: 10px; min-width: 0; }
.news-map-link { color: var(--text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.news-map-link:hover { text-decoration: underline; }
.news-map-version { color: var(--muted); }
.news-map-slot { margin-left: auto; padding: 1px 8px; font-size: 0.74rem; font-weight: 700; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; }
.dash-map-meta .diff-circle { margin-right: 2px; }
@media (max-width: 600px) {
  .news-row-meta { white-space: normal; }
}

/* ---- v4.20: round presets, the BPM / stats reveals, mods-only pool ------------------------- */
.presets { display: flex; flex-direction: column; gap: 6px; }
.preset-btn { width: 100%; font-weight: 700; text-align: center; }
.preset-btn.on { color: #fff; background: hsl(var(--hue) 60% 52%); border-color: hsl(var(--hue) 60% 52%); }
.preset-btn:disabled { opacity: 0.7; cursor: default; }
.preset-hint { margin: 4px 0 0; font-size: 0.85rem; }
.custom-rounds { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); }
.round-default { margin-bottom: 6px; }
/* The draggable area: its own shade (darker than the --surface-2 panel it sits in), so it reads as
   one distinct, self-contained control. Rows are positioned absolutely by top (index * step), fixed
   height so dragging math never has to measure anything -- see ROUND_STEP in lobby.js. */
.round-board { padding: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 0; }
.round-list {
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
  --round-row-h: 42px;
  --round-row-gap: 4px;
  height: calc(6 * var(--round-row-h) + 5 * var(--round-row-gap));
}
.round-row {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--round-row-h);
  box-sizing: border-box;
  padding: 0 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 0;
  transition: top 150ms ease;
}
.round-row.dragging { transition: none; z-index: 2; cursor: grabbing; border-color: hsl(var(--hue) 60% 52%); box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45); }
.round-row.inactive { opacity: 0.6; }
.round-handle { cursor: grab; touch-action: none; color: var(--muted); font-size: 0.95rem; flex: none; }
.round-num { flex: none; width: 1.3rem; height: 1.3rem; display: inline-flex; align-items: center; justify-content: center; font-size: 0.74rem; font-weight: 700; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; }
.round-row .check { flex: 1 1 auto; margin: 0; min-width: 0; }
.round-label { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.round-moves { display: none; gap: 2px; flex: none; }
.round-move { padding: 0 0.4rem; line-height: 1.6; }
@media (max-width: 760px) {
  /* No mouse to drag with here: the handle gives way to ↑/↓ buttons instead. */
  .round-handle { display: none; }
  .round-moves { display: flex; }
}
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 8px; margin: 4px 0 10px; }
.stat-cell { display: flex; flex-direction: column; align-items: center; padding: 8px 6px; background: var(--bg); border-radius: 0; }
.stat-label { font-size: 0.75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.stat-value { font-size: 1.25rem; font-weight: 800; color: var(--gold); font-variant-numeric: tabular-nums; text-align: center; }
.map-stats { margin: 0 0 8px; font-size: 0.9rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.info-chip.info-stats.known { font-size: 0.85rem; }
.lookup { margin: 10px 0 4px; padding: 10px 12px; background: var(--bg); border-radius: 0; }
.lookup-name { margin: 0; font-weight: 700; }
.lookup-name a { color: var(--gold); text-decoration: none; }
.lookup-name a:hover { text-decoration: underline; }
.lookup-meta { margin: 2px 0 8px; }
.mod-picks { display: flex; flex-wrap: wrap; gap: 8px; }
.mod-pick { display: inline-flex; flex-direction: column; align-items: center; min-width: 78px; padding: 6px 10px; line-height: 1.2; }
.mod-pick b { font-size: 1.05rem; color: var(--gold); }
.mod-pick span { font-size: 0.8rem; color: var(--muted); }
.mod-pick.in-pool { opacity: 0.6; }
.mod-pick.picked { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 16%, var(--surface)); }
.mod-pick.picked b { color: var(--gold); }
.suggest-review .mod-picks { width: 100%; margin: 4px 0; }
.manual-grid .btn { grid-column: 1 / -1; justify-self: start; }

/* ---------- v4.21: beatmap covers, like osu.ppy.sh's beatmap lists: the set's cover picture next to
   the name, with a play button for osu!'s song preview over it (see ui/beatmap.js) ---------- */
.beatmap-cover { position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none; width: 64px; height: 44px; background: hsl(var(--hue) 10% 26%) center / cover no-repeat; background-image: var(--cover); overflow: hidden; }
.beatmap-cover.is-sm { width: 48px; height: 33px; }
.beatmap-cover.is-lg { width: 96px; height: 66px; }
.beatmap-play { appearance: none; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; color: #fff; background: rgba(0, 0, 0, 0.55); border: 0; border-radius: 50%; cursor: pointer; opacity: 0; transition: opacity 0.15s, background-color 0.15s, transform 0.15s var(--ease); }
.beatmap-play .ico { width: 16px; height: 16px; }
.beatmap-cover:hover .beatmap-play, .beatmap-play:focus-visible, .beatmap-play.on { opacity: 1; }
.beatmap-play:hover { background: rgba(0, 0, 0, 0.75); transform: scale(1.08); }
.beatmap-play.on { background: var(--pink); }
.beatmap-cover.is-sm .beatmap-play { width: 22px; height: 22px; }
.beatmap-cover.is-sm .beatmap-play .ico { width: 13px; height: 13px; }
.beatmap-cover.is-lg .beatmap-play { width: 36px; height: 36px; }
.beatmap-cover.is-lg .beatmap-play .ico { width: 20px; height: 20px; }
@media (hover: none) { .beatmap-play { opacity: 1; } } /* no hover on a phone: the button is always there */
/* the bar at the bottom left while a preview plays: the song, how far it is, the volume, stop */
.preview-bar { position: fixed; left: 16px; bottom: 16px; z-index: 13; display: flex; align-items: center; gap: 12px; width: min(380px, calc(100vw - 32px)); padding: 10px 12px; background: var(--nav-bg-2); border: 1px solid var(--nav-line); box-shadow: 0 12px 34px rgba(0, 0, 0, 0.55); animation: roll-out 0.2s var(--ease); }
.preview-what { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.preview-what > .ico { flex: none; width: 16px; height: 16px; color: var(--pink); }
.preview-name { min-width: 0; flex: 1; font-size: 0.86rem; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview-line { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, 0.08); }
.preview-done { display: block; height: 100%; width: 0; background: var(--pink); transition: width 0.25s linear; }
.preview-volume { width: 90px; flex: none; accent-color: var(--pink); }
.preview-stop { appearance: none; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; flex: none; padding: 0; color: #fff; background: rgba(255, 255, 255, 0.08); border: 0; border-radius: 50%; cursor: pointer; }
.preview-stop:hover { background: rgba(255, 255, 255, 0.18); }
.preview-stop .ico { width: 14px; height: 14px; }
@media (max-width: 760px) { .preview-bar { bottom: 84px; } } /* over the chat bubble's corner */
/* where the cover sits next to a beatmap's name */
.map-head { display: flex; align-items: center; gap: 14px; }
.map-head-text { min-width: 0; flex: 1; }
.map-head-text .map-title, .map-head-text .map-meta, .map-head-text .map-stars { margin-top: 0; }
.map-head-text .map-stats { margin-bottom: 0; }
.map-cover-box:empty { display: none; }
.tb-map-cover:empty { display: none; }
.pop-map-row { display: flex; align-items: center; gap: 14px; margin-bottom: 0.4rem; }
.pop-map-row .pop-map { margin: 0; }
.match-map-row { display: flex; align-items: center; gap: 12px; }
.history-row .beatmap-cover { flex: none; }
.history-row .h-main { flex: 1; }
.news-map .beatmap-cover { flex: none; }

/* ---------- v4.22: the tutorial's coach card and the tutorial card on the play page ---------- */
.tutorial-start { display: flex; justify-content: center; margin: 14px 0 12px; }
.tutorial-card h2 { text-align: center; }
.tutorial-card .hint { text-align: center; }
.lobby .invite.locked { opacity: 0.45; pointer-events: none; user-select: none; } /* the tutorial: the real lobby's settings, fixed */
.tut-arrow { display: inline-flex; align-items: center; gap: 6px; flex: none; align-self: center; margin-left: 4px; color: var(--gold); }
.tut-arrow-head { font-size: 1.7rem; font-weight: 900; line-height: 1; animation: tut-point 0.9s ease-in-out infinite; }
.tut-arrow-text { font-size: 0.8rem; font-weight: 800; max-width: 88px; line-height: 1.15; }
@keyframes tut-point { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(-8px); } }
.map-card.tutorial .req-mods { padding: 8px 10px; margin-left: -10px; gap: 10px; border: 2px dashed var(--gold); border-radius: 12px; }
.tut-onetry { margin: 8px 0 12px; }
@media (prefers-reduced-motion: reduce) { .tut-arrow-head { animation: none; } }
/* the coach: a panel fixed beside the page's box (its right edge 16px left of the box, which is
   1068px wide and centred), vertically centred like the dev panel, so it is in view whatever is
   scrolled. On screens too narrow for both, it sits at the screen's edge and the room shifts right
   just enough to clear it. */
@media (min-width: 961px) {
  .room > .coach { position: fixed; left: max(16px, calc(50% - 534px - 296px)); top: 50%; transform: translateY(-50%); width: 280px; max-height: calc(100vh - 120px); overflow: auto; z-index: 11; margin: 0; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); }
  .room.with-coach { margin-left: max(0px, calc(312px - (100vw - 1068px) / 2)); } /* only as far as the panel reaches into the column */
}
/* the lobby card first opens as a popup (osu-style, over a dimmed page) until "I understand" */
.coach-backdrop { position: fixed; inset: 0; z-index: 14; background: rgba(10, 5, 16, 0.6); }
.room > .coach.coach-popup, .coach.coach-popup { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(480px, calc(100vw - 32px)); max-height: 90vh; overflow: auto; margin: 0; padding: 34px 22px 16px 24px; z-index: 15; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6); }
.coach.coach-popup .coach-title { font-size: 1.3rem; }
.coach.coach-popup .coach-steps { font-size: 1rem; }
.coach.coach-popup .coach-text { font-size: 1rem; }
.coach-ok-row { justify-content: center; margin: 14px 0 2px; }
.coach { position: relative; margin: 0 0 14px; padding: 30px 16px 12px 18px; background: color-mix(in srgb, var(--gold) 8%, var(--surface)); border: 2px solid color-mix(in srgb, var(--gold) 55%, var(--line)); border-left-width: 6px; }
.coach.coach-new { animation: coach-in 0.35s var(--ease); }
@keyframes coach-in { 0% { opacity: 0.5; } 100% { opacity: 1; } } /* opacity only: the panel is placed with a transform */
.coach-label { position: absolute; top: 8px; left: 14px; padding: 0 8px; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: #2a1a24; background: var(--gold); border-radius: 999px; }
.coach-title { margin: 2px 0 4px; font-size: 1.05rem; }
.coach-text { margin: 0 0 6px; font-size: 0.92rem; }
.coach-steps { margin: 0 0 6px; padding-left: 22px; font-size: 0.9rem; list-style: decimal; }
.coach-steps li { margin: 2px 0; }
.coach-tip { margin: 4px 0 0; font-size: 0.82rem; color: var(--muted); }
.coach-skip { margin: 6px auto 0; white-space: normal; text-align: center; max-width: 100%; }
.coach-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.coach-row .coach-hint-button { margin-right: auto; } /* the hint keeps its place on the left; the skip sits centred */
.coach-done { margin: 10px 0 4px; }
.coach-thoughts { list-style: none; margin: 10px 0 0; padding: 8px 0 0; border-top: 1px dashed color-mix(in srgb, var(--gold) 40%, var(--line)); font-size: 0.85rem; display: grid; gap: 3px; }
.coach-thought b { color: var(--gold); }
.tutorial-card { max-width: 640px; margin: 8px auto 0; }
.tutorial-card.only { margin-top: 20px; }
.tutorial-points { margin: 8px 0 14px; padding-left: 20px; }
.tutorial-points li { margin: 4px 0; }

/* ---------- v4.22: the developer's pages (/dev) ---------- */
.dev-page h2 { margin: 22px 0 8px; font-size: 1.05rem; }
.dev-page .stat-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 8px 0 4px; }
.dev-date { flex: 1 1 170px; min-width: 170px; max-width: 240px; padding: 0.35rem 0.6rem; }
.pager-more .pager-fields:has(.dev-date) { width: 100%; }
.dev-matches { list-style: none; padding: 0; margin: 12px 0 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.dev-match { min-width: 0; max-width: 100%; background: var(--surface); border: 2px solid var(--line); } /* (minmax(0) and min-width: a long beatmap name never widens the page on a phone) */
.dev-match-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 10px 14px; color: var(--text); text-decoration: none; }
.dev-match-head:hover { background: var(--surface-2); }
.dev-match-main { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.25; }
.dev-match-title { font-weight: 700; }
.dev-match-title small { font-weight: 400; color: var(--muted); }
.dev-match-map { font-size: 0.85rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dev-match-side { display: inline-flex; align-items: center; gap: 8px; flex: none; }
.dev-players { display: flex; flex-wrap: wrap; gap: 4px 6px; padding: 0 14px 10px; font-size: 0.8rem; }
.dev-player { padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.dev-player.exact { color: var(--good); }
.dev-player.off { color: var(--text); }
.dev-player.me { outline: 2px solid var(--gold); color: #fff; }
.dev-people { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 4px; }
.dev-person { appearance: none; width: 100%; text-align: left; padding: 8px 12px; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); cursor: pointer; }
.dev-person:hover { border-color: var(--accent); }
.dev-detail { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.dev-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.dev-table th, .dev-table td { padding: 5px 10px; text-align: left; border-bottom: 1px solid var(--line); }
.dev-table th { font-size: 0.75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.dev-table td:not(:first-child), .dev-table th:not(:first-child) { text-align: right; white-space: nowrap; }
.dev-chart { display: grid; gap: 3px; font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.dev-chart-row { display: grid; grid-template-columns: 92px 1fr 40px; align-items: center; gap: 8px; }
.dev-chart-day { color: var(--muted); }
.dev-chart-bar { display: block; height: 10px; background: var(--surface-2); }
.dev-chart-fill { display: block; height: 100%; width: calc(var(--p) * 100%); background: var(--accent); }
.dev-chart-n { text-align: right; }
.dev-plain { margin: 6px 0; padding-left: 18px; font-size: 0.9rem; }
.dev-plain li { margin: 3px 0; }
.dev-lobby-actions { display: inline-flex; gap: 4px; margin-left: 8px; vertical-align: middle; }
.dev-lobby-actions .btn { border-color: var(--line); }
.dev-errors { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 6px; }
.dev-error { padding: 8px 12px; background: var(--surface); border-left: 3px solid var(--muted); }
.dev-error.error, .dev-error.critical { border-left-color: var(--bad); }
.dev-error.warning { border-left-color: var(--gold); }
.dev-error-head { font-size: 0.8rem; color: var(--muted); }
.dev-error pre { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.8rem; }
@media (max-width: 760px) {
  .dev-match-head { flex-wrap: wrap; }
  .dev-match-side { width: 100%; justify-content: flex-start; }
  .dev-chart-row { grid-template-columns: 80px 1fr 32px; }
}

/* ---------- v4.22: the table on phones is a list, not a circle ----------
   The circle can't hold eight seats, their coins and the tutorial's bubbles on a 390px screen. On
   phones the free coins sit in a tray at the top, and every player is a row: picture (the held coin
   sits on it), name and chips, steal dots, the small coins of earlier rounds. You are the last row.
   A bot's bubble is a line under its row. The seats keep their --x/--y (unused here); the held-coin
   spots are placed by placeSpots() over each row's picture. */
@media (max-width: 760px) {
  .table { display: flex; flex-direction: column; gap: 6px; width: 100%; min-width: 0; aspect-ratio: auto; padding: 10px 8px 8px; background: hsl(var(--hue) 26% 20%); border: 2px solid hsl(var(--hue) 70% 62% / 0.55); border-radius: 16px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); }
  .table.stage-pick { border-color: hsl(var(--hue) 75% 66%); box-shadow: 0 0 22px hsl(var(--hue) 70% 60% / 0.3), 0 10px 30px rgba(0, 0, 0, 0.45); }
  .felt { display: none; }
  .table-center { position: static; transform: none; order: -1; width: 100%; gap: 6px; margin: 0 0 6px; padding: 0 0 8px; border-bottom: 1px dashed hsl(var(--hue) 50% 80% / 0.25); }
  .call { min-height: 0; }
  .word { font-size: 2.4rem; }
  .table .tray { justify-content: center; gap: 6px; min-height: 0; }
  .table .tray.four { max-width: none; } /* one row of four: there is no ring of seats to run into */
  .table .coin.lg, .table .tray-slot { --size: 46px; }
  .table .tray.many { gap: 5px; }
  .table .tray.many .coin.lg, .table .tray.many .tray-slot { --size: 36px; } /* eight in one row on a 360px screen */
  .table .spot .coin.lg { --size: 34px; }
  .seat { position: static; transform: none; order: 1; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 4px 8px; width: 100%; max-width: none; padding: 2px 4px; }
  .seat-card { flex: 1 1 auto; min-width: 0; gap: 10px; padding: 3px 8px 3px 3px; border-radius: 12px; }
  .seat-card.me { background: rgba(0, 0, 0, 0.18); }
  .seat .avatar-slot { flex: none; margin-right: 18px; } /* room for the held coin on the picture's right half */
  .seat-card.me .seat-sub { display: none; } /* your own rank: you know it; the row needs the room */
  .seat .avatar { width: 34px; height: 34px; }
  .seat-name { font-size: 0.92rem; }
  .seat-sub { display: inline; font-size: 0.72rem; }
  .seat-sub.unknown { display: none; }
  .seat-text { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 2px 7px; } /* name, rank, chips and dots on one line when they fit */
  .seat-steals { margin: 0; }
  .seat-history { flex: none; justify-content: flex-end; flex-wrap: nowrap; min-height: 0; margin-left: auto; }
  .seat-history .coin { --size: 20px; }
  .seat-say { flex: 1 1 100%; max-width: none; margin: 0 0 2px 48px; padding: 5px 10px; font-size: 0.8rem; text-align: left; border-radius: 10px; }
  .spot { z-index: 3; }
  .seat:has(> .seat-card.me) { max-width: none; }
}
