/* PT-CTB — one stylesheet, dark, warm and flat. Solid surfaces, 1px borders and type do the work.

   Colour: one warm accent, with greys tinted towards its hue so the page never reads as cold blue-black. The accent,
   rosa, is osu!'s pink warmed towards the rose of a glass of port; its split complements (+150° and +210°) are the
   green of the Portuguese flag and the blue of azulejo tiles, which become the ranked and converts colours. Loved keeps
   osu!'s own pink. */

:root {
  color-scheme: dark;
  --bg: #1f191b;
  --bg-2: #1b1617;
  --surface: #282022;
  --surface-2: #32282b;
  --surface-3: #3e3336;
  --border: #372c30;
  --border-strong: #4c3e42;
  --text: #f4ebee;
  --text-dim: #c1b3b7;
  --text-faint: #a09095;      /* 5.24:1 on --surface, 4.69:1 on --surface-2 */

  --accent: #ff6b89;          /* rosa */
  --accent-hover: #ff8fa5;
  --accent-ink: #25090f;      /* text on the accent */
  --accent-bg: #402127;       /* solid tint for selected things */
  --accent-line: #783643;
  --red: #f06a6e;             /* misses and wrong answers; 5.30:1 on --surface */
  --input-border: #806e73;    /* 3.6:1 against the page, so a text field's edge is visible (WCAG 1.4.11) */
  --red-bg: #3e1e1f;

  --cat-c: #73c5e8;   /* converts: azulejo blue */
  --cat-u: #ff66ab;   /* loved & unranked: osu!'s loved pink */
  --cat-r: #70cd8f;   /* ranked: the flag's green, lifted for a dark page */

  --gold: #f2c94c;
  --silver: #c9d1da;
  --bronze: #d08b5b;

  --r: 5px;
  --r-sm: 3px;
  --r-xs: 2px;

  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;           /* text and every number */
  --display: 'Josefin Sans', 'Inter', system-ui, sans-serif;                          /* headings and the brand */
  --mono: ui-monospace, 'Cascadia Mono', Consolas, monospace;

  /* Type scale (16px root): 12 · 13 · 15 · 17 · 20 · 26 · 36 · 48 */
  --fs-xs: .75rem;
  --fs-sm: .8125rem;
  --fs-md: .9375rem;
  --fs-lg: 1.0625rem;
  --fs-xl: 1.25rem;
  --fs-2xl: 1.625rem;
  --fs-3xl: 2.25rem;
  --fs-4xl: 3rem;

  --page: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text); font: 400 var(--fs-md)/1.55 var(--font);
  -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums;
}
img { max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 .6em; font-weight: 700; }
h1 { font: 700 clamp(1.875rem, 4vw, 2.5rem)/1.1 var(--display); letter-spacing: -.005em; }
h2 { font: 700 1.375rem/1.2 var(--display); }
h3 { font-size: var(--fs-md); font-weight: 600; }
p { margin: 0 0 1em; }
b, strong { font-weight: 600; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.num, td.num, .tabular { font-variant-numeric: tabular-nums; }

.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--accent-ink); padding: .5rem 1rem; z-index: 100; }
.skip:focus { left: 1rem; }

/* ---- Top bar ------------------------------------------------------------------------------------- */

.topbar { position: sticky; top: 0; z-index: 50; background: var(--bg); border-bottom: 1px solid var(--border); }
.topbar-inner { max-width: var(--page); margin: 0 auto; padding: 0 16px; height: 56px; display: flex; align-items: stretch; gap: 28px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font: 700 1.375rem/1 var(--display); letter-spacing: .02em; padding-top: 3px; }
.brand:hover { text-decoration: none; }
.brand img { display: block; }
.brand-dot { color: var(--text-faint); margin: 0 1px; }
.nav { display: flex; align-items: stretch; gap: 0; margin-left: auto; }
.nav a, .nav-more-btn {
  display: flex; align-items: center; color: var(--text-dim); padding: 0 11px; font-weight: 500; font-size: var(--fs-md);
  background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer;
}
.nav a:hover, .nav-more-btn:hover { color: var(--text); text-decoration: none; }
.nav a.active { color: var(--text); border-bottom-color: var(--accent); }
.nav-more { position: relative; display: flex; }
.nav-more-btn::after { content: ''; display: inline-block; margin-left: 6px; border: 4px solid transparent; border-top-color: currentColor; transform: translateY(2px); }
.nav-more-menu {
  display: none; position: absolute; right: 0; top: 100%; min-width: 210px; padding: 4px 0;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r);
}
.nav-more-menu a { padding: 9px 14px; border-bottom: 0; margin: 0; }
.nav-more-menu a:hover { background: var(--surface-2); }
.nav-more-menu a.active { color: var(--accent); }
.nav-more.open .nav-more-menu { display: grid; }
.nav-toggle { display: none; margin-left: auto; align-self: center; width: 40px; height: 40px; background: none; border: 0; cursor: pointer; padding: 12px 10px; }
.nav-toggle span { display: block; height: 2px; background: var(--text); margin: 0 0 5px; transition: transform .2s, opacity .2s; }

@media (max-width: 940px) {
  .nav-toggle { display: block; }
  .nav {
    display: none; position: absolute; top: 56px; left: 0; right: 0; flex-direction: column; align-items: stretch;
    padding: 6px 0 12px; background: var(--bg); border-bottom: 1px solid var(--border);
  }
  .nav.open { display: flex; }
  .nav a, .nav-more-btn { padding: 11px 16px; border-bottom: 0; border-left: 2px solid transparent; margin: 0; }
  .nav a.active { border-left-color: var(--accent); }
  .nav-more { display: block; }
  .nav-more-btn { display: none; }
  .nav-more-menu { display: grid; position: static; border: 0; border-top: 1px solid var(--border); border-radius: 0; padding: 6px 0 0; margin-top: 6px; background: none; }
  .nav-more-menu a { padding: 11px 16px; border-left: 2px solid transparent; }
  .nav-more-menu a:hover { background: none; }
  .nav-toggle[aria-expanded='true'] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded='true'] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded='true'] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* ---- Page frame --------------------------------------------------------------------------------- */

