/* skillshotcity.gg — visual system.
 *
 * The palette is lifted from the cards the Discord bot renders
 * (bot/templates/*.html): deep navy ground, cyan accent, the same positive /
 * negative pair. Someone who sees a scoreboard in Discord and then opens the
 * site should recognise it as the same product.
 *
 * Layout is one centred column under the top bar, which is the only
 * navigation. There are no ad slots.
 */

:root {
  --bg: #02101c;
  --bg-deep: #010a12;
  --panel: #0a2436;
  --panel-2: #0d3350;
  --panel-3: #0f3d5e;
  --row: #051c2c;
  --row-alt: #072434;
  --border: #14456b;
  --border-bright: #2078b8;
  --text: #ffffff;
  --muted: #b9dcf4;
  --dim: #7ba7c7;
  --accent: #00aaff;
  --accent-soft: #0085c7;
  --accent-dim: rgba(0, 170, 255, 0.12);
  --pos: #5dffae;
  --neg: #ff8086;
  --warn: #ffc861;
  --gold: #ffd36b;
  --discord: #5865f2;
  --kofi: #ff5a6e;

  --radius: 12px;
  --radius-sm: 8px;
  /* Wide enough that a dense scoreboard — a 13-column match table needs
     about 1100px — fits without scrolling sideways. The top bar shares
     it, so its edges line up with the content's. */
  --shell-max: 1248px;
  --gap: 16px;

  --font: "Inter", -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-deep);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body {
  background-image:
    radial-gradient(1200px 600px at 15% -10%, rgba(0, 170, 255, 0.16), transparent 60%),
    radial-gradient(900px 500px at 90% 0%, rgba(32, 120, 184, 0.12), transparent 55%);
  background-attachment: fixed;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: #12405f; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-bright); }

/* --- top bar ------------------------------------------------------------ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: linear-gradient(180deg, rgba(4, 22, 38, 0.98), rgba(2, 16, 28, 0.94));
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.topbar-inner {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 0 18px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 22px;
}

/* The menu button. Only shown where the nav is folded away behind it. */
.navtoggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 40px;
  height: 40px;
  margin-left: -8px;
  padding: 0 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  cursor: pointer;
}
.navtoggle span { height: 2px; border-radius: 2px; background: var(--muted); transition: transform 0.16s, opacity 0.16s; }
.navtoggle:hover span { background: var(--text); }
.nav-open .navtoggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-open .navtoggle span:nth-child(2) { opacity: 0; }
.nav-open .navtoggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.brand {
  display: flex;
  align-items: baseline;
  gap: 2px;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.3px;
  white-space: nowrap;
}
.brand .brand-city { color: var(--text); }
.brand .brand-gg {
  color: var(--accent);
  text-shadow: 0 0 18px rgba(0, 170, 255, 0.6);
}

.topnav { display: flex; gap: 4px; }
.topnav > a, .navdrop > a {
  padding: 7px 13px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 600;
  font-size: 13.5px;
  transition: background 0.14s, color 0.14s;
}
.topnav > a, .navdrop > a { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.topnav > a:hover, .navdrop > a:hover, .navdrop:hover > a { background: var(--accent-dim); color: var(--text); }
.topnav > a.active, .navdrop > a.active { background: var(--accent); color: #02101c; }

/* Meta's four tables hang off its nav entry, and the ladder and the ranks off
   Ranked's. Opened by hover and by keyboard
   focus; the padding on the menu's wrapper bridges the gap to the entry, so
   the pointer never crosses dead space on the way down. */
.navdrop { position: relative; }
.navdrop .caret { font-size: 10px; opacity: 0.8; }
.navdrop-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 168px;
  padding-top: 8px;
  z-index: 70;
}
.navdrop:hover .navdrop-menu, .navdrop:focus-within .navdrop-menu,
.navdrop.open .navdrop-menu { display: block; }
.navdrop-menu::before {
  content: "";
  position: absolute;
  inset: 8px 0 0;
  background: var(--panel);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-sm);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
}
.navdrop-menu a {
  position: relative;
  display: block;
  margin: 0 6px;
  padding: 7px 10px;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
}
.navdrop-menu a:first-child { margin-top: 6px; }
.navdrop-menu a:last-child { margin-bottom: 6px; }
.navdrop-menu a:hover { background: var(--panel-2); color: var(--text); }

.topbar-spacer { flex: 1; }

/* --- search ------------------------------------------------------------- */

.search {
  position: relative;
  width: 268px;
  max-width: 32vw;
  /* Never let the flex row squeeze this into a sliver: a search box you can't
     read what you typed into is worse than a narrower one. */
  min-width: 190px;
}
.search input {
  width: 100%;
  height: 38px;
  padding: 0 14px 0 38px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(2, 16, 28, 0.85);
  color: var(--text);
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search input::placeholder { color: var(--dim); }
.search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 170, 255, 0.16);
}
.search .search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--dim);
  pointer-events: none;
}
.search-results {
  position: absolute;
  top: 46px;
  left: 0;
  right: 0;
  background: var(--panel);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
  z-index: 60;
}
.search-results .hit {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  cursor: pointer;
  border-bottom: 1px solid rgba(20, 69, 107, 0.6);
}
.search-results .hit:last-child { border-bottom: none; }
.search-results .hit:hover { background: var(--panel-2); }
.search-results .hit .nm { font-weight: 600; }
.search-results .hit .alias { color: var(--dim); font-size: 12px; }
.search-results .empty { padding: 12px; color: var(--dim); }

/* --- steam button ------------------------------------------------------- */

