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

/* Typography like osu.ppy.sh: Torus first (a licensed font: put its files in fonts/torus/, see the
   README there, and torus.css maps the weights the way osu-web does), else Quicksand, the rounded
   free typeface osu-web itself uses as its Torus stand-in (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: 6px; /* small, like osu's cards; the page boxes have none */
  --font: "Torus", "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 ---------- */
#app { max-width: 1100px; margin: 0 auto; padding: 0 16px 64px; }
/* the top bar, like osu.ppy.sh's: a full-width dark bar, the logo, lowercase menu links with a
   pink bar under the current one, and you on the right */
/* the banner is 160px tall, like osu's: the menu in its top part, and the page's box starts over its
   bottom part (see .page) */
/* osu's banner: a dark triangle pattern across the width, the cover in the middle with blurred edges;
   the page's box covers the banner's bottom, the menu row (and its drop-downs) stays on top */
.topbar { position: relative; min-height: 160px; background-color: hsl(var(--hue) 14% 12%); }
/* osu!'s own nav triangles (nav2-background-hue0.png from osu-web, AGPL-3.0, see static/img/NOTICE.txt):
   the picture is drawn in red (hue 0) and turned to the page's hue with a filter, exactly as osu.ppy.sh does */
.topbar::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: url("../img/nav-triangles.png") center bottom / auto 100% repeat-x;
  filter: hue-rotate(calc(var(--hue) * 1deg)) saturate(0.6);
}
/* sizes as on osu.ppy.sh: a 100px bar, a big logo circle, 15px links, a 60px picture */
.topbar-inner { position: relative; z-index: 20; display: flex; align-items: center; gap: 8px; max-width: 1100px; min-height: 100px; 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; }
.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); }

.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 { margin-top: -30px; }
  .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: 12px;
}
.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; }
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; }
.round-title { font-size: clamp(1.1rem, 3vw, 1.35rem); margin-bottom: 0.1rem; text-align: center; }
.round-hint { text-align: center; min-height: 2.6em; margin-bottom: 0.3rem; font-size: 0.95rem; }
/* 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; }
.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; }

/* 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-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 { --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: 18px; 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: 10px; }
.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; }
.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: 10px; 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: 8px; 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: 14px; }
.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: 12px; }
.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: 6px; 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: 12px; }
.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: 12px; 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: 10px; 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: 14px; 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: 6px; 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: 8px 8px 0 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: 12px; }
.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.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); }

/* ---------- 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 10px 10px 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: 12px; }
.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: 6px; 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: 10px; }
.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: 12px; }
.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: 12px; }
.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: 8px; 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 { --size: clamp(34px, 11cqw, 72px); }
  .table .spot .coin.lg { --size: clamp(28px, 8cqw, 56px); }
  .tray.many .coin.lg { --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; }
.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 200px; }
.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; }
/* 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 { --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.many { gap: 5px; max-width: none; }
  .tray.many .coin.lg { --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 */
.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: 10px; 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: 14px; 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: 12px; 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: 560px) {
  .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: 12px; 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 { color: var(--muted); font-variant-numeric: tabular-nums; }
.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-direction: column; align-items: flex-start; }
  .h-side { justify-content: flex-start; }
  .topnav-link { padding: 6px 9px; }
}
/* v4.3: the osu.ppy.sh-style top bar on small screens */
@media (max-width: 600px) {
  .topbar-inner { flex-wrap: wrap; padding: 8px 12px; min-height: 0; }
  .brand { margin-right: auto; }
  .topnav { order: 3; flex-basis: 100%; }
  .topnav-link { padding: 8px 10px; }
}
.view { padding-top: 18px; }

/* ---------- 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: 10px; 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: 8px; 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: 8px; 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 8px 8px 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; }
  .me-avatar .avatar { width: 40px; height: 40px; }
  .brand-dot { width: 40px; height: 40px; border-width: 4px; }
  .brand { font-size: 1.15rem; }
}

/* ---------- 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; }
.lobby-row, .player, .edit-row { border-radius: var(--radius); }
.team-col, .verdict, .popup-card, .modal-card { border-radius: 10px; }
.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: 8px; 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: 8px; }
.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: 8px 0 0 8px; }
.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-sort { flex: 0 0 auto; padding: 0.45rem 0.8rem; }
.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%); }
.pager-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 14px 0 0; }
.pager-numbers { display: inline-flex; align-items: center; gap: 4px; }
.pager-page { appearance: none; min-width: 32px; height: 32px; padding: 0 8px; font: inherit; font-weight: 700; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.pager-page.on { color: #fff; background: hsl(var(--hue) 60% 52%); border-color: hsl(var(--hue) 60% 52%); }
.pager-gap { color: var(--muted); padding: 0 2px; }
.pager-info { margin-left: auto; font-size: 0.85rem; color: var(--muted); }
.pager-list { margin: 0; padding: 0; list-style: none; }
.pager-empty { margin: 8px 0; }
.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: 12px; 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; }
/* 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; }
.help-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 12px; margin: 18px 0 26px; }
.help-card { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; color: var(--text); text-decoration: none; background: var(--surface-2); border: 2px solid transparent; border-radius: 12px; transition: border-color 0.12s, transform 0.12s var(--ease); }
.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 10px 10px 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: 12px; }
.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; }
.legal-h2 { scroll-margin-top: 20px; }
.legal-h3 { scroll-margin-top: 20px; }
/* 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: 8px; }
.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: 10px; 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 8px 8px 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: 10px; 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: 10px; }
.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: 640px) {
  .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: 10px; }
.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: 64px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.dash-map-cover { display: block; width: 64px; height: 44px; border-radius: 6px; background: hsl(var(--hue) 10% 26%) center / cover no-repeat; background-image: var(--cover); }
.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: 8px; }
.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: 8px; padding: 4px 4px 4px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 0.85rem; }
.follow-btn.on { background: hsl(var(--hue) 60% 52%); border-color: hsl(var(--hue) 60% 52%); color: #fff; }
.news-list { display: grid; gap: 10px; }
.news-card { padding: 12px 16px; background: var(--surface-2); border-radius: 10px; border-left: 4px solid var(--news-colour, var(--accent)); }
.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: 860px) {
  .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: 8px; 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: 640px) {
  .news-row-meta { white-space: normal; }
}