.page { flex: 1; width: 100%; max-width: var(--page); margin: 0 auto; padding: 36px 16px 64px; outline: none; }
.footer { border-top: 1px solid var(--border); color: var(--text-dim); font-size: var(--fs-sm); }
.footer-inner { max-width: var(--page); margin: 0 auto; padding: 22px 16px 28px; }
.footer p { margin: 0 0 4px; }
.footer-dim { color: var(--text-faint); }

.page-head { margin-bottom: 28px; }
.page-head p { color: var(--text-dim); max-width: 70ch; margin-top: 10px; }
.eyebrow {
  display: inline-block; color: var(--accent); font-weight: 600; font-size: var(--fs-xs);
  letter-spacing: .1em; text-transform: uppercase; margin-bottom: 8px;
}
.eyebrow a { color: inherit; }
.section { margin-top: 44px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 14px; flex-wrap: wrap; margin-bottom: 14px; }
.section-head h2 { margin: 0; }
.section-head > a { font-size: var(--fs-sm); font-weight: 500; }
.muted { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.small { font-size: var(--fs-sm); }
.center { text-align: center; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); } }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 18px; min-width: 0; }
.card > h2 { margin-bottom: 14px; }
/* .card-h: a card title that has to be an h2 for the outline (WCAG 1.3.1) but looks like the small h3 titles. */
.card > h3, .card > h2.card-h {
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
  font-size: var(--fs-xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-dim);
}
.card-link { display: block; color: inherit; transition: border-color .12s, background-color .12s; }
.card-link:hover { border-color: var(--border-strong); background: var(--surface-2); text-decoration: none; }

/* ---- Buttons, inputs, chips, tabs --------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px;
  border-radius: var(--r); border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text);
  font-weight: 600; font-size: var(--fs-md); cursor: pointer; white-space: nowrap; transition: background-color .12s, border-color .12s;
}
.btn:hover { background: var(--surface-3); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-discord { background: #5865f2; border-color: #5865f2; color: #fff; }
.btn-discord:hover { background: #6d78f5; border-color: #6d78f5; }
.btn-small { height: 30px; padding: 0 11px; font-size: var(--fs-sm); }
.btn-on { border-color: var(--accent-line); background: var(--accent-bg); color: var(--accent); }
.btn-on:hover { background: var(--accent-bg); border-color: var(--accent); }
.btn[disabled] { opacity: .45; cursor: default; }
.btn[disabled]:hover { background: var(--surface-2); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

.input, .select {
  height: 36px; background: var(--bg-2); border: 1px solid var(--input-border); border-radius: var(--r); padding: 0 12px;
  min-width: 0; width: 100%;
}
.input::placeholder { color: var(--text-faint); }
.input:hover, .select:hover { border-color: var(--text-faint); }
.input:focus, .select:focus { border-color: var(--accent); outline: none; }
.field { display: grid; grid-template-rows: 1fr auto; gap: 6px; }
.field label, .field .field-label { align-self: end; font-size: var(--fs-sm); color: var(--text-dim); font-weight: 500; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar .input { max-width: 320px; }
.toolbar .select { width: auto; }
input[type='checkbox'] { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; }

.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 10px; border-radius: var(--r-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--text-dim);
  font-weight: 500; font-size: var(--fs-sm); cursor: pointer;
}
.chip:hover { color: var(--text); border-color: var(--border-strong); text-decoration: none; }
.chip.active { background: var(--accent-bg); border-color: var(--accent-line); color: var(--accent); }

.tabs { display: flex; flex-wrap: wrap; column-gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tabs a { padding: 10px 12px 11px; color: var(--text-dim); font-weight: 600; white-space: nowrap; }
.tabs a:first-child { padding-left: 0; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.tabs .count { color: var(--text-faint); font-size: var(--fs-xs); font-weight: 500; margin-left: 6px; }

/* A category: a small square in its colour, then the name. */
.cat {
  display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; white-space: nowrap; color: var(--text-dim);
}
.cat::before { content: ''; width: 7px; height: 7px; border-radius: 1px; background: var(--c); flex: none; }
.cat-c { --c: var(--cat-c); }
.cat-u { --c: var(--cat-u); }
.cat-r { --c: var(--cat-r); }
h3 .cat { color: var(--text); }

/* ---- osu! bits: mods, grades, stars ------------------------------------------------------------- */