.steam-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--border-bright);
  background: linear-gradient(180deg, #10405f, #0a2c44);
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s, transform 0.1s;
}
.steam-btn:hover { border-color: var(--accent); }
.steam-btn:active { transform: translateY(1px); }
.account { position: relative; }
.steam-user {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;                 /* the search box's height, so they line up */
  padding: 0 4px;
  /* No pill: the badge and the search box already carry rounded outlines, and
     a third one around this made the corner read as three stacked capsules.
     It is still a button — the hover and the caret say so. */
  border: none;
  background: none;
  color: var(--text);
  font-family: inherit;
  white-space: nowrap;
  cursor: pointer;
}
.steam-user:hover .nm { color: var(--accent); }
.steam-user:hover .caret { color: var(--muted); }
.steam-user .caret { color: var(--dim); font-size: 10px; transition: color 0.14s; }
.steam-user .nm { transition: color 0.14s; }

/* The account menu: the profile link and sign-out. */
.account-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 168px;
  padding: 6px;
  background: var(--panel);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-sm);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
  z-index: 70;
}
.account-menu[hidden] { display: none; }
.account-menu .menu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 7px 10px;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.account-menu .menu-item:hover { background: var(--panel-2); }
.account-menu .menu-item.plain { color: var(--muted); font-weight: 600; }
.account-menu .menu-item.danger:hover { color: var(--neg); }

/* Scoped to the avatar, not to every img in here: the rank badge is also an
   img, and this rule was cropping it into a 30x30 circle with a blue ring —
   squashing a 2:1 plate and drawing the very bubble it looked like. */
.steam-user .avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border-bright);
}
.steam-user .nm {
  font-weight: 700;
  font-size: 13px;
  /* A name is arbitrary text; without a ceiling one long enough would push
     the chip into the search box. */
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.steam-user-rank {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--muted);
}
.steam-user-rank .badge { height: 20px; }


/* --- shell -------------------------------------------------------------- */

.shell {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: var(--gap) 18px 64px;
}

/* --- filter bar --------------------------------------------------------- */

.filterbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: var(--gap);
}
.filterbar .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--dim);
  margin-right: -4px;
}
.filterbar select, .pageselect {
  height: 34px;
  padding: 0 30px 0 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--row) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2 4l4 4 4-4' fill='none' stroke='%23b9dcf4' stroke-width='1.6'/></svg>") no-repeat right 10px center;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  appearance: none;
  cursor: pointer;
  outline: none;
}
.filterbar select:hover, .pageselect:hover { border-color: var(--border-bright); }
.filterbar select:focus, .pageselect:focus { border-color: var(--accent); }
/* The rank control wears the badge of whatever it is filtered to. The slot is
   a fixed width whether or not it holds one, so choosing a rank doesn't shift
   the rest of the bar sideways. */
.rank-select {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.rank-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  flex: 0 0 auto;
}
.rank-slot .badge { height: 22px; }

.search-results .hit .rank-slot { width: 36px; }
.search-results .hit .rank-slot .badge { height: 20px; }

.filterbar .scope {
  margin-left: auto;
  color: var(--dim);
  font-size: 12px;
}
.filterbar .scope b { color: var(--muted); font-weight: 700; }

/* --- panels and tables -------------------------------------------------- */

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: var(--gap);
}
.panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(0, 170, 255, 0.09), transparent);
}
.panel-head h2, .panel-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.panel-head .sub { color: var(--dim); font-size: 12px; font-weight: 500; text-transform: none; letter-spacing: 0; }
.panel-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.panel-body { padding: 14px 16px; }
.panel-body.flush { padding: 0; overflow-x: auto; }

table.data { width: 100%; border-collapse: collapse; }
table.data th {
  text-align: left;
  font-size: 10.5px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--dim);
  font-weight: 700;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: rgba(2, 16, 28, 0.5);
}
table.data td {
  padding: 9px 14px;
  border-bottom: 1px solid rgba(20, 69, 107, 0.45);
  vertical-align: middle;
}
table.data tbody tr:nth-child(even) { background: rgba(5, 28, 44, 0.5); }
table.data tbody tr:hover { background: var(--panel-2); }
table.data tbody tr:last-child td { border-bottom: none; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
table.data .clickable { cursor: pointer; }

/* Sortable headers. The caret is always in the layout, invisible until the
   column is the one being sorted, so a header doesn't jump when you click it. */
table.data th.sortable { cursor: pointer; user-select: none; }
table.data th.sortable:hover { color: var(--muted); }
table.data th.sortable::after {
  content: "▾";
  display: inline-block;
  margin-left: 5px;
  opacity: 0;
  transition: opacity 0.12s, transform 0.12s;
}
table.data th.sortable:hover::after { opacity: 0.35; }
table.data th.sorted { color: var(--accent); }
table.data th.sorted::after { opacity: 1; }
table.data th.sorted[data-dir="asc"]::after { transform: rotate(180deg); }

.rankcell { color: var(--dim); font-variant-numeric: tabular-nums; width: 38px; }

/* --- bits --------------------------------------------------------------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--accent-dim);
  border: 1px solid rgba(0, 170, 255, 0.45);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}
.pill.ghost { background: transparent; border-color: var(--border); color: var(--muted); }
.pill.pos { background: rgba(93, 255, 174, 0.12); border-color: rgba(93, 255, 174, 0.45); color: var(--pos); }
.pill.neg { background: rgba(255, 128, 134, 0.12); border-color: rgba(255, 128, 134, 0.45); color: var(--neg); }
.pill.gold { background: rgba(255, 211, 107, 0.13); border-color: rgba(255, 211, 107, 0.5); color: var(--gold); }

.pos { color: var(--pos); }
.neg { color: var(--neg); }
.dim { color: var(--dim); }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }

.icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--row);
  border: 1px solid var(--border);
  object-fit: contain;
  flex: 0 0 auto;
}
.icon.lg { width: 44px; height: 44px; border-radius: 8px; }
.icon.sm { width: 22px; height: 22px; border-radius: 5px; }
table.data.scoreboard td.loadout .icon.sm { width: 20px; height: 20px; }
.icon-missing {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--dim);
  font-size: 12px;
  font-weight: 700;
}

.itemcell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.itemcell > span { min-width: 0; }
.itemcell .nm { font-weight: 700; }
/* The sub-label always takes its own line: inline, it wraps mid-phrase and
   "Blast Cannon 865 appearances" breaks in the wrong place. */
.itemcell .meta { display: block; color: var(--dim); font-size: 11.5px; white-space: nowrap; }

.iconrow { display: inline-flex; align-items: center; gap: 4px; }
td.loadout { white-space: nowrap; width: 0; }

/* A skill and the level it was drafted to are one thing, so they are drawn as
   one: the level frame from the game's own artwork, with the skill icon
   centred inside it — the same composition the bot's match card uses. */
.skill-grid { display: inline-flex; gap: 3px; align-items: center; }
.skill-cell {
  position: relative;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
}
.skill-cell .lvl,
.skill-cell .skill {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.skill-cell .lvl { width: 30px; height: 30px; }
.skill-cell .skill { width: 19px; height: 19px; object-fit: contain; }
.skill-cell .icon-missing {
  width: 19px; height: 19px; border: none; background: none;
}

table.data.compact th, table.data.compact td { padding: 7px 9px; }
/* A scoreboard carries a lot of columns; it earns its space by spending less
   of it on padding. */
table.data.scoreboard th, table.data.scoreboard td { padding: 8px 8px; }

/* Standard play has no mode marker in the game — the class id simply carries
   no suffix — so mode 0's artwork is blank on purpose. The cell keeps its
   width regardless, so the column stays aligned down the table. */
.mode-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
}
/* No plate behind a mode glyph: Standard's artwork is empty, and a bordered
   box around nothing reads as a missing icon rather than as "no marker". */
.mode-cell .icon { background: none; border: none; border-radius: 0; }
table.data.compact .bar { min-width: 34px; }

.bar {
  position: relative;
  height: 6px;
  border-radius: 3px;
  background: rgba(32, 120, 184, 0.2);
  overflow: hidden;
  min-width: 60px;
}
.bar > span {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, var(--accent-soft), var(--accent));
  border-radius: 3px;
}
.barcell { display: flex; align-items: center; gap: 9px; }
.barcell .val { min-width: 46px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }

.badge {
  height: 34px;
  width: auto;
  vertical-align: middle;
  image-rendering: -webkit-optimize-contrast;
}
.badge.lg { height: 58px; }
/* Inside a table cell the full-size plate pushes the rating onto its own
   line; the small variant keeps tier and number on one row. */
.badge.sm { height: 24px; }

/* The region a ladder row played in most. The slot holds its width with no
   flag in it, so the names beside it start on one line. */
.flag-slot {
  display: inline-block;
  width: 20px;
  margin-right: 9px;
  vertical-align: middle;
  line-height: 0;
}
.flag {
  width: 20px;
  height: 15px;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.rankpill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px 14px 4px 6px;
  border-radius: 999px;
  background: var(--accent-dim);
  border: 1px solid rgba(0, 170, 255, 0.5);
}
.rankpill .rating { font-size: 18px; font-weight: 800; }
.rankpill .tier {
  font-size: 13px;
  font-weight: 700;
  padding-left: 11px;
  border-left: 1px solid rgba(0, 170, 255, 0.4);
}

/* --- stat tiles --------------------------------------------------------- */

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.tile {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
}
.tile .k {
  font-size: 10.5px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--dim);
  font-weight: 700;
}
.tile .v { font-size: 22px; font-weight: 800; margin-top: 2px; font-variant-numeric: tabular-nums; }
.tile .v.sm { font-size: 17px; }
.tile .note { font-size: 11.5px; color: var(--dim); }

/* A tile that opens something: the same plate, as a button. */
.tile-btn {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.tile-btn:hover, .tile-btn[aria-expanded="true"] { border-color: var(--accent); background: var(--panel-3); }
/* The favourites row under the summary: four wider cards, each naming one
   thing by its icon and name. */
.tiles.favs { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: 20px; }
.tile.fav .v { display: flex; align-items: center; min-height: 30px; margin-top: 4px; }
.tile.fav .v .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-btn .chev { display: inline-block; color: var(--accent); transition: transform 0.12s; }
.tile-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }

/* Level distribution: one column per level, scaled against the fullest. */
.histogram { display: flex; align-items: flex-end; justify-content: center; gap: 10px; }
.histcol {
  flex: 1 1 0;
  min-width: 0;
  max-width: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.histval { font-size: 12px; font-weight: 700; }
.histbar { width: 100%; height: 130px; display: flex; align-items: flex-end; }
/* A column is a stack: the `part` (a level's mutated share) on top of the
   `rest`, which takes whatever height the part leaves. */
.histbar .stack {
  width: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 4px 4px 0 0;
  overflow: hidden;
}
.histbar .stack span { display: block; width: 100%; flex: 0 0 auto; }
.histbar .stack .rest { flex: 1 1 auto; }
.histogram .rest, .histlegend .rest { background: linear-gradient(180deg, var(--accent), var(--accent-soft)); }
.histogram .part, .histlegend .part { background: var(--gold); }
.histbar .stack .part { border-bottom: 2px solid var(--panel); }
.histlabel { font-size: 11px; color: var(--dim); white-space: nowrap; }
/* Many columns: narrower gaps, and the row scrolls sideways on a phone
   instead of crushing its labels into each other. */
.histogram.dense { gap: 6px; justify-content: flex-start; overflow-x: auto; }
.histogram.dense .histcol { min-width: 52px; }
.histogram.dense .histval { font-size: 11px; }
.histlegend {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--dim);
}
.histlegend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; }