.mods { display: inline-flex; gap: 2px; flex-wrap: wrap; }
.mod {
  display: inline-block; min-width: 26px; text-align: center; font-size: .6875rem; font-weight: 700;
  line-height: 18px; padding: 0 4px; border-radius: var(--r-xs); color: #101214; letter-spacing: .03em;
}
.mod-reduce { background: #a9e66a; }
.mod-increase { background: #f2706f; }
.mod-auto { background: #6cb8f0; }
.mod-other { background: #f2c94c; }
.mod-nm { background: var(--surface-3); color: var(--text-dim); }

.grade { display: inline-block; min-width: 1.4em; font-weight: 800; font-size: var(--fs-md); letter-spacing: -.01em; }
.grade-X, .grade-S { color: var(--gold); }
.grade-XH, .grade-SH { color: var(--silver); }
.grade-A { color: #8fd14f; }
.grade-B { color: #5aa8f0; }
.grade-C { color: #e8905e; }
.grade-D, .grade-F { color: var(--red); }

.stars {
  display: inline-flex; align-items: center; gap: 3px; font-size: .6875rem; font-weight: 700; line-height: 18px;
  padding: 0 5px; border-radius: var(--r-xs); white-space: nowrap; vertical-align: 1px;
}

/* People are round, maps are rectangles. */
.avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: var(--surface-3); flex: none; }
.avatar-lg { width: 88px; height: 88px; }
.avatar-md { width: 44px; height: 44px; }
.avatar-sm { width: 22px; height: 22px; }
.player { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 500; min-width: 0; }
.player span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player:has(.avatar-sm) { gap: 8px; }
a.player:hover { color: var(--accent); text-decoration: none; }

.map { display: flex; align-items: center; gap: 12px; min-width: 0; color: var(--text); }
a.map:hover { text-decoration: none; }
a.map:hover .map-title { color: var(--accent); }
.map-cover { width: 60px; height: 42px; border-radius: var(--r-sm); object-fit: cover; background: var(--surface-3); flex: none; }
.map-text { min-width: 0; display: grid; gap: 1px; }
.map-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-sub { color: var(--text-dim); font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pos {
  display: inline-block; min-width: 30px; text-align: center; line-height: 20px; padding: 0 5px; border-radius: var(--r-xs);
  font-size: var(--fs-xs); font-weight: 700; background: var(--surface-3); color: var(--text-dim);
}
.pos-1 { background: var(--gold); color: #261d00; }
.pos-2 { background: var(--silver); color: #1a1f25; }
.pos-3 { background: var(--bronze); color: #251205; }

.pp { font-weight: 700; color: var(--text); white-space: nowrap; }
.pp small { font-weight: 500; color: var(--text-faint); font-size: .8em; margin-left: 2px; }

/* ---- Tables --------------------------------------------------------------------------------------- */

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 14px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th {
  font-size: .6875rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-faint); font-weight: 600;
  background: var(--bg-2); padding-block: 8px;
}
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface-2); }
td.num, th.num { text-align: right; }
td.rank { width: 1%; color: var(--text-faint); font-weight: 700; }
td.wide { white-space: normal; min-width: 260px; max-width: 460px; }
tr.me { background: var(--accent-bg); box-shadow: inset 2px 0 0 var(--accent); }
tr.me:hover { background: var(--accent-bg); }
.table-compact td, .table-compact th { padding: 7px 12px; }
.card .table-wrap { border-radius: var(--r-sm); }
@media (max-width: 600px) { th, td { padding: 8px 10px; } }

/* ---- Lists of rows (score lists, events): one bordered list with dividers ---------------------------- */

.rows { display: grid; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 18px; align-items: center;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
}
.row:last-child { border-bottom: 0; }
.row-main { display: grid; gap: 6px; min-width: 0; }
.row-main > .map + div { padding-left: 72px; }
.row:hover { background: var(--surface-2); }
a.row.card-link { border-radius: 0; border-width: 0 0 1px; }
a.row.card-link:last-child { border-bottom: 0; }
.row-meta { display: flex; align-items: center; gap: 6px 12px; flex-wrap: wrap; justify-content: flex-end; color: var(--text-dim); font-size: var(--fs-sm); }
.row-meta .sep { width: 1px; height: 14px; background: var(--border-strong); }
.row-meta .pp { min-width: 4.6em; text-align: right; font-size: var(--fs-md); }
.row-meta > .faint:last-child { min-width: 7.5em; text-align: right; }
.card .rows { border: 0; border-radius: 0; background: none; }
.card .row { padding-inline: 0; }
.card .row:hover { background: none; }
@media (max-width: 700px) {
  .row { grid-template-columns: minmax(0, 1fr); }
  .row-meta { justify-content: flex-start; gap: 6px 10px; }
  .row-meta .sep { display: none; }
  .row-meta .pp, .row-meta > .faint:last-child, .row-meta .acc, .row-meta .combo, .row-meta .miss { min-width: 0; text-align: left; }
  .row-main > .map + div { padding-left: 0; }
}

.score-line { display: flex; gap: 6px 10px; align-items: center; flex-wrap: wrap; font-size: var(--fs-sm); color: var(--text-dim); }
.acc { min-width: 4.4em; text-align: right; color: var(--text); }
.combo { min-width: 3.8em; text-align: right; }
.miss { min-width: 2.4em; text-align: right; }
.card .score-line > *, .slide .score-line > * { min-width: 0; }
.miss-fc { color: var(--accent); font-weight: 600; }
.miss-n { color: var(--red); }

/* ---- Stat tiles ---------------------------------------------------------------------------------- */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; }
.stat { display: grid; grid-template-rows: 1fr auto auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 12px 16px 14px; min-width: 0; }
.stat-label {
  display: flex; align-items: center; gap: 6px; color: var(--text-faint); font-size: .6875rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; align-self: end;
}
.stat-value { font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -.02em; line-height: 1.2; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-sub { color: var(--text-dim); font-size: var(--fs-sm); }
.stat-c .stat-label::before, .stat-u .stat-label::before, .stat-r .stat-label::before { content: ''; width: 7px; height: 7px; border-radius: 1px; }
.stat-c .stat-label::before { background: var(--cat-c); }
.stat-u .stat-label::before { background: var(--cat-u); }
.stat-r .stat-label::before { background: var(--cat-r); }

/* ---- Home --------------------------------------------------------------------------------------- */

.hero {
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 40px; align-items: end;
  padding: clamp(24px, 5vw, 48px); background: var(--surface); border: 1px solid var(--border); border-radius: 6px;
}
/* The flag's green and red in its 2:3 proportion, as a short rule above the title. */
.flag-rule { display: flex; gap: 3px; width: 72px; height: 4px; margin-bottom: 22px; }
.flag-rule::before, .flag-rule::after { content: ''; border-radius: 1px; }
.flag-rule::before { flex: 2; background: #2fa865; }
.flag-rule::after { flex: 3; background: #e5484d; }
.hero h1 { font-size: clamp(2.25rem, 6vw, var(--fs-4xl)); max-width: 14ch; margin-bottom: .35em; line-height: 1; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { color: var(--text-dim); font-size: var(--fs-lg); max-width: 50ch; margin-bottom: 22px; }
.hero-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; border-top: 1px solid var(--border); }
.hero-stats div { display: flex; flex-direction: column; justify-content: space-between; padding: 14px 0 12px; border-bottom: 1px solid var(--border); }
.hero-stats div:nth-child(odd) { padding-right: 16px; }
.hero-stats div:nth-child(even) { padding-left: 16px; border-left: 1px solid var(--border); }
.hero-stats dt { color: var(--text-faint); font-size: .6875rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.hero-stats dd { margin: 2px 0 0; font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
@media (max-width: 820px) { .hero { grid-template-columns: minmax(0, 1fr); gap: 28px; } }
@media (max-width: 480px) { .hero-stats dd { font-size: var(--fs-xl); } }

/* Numbered steps: 01, 02… in the display face. */
.steps { counter-reset: step; display: grid; gap: 16px; }
.step { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: baseline; }
.step::before {
  counter-increment: step; content: counter(step, decimal-leading-zero);
  font: 700 var(--fs-xl)/1 var(--display); color: var(--accent);
}
.step p { margin: 2px 0 0; color: var(--text-dim); }

/* A list of links with a title and a line of description. */
.link-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--border); }
.link-list a { display: block; padding: 12px 14px 12px 0; border-bottom: 1px solid var(--border); color: var(--text); }
.link-list a:nth-child(even) { padding-left: 14px; padding-right: 0; border-left: 1px solid var(--border); }
.link-list a:hover { text-decoration: none; }
.link-list a:hover b { color: var(--accent); }
.link-list b::after { content: ' →'; color: var(--text-faint); font-weight: 400; }
.link-list span { display: block; color: var(--text-dim); font-size: var(--fs-sm); margin-top: 2px; }
@media (max-width: 480px) {
  .link-list { grid-template-columns: minmax(0, 1fr); }
  .link-list a:nth-child(even) { padding-left: 0; border-left: 0; }
}

.mini-board { display: grid; }
.mini-board a.line {
  display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 7px 0; border-bottom: 1px solid var(--border); color: var(--text);
}
.mini-board a.line:last-child { border-bottom: 0; }
.mini-board a.line:hover { text-decoration: none; }
.mini-board a.line:hover .player span { color: var(--accent); }
.mini-board .n { color: var(--text-faint); font-weight: 700; font-size: var(--fs-sm); }
.card-foot { margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--border); font-size: var(--fs-sm); }

/* ---- Map banner / player header ---------------------------------------------------------------- */

.banner { border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.banner-art { aspect-ratio: 18 / 5; max-height: 220px; width: 100%; background: var(--surface-3) center / cover no-repeat; border-bottom: 1px solid var(--border); }
.banner-body { padding: 18px 20px 20px; }
.banner h1 { margin-bottom: .25em; }
.banner h1 a { color: inherit; }
.banner .sub { color: var(--text-dim); font-size: var(--fs-lg); }
.banner .links { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.banner p { color: var(--text-dim); }
.week-cover { display: block; width: 100%; aspect-ratio: 18 / 5; object-fit: cover; background: var(--surface-3); border-bottom: 1px solid var(--border); }

.profile-head { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; margin-bottom: 28px; }
.profile-head h1 { margin: 0 0 10px; }
.profile-head .links { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: var(--r-sm);
  font-size: var(--fs-xs); font-weight: 600; border: 1px solid var(--border-strong); color: var(--text-dim); white-space: nowrap;
}
.badge-gold { border-color: color-mix(in srgb, var(--gold) 40%, transparent); color: var(--gold); }
.badge-accent { border-color: var(--accent-line); color: var(--accent); }
.badge-red { border-color: color-mix(in srgb, var(--red) 40%, transparent); color: var(--red); }

.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 12px 20px; margin: 0; }
.kv dt { color: var(--text-faint); font-size: .6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.kv dd { margin: 1px 0 0; font-weight: 600; font-size: var(--fs-lg); }
.kv-strip { padding: 14px 0; border-bottom: 1px solid var(--border); }
.kv-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding-top: 12px; border-top: 1px solid var(--border); }
.kv-3 dd { font-size: var(--fs-md); }

/* ---- Dan -------------------------------------------------------------------------------------------- */

.dan-ladder { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.dan-stage {
  position: relative; display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 14px;
  cursor: pointer; text-align: left; color: var(--text); transition: border-color .12s, background-color .12s;
}
a.dan-stage:hover { text-decoration: none; }
.dan-stage:hover { border-color: var(--border-strong); background: var(--surface-2); }
.dan-stage.selected { border-color: var(--accent); background: var(--accent-bg); }
.dan-stage.locked { color: var(--text-dim); border-style: dashed; }
.dan-stage.locked .dan-glyph { color: var(--text-dim); }
.dan-glyph { font: 700 2.25rem/1 var(--display); margin-bottom: 10px; color: var(--text); }
.dan-stage.hebrew .dan-glyph { color: var(--gold); }
.dan-stage .points { position: absolute; top: 12px; right: 12px; font-size: var(--fs-xs); color: var(--text-faint); font-weight: 600; }
.dan-pass { color: var(--accent); }
.avatars { display: flex; margin-top: 10px; }
.avatars img { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--surface); margin-left: -6px; background: var(--surface-3); }
.dan-stage.selected .avatars img { border-color: var(--accent-bg); }
.dan-stage:hover .avatars img { border-color: var(--surface-2); }
.avatars img:first-child { margin-left: 0; }
.avatars .more { font-size: var(--fs-xs); color: var(--text-faint); margin-left: 6px; align-self: center; }
.detail-head { display: flex; align-items: baseline; gap: 4px 12px; flex-wrap: wrap; margin-bottom: 14px; }
.detail-head h2 { margin: 0; }

/* ---- Activity ----------------------------------------------------------------------------------- */

.feed { display: grid; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.feed-day {
  padding: 8px 14px; background: var(--bg-2); border-bottom: 1px solid var(--border); color: var(--text-faint);
  font-size: .6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em;
}
.event { padding: 11px 14px 12px; border-bottom: 1px solid var(--border); min-width: 0; }
.event:last-child { border-bottom: 0; }
.event-head { display: flex; align-items: center; gap: 10px; font-size: var(--fs-xs); color: var(--text-faint); margin-bottom: 2px; }
.event-kind { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--k); }
.event-kind::before { content: ''; width: 6px; height: 6px; border-radius: 1px; background: currentColor; }
.event .what { font-weight: 400; }
.event .what a { color: var(--text); }
.event .what a:hover { color: var(--accent); text-decoration: none; }
.event .where { color: var(--text-dim); font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-play { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; font-size: var(--fs-sm); }
.ev-snipe { --k: #f2706f; }
.ev-top { --k: var(--gold); }
.ev-dan { --k: var(--accent); }
.ev-pass { --k: var(--cat-c); }
.ev-mile { --k: var(--cat-u); }
.ev-join { --k: var(--text-dim); }
.chip .event-kind { letter-spacing: 0; text-transform: none; font-weight: inherit; color: inherit; }
.chip .event-kind::before { background: var(--k); }

/* ---- Charts ------------------------------------------------------------------------------------- */

.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--text-faint); font-size: 12px; font-family: var(--font); }
.chart .grid-line { stroke: var(--border); stroke-width: 1; }
.chart .bar { fill: var(--accent); }
.chart .bar:hover { opacity: .8; }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: var(--fs-sm); color: var(--text-dim); margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 2px; display: inline-block; }
.hbars { display: grid; gap: 9px; }
.hbar { display: grid; grid-template-columns: 80px minmax(0, 1fr) 56px; gap: 12px; align-items: center; font-size: var(--fs-sm); }
.hbar > span:first-child { font-weight: 600; }
.hbar .track { height: 8px; background: var(--surface-3); border-radius: var(--r-xs); overflow: hidden; }
.hbar .fill { height: 100%; background: var(--accent); }
.hbar .val { text-align: right; color: var(--text-dim); }

/* ---- Games ------------------------------------------------------------------------------------- */

.game { max-width: 760px; margin: 0 auto; }
.game-cover { position: relative; aspect-ratio: 18 / 5; border-radius: var(--r); overflow: hidden; background: var(--surface-3); border: 1px solid var(--border); }
.game-cover img { display: block; width: 100%; height: 100%; object-fit: cover; transition: filter .5s ease; }
.game-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
@media (max-width: 560px) { .game-options { grid-template-columns: minmax(0, 1fr); } }
.option {
  padding: 12px 14px; border-radius: var(--r); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  text-align: left; cursor: pointer; font-weight: 600; transition: background-color .12s, border-color .12s;
}
.option:hover:not([disabled]) { background: var(--surface-2); border-color: var(--text-faint); }
.option small { display: block; color: var(--text-dim); font-weight: 400; font-size: var(--fs-sm); }
.option.right { border-color: var(--accent); background: var(--accent-bg); }
.option.wrong { border-color: var(--red); background: var(--red-bg); }
.option[disabled] { cursor: default; }
.scoreboard { display: flex; gap: 28px; justify-content: center; margin: 0 0 16px; color: var(--text-faint); font-size: var(--fs-xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.scoreboard > span { display: grid; justify-items: center; gap: 2px; }
.scoreboard b { color: var(--text); font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -.02em; line-height: 1.1; order: -1; }
.scoreboard b small { font-size: .55em; color: var(--text-faint); font-weight: 600; margin-left: 1px; }
.game-result { display: flex; justify-content: center; gap: 8px; margin-top: 14px; font-weight: 600; }
.game-result.right { color: var(--accent); }
.game-result.wrong { color: var(--red); }
.game-result b { color: var(--text); }
.game-score { font-size: clamp(3rem, 12vw, 4.5rem); font-weight: 800; letter-spacing: -.02em; line-height: 1; margin-bottom: 6px; }
.game-score small { font-size: .4em; color: var(--text-faint); font-weight: 600; margin-left: 4px; }

.duel { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: stretch; }
.duel-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 22px; text-align: center; display: grid; gap: 6px; justify-items: center; }
.duel-card .value { font-size: var(--fs-3xl); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.duel-vs { align-self: center; font-family: var(--display); font-weight: 700; color: var(--text-faint); letter-spacing: .06em; }
@media (max-width: 620px) {
  .duel { grid-template-columns: 1fr; gap: 8px; }
  .duel-vs { justify-self: center; }
  .duel-card { padding: 14px; gap: 2px; }
  .duel-card .avatar-lg { width: 52px; height: 52px; margin-bottom: 4px; }
  .duel-card .value { font-size: var(--fs-2xl); }
}

/* ---- Compare ------------------------------------------------------------------------------------ */

.versus { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 12px; align-items: center; }
.versus .side { display: flex; align-items: center; gap: 12px; min-width: 0; }
.versus .side.right { justify-content: flex-end; text-align: right; }
.cmp-row { display: grid; grid-template-columns: minmax(0, 1fr) 128px minmax(0, 1fr); gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.cmp-row:last-child { border-bottom: 0; }
.cmp-row .label { text-align: center; color: var(--text-faint); font-size: .6875rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.cmp-row .a { text-align: right; }
.cmp-row .win { color: var(--accent); font-weight: 700; }
@media (max-width: 480px) { .cmp-row { grid-template-columns: minmax(0, 1fr) 96px minmax(0, 1fr); } }
.split { display: flex; gap: 2px; height: 8px; overflow: hidden; }
.split .a { background: var(--accent); border-radius: var(--r-xs); }
.split .b { background: var(--cat-c); border-radius: var(--r-xs); }
.side-play.lost { opacity: .55; }
.side-play .win-mark { font-size: var(--fs-xs); font-weight: 700; color: var(--accent); min-width: 1.8em; }

/* ---- Wrapped ----------------------------------------------------------------------------------- */

.wrapped { display: grid; gap: 8px; }
.wrapped .grid { gap: 8px; }
.wrapped .big { font-size: clamp(2.25rem, 6vw, 3.5rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.02; margin-top: 4px; overflow-wrap: anywhere; }
.wrapped .slide { border-radius: var(--r); padding: clamp(18px, 3.5vw, 28px); border: 1px solid var(--border); background: var(--surface); min-width: 0; }
.wrapped .slide > .muted:first-child { color: var(--text-faint); font-size: .6875rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.wrapped .chart { max-height: 240px; margin-top: 12px; }
.wrapped .slide.green .big { color: var(--accent); }
.wrapped .slide.gold .big { color: var(--gold); }

/* ---- Misc ------------------------------------------------------------------------------------------ */

.notice { background: var(--surface); border: 1px solid var(--border); border-left: 2px solid var(--accent); border-radius: var(--r-sm); padding: 12px 16px; color: var(--text-dim); }
.empty { text-align: center; color: var(--text-dim); padding: 40px 16px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); }
.empty h2 { color: var(--text); }
.loading { display: grid; place-items: center; min-height: 40vh; color: var(--text-faint); font-size: var(--fs-sm); }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--surface-3); border-top-color: var(--accent); animation: spin .7s linear infinite; margin-bottom: 12px; }
@keyframes spin { to { transform: rotate(360deg); } }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 16px; color: var(--text-dim); font-size: var(--fs-sm); }
.kbd { font-family: var(--mono); font-size: .85em; background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--r-sm); padding: 0 5px; color: var(--text); white-space: nowrap; }
.cmd-list { display: grid; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.cmd { display: grid; grid-template-columns: minmax(180px, 260px) minmax(0, 1fr); gap: 16px; padding: 11px 14px; border-bottom: 1px solid var(--border); }
.cmd:last-child { border-bottom: 0; }
.cmd code { font-family: var(--mono); font-size: var(--fs-sm); color: var(--accent); padding-top: 2px; }
@media (max-width: 600px) { .cmd { grid-template-columns: 1fr; gap: 2px; } }
.result-big { font-size: var(--fs-4xl); font-weight: 800; letter-spacing: -.02em; color: var(--accent); line-height: 1.05; }
.checks { display: flex; gap: 14px; flex-wrap: wrap; }
.checks label { display: inline-flex; gap: 7px; align-items: center; cursor: pointer; color: var(--text-dim); font-size: var(--fs-sm); }
.hidden { display: none !important; }
.countdown { font-weight: 700; color: var(--text); }
.dim-link { color: var(--text-dim); }
.dim-link:hover { color: var(--text); }

/* ---- Community lore: in-joke badges, map stories, captions, easter eggs ------------------------------------ */

.hero-tag { font: 600 var(--fs-lg)/1.3 var(--display); color: var(--accent) !important; letter-spacing: .01em; margin: -.2em 0 14px !important; }
.hero-stats .hero-rework { grid-column: 1 / -1; padding-left: 0 !important; border-left: 0 !important; }
.hero-rework dd { color: var(--accent); }

.throne-strip {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; margin-top: 16px;
  padding: 12px 16px; background: var(--surface); border: 1px solid var(--border); border-left: 2px solid var(--gold); border-radius: var(--r);
}
.throne-strip .throne-go { color: var(--gold); font-weight: 600; font-size: var(--fs-sm); white-space: nowrap; }
@media (max-width: 560px) { .throne-strip { grid-template-columns: auto minmax(0, 1fr); } .throne-strip .throne-go { grid-column: 2; } }

/* In-joke badges on profiles and tags on maps: dashed, so they read as jokes next to the real badges. */
.fun-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.fun-chip {
  display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border-radius: var(--r-sm); cursor: pointer; font-family: inherit;
  font-size: var(--fs-xs); font-weight: 600; color: var(--accent); border: 1px dashed var(--accent-line); background: color-mix(in srgb, var(--accent-bg) 55%, transparent);
}
.fun-chip:hover, .fun-chip:focus-visible, .fun-chip[aria-pressed='true'] { border-style: solid; }
.fun-chip[aria-pressed='true'] { background: var(--accent-bg); }
.fun-tip { margin: 8px 0 0; padding: 8px 12px; max-width: 60ch; background: var(--surface); border: 1px solid var(--border); border-left: 2px solid var(--accent); border-radius: var(--r-sm); font-size: var(--fs-sm); color: var(--text-dim); }
.fun-tip b { color: var(--text); margin-right: 4px; }
.map-tags { margin-top: 12px; }
.badge-era { border-style: dashed; }

.signature h3 .faint { text-transform: none; letter-spacing: 0; font-weight: 500; }
.lore-card { margin-top: 16px; padding: 14px 18px; background: var(--surface); border: 1px solid var(--border); border-left: 2px solid var(--accent); border-radius: var(--r-sm); }
.lore-card .eyebrow { margin-bottom: 4px; }
.lore-card p { margin: 0 0 4px; }
.role-lore { margin-top: 4px; font-size: var(--fs-xs); color: var(--text-faint); white-space: normal; max-width: 34ch; }

.event .quip { margin-top: 4px; font-size: var(--fs-sm); color: var(--text-faint); font-style: italic; }
.event-emoji { margin-left: auto; font-size: var(--fs-sm); }

tr.inactive td, tr.inactive .player, tr.inactive .pp { color: var(--text-dim); }
tr.inactive .avatar { filter: grayscale(.7); }
.legend-tag { margin-left: 6px; font-size: .6875rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); border: 1px solid var(--border-strong); border-radius: var(--r-xs); padding: 0 4px; }

.progress { display: block; width: 100%; min-width: 80px; height: 6px; background: var(--surface-3); border-radius: var(--r-xs); overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--gold); }
.pool { margin-top: 14px; }
.pool summary { cursor: pointer; color: var(--text-dim); font-weight: 600; font-size: var(--fs-sm); margin-bottom: 10px; }
.bounty-tag { color: var(--gold); font-weight: 600; }

.throne-head { display: flex; gap: 18px; align-items: center; border-left: 2px solid var(--gold); }
.cmp-aura .label { color: var(--gold); }
.special-round { min-height: 1.4em; margin: -6px 0 10px; color: var(--gold); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: var(--fs-xs); }

.timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--border-strong); }
.timeline li { position: relative; display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 14px; padding: 0 0 18px 18px; }
.timeline li::before { content: ''; position: absolute; left: -6px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.timeline-year { font: 700 var(--fs-lg)/1.3 var(--display); color: var(--text-faint); }
.timeline-body p { margin: 2px 0 0; color: var(--text-dim); }

/* Toasts, the WYSI flash and the emote wall. */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 80; display: grid; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.toast { background: var(--surface-2); border: 1px solid var(--border-strong); border-left: 2px solid var(--accent); border-radius: var(--r); padding: 12px 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .35); }
.toast-body { margin-bottom: 6px; }
.toast-close { background: none; border: 0; padding: 0; color: var(--text-faint); font-size: var(--fs-xs); cursor: pointer; }
.toast-close:hover { color: var(--text); }
.flash { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; pointer-events: none; font: 800 clamp(4rem, 18vw, 12rem)/1 var(--display); color: var(--accent); animation: flash 1.4s ease-out forwards; }
.flash-wall { font-size: clamp(2.5rem, 10vw, 6rem); }
@keyframes flash { 0% { opacity: 0; transform: scale(.8); } 20% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.15); } }
.emote-wall { position: fixed; inset: 0; z-index: 90; pointer-events: none; overflow: hidden; }
.emote-wall span { position: absolute; top: -60px; animation: fall 2.4s ease-in forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(25deg); } }
@media (prefers-reduced-motion: reduce) { .flash { animation-duration: .9s; } }

/* Bacalhau mode (type "bacalhau"): the loader catches cod instead of fruit. */
.bacalhau .spinner { border: 0; width: auto; height: auto; animation: none; }
.bacalhau .spinner::before { content: '🐟'; display: inline-block; font-size: 26px; animation: bob .8s ease-in-out infinite alternate; }
@keyframes bob { to { transform: translateY(-8px) rotate(-12deg); } }

/* The logo's seasonal hat: Santa in December, a bacalhau on Portugal Day. */
[data-season] .brand::after { font-size: 1rem; margin-left: -2px; }
[data-season='xmas'] .brand::after { content: '🎅'; }
[data-season='ptday'] .brand::after { content: '🐟'; }

/* =================================================================================================================
   Player search in the top bar (core/search.js). Inline next to the brand from 1180px; below that a search button
   that opens a full-width row under the bar. Kept as one block so it stays out of the way of other edits.
   ================================================================================================================= */

.search { position: relative; display: flex; align-items: center; }
.search-toggle {
  display: none; align-self: center; width: 40px; height: 40px; place-items: center; padding: 0;
  background: none; border: 0; color: var(--text); cursor: pointer;
}
.search-toggle[aria-expanded='true'] { color: var(--accent); }
.search-panel { display: block; }
.search-field { position: relative; display: flex; align-items: center; }
.search-field > svg { position: absolute; left: 10px; color: var(--text-faint); pointer-events: none; }
.search-field input {
  width: 220px; height: 34px; padding: 0 30px 0 32px; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--r); font-size: var(--fs-sm); transition: border-color .12s;
}
.search-field input::placeholder { color: var(--text-faint); }
.search-field input:hover { border-color: var(--border-strong); }
.search-field input:focus { outline: none; border-color: var(--accent); }
.search-key {
  position: absolute; right: 8px; min-width: 18px; padding: 0 4px; text-align: center; font: 600 .6875rem/16px var(--font);
  color: var(--text-faint); border: 1px solid var(--border-strong); border-radius: var(--r-xs); pointer-events: none;
}
.search-field input:focus ~ .search-key, .search-field input:not(:placeholder-shown) ~ .search-key { display: none; }

.search-pop {
  position: absolute; top: calc(100% + 6px); left: 0; width: 340px; z-index: 55; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r);
}
.search-pop[hidden] { display: none; }
.search-results { list-style: none; margin: 0; padding: 4px 0; max-height: min(420px, 70vh); overflow-y: auto; }
.search-results [role='option'] {
  display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 7px 12px; cursor: pointer;
}
.search-results [aria-selected='true'] { background: var(--surface-2); box-shadow: inset 2px 0 0 var(--accent); }
.search-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.search-name mark { background: none; color: var(--accent); }
.search-detail { color: var(--text-faint); font-size: var(--fs-xs); white-space: nowrap; }
.search-none { padding: 12px; color: var(--text-dim); font-size: var(--fs-sm); }
.search-all { display: block; padding: 9px 12px; border-top: 1px solid var(--border); font-size: var(--fs-sm); font-weight: 500; }
.search-all:hover { background: var(--surface-2); text-decoration: none; }

@media (max-width: 1100px) {
  .search-field input { width: 170px; }
  .nav a, .nav-more-btn { padding-inline: 9px; }
}
@media (max-width: 940px) {
  .search { position: static; order: 3; }
  .nav-toggle { order: 4; }
  .search-toggle { display: grid; }
  .search-panel {
    display: none; position: absolute; top: 56px; left: 0; right: 0; z-index: 51;
    padding: 10px 16px 12px; background: var(--bg); border-bottom: 1px solid var(--border);
  }
  .search.open .search-panel { display: block; }
  .search-field input, .search-field input:focus { width: 100%; height: 38px; font-size: var(--fs-md); }
  .search-pop { position: static; width: auto; margin-top: 8px; }
  .search-key { display: none; }
}
@media (max-width: 940px) {
  .search { margin-left: auto; }
  .search ~ .nav-toggle { margin-left: -24px; }
}

/* The profile picture on a player page links to their osu! profile: a quiet ring on hover, the usual focus ring. */
.avatar-link { display: block; flex: none; border-radius: 50%; }
.avatar-link .avatar { display: block; transition: box-shadow .12s, filter .12s; }
.avatar-link:hover .avatar { box-shadow: 0 0 0 2px var(--border-strong); filter: brightness(1.08); }
.avatar-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* =================================================================================================================
   "You" in the top bar (core/you.js): the avatar of whoever this browser marked with "This is me", and its menu.
   Sits last on wide screens; on narrow ones between the search button and the menu button.
   ================================================================================================================= */

.you { position: relative; display: flex; align-items: center; order: 5; margin-left: -12px; }
.you[hidden] { display: none; }
.you-btn {
  display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%;
  background: none; cursor: pointer;
}
.you-btn .avatar { width: 28px; height: 28px; box-shadow: 0 0 0 2px var(--border-strong); transition: box-shadow .12s; }
.you-btn:hover .avatar, .you-btn[aria-expanded='true'] .avatar { box-shadow: 0 0 0 2px var(--accent); }
.you-menu {
  position: absolute; top: calc(100% - 2px); right: 0; z-index: 56; width: 240px; padding: 6px 0;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r);
}
.you-menu[hidden] { display: none; }
.you-head { display: flex; align-items: center; gap: 10px; padding: 8px 14px 12px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.you-head > div { display: grid; min-width: 0; }
.you-head b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.you-label { color: var(--text-faint); font-size: .6875rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.you-menu a, .you-forget {
  display: block; width: 100%; padding: 8px 14px; color: var(--text); font-size: var(--fs-sm); text-align: left;
  background: none; border: 0; cursor: pointer;
}
.you-menu a:hover, .you-forget:hover { background: var(--surface-2); text-decoration: none; }
.you-forget { color: var(--text-dim); }
.you-note { margin: 4px 14px 6px; color: var(--text-faint); font-size: var(--fs-xs); }

@media (max-width: 940px) {
  .you { order: 4; margin-left: -20px; }
  .nav-toggle { order: 5; }
}

/* Your row on the home page's top 5s. */
.mini-board a.line.me { background: var(--accent-bg); box-shadow: inset 2px 0 0 var(--accent); padding-inline: 8px; margin-inline: -8px; }

/* =================================================================================================================
   "Sign in with osu!" (core/you.js, only when CONFIG.signIn is set): takes the avatar's place while nobody is chosen.
   ================================================================================================================= */

.you:has(.you-signin) { margin-left: 0; }
.you-signin {
  height: 32px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--r);
  background: none; color: var(--text); font: inherit; font-size: var(--fs-sm); font-weight: 600; white-space: nowrap;
  cursor: pointer; transition: border-color .12s, color .12s;
}
.you-signin:hover { border-color: var(--accent); color: var(--accent); }
.you-signin:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* =================================================================================================================
   Development builds (tools/build-site.mjs sets <html data-env="dev"> on every branch but main): a gold line along the
   top bar and a DEV tag after the logo, so dev.ptcatch.com can't be mistaken for the real site.
   ================================================================================================================= */

html[data-env] .topbar { box-shadow: inset 0 3px 0 var(--gold); }
html[data-env] .brand::after {
  content: 'DEV'; padding: 3px 5px 2px; border-radius: var(--r-xs); background: var(--gold); color: #1f191b;
  font: 800 .625rem/1 var(--font); letter-spacing: .08em;
}

/* =================================================================================================================
   Accessibility and UX review fixes (notes/ux-review.md): shared states, phone tables, filters, newcomer help.
   ================================================================================================================= */

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

/* A5: links inside running text are underlined, not told apart by colour alone. */
p a:not(.btn), li a:not(.btn), dd a:not(.btn), .muted a:not(.btn), .notice a:not(.btn) { text-decoration: underline; text-underline-offset: 3px; }
p a.dim-link { text-decoration: underline; }

/* A2/D2: "More" shows where you are when one of its pages is open. */
.nav-more-btn.active { color: var(--text); border-bottom-color: var(--accent); }
@media (max-width: 940px) { .nav-more-btn.active { border-left-color: var(--accent); } }

/* Headings: a plain H1, then the community's own line under it (pageHead() in ui.js). */
.page-tag { font: 600 var(--fs-lg)/1.3 var(--display); color: var(--accent) !important; letter-spacing: .01em; margin: 2px 0 0 !important; }

/* U7: chip groups say what they filter. */
.chips-label { align-self: center; margin-right: 4px; color: var(--text-dim); font-size: var(--fs-xs); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }

/* U4/A3: result counts and empty states with a way back. */
.result-count { margin: 0 0 10px; color: var(--text-dim); font-size: var(--fs-sm); }
.empty p { margin: 0 0 12px; }
.empty p:last-child { margin-bottom: 0; }

/* U1: data tables are focusable, labelled regions; on phones they keep only rank, player and the key number. */
.table-wrap:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cell-sub { display: none; margin-top: 2px; color: var(--text-dim); font-size: var(--fs-xs); font-weight: 400; white-space: normal; }
.cell-sub .score-line { font-size: var(--fs-xs); gap: 4px 8px; }
@media (max-width: 600px) {
  .col-opt { display: none; }
  .cell-sub { display: block; }
  td.cell-player { white-space: normal; }
}

/* D3: on phones the search button says "Search", not just a magnifier. */
.search-toggle-label { display: none; }
@media (max-width: 940px) {
  .search-toggle { width: auto; gap: 6px; padding: 0 8px; grid-auto-flow: column; font: 600 var(--fs-sm)/1 var(--font); color: var(--text); }
  .search-toggle-label { display: inline; }
}
.search-status { padding: 10px 12px; color: var(--text-dim); font-size: var(--fs-sm); }
.search-status:empty { display: none; }

/* D5: "This is me" is a toggle with a visible state. */
.btn[aria-pressed='true'] { border-color: var(--accent-line); background: var(--accent-bg); color: var(--accent); }
.btn[aria-pressed='true']::before { content: '✓'; }
.not-you { font-size: var(--fs-sm); }

/* Home: find yourself, and the Discord. */
.find-me { margin-top: 14px; font-size: var(--fs-sm); color: var(--text-dim); }
.find-me button { padding: 0; border: 0; background: none; color: var(--accent); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-bottom: 10px !important; }

/* D8: the glossary. */
.glossary { display: grid; gap: 0; margin: 0; border-top: 1px solid var(--border); }
.glossary > div { display: grid; grid-template-columns: minmax(120px, 200px) minmax(0, 1fr); gap: 4px 20px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.glossary dt { font-weight: 700; color: var(--text); }
.glossary dd { margin: 0; color: var(--text-dim); }
@media (max-width: 600px) { .glossary > div { grid-template-columns: 1fr; } }
.help-link { margin-left: 6px; font-size: var(--fs-xs); font-weight: 600; }

/* The map of the week's title sits under the "Map of the week" heading, so it's an h3 styled like a title. */
.banner .banner-title { font: 700 clamp(1.5rem, 3.6vw, 2.25rem)/1.1 var(--display); margin: 0 0 .25em; }
.banner .banner-title a { color: inherit; }
/* The play's stats under a player's name on phones: no desktop column widths, so they pack onto one or two lines. */
.cell-sub .score-line > * { min-width: 0; text-align: left; }
@media (max-width: 600px) { .rows .map-sub { white-space: normal; } }
/* WCAG 2.5.8: the map link under each activity event stands on its own line, so it gets a 24px-tall target. */
.event .where a { display: inline-block; padding-block: 4px; margin-block: -4px; }
/* "Ranked 14 Mar 2021" on a map page: the date after the status, a little quieter. */
.kv .status-date { font-weight: 500; color: var(--text-dim); white-space: nowrap; }

/* Players inactive on osu! keep their official pp: an "est." after an estimated value, the "inactive" tag beside names. */
.est { margin-left: 3px; font-size: .75em; font-weight: 600; color: var(--text-dim); cursor: help; }
.mini-board .player .legend-tag { flex: none; overflow: visible; }
.stat-sub .legend-tag { margin-left: 0; margin-right: 4px; }
/* In a table the "(estimated)" sits on its own small line, so the pp column stays aligned. */
td.num .est { display: block; margin: 1px 0 0; font-size: .6875rem; line-height: 1.1; }