/* Rating over the period: a stepped line, season resets as dashed rules. */
.ratingchart { display: block; width: 100%; height: auto; }
.ratingchart .grid { stroke: var(--border); stroke-width: 1; }
.ratingchart .axis { fill: var(--dim); font-size: 12px; font-family: var(--mono); }
.ratingchart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.ratingchart .dot { fill: var(--accent); stroke: var(--panel); stroke-width: 1.5; }
.ratingchart .peak { fill: var(--gold); stroke: var(--panel); stroke-width: 2; }
.ratingchart .reset { stroke: var(--gold); stroke-width: 1.5; stroke-dasharray: 5 5; opacity: 0.7; }

/* A finishing place, in the colours the bot's cards give it. */
.placetag { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--accent); }
.placetag.p1 { color: #ffd95e; }
.placetag.p2 { color: #e7eef2; }
.placetag.p3 { color: #f1a576; }

/* A bot's name on a scoreboard, for a reader who was in the match: greyed
   rather than labelled. */
.scoreboard .nm.botname { color: var(--dim); font-weight: 400; }

/* Admin: visitors per day, one bar each, scaled against the busiest day. */
.visitchart { display: flex; align-items: flex-end; gap: 3px; height: 96px; margin-top: 16px; }
.visitbar { flex: 1 1 0; min-width: 0; height: 100%; display: flex; align-items: flex-end; }
.visitbar span {
  display: block;
  width: 100%;
  min-height: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-soft));
  border-radius: 2px 2px 0 0;
}
.visitbar:hover span { background: var(--accent); }
.visitaxis {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 11px;
  color: var(--dim);
}

/* "Run alongside": the first eight rows until "See more", then all of them
   in a list that scrolls instead of running down the page. The 8 has to
   agree with PARTNERS_SHOWN in meta.js. */
.partners:not(.expanded) tbody tr:nth-child(n+9) { display: none; }
.partners.expanded { max-height: 420px; overflow-y: auto; }
.partners.expanded thead th { position: sticky; top: 0; z-index: 1; background: var(--bg); }
/* A profile's favourites tables: six rows, then "See more" (players.js:FAV_SHOWN). */
.favlist:not(.expanded) tbody tr:nth-child(n+7) { display: none; }
.favlist.expanded { max-height: 420px; overflow-y: auto; }
.favlist.expanded thead th { position: sticky; top: 0; z-index: 1; background: var(--bg); }
.morebtn { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; }
.morebtn:hover { text-decoration: underline; }

/* --- hero --------------------------------------------------------------- */

.hero {
  background:
    linear-gradient(90deg, rgba(0, 170, 255, 0.22), rgba(2, 16, 28, 0)),
    linear-gradient(180deg, #0e3b58, #02101c);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  padding: 26px 28px;
  margin-bottom: var(--gap);
  box-shadow: inset 0 3px 0 var(--accent);
}
.hero h1 { margin: 0 0 6px; font-size: 27px; font-weight: 800; letter-spacing: -0.4px; }
.hero p { margin: 0 0 16px; color: var(--muted); max-width: 640px; }
.hero .hero-search { max-width: 520px; width: 100%; }
.hero .hero-search input { height: 46px; font-size: 15px; }

/* --- headers ------------------------------------------------------------ */

.pagehead { display: flex; align-items: flex-start; gap: 18px; margin-bottom: var(--gap); }
.pagehead h1 { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -0.3px; }
.pagehead .sub { color: var(--dim); margin-top: 3px; }
.pagehead .right { margin-left: auto; text-align: right; }


/* --- match rows --------------------------------------------------------- */

.match {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(20, 69, 107, 0.45);
  cursor: pointer;
}
.match:hover { background: var(--panel-2); }
.match:last-child { border-bottom: none; }
.match.win { box-shadow: inset 3px 0 0 var(--pos); }
.match.loss { box-shadow: inset 3px 0 0 rgba(255, 128, 134, 0.6); }
.match .when { color: var(--dim); font-size: 12px; }
.match .where { font-weight: 700; font-size: 13px; }
.match .roster { display: flex; gap: 6px; flex-wrap: wrap; }
.match .who {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--row);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 9px 2px 3px;
  font-size: 12px;
}
.match .who.first { border-color: var(--gold); background: rgba(255, 211, 107, 0.08); }

/* The modifiers sit with the match's own facts — version, size, rounds —
   rather than with the roster, because they describe the game, not who was
   in it. Icons only at this density; the round and the name are in the
   tooltip, and the match page names them in full. */
.match .mods { margin-top: 4px; }

/* In a match list the modifiers are a glance, not a reading — the profile's
   table is the widest on the site, so this column spends as little width as
   it can and still be legible. */
td.mods { padding-left: 4px; padding-right: 4px; white-space: nowrap; width: 0; }
td.mods .iconrow { gap: 3px; }
td.mods .icon.sm { width: 20px; height: 20px; }

/* --- round modifiers ----------------------------------------------------- */

.modchips { display: flex; flex-wrap: wrap; gap: 8px; }
.modchip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--row);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 12px 5px 8px;
  font-size: 13px;
}
.modchip .rnd {
  color: var(--accent);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.6px;
  font-variant-numeric: tabular-nums;
}
.modchip .nm { font-weight: 600; }
/* The plate behind a modifier glyph fights the chip's own border. */
.modchip .icon { background: none; border: none; border-radius: 0; }

/* --- scoreboard --------------------------------------------------------- */

.scoreboard td { vertical-align: middle; }
.scoreboard .place {
  width: 34px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--dim);
}
.scoreboard tr.first .place { color: var(--gold); }
.scoreboard .who { display: flex; align-items: center; gap: 9px; }
.scoreboard .who .nm { font-weight: 700; }

.split { color: var(--dim); font-weight: 600; }
.split b { color: var(--text); font-weight: 800; }

/* --- misc --------------------------------------------------------------- */

/* --- skill description -------------------------------------------------- */

.skilldetails { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px 28px; }
.skilltext p { margin: 0 0 10px; color: var(--muted); line-height: 1.5; }
.skilltext .syringe { color: var(--gold); font-weight: 700; }
.skillstat { display: flex; flex-direction: column; gap: 1px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.skillstat:last-child { border-bottom: 0; }
.skillstat .k, .skillbuffs .k {
  font-size: 10.5px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--dim);
  font-weight: 700;
}
.skillstat .v { color: var(--gold); font-size: 13.5px; }
.skillstat.row { flex-direction: row; justify-content: space-between; align-items: baseline; gap: 12px; padding: 5px 0; }
.skillstat.mutation .k { color: var(--gold); }
.skillbuffs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.skillbuffs .k { flex-basis: 100%; }

.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: var(--gap); }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: var(--gap); }

.empty-state { padding: 40px 20px; text-align: center; color: var(--dim); }
.empty-state .big { font-size: 15px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }

.skeleton {
  background: linear-gradient(90deg, var(--panel) 25%, var(--panel-2) 37%, var(--panel) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
  border-radius: var(--radius-sm);
  height: 14px;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

.loading { padding: 26px; display: flex; flex-direction: column; gap: 9px; }

.footnote {
  color: var(--dim);
  font-size: 11.5px;
  padding: 10px 16px;
  border-top: 1px solid rgba(20, 69, 107, 0.45);
  background: rgba(2, 16, 28, 0.4);
}

.linkish { color: var(--accent); cursor: pointer; }
.linkish:hover { text-decoration: underline; }

/* --- footer & legal pages ------------------------------------------------ */

.sitefoot {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 18px 18px 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  color: var(--dim);
  font-size: 12.5px;
  border-top: 1px solid var(--border);
}
.sitefoot a:hover { color: var(--text); }
.sitefoot-discord { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; }
.sitefoot-discord:hover .discord-logo { color: var(--discord); }
.sitefoot-kofi:hover .kofi-logo { color: var(--kofi); }
.sitefoot-spacer { flex: 1 1 auto; }

/* Running text, which nothing else on the site is: a measure narrow enough
   to read, and the spacing a table never needed. */
.prose { padding: 8px 26px 24px; color: var(--muted); font-size: 14px; line-height: 1.65; }
.prose > * { max-width: 760px; }
.prose h2 { margin: 26px 0 6px; font-size: 15px; font-weight: 700; color: var(--text); }
.prose p { margin: 0 0 10px; }
.prose ul { margin: 0 0 10px; padding-left: 20px; }
.prose code { font-family: var(--mono); font-size: 12.5px; color: var(--text); }
.prose .todo { padding: 1px 5px; border-radius: 4px; background: rgba(255, 200, 97, 0.18); color: var(--warn); }

/* --- buttons and forms --------------------------------------------------
   Nothing on the site took input but the search box and the filter bar
   until the blog and the admin panel did. */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-bright);
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.14s, background 0.14s, color 0.14s;
}
.btn:hover { border-color: var(--accent); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn.primary { background: linear-gradient(180deg, var(--accent), var(--accent-soft)); border-color: var(--accent); color: #00121f; }
.btn.primary:hover { filter: brightness(1.1); }
.btn.ghost { background: transparent; border-color: var(--border); color: var(--muted); }
.btn.ghost:hover { border-color: var(--border-bright); color: var(--text); }
.btn.danger { background: transparent; border-color: rgba(255, 128, 134, 0.4); color: var(--neg); }
.btn.danger:hover { border-color: var(--neg); background: rgba(255, 128, 134, 0.1); }
.btn.discord { background: var(--discord); border-color: var(--discord); color: #fff; }

.input {
  width: 100%;
  min-height: 36px;
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--row);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  outline: none;
}
.input:hover { border-color: var(--border-bright); }
.input:focus { border-color: var(--accent); }
.input::placeholder { color: var(--dim); }
textarea.input { resize: vertical; line-height: 1.5; }
select.input { width: auto; max-width: 100%; cursor: pointer; }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--dim); font-weight: 700; }
.field-label .dim { text-transform: none; letter-spacing: 0; font-weight: 500; }
.formrow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.formrow.padded { padding: 14px 16px; border-top: 1px solid var(--border); }
.formrow .grow { flex: 1 1 260px; width: auto; }
.formactions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.formstatus { color: var(--pos); font-size: 12.5px; min-height: 1em; }
.formstatus.error { color: var(--neg); }
.hint { margin-top: 9px; color: var(--dim); font-size: 12px; max-width: 720px; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 1.1px; text-transform: uppercase; color: var(--accent); }

/* --- blog --------------------------------------------------------------- */

.postgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.postcard {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.14s, transform 0.14s;
}
.postcard:hover { border-color: var(--accent); transform: translateY(-1px); }
.postcard-cover { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--row); }
.postcard-cover.blank {
  background:
    linear-gradient(135deg, rgba(0, 170, 255, 0.22), transparent 60%),
    linear-gradient(180deg, var(--panel-3), var(--row));
}
.postcard-text { display: flex; flex-direction: column; gap: 5px; padding: 14px 16px 16px; min-width: 0; }
.postcard-title { font-size: 16.5px; font-weight: 800; line-height: 1.3; letter-spacing: -0.2px; }
.postcard-summary {
  color: var(--muted);
  font-size: 13.5px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.postcard-meta { color: var(--dim); font-size: 12px; margin-top: 2px; }

/* A list of posts in a panel: the card laid on its side, without a frame of
   its own. */
.postlist .postcard { flex-direction: row; align-items: center; border: none; border-radius: 0; background: none; border-bottom: 1px solid rgba(20, 69, 107, 0.45); transform: none; }
.postlist .postcard:last-child { border-bottom: none; }
.postlist .postcard:hover { background: var(--panel-2); }
.postlist .postcard-cover { width: 112px; flex: 0 0 112px; margin: 10px 0 10px 12px; border-radius: 6px; }
.postlist .postcard-text { padding: 10px 14px; }
.postlist .postcard-title { font-size: 14px; }
.postlist .postcard-summary { display: none; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: var(--gap); }
.btn:disabled { opacity: 0.4; cursor: default; pointer-events: none; }

/* A profile's match history while the next page of it is on its way, and
   where it lands when a page is turned from below the top of the table. */
#history { scroll-margin-top: 140px; }
#history.busy { opacity: 0.55; pointer-events: none; transition: opacity 0.14s; }

.post { max-width: 860px; margin-left: auto; margin-right: auto; }
.post-cover { display: block; width: 100%; max-height: 420px; object-fit: cover; }
.post-head { padding: 22px 30px 0; }
.post-head h1 { margin: 8px 0 8px; font-size: 30px; font-weight: 800; line-height: 1.2; letter-spacing: -0.5px; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: var(--dim); font-size: 13px; }
.post > .post-body { padding: 14px 30px 30px; }

/* A post's own typography — shared by the page that shows it and the editor
   that writes it, which is what makes the editor show what will be
   published. */
.post-body { color: var(--muted); font-size: 15.5px; line-height: 1.7; overflow-wrap: anywhere; }
.post-body > :first-child { margin-top: 0; }
.post-body p { margin: 0 0 14px; }
.post-body h2 { margin: 30px 0 10px; font-size: 21px; font-weight: 800; color: var(--text); letter-spacing: -0.2px; }
.post-body h3 { margin: 24px 0 8px; font-size: 17px; font-weight: 700; color: var(--text); }
.post-body h4 { margin: 20px 0 6px; font-size: 15px; font-weight: 700; color: var(--text); }
.post-body strong, .post-body b { color: var(--text); }
.post-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.post-body ul, .post-body ol { margin: 0 0 14px; padding-left: 24px; }
.post-body li { margin-bottom: 4px; }
.post-body blockquote { margin: 0 0 14px; padding: 4px 0 4px 16px; border-left: 3px solid var(--accent); color: var(--text); font-style: italic; }
.post-body img { display: block; max-width: 100%; height: auto; margin: 18px auto; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.post-body iframe { display: block; width: 100%; aspect-ratio: 16 / 9; height: auto; margin: 18px 0; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-deep); }
/* In the editor a video is something to place and delete, not to watch: a
   click on it would otherwise go to the player and never reach the text. */
.editor-body iframe { pointer-events: none; }
.post-body hr { border: none; border-top: 1px solid var(--border); margin: 26px 0; }
.post-body code { font-family: var(--mono); font-size: 13px; color: var(--text); background: var(--row); padding: 1px 5px; border-radius: 4px; }
.post-body pre { margin: 0 0 14px; padding: 12px 14px; background: var(--row); border: 1px solid var(--border); border-radius: var(--radius-sm); font-family: var(--mono); font-size: 13px; color: var(--text); white-space: pre-wrap; }
.post-body pre code { background: none; padding: 0; }

/* --- the post editor ----------------------------------------------------- */

.compose { padding: 18px; display: flex; flex-direction: column; gap: 14px; max-width: 900px; margin-left: auto; margin-right: auto; overflow: visible; }
.pagehead:has(#post-actions) { max-width: 900px; margin-left: auto; margin-right: auto; }
.input.title { font-size: 22px; font-weight: 800; letter-spacing: -0.3px; padding: 10px 12px; }
.compose-extra { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--gap); }
.coverpick { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 12px; }
.coverpick img { width: 160px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }

.editor { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--row); }
.editor:focus-within { border-color: var(--border-bright); }
.editor-toolbar {
  position: sticky;
  top: 60px;                      /* under the top bar */
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  padding: 7px 9px;
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: var(--panel);
}
.editor-group { display: inline-flex; gap: 2px; }
.editor-toolbar button {
  min-width: 32px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.editor-toolbar button:hover { background: var(--panel-2); color: var(--text); }
.editor-toolbar button.on { background: var(--accent-dim); border-color: rgba(0, 170, 255, 0.45); color: var(--accent); }
.editor-status { margin-left: auto; color: var(--dim); font-size: 12px; }
.editor-status.error { color: var(--neg); }
.editor-linkbar { display: flex; gap: 8px; padding: 8px 9px; border-bottom: 1px solid var(--border); background: var(--panel); }
.editor-linkbar[hidden] { display: none; }
.editor-linkbar input { flex: 1 1 auto; min-width: 0; height: 28px; padding: 0 9px; border-radius: 6px; border: 1px solid var(--border); background: var(--row); color: var(--text); font: inherit; font-size: 13px; outline: none; }
.editor-linkbar input:focus { border-color: var(--accent); }
.editor-body { min-height: 340px; padding: 16px 18px; outline: none; }
.editor-body.empty::before { content: attr(data-placeholder); color: var(--dim); pointer-events: none; float: left; height: 0; }

/* --- home --------------------------------------------------------------- */

.home-featured { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--gap); margin-bottom: var(--gap); }
.home-featured.single { grid-template-columns: minmax(0, 1fr); }
.feature-post { display: flex; }
.feature-post .postcard { flex: 1 1 auto; }
.feature-post .postcard-title { font-size: 21px; }
/* Alone on the row, the featured post lies on its side rather than
   stretching a 16:9 cover across the whole column. */
.home-featured.single .postcard, .home-featured.single .videocard { flex-direction: row; }
.home-featured.single .postcard-cover, .home-featured.single .videocard-frame { width: 46%; flex: 0 0 46%; }
.home-featured.single .postcard-text { justify-content: center; padding: 20px 24px; }

.videocard { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: border-color 0.14s, transform 0.14s; }
a.videocard:hover { border-color: var(--accent); transform: translateY(-1px); }
div.videocard:hover { border-color: var(--accent); }
.videocard-frame { position: relative; display: block; aspect-ratio: 16 / 9; background: linear-gradient(180deg, var(--panel-3), var(--bg-deep)); }
button.videocard-frame { width: 100%; padding: 0; border: none; cursor: pointer; font: inherit; }
.videocard-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.videocard-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.videocard-play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(2, 16, 28, 0.78);
  border: 2px solid #fff;
  transition: background 0.14s, transform 0.14s;
}
.videocard-play::after { content: ""; position: absolute; top: 50%; left: 54%; transform: translate(-50%, -50%); border-style: solid; border-width: 11px 0 11px 18px; border-color: transparent transparent transparent #fff; }
.videocard:hover .videocard-play { background: var(--accent-soft); transform: scale(1.06); }

.home-columns td.nm { white-space: nowrap; }
.home-columns { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: var(--gap); align-items: start; }

.discord-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  margin-bottom: var(--gap);
  border-radius: var(--radius);
  border: 1px solid rgba(88, 101, 242, 0.6);
  background: linear-gradient(120deg, rgba(88, 101, 242, 0.3), rgba(88, 101, 242, 0.08)), var(--panel);
  transition: border-color 0.14s;
}
.discord-card:hover { border-color: var(--discord); }
.discord-card .discord-logo { color: #fff; flex: 0 0 auto; }
.discord-card .kofi-logo { color: #fff; flex: 0 0 auto; }
.discord-card .guides-logo { color: #fff; flex: 0 0 auto; }
.guides-card { border-color: rgba(0, 170, 255, 0.5); background: linear-gradient(120deg, rgba(0, 170, 255, 0.22), rgba(0, 170, 255, 0.05)), var(--panel); }
.guides-card:hover { border-color: var(--accent); }
.btn.guides { background: var(--accent-soft); border-color: var(--accent); color: #fff; }
.discord-card .trophy-logo { color: #fff; flex: 0 0 auto; }
.cup-card { border-color: rgba(255, 211, 107, 0.5); background: linear-gradient(120deg, rgba(255, 211, 107, 0.2), rgba(255, 211, 107, 0.04)), var(--panel); }
.cup-card:hover { border-color: var(--gold); }
.btn.cup { background: var(--gold); border-color: var(--gold); color: #2a1d00; }
/* A tournament match in a profile's history: its group name in gold, in place of a "Cup" pill. */
.nm.cup { color: var(--gold); }
.kofi-card { border-color: rgba(255, 90, 110, 0.55); background: linear-gradient(120deg, rgba(255, 90, 110, 0.26), rgba(255, 90, 110, 0.06)), var(--panel); }
.kofi-card:hover { border-color: var(--kofi); }
.btn.kofi { background: var(--kofi); border-color: var(--kofi); color: #fff; }
.discord-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }
.discord-text b { font-size: 15px; }
.discord-text span { color: var(--muted); font-size: 12.5px; }

/* --- admin -------------------------------------------------------------- */

.videoform { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: var(--gap); align-items: start; }
.videoform-fields { display: flex; flex-direction: column; gap: 12px; }
.videoform-preview { aspect-ratio: 16 / 9; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--row); display: flex; align-items: center; justify-content: center; overflow: hidden; font-size: 12px; }
.videoform-preview img { width: 100%; height: 100%; object-fit: cover; }
#admin table.data .pill { margin-left: 6px; }
#admin table.data td .btn + .btn { margin-left: 6px; }

/* --- responsive --------------------------------------------------------- */

@media (max-width: 1000px) {
  .shell { padding: 14px; }
  .sitefoot { padding-left: 14px; padding-right: 14px; }
  .match { grid-template-columns: minmax(0, 1fr); }

  /* The top bar folds into two rows — menu button, brand and account, then
     the search box at full width — with the nav in a panel behind the
     button. It used to wrap wherever the row happened to run out, and Meta's
     hover dropdown could not be opened by a tap at all. */
  .topbar-inner {
    height: auto;
    flex-wrap: wrap;
    padding: 8px 14px 10px;
    gap: 8px 10px;
  }
  .navtoggle { display: flex; }
  .search { order: 3; flex: 0 0 100%; width: auto; max-width: none; min-width: 0; }
  /* 16px is the size below which iOS zooms the page on focus. */
  .search input { height: 40px; font-size: 16px; }

  .topnav { display: none; order: 4; flex: 0 0 100%; flex-direction: column; gap: 2px; padding-bottom: 4px; }
  .nav-open .topnav { display: flex; }
  .topnav > a, .navdrop > a { display: flex; padding: 11px 12px; border-radius: var(--radius-sm); font-size: 15px; }
  /* Meta's tables are listed outright under it: nothing to hover, nothing to
     open. The caret would promise a menu that is already there. */
  .navdrop .caret { display: none; }
  .navdrop-menu { display: block; position: static; min-width: 0; padding: 0 0 4px 14px; }
  .navdrop-menu::before { display: none; }
  .navdrop-menu a, .navdrop-menu a:first-child, .navdrop-menu a:last-child { margin: 0; padding: 10px 12px; font-size: 14.5px; }

  /* A long page of nav must not run off a short screen with the bar stuck
     to the top of it. */
  .nav-open .topbar-inner { max-height: 100vh; max-height: 100dvh; overflow-y: auto; }

  .account-menu .menu-item { padding: 11px 12px; font-size: 14.5px; }
  .prose { padding: 4px 16px 18px; }

  .home-featured, .home-columns, .compose-extra, .videoform { grid-template-columns: minmax(0, 1fr); }
  .home-featured.single .postcard, .home-featured.single .videocard { flex-direction: column; }
  .home-featured.single .postcard-cover, .home-featured.single .videocard-frame { width: 100%; flex: 0 0 auto; }
  .videoform-preview { max-width: 320px; }
  .post-head { padding: 16px 16px 0; }
  .post-head h1 { font-size: 24px; }
  .post > .post-body { padding: 12px 16px 22px; }
  /* The top bar is two rows tall here and no longer a fixed height to sit
     under, so the toolbar scrolls with the post. */
  .editor-toolbar { position: static; }
  .input { font-size: 16px; }   /* below 16px iOS zooms the page on focus */
  .pagehead:has(.formactions) { flex-direction: column; }
  .pagehead .formactions { margin-left: 0; justify-content: flex-start; }
}

/* Phone width: the account chip keeps the avatar and name and drops the
   rank clause, and the brand gives up a little, so the first row holds. */
@media (max-width: 560px) {
  .home-columns .tiername { display: none; }
  .brand { font-size: 17px; }
  .steam-user-rank { display: none; }
  .steam-user .nm { max-width: 96px; }
  .steam-btn { padding: 0 12px; font-size: 12.5px; }
}
@media (max-width: 400px) {
  .steam-btn .steam-btn-long { display: none; }
}

/* ---------- Match timeline (admin-only cash/level/upgrades chart) ---------- */
/* Chart colours. Shared with the SVG via CSS tokens so a theme / palette
   tweak lands in one place. */
:root {
  --upgrades-c: #7cc5ff;
  --cash-c:     #4fd1c5;
  --level-c:    #ffd36b;
  --wep-c:      #ff8a8a;
  --chem-c:     #c7a5ff;
}
.scoreboard tr.timeline-open { background: var(--row-alt); }
.scoreboard tr.timeline-open td { border-bottom-color: transparent; }
.scoreboard tr.timeline-row td { padding: 0; }
.timeline-pane {
  background: var(--panel);
  border-top: 1px solid var(--border);
  padding: 14px 16px 18px;
  position: relative;
}
.timeline-pane[aria-busy="true"] { opacity: .6; }
.timeline-head {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;
}
.timeline-head strong { color: var(--text); font-weight: 600; margin-right: 4px; }
.timeline-chart { position: relative; }
.timeline-chart svg { display: block; width: 100%; height: auto; max-width: 100%; }
.timeline-chart .grid-line  { stroke: var(--border); stroke-width: 1; opacity: .55; }
.timeline-chart .pane-rule  { stroke: var(--border); stroke-width: 1; stroke-dasharray: 2 3; opacity: .7; }
.timeline-chart .round-line { stroke: var(--border-bright); stroke-width: 1; stroke-dasharray: 3 3; opacity: .75; }
.timeline-chart .round-label{ fill: var(--muted); font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase; }
.timeline-chart .axis-label { fill: var(--dim); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.timeline-chart .panel-label{ font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; }
.timeline-chart .value-label{ fill: var(--text); font-size: 11.5px; font-variant-numeric: tabular-nums; font-weight: 600; }
.timeline-chart .cash-area  { fill: var(--cash-c); fill-opacity: .14; }
.timeline-chart .cash-line  { fill: none; stroke: var(--cash-c); stroke-width: 1.7; stroke-linejoin: round; }
.timeline-chart .level-step { fill: none; stroke: var(--level-c); stroke-width: 1.8; stroke-linejoin: round; }
.timeline-chart .level-dot  { fill: var(--level-c); }
.timeline-chart .upg-step   { fill: none; stroke: var(--upgrades-c); stroke-width: 1.8; stroke-linejoin: round; }
.timeline-chart .upg-dot    { fill: var(--upgrades-c); }
.timeline-chart .hover-line { stroke: var(--text); stroke-width: 1; stroke-dasharray: 2 3; opacity: .6; }
.timeline-chart .hover-rect { cursor: crosshair; }
.timeline-tt {
  position: absolute;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 10px));
  background: rgba(1, 10, 18, .95);
  border: 1px solid var(--border-bright);
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 11.5px;
  color: var(--text);
  min-width: 140px;
  z-index: 2;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
}
.timeline-tt .tt-head { color: var(--muted); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 4px; }
.timeline-tt .tt-row { display: flex; justify-content: space-between; gap: 10px; }
.timeline-tt .tt-row .k { color: var(--muted); }
.timeline-tt .tt-row .v { font-variant-numeric: tabular-nums; font-weight: 600; }
.timeline-strip {
  margin-top: 10px;
  background: var(--row);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.timeline-strip .strip-head {
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.timeline-strip svg { display: block; width: 100%; height: auto; }
.timeline-strip .loadout-event .ring { fill: var(--panel); stroke-width: 1.5; }
.timeline-strip .loadout-event.wep  .ring { stroke: var(--wep-c); }
.timeline-strip .loadout-event.chem .ring { stroke: var(--chem-c); }
.timeline-strip .loadout-event .ic  { font-size: 10.5px; font-weight: 700; }
.timeline-strip .loadout-event.wep  .ic { fill: var(--wep-c); }
.timeline-strip .loadout-event.chem .ic { fill: var(--chem-c); }
