/* Walkout Song Database — Rajadamnern design system skin (see the
   rajadamnern-design-system skill for the full spec this implements).
   Dark/red sports-federation identity: sharp corners, hairline borders
   instead of shadows, Anton for impact type, Archivo for everything else.
   Every selector below kept its original name/shape on purpose -- this is a
   visual reskin only, not a markup change, so index.html/app.js needed zero
   edits for it.
   Fonts are self-hosted in /fonts so the venue doesn't need internet. */

@import url("/fonts/fonts.css");

:root {
  /* ---- Rajadamnern canonical tokens ---- */
  --black: #0a0a0a;
  --panel: #141414;
  --panel-2: #1a1414;
  --red: #e0091c;
  --red-2: #ff2f3f;
  --red-deep: #5c040d;
  --cream: #efe9dc;
  --ink: #efe9dc;
  --ink-dim: #9a9488;
  --ink-faint: #5c5850;
  --line: #2a2422;
  --line-strong: #3a322e;
  --up: #5fd97a;
  --down: #ff5f6d;
  /* Justified exception to the "one accent hue" rule: muay thai bouts have a
     literal red corner and blue corner, a real domain fact, not decoration.
     Used ONLY for that literal marker (.ord.corner-blue, .avatar.corner-ring-blue)
     -- every other old "blue" chip/banner below was informational, not a
     corner, and was folded into the neutral ink palette instead. */
  --corner-blue: #4a9eff;
  --corner-blue-soft: rgba(74, 158, 255, 0.14);

  --grad-hero: radial-gradient(85% 110% at 18% -10%, #6e0812 0%, #440509 26%, #200308 48%, #0e0505 70%, #0a0a0a 100%);
  --grad-glow: radial-gradient(60% 80% at 85% 10%, rgba(224, 9, 28, 0.35) 0%, rgba(224, 9, 28, 0) 70%);
  --grad-card: linear-gradient(160deg, rgba(224, 9, 28, 0.2) 0%, rgba(224, 9, 28, 0.02) 55%, rgba(224, 9, 28, 0) 100%);
  --grad-line: linear-gradient(90deg, var(--red) 0%, var(--red-2) 50%, var(--red) 100%);
  --grad-text: linear-gradient(100deg, #f2e9e4 0%, #ff8a90 22%, var(--red-2) 50%, #f2e9e4 100%);

  --red-soft: rgba(224, 9, 28, 0.14);
  --red-2-soft: rgba(255, 47, 63, 0.14);
  --up-soft: rgba(95, 217, 122, 0.14);
  --down-soft: rgba(255, 95, 109, 0.16);

  /* ---- legacy variable names, kept so this file (and every inline style in
     app.js) didn't need touching. Each aliases to whatever the ACTUAL use at
     that call site needs -- not a blind 1:1 old-value swap. See the comment
     block above each section below for anything non-obvious. ---- */
  --bg: var(--black);
  --bg-elev: var(--panel);
  --sidebar: var(--black);
  --surface: var(--panel);
  --surface-hover: #1c1616;
  --surface-2: var(--panel-2);
  --border: var(--line);
  --border-soft: var(--line);
  --border-strong: var(--line-strong);
  --text: var(--cream);
  --text-soft: var(--ink-dim);
  --text-faint: var(--ink-faint);

  /* Old --green meant two different things at different call sites: brand/
     primary-action color (buttons, focus, active nav -- the majority of its
     uses) and genuine success/positive status (confirmed, matched, moved
     up). Those two now diverge: brand uses were repointed directly to
     var(--red)/var(--red-2) at each selector below; this variable itself
     keeps only the success meaning, using the design system's own "moved
     up" green rather than inventing a new one. */
  --green: var(--up);
  --green-ink: var(--black);
  --green-soft: var(--up-soft);

  /* Old --red meant danger/error/clash (a real, still-needed status) at
     every call site except the literal "red corner" marker, which moved to
     var(--red) directly (brand red IS the red corner -- a nice fit, not a
     coincidence). Everything else below uses var(--down) explicitly rather
     than aliasing this name, since "--red" now means brand, not danger. */

  /* Old --blue meant either the literal blue corner (kept, see --corner-blue
     above) or a purely informational tag ("pool", "proposed", guest banner)
     that had no real reason to be a third hue -- those became neutral. */
  --blue: var(--corner-blue);
  --blue-soft: var(--corner-blue-soft);

  --amber: #c9862a;
  --amber-soft: rgba(201, 134, 42, 0.16);

  --shadow: none; /* this identity uses borders, never drop shadows */
  color-scheme: dark;
}

* { box-sizing: border-box; }

/* Must sit above every `display:` rule below, or it loses on specificity and
   the modal backdrop and login screens stay stuck on top of the page. */
[hidden] { display: none !important; }

html, body { margin: 0; height: 100%; background: var(--bg); }

/* The hairline frame: the whole page sits inside a 1px border with a small
   margin, like a poster mounted in a frame. A fixed decorative overlay
   rather than a real margin/border on body, so it never affects layout
   math (100dvh calculations, scroll position, etc). */
body::after {
  content: "";
  position: fixed;
  inset: 10px;
  border: 1px solid var(--line);
  pointer-events: none;
  z-index: 1000;
}
@media (max-width: 900px) {
  body::after { inset: 5px; }
}

body {
  font-family: "Archivo", "IBM Plex Sans Thai", "Segoe UI", -apple-system, sans-serif;
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; text-wrap: balance; }
button, input, select, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; }

.num, .mono {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
}

/* Anton: display/impact only, always uppercase, used sparingly on the one
   or two things per screen that should command attention. */
.topline h1, .hero .info h1, .login-card h1, .modal h2 {
  font-family: "Anton", "Archivo", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}

::selection { background: var(--red-soft); color: var(--ink); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 0; }
::-webkit-scrollbar-thumb:hover { background: var(--border-soft); }
::-webkit-scrollbar-track { background: transparent; }

/* ========================================================== sign-in screens */

.login-screen {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--grad-hero);
}
.login-card {
  width: 100%;
  max-width: 372px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 34px 30px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.login-mark {
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 4px;
}
.login-card h1 { font-size: 24px; text-align: center; }
.login-card h1 .dot, .wordmark .dot { color: var(--red-2); }
.login-card > .muted { text-align: center; margin: -8px 0 10px; }
.login-card label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 11.5px; font-weight: 700; color: var(--text-soft); letter-spacing: 0.02em;
}
.login-card .hint { font-weight: 400; color: var(--text-faint); }
.login-card #guest-row { display: flex; flex-direction: column; gap: 10px; }
.login-card #guest-row .btn { width: 100%; }

.or-rule {
  display: flex; align-items: center; gap: 12px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-faint);
  margin: 4px 0 2px;
}
.or-rule::before, .or-rule::after {
  content: ""; flex: 1; height: 1px; background: var(--border);
}
.guest-note { margin: 0; font-size: 11.5px; color: var(--text-faint); text-align: center; }

/* ==================================================================== shell */

.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100dvh; }

.sidebar {
  background: var(--sidebar);
  border-right: 1px solid var(--border-soft);
  padding: 18px 12px;
  display: flex; flex-direction: column; gap: 20px;
  position: sticky; top: 0; height: 100dvh; overflow: auto;
}
.wordmark { display: flex; align-items: center; gap: 9px; padding: 6px 8px; }
.wordmark .glyph {
  display: flex; align-items: center; justify-content: center; flex: none;
}
.wordmark .name { font-family: "Anton", sans-serif; font-size: 18px; text-transform: uppercase; letter-spacing: 0.01em; }
.org { padding: 0 8px; font-size: 11px; color: var(--text-faint); margin-top: 1px; }

.navgroup { display: flex; flex-direction: column; gap: 2px; }
.navlabel {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-faint); padding: 10px 10px 4px;
}
.navitem {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 10px; border-radius: 0;
  color: var(--text-soft); font-size: 13.5px; font-weight: 600;
  cursor: pointer; transition: background 0.12s, color 0.12s;
}
.navitem .ic { width: 18px; text-align: center; font-size: 14px; flex: none; }
.navitem:hover { background: var(--surface); color: var(--text); }
.navitem.active { background: var(--surface-hover); color: var(--text); }
.navitem.active .ic { color: var(--red-2); }
.navitem .badge {
  margin-left: auto; font-size: 10px; font-weight: 700;
  background: var(--down-soft); color: var(--down); padding: 2px 7px; border-radius: 0;
}

.sidebar-foot { margin-top: auto; padding: 10px 8px 0; border-top: 1px solid var(--border-soft); }
.who { display: flex; align-items: center; gap: 9px; padding: 8px 2px; }
.who .fd { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.who .name { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who .role { font-size: 10.5px; color: var(--text-faint); }

/* ===================================================================== main */

.main-col { min-width: 0; display: flex; flex-direction: column; }

.mainhead {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 28px;
  background: rgba(10, 10, 10, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
}
.menu-toggle {
  display: none; background: none; border: none; color: var(--text);
  font-size: 19px; cursor: pointer; padding: 4px 6px;
}
.searchfield {
  position: relative; flex: 1; max-width: 460px;
  display: flex; align-items: center; gap: 9px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 0; padding: 9px 16px;
  transition: border-color 0.12s;
}
.searchfield:focus-within { border-color: var(--red); }
.searchfield .ic { color: var(--text-faint); font-size: 13px; }
.searchfield input {
  flex: 1; background: none; border: none; color: var(--text); font-size: 13.5px; min-width: 0;
}
.searchfield input:focus { outline: none; }
.searchfield input::placeholder { color: var(--text-faint); }

.global-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 0;
  max-height: 64vh; overflow: auto; z-index: 50; padding: 6px;
}
.gr-head {
  padding: 8px 10px 5px; font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-faint);
}
.main { padding: 22px 28px 70px; min-width: 0; flex: 1; }

/* ================================================================ page head */

.topline {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 20px;
}
.topline h1 { font-size: 30px; }
.topline .sub { color: var(--text-soft); font-size: 12.5px; margin-top: 4px; }
.muted { color: var(--text-soft); font-size: 12.5px; margin: 0; }
.faint { color: var(--text-faint); }

.back {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: none; color: var(--text-soft);
  font-size: 12.5px; font-weight: 600; cursor: pointer; padding: 0 0 14px;
}
.back:hover { color: var(--text); }

/* ============================================================ cover artwork */

.cover {
  border-radius: 0; position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 10px; flex: none;
  box-shadow: inset 0 -40px 40px -20px rgba(0, 0, 0, 0.55); /* legibility gradient, not a drop shadow */
}
.cover .dow-lbl {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.85); text-transform: uppercase;
}
.cover .day-num { font-family: "Anton", sans-serif; font-size: 30px; color: #fff; line-height: 1; margin-top: 2px; }

.board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.daycard {
  background: var(--surface); border: 1px solid transparent;
  border-radius: 0; padding: 12px; cursor: pointer;
  display: flex; flex-direction: column; gap: 10px;
  transition: background 0.12s, transform 0.12s;
}
.daycard:hover { background: var(--surface-hover); border-color: var(--red); transform: translateY(-2px); }

/* Fight Schedule / calendar day states. */
.daycard.passed { opacity: 0.5; filter: grayscale(0.7); }
.daycard.today-current { border-color: var(--red); animation: glow-red 1.8s ease-in-out infinite; }
.daycard.upcoming { border-color: var(--red-2); }
.daycard.special { border-color: #f0c419; animation: glow-yellow 1.8s ease-in-out infinite; }
@keyframes glow-red {
  0%, 100% { box-shadow: 0 0 4px 0 rgba(224, 9, 28, 0.35); }
  50% { box-shadow: 0 0 16px 3px rgba(224, 9, 28, 0.85); }
}
@keyframes glow-yellow {
  0%, 100% { box-shadow: 0 0 4px 0 rgba(240, 196, 25, 0.35); }
  50% { box-shadow: 0 0 16px 3px rgba(240, 196, 25, 0.85); }
}
.daycard { position: relative; }
.daycard-link { display: flex; flex-direction: column; gap: 10px; color: inherit; text-decoration: none; }
.special-toggle {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text-faint);
  width: 24px; height: 24px; padding: 0; cursor: pointer; font-size: 13px; line-height: 1; border-radius: 0;
}
.special-toggle:hover { border-color: #f0c419; color: #f0c419; }
.special-toggle.on { color: #f0c419; border-color: #f0c419; }
.cal-cell.today-current .special-toggle,
.daycard.today-current .special-toggle { color: #fff; }

/* ------------------------------------------------------ month calendar */
/* Comparison's full-month view. Reuses the passed/today-current/upcoming
   language from the Fight Schedule day cards above, applied to a real
   Sun-Sat grid instead of a flat list. */
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.cal-head h2 { font-family: "Anton", sans-serif; font-size: 22px; text-transform: uppercase; }
.cal-nav { display: flex; gap: 6px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.cal-dow {
  background: var(--surface-2); padding: 8px 4px; text-align: center;
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint);
}
.cal-cell {
  background: var(--surface); min-height: 84px; padding: 8px; position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 4px;
}
.cal-cell.empty { background: var(--black); }
.cal-cell .cal-daynum { font-size: 12px; color: var(--text-faint); font-weight: 700; }
.cal-cell.has-event { cursor: pointer; }
.cal-cell.has-event .cal-daynum { color: var(--text); }
.cal-cell.passed { opacity: 0.5; filter: grayscale(0.7); }
.cal-cell.today-current { border: 1px solid var(--red); animation: glow-red 1.8s ease-in-out infinite; }
.cal-cell.upcoming-event { border: 1px solid var(--red-2); }
.cal-cell .cal-count { font-size: 10px; color: var(--red-2); font-weight: 700; text-align: center; }
.cal-cell:hover.has-event { background: var(--surface-hover); }

/* -------------------------------------------------------- bout vs-row */
.boutrow {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  padding: 16px; border-bottom: 1px solid var(--line); cursor: pointer;
}
.boutrow:last-child { border-bottom: none; }
.boutrow:hover { background: var(--surface-hover); }
.boutrow .side { display: flex; align-items: center; gap: 11px; min-width: 0; }
.boutrow .side.red { justify-content: flex-end; text-align: right; flex-direction: row-reverse; }
.boutrow .side.blue { justify-content: flex-start; text-align: left; }
.boutrow .vs {
  display: flex; flex-direction: column; align-items: center; gap: 2px; flex: none; min-width: 90px;
}
.boutrow .vs .num { font-family: "Anton", sans-serif; font-size: 13px; color: var(--text-faint); }
.boutrow .vs .wt { font-size: 11px; font-weight: 700; color: var(--red-2); text-align: center; }
.boutrow .vs .wt .alt { color: var(--text-faint); font-weight: 400; }
@media (max-width: 640px) {
  .boutrow { grid-template-columns: 1fr; gap: 8px; }
  .boutrow .side.red { flex-direction: row; justify-content: flex-start; text-align: left; }
}
.daycard .cover { aspect-ratio: 1; }
.daycard .program { font-size: 12.5px; font-weight: 600; }
.daycard .stat-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.daycard .count { font-size: 11px; color: var(--text-faint); }

.hero { display: flex; gap: 20px; align-items: flex-end; padding: 10px 4px 24px; }
.hero .cover { width: 132px; height: 132px; border-radius: 0; }
.hero .cover .day-num { font-size: 46px; }
.hero .info { min-width: 0; }
.hero .kicker {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--red-2);
}
.hero .info h1 { font-size: 36px; margin-top: 6px; }
.hero .meta { font-size: 12.5px; color: var(--text-soft); margin-top: 8px; }
.hero .meta a { color: var(--text-soft); text-decoration: underline; text-underline-offset: 2px; }
.hero .meta a:hover { color: var(--text); }

/* ==================================================== master platform home */
/* The platform's own landing page (NOT the fighter/event .hero above) --
   modeled directly on the original Rajadamnern ranking handoff's own hero
   (eyebrow / big Anton headline with a slow gradient sheen / tagline / stat
   grid), per the rajadamnern-design-system skill's "gradient hero" pattern. */

.platform-hero {
  position: relative; overflow: hidden;
  margin: -22px -28px 30px; padding: 56px 28px 40px;
  background: var(--grad-hero); border-bottom: 1px solid var(--line);
}
.platform-hero::before {
  content: ""; position: absolute; inset: 0; background: var(--grad-glow); pointer-events: none;
}
.platform-hero-inner { max-width: 900px; margin: 0 auto; position: relative; z-index: 1; }
.platform-hero .eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85); margin: 0 0 14px;
}
.platform-hero h1 {
  font-family: "Anton", sans-serif; text-transform: uppercase;
  font-size: clamp(34px, 6vw, 64px); line-height: 0.98; margin: 0 0 14px;
  background: var(--grad-text); background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  animation: sheen 7s linear infinite;
}
@keyframes sheen { 0% { background-position: 0% center; } 100% { background-position: 200% center; } }
.platform-hero .tagline { font-size: 15px; color: rgba(255, 255, 255, 0.82); max-width: 520px; line-height: 1.5; margin: 0 0 28px; }
@media (max-width: 900px) {
  .platform-hero { margin: -16px -16px 24px; padding: 44px 16px 32px; }
}

.modulegrid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1px; background: var(--line); border: 1px solid var(--line); margin-top: 4px;
}
.modulecard {
  background: var(--surface); padding: 20px; cursor: pointer; position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 8px; transition: background 0.16s ease;
}
.modulecard::before {
  content: ""; position: absolute; inset: 0; background: var(--grad-card); opacity: 0;
  transition: opacity 0.25s; pointer-events: none;
}
.modulecard:hover { background: var(--surface-hover); }
.modulecard:hover::before { opacity: 1; }
.modulecard .mc-ic { font-size: 22px; position: relative; }
.modulecard .mc-name {
  font-family: "Anton", sans-serif; font-size: 18px; text-transform: uppercase;
  letter-spacing: 0.01em; position: relative;
}
.modulecard .mc-desc { font-size: 12px; color: var(--text-soft); position: relative; }
.modulecard:hover { border: 1px solid var(--red); margin: -1px; }

/* ============================================================== rankings */
/* Ported as closely as practical from the original Rajadamnern ranking
   handoff's own frontend/styles.css + app.js -- same class names, same
   layout, same interaction model (month picker -> division grid -> division
   modal with compare -> fighter modal with rank-trend sparkline). */

.monthpicker-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin: 0 0 12px; }
.monthpicker-head h2 { font-family: "Anton", sans-serif; font-size: 22px; text-transform: uppercase; }
.monthpicker-head .current { color: var(--red-2); }
.yearlabel { font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); font-weight: 700; margin: 10px 0 6px; }
.monthrow { display: flex; gap: 0; overflow-x: auto; border: 1px solid var(--line); margin-bottom: 14px; scrollbar-width: thin; }
.monthrow::-webkit-scrollbar { height: 5px; }
.monthrow::-webkit-scrollbar-thumb { background: var(--line); }
button.monthpill {
  flex: 0 0 auto; font-size: 12.5px; font-weight: 600; padding: 9px 13px;
  border: none; border-right: 1px solid var(--line);
  background: transparent; color: var(--text-faint); cursor: pointer; white-space: nowrap; transition: 0.15s;
}
button.monthpill:last-child { border-right: none; }
button.monthpill:hover { background: var(--surface); color: var(--text); }
button.monthpill[aria-current="true"] { background: var(--grad-line); color: var(--black); font-weight: 700; }

.divgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-bottom: 30px; }
.divbox { background: var(--surface); border: 1px solid var(--line); padding: 16px 16px 14px; cursor: pointer; position: relative; overflow: hidden; }
.divbox::before { content: ""; position: absolute; inset: 0; background: var(--grad-card); opacity: 0; transition: opacity 0.25s; pointer-events: none; }
.divbox:hover { border-color: var(--red); }
.divbox:hover::before { opacity: 1; }
.divbox .wt { font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--red-2); font-weight: 700; margin-bottom: 2px; }
.divbox .dname { font-size: 14px; font-weight: 700; margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.01em; }
.divbox .champ-lbl { font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); font-weight: 700; margin-bottom: 3px; }
.divbox .champ-name { font-family: "Anton", sans-serif; font-size: 19px; line-height: 1.12; margin-bottom: 2px; color: #fff; }
.divbox .champ-thai { font-size: 11px; color: var(--text-soft); margin-bottom: 12px; }
.divbox .top5 { border-top: 1px solid var(--line); padding-top: 8px; }
.divbox .top5row { display: flex; gap: 8px; font-size: 11.5px; padding: 2px 0; color: var(--text-soft); }
.divbox .top5row b { color: var(--text-faint); font-weight: 700; width: 14px; flex: 0 0 auto; }
.divbox .viewmore { font-size: 10.5px; color: var(--red-2); margin-top: 10px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }

.modal.wide { max-width: 880px; }
.modal.medium { max-width: 640px; }

.specband { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); border: 1px solid var(--line); margin-bottom: 16px; }
.spec { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 13px 15px; }
.spec:last-child { border-right: none; }
.spec .k { font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700; color: var(--red-2); margin-bottom: 6px; }
.spec .name-en { font-size: 14px; font-weight: 600; cursor: pointer; }
.spec .name-en:hover { color: var(--red-2); text-decoration: underline; }
.spec .name-th { font-size: 11.5px; color: var(--text-soft); margin-top: 2px; }

.modal-toolbar { display: flex; justify-content: flex-end; margin-bottom: 10px; }
.btn-compare {
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: #fff;
  background: var(--grad-line); border: none; padding: 9px 14px; cursor: pointer;
}
.btn-compare:hover { filter: brightness(1.1); }
.btn-compare.active { background: var(--surface); color: var(--red-2); border: 1px solid var(--red); }

.compare-cols { display: grid; grid-template-columns: 1fr; gap: 0; }
.compare-cols.split { grid-template-columns: 1fr 1fr; }
.compare-cols .col { border: 1px solid var(--line); border-left: none; }
.compare-cols .col:first-child { border-left: 1px solid var(--line); }
.compare-cols .col-head {
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 700; color: var(--text-soft);
  padding: 9px 14px; border-bottom: 1px solid var(--line); background: var(--surface);
}
@media (max-width: 640px) {
  .compare-cols.split { grid-template-columns: 1fr; }
  .compare-cols.split .col { border-left: 1px solid var(--line); }
}

.rankrow { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; padding: 9px 14px; border-bottom: 1px solid var(--line); }
.rankrow:last-child { border-bottom: none; }
.rankrow .num { font-family: "Anton", sans-serif; font-size: 16px; color: var(--text-faint); }
.rankrow .nm { cursor: pointer; min-width: 0; }
.rankrow .nm .en { font-size: 13.5px; font-weight: 600; }
.rankrow .nm:hover .en { color: var(--red-2); text-decoration: underline; }
.rankrow .delta { font-size: 11px; font-weight: 700; white-space: nowrap; }
.delta.up { color: var(--up); }
.delta.down { color: var(--down); }
.delta.new { color: var(--red-2); }
.delta.flat { color: var(--text-faint); }

.fighter-back {
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; color: var(--text-soft);
  background: none; border: none; cursor: pointer; display: flex; align-items: center; gap: 6px; margin-bottom: 14px;
}
.fighter-back:hover { color: var(--red-2); }
.fighter-history { border: 1px solid var(--line); }
.fighter-history .hrow { display: grid; grid-template-columns: 120px 1fr 70px; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.fighter-history .hrow:last-child { border-bottom: none; }
.fighter-history .hrow.current { background: var(--red-soft); }
.fighter-history .hrow .m { color: var(--text-soft); }
.fighter-history .hrow .d { font-weight: 600; }
.fighter-history .hrow .p { text-align: right; font-family: "Anton", sans-serif; color: var(--red-2); }
.sparkwrap { border: 1px solid var(--line); padding: 16px; margin-bottom: 16px; background: var(--surface); }
.sparkwrap .lbl { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); font-weight: 700; margin-bottom: 10px; }

.avatar {
  border-radius: 0; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-family: "Anton", sans-serif;
  font-size: 12px; color: #fff;
  width: 32px; height: 32px;
}
.avatar.lg { width: 112px; height: 112px; font-size: 36px; border-radius: 0; }
.avatar.sm { width: 26px; height: 26px; font-size: 10px; }

/* ================================================================ tracklist */

.tracklist { display: flex; flex-direction: column; }
.row {
  display: grid; gap: 14px; align-items: center;
  padding: 9px 10px; border-radius: 0;
  border-left: 3px solid transparent;
}
.row.head {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--text-faint); padding-bottom: 9px;
  border-bottom: 1px solid var(--border-soft); margin-bottom: 4px;
  border-left-color: transparent;
}
.row.item:hover { background: var(--surface); }
.row.clash { border-left-color: var(--down); background: var(--down-soft); }
.row.clash:hover { background: rgba(255, 95, 109, 0.24); }
.row .ord { color: var(--text-faint); font-size: 12px; }

/* Corner marker. One row per fighter in running order, so odd positions are
   the red corner and even the blue -- rows 1+2 are bout 1, 3+4 are bout 2.
   Red corner uses the brand red directly (a genuine, not coincidental, fit
   for this identity); blue corner is the one deliberate second hue this
   system keeps, because a fight has two corners in real life. */
.ord.corner-red, .ord.corner-blue {
  display: inline-block; width: 28px; text-align: center;
  padding: 3px 0; border-radius: 0; font-weight: 700; font-size: 11.5px;
}
.ord.corner-red { background: var(--red-soft); color: var(--red-2); box-shadow: inset 0 0 0 1px rgba(224, 9, 28, 0.4); }
.ord.corner-blue { background: var(--blue-soft); color: var(--blue); box-shadow: inset 0 0 0 1px rgba(74, 158, 255, 0.35); }
.corner-key {
  display: inline-flex; align-items: center; gap: 6px;
  margin-left: auto; font-size: 11px; color: var(--text-faint);
}

/* Column templates. Every flexible column is minmax(0,…) — a bare 1fr refuses
   to shrink below its content, which squeezes the song column to nothing on a
   laptop. Columns are dropped progressively in the media queries below. */
.row { gap: 12px; }
.tracklist.card-rows .row { grid-template-columns: 34px minmax(0, 1.3fr) 130px minmax(0, 1.6fr) 106px 100px; }
.tracklist.card-rows.is-admin .row { grid-template-columns: 34px minmax(0, 1.3fr) 130px minmax(0, 1.6fr) 106px 100px 128px; }
.tracklist.fighter-rows .row { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 150px 92px 66px; }
.tracklist.song-rows .row { grid-template-columns: 44px minmax(0, 1fr) 118px 64px 96px; }
.tracklist.history-rows .row { grid-template-columns: 138px minmax(0, 1.6fr) minmax(0, 1fr) 96px; }
/* For lists living inside a narrow side panel, where a viewport media query
   can't tell the column is short. Secondary detail goes inline instead. */
.tracklist.compact-rows .row { grid-template-columns: 118px minmax(0, 1fr); }
.tracklist.import-rows .row { grid-template-columns: 44px minmax(0, 1fr) minmax(0, 1.1fr) minmax(0, 1.3fr); }

/* ---------------------------------------------------------- CSV import */

.dropzone {
  display: block; border: 1.5px dashed var(--border); border-radius: 0;
  padding: 22px 14px; text-align: center; color: var(--text-soft);
  font-size: 12.5px; cursor: pointer; background: var(--surface-2);
  transition: border-color 0.12s, color 0.12s, background 0.12s;
}
.dropzone:hover, .dropzone.over { border-color: var(--red); color: var(--text); background: var(--red-soft); }
.dropzone strong { font-weight: 700; }

.panel textarea {
  min-height: 116px; resize: vertical;
  font-family: "IBM Plex Mono", monospace; font-size: 11.5px;
}

/* Corner colour on the avatar in the import preview, where the grid has no
   numbered badge to carry it. */
.avatar.corner-ring-red { box-shadow: 0 0 0 2px var(--red); }
.avatar.corner-ring-blue { box-shadow: 0 0 0 2px var(--blue); }

details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "▸ "; color: var(--text-faint); }
details[open] > summary::before { content: "▾ "; }

/* .match.check was "needs a human look" in the CSV import preview, not a
   corner and not success/danger -- an attention cue via the brighter brand
   red instead of a fourth hue. */
.match.ok { background: var(--green-soft); color: var(--green); }
.match.check { background: var(--panel-2); color: var(--red-2); border: 1px solid var(--red-2); }
.match.new { background: var(--amber-soft); color: var(--amber); }

.fighter { display: flex; align-items: center; gap: 11px; min-width: 0; }
.fighter .fd { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.fighter .name {
  font-weight: 600; font-size: 13.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.row.item:hover .fighter .name { color: var(--red-2); }
.fighter .alt {
  font-size: 11px; color: var(--text-faint);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.songcell { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.songcell .title {
  font-size: 13px; font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.row.item:hover .songcell .title { color: var(--red-2); }
.songcell .raw {
  font-family: "IBM Plex Mono", monospace; font-size: 10.5px; color: var(--text-faint);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.songcell .used-note { font-size: 10.5px; color: var(--down); font-weight: 600; }

.artsq {
  width: 40px; height: 40px; border-radius: 0; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; box-shadow: inset 0 -14px 16px -10px rgba(0, 0, 0, 0.5); /* legibility gradient */
}

.dim { font-size: 12.5px; color: var(--text-soft); }
.tright { text-align: right; }

/* ==================================================================== chips */

.pill, .chip, .status-chip, .match {
  font-size: 10.5px; font-weight: 700; padding: 3px 9px;
  border-radius: 0; letter-spacing: 0.04em; white-space: nowrap;
  display: inline-block; text-transform: uppercase;
}
.pill.clash, .status-chip.needs_change, .chip.red { background: var(--down-soft); color: var(--down); }
.pill.clear, .status-chip.confirmed, .chip.green { background: var(--green-soft); color: var(--green); }
/* Old .chip.blue / .status-chip.proposed were informational tags ("pool",
   "proposed"), not the literal blue corner -- neutral ink, no extra hue. */
.chip.blue, .status-chip.proposed { background: var(--panel-2); color: var(--text-soft); }
/* These two ARE the literal corner marking (Comparison bout page's "RED
   CORNER"/"BLUE CORNER" labels) -- kept distinct from .chip.red/.chip.blue
   above, which mean danger/neutral respectively, not a corner. */
.chip.corner-red { background: var(--red-soft); color: var(--red-2); }
.chip.corner-blue { background: var(--blue-soft); color: var(--blue); }
.chip.amber { background: var(--amber-soft); color: var(--amber); }
.chip.plain { background: var(--surface-2); color: var(--text-faint); font-weight: 600; }
.tag {
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-faint); background: var(--surface-2); padding: 3px 7px; border-radius: 0;
  display: inline-block; white-space: nowrap;
}

.filterchip {
  border: 1px solid var(--border); background: var(--surface); color: var(--text-soft);
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.03em;
  padding: 6px 13px; border-radius: 0; cursor: pointer; transition: all 0.12s;
}
.filterchip:hover { color: var(--text); border-color: var(--text-faint); }
.filterchip[aria-pressed="true"] { background: var(--grad-line); border-color: var(--red); color: var(--black); }

/* =================================================================== panels */

.panel {
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: 0; padding: 18px; margin-bottom: 16px;
}
.panel > h2 { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.panel > .phint { font-size: 12px; color: var(--text-soft); margin: 0 0 14px; }
.panel.flush { padding: 18px 12px; }

/* Stat tiles rendered as a seamed grid of boxes (design system's "grid of
   spec boxes" -- the 1px gap shows the line color between them). */
.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(164px, 1fr));
  gap: 1px; background: var(--line); border: 1px solid var(--line);
  margin-bottom: 26px;
}
.stat {
  background: var(--surface); border: 1px solid transparent;
  border-radius: 0; padding: 16px 18px;
  display: flex; flex-direction: column; gap: 3px;
  cursor: pointer; transition: background 0.12s, transform 0.12s;
}
.stat:hover { background: var(--surface-hover); border-color: var(--red); }
.stat .n { font-family: "Anton", sans-serif; font-size: 32px; line-height: 1.1; }
.stat .l {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-soft);
}
.stat.red .n { color: var(--down); }
.stat.amber .n { color: var(--amber); }
.stat.green .n { color: var(--green); }

.sectionlabel {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-faint); margin: 0 0 12px;
}

.banner {
  display: flex; align-items: center; gap: 10px;
  border-radius: 0; border: 1px solid transparent;
  padding: 10px 15px; font-size: 12.5px; font-weight: 600;
  margin-bottom: 14px;
}
.banner .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.banner.red { background: var(--down-soft); color: var(--down); border-color: rgba(255, 95, 109, 0.35); }
.banner.green { background: var(--green-soft); color: var(--green); border-color: rgba(95, 217, 122, 0.35); }
.banner.amber { background: var(--amber-soft); color: var(--amber); border-color: rgba(201, 134, 42, 0.35); }
/* Old .banner.blue was informational (guest access notice), not a corner --
   neutral panel treatment. */
.banner.blue { background: var(--panel-2); color: var(--text-soft); border-color: var(--line); }
.banner strong { font-weight: 700; }
.banner code {
  font-family: "IBM Plex Mono", monospace; font-size: 11.5px;
  background: rgba(255, 255, 255, 0.07); padding: 1px 5px; border-radius: 0;
}

/* Spec box, row form: the signature label-above/beside-value pattern,
   applied to the existing dt/dd markup everywhere it's used (fighter
   profile, event stats, account page) with zero HTML changes. */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 0; font-size: 13px; border: 1px solid var(--line); }
.kv dt {
  color: var(--red-2); white-space: nowrap; font-size: 9.5px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 9px 12px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line);
  background: var(--panel-2);
  display: flex; align-items: center;
}
.kv dd { margin: 0; overflow-wrap: anywhere; padding: 9px 12px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.kv dt:last-of-type, .kv dd:last-of-type { border-bottom: none; }

.record { display: flex; gap: 22px; }
.record span { display: flex; flex-direction: column; gap: 2px; }
.record .rn { font-family: "Anton", sans-serif; font-size: 28px; line-height: 1; }
.record small {
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-faint);
}

.empty { padding: 30px 10px; text-align: center; color: var(--text-faint); font-size: 12.5px; }
.spinner { padding: 60px; text-align: center; color: var(--text-faint); font-size: 12.5px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.grid-side { display: grid; grid-template-columns: 296px 1fr; gap: 16px; align-items: start; }

/* ================================================================== buttons */

.btn {
  font-size: 12px; font-weight: 700; border-radius: 0;
  letter-spacing: 0.03em; text-transform: uppercase;
  padding: 9px 17px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  white-space: nowrap; transition: all 0.12s;
}
.btn:hover { border-color: var(--text-soft); }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: var(--red-2); border-color: var(--red-2); }
.btn.danger { border-color: var(--down); color: var(--down); background: none; }
.btn.danger:hover { background: var(--down); color: var(--black); }
.btn.ghost { background: none; border-color: transparent; color: var(--text-soft); }
.btn.ghost:hover { color: var(--text); border-color: var(--border); }
.btn.small { padding: 6px 12px; font-size: 11px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.icon-btn {
  width: 28px; height: 28px; border-radius: 0;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-soft);
  cursor: pointer; font-size: 12px; flex: none; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.12s;
}
.icon-btn:hover { border-color: var(--red-2); color: var(--red-2); }
.icon-btn.danger:hover { border-color: var(--down); color: var(--down); }

/* =================================================================== inputs */

input, select, textarea {
  font-size: 13.5px; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 0; padding: 9px 11px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--red); }
input::placeholder, textarea::placeholder { color: var(--text-faint); }
select { cursor: pointer; }
input[type="checkbox"] { width: auto; accent-color: var(--red); }

.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; align-items: flex-end; }
.filters > div { display: flex; flex-direction: column; gap: 6px; }
.filters label {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-faint);
}
.filters input, .filters select { min-width: 148px; width: auto; border-radius: 0; padding: 8px 14px; }
.filters input.wide { min-width: 250px; }

.pager { display: flex; align-items: center; gap: 14px; margin-top: 18px; font-size: 12px; color: var(--text-soft); }

/* ==================================================== search-picker dropdown */

.picker { position: relative; }
.searchdrop {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 0;
  max-height: 240px; overflow: auto; z-index: 25; padding: 6px;
}
.sr {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 9px; border-radius: 0; cursor: pointer; width: 100%; text-align: left;
  border: none; background: none; color: var(--text);
}
.sr:hover { background: var(--surface-hover); }
.sr .fd { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.sr .name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr .alt { font-size: 10.5px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr .meta { margin-left: auto; font-size: 10.5px; color: var(--text-faint); white-space: nowrap; }
.sr-empty { padding: 14px 10px; font-size: 12.5px; color: var(--text-faint); }

/* "Add this as a new …" — always offered under the matches, because a
   near-miss is exactly when someone needs to create the real one. */
.sr-create {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 10px 9px; margin-top: 4px; padding-top: 11px;
  border: none; border-top: 1px solid var(--border); background: none;
  color: var(--red-2); font-weight: 700; font-size: 12.5px; cursor: pointer;
  border-radius: 0;
}
.sr-create:hover { background: var(--red-soft); }
.sr-create .plus {
  width: 22px; height: 22px; border-radius: 0; flex: none;
  background: var(--red-soft); color: var(--red-2);
  display: flex; align-items: center; justify-content: center; font-size: 14px;
}

/* ==================================================================== modal */

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(6, 5, 5, 0.82);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; z-index: 100;
}
.modal {
  width: 100%; max-width: 440px; max-height: 88vh; overflow: auto;
  background: var(--bg-elev); border: 1px solid var(--red);
  border-radius: 0; padding: 24px;
  display: flex; flex-direction: column; gap: 13px;
}
.modal h2 { font-size: clamp(20px, 4vw, 26px); }
.modal .hint { font-size: 12px; color: var(--text-soft); margin: -8px 0 0; }
.modal label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 11.5px; font-weight: 700; color: var(--text-soft); letter-spacing: 0.02em;
}
.modal label .hint { font-weight: 400; color: var(--text-faint); margin: 0; }
.modal label.inline {
  flex-direction: row; align-items: center; gap: 9px;
  font-size: 13px; font-weight: 500; color: var(--text); text-transform: none;
}
.modal .btn-row { margin-top: 6px; justify-content: flex-end; }

/* Two-part modal anatomy (header band + body) used by the Rankings division/
   fighter modals -- an opt-in on top of the plain .modal used by every other
   dialog in the app (user/song/fighter forms etc, which just put content
   directly in .modal's own flex column). Negative margins bleed modal-head
   to the modal's edges despite the parent's own padding, so the header's
   gradient reaches edge-to-edge like the original design. */
.modal-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  margin: -24px -24px 0; padding: 22px 24px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(224, 9, 28, 0.28), rgba(224, 9, 28, 0) 70%);
}
.modal-head h3 { font-family: "Anton", sans-serif; font-size: clamp(22px, 4vw, 30px); text-transform: uppercase; }
.modal-head .th { font-size: 12.5px; color: var(--text-soft); margin-top: 4px; }
.modal-close {
  background: none; border: 1px solid var(--line); color: var(--text-soft); cursor: pointer;
  width: 32px; height: 32px; flex: 0 0 auto; font-size: 16px; line-height: 1; border-radius: 0; padding: 0;
}
.modal-close:hover { border-color: var(--red); color: #fff; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--surface-2); border: 1px solid var(--border);
  border-left: 3px solid var(--up); color: var(--text);
  padding: 11px 19px; border-radius: 0;
  z-index: 200; font-size: 13px; font-weight: 600; max-width: 90vw;
}
.toast.error { border-left-color: var(--down); }
.form-error { color: var(--down); font-size: 12.5px; font-weight: 600; margin: 0; }

/* =================================================================== tables */
/* Only for the admin screens where a real grid beats a tracklist. */

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th {
  text-align: left; font-size: 10.5px; font-weight: 700; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--red-2);
  padding: 8px 12px; border-bottom: 1px solid var(--border-soft); white-space: nowrap;
}
td { padding: 10px 12px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface-hover); }

/* =================================================================== motion */
/* Small, quick, and never in the way. Everything here is switched off wholesale
   under prefers-reduced-motion at the bottom of this block. */

.tracklist.jobs-rows .row { grid-template-columns: minmax(0, 1fr) 110px 200px 96px; }

/* Scroll-driven: elements fade and lift as they come into view. The class is
   added by JS; [data-revealed] is what actually plays it, so anything already
   on screen at load appears at once. */
.reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.42s cubic-bezier(0.22, 1, 0.36, 1) var(--reveal-delay, 0ms),
              transform 0.42s cubic-bezier(0.22, 1, 0.36, 1) var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
.reveal[data-revealed] { opacity: 1; transform: none; will-change: auto; }

/* How far down the page you are, as a hairline across the top. */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 90;
  background: var(--grad-line);
  transform: scaleX(0); transform-origin: 0 50%;
  pointer-events: none;
}

/* Cover art lifts a little and brightens on hover. */
.daycard { transition: background .16s ease, transform .16s cubic-bezier(.22,1,.36,1), border-color .16s ease; }
.daycard:hover { transform: translateY(-3px); }
.daycard .cover { transition: transform .28s cubic-bezier(.22,1,.36,1); }
.daycard:hover .cover { transform: scale(1.035); box-shadow: inset 0 -40px 40px -20px rgba(0,0,0,.4); }
.daycard:active { transform: translateY(-1px) scale(.995); }

.stat { transition: background .16s ease, transform .16s cubic-bezier(.22,1,.36,1); }
.stat:active { transform: translateY(0) scale(.99); }

/* Row hover: a red edge slides in from the left rather than appearing. */
.row.item { transition: background .13s ease, border-left-color .13s ease; }
.row.item:not(.clash) { border-left-color: transparent; }
.row.item:not(.clash):hover { border-left-color: var(--red); }
.fighter .name, .songcell .title { transition: color .13s ease; }
.avatar { transition: transform .16s cubic-bezier(.22,1,.36,1); }
.row.item:hover .avatar { transform: scale(1.08); }

.btn, .icon-btn, .filterchip, .navitem { transition: all .14s ease; }
.btn:active, .icon-btn:active, .filterchip:active { transform: scale(.96); }
.icon-btn:hover { transform: translateY(-1px); }
.navitem { position: relative; }
.navitem.active::before {
  content: ""; position: absolute; left: 0; top: 50%;
  width: 3px; height: 16px; margin-top: -8px;
  background: var(--red);
  animation: nav-mark .22s cubic-bezier(.22,1,.36,1);
}
@keyframes nav-mark { from { transform: scaleY(0); opacity: 0; } to { transform: scaleY(1); opacity: 1; } }

/* Things that appear: modal, toast, dropdowns. */
.modal-backdrop { animation: fade-in .16s ease; }
.modal { animation: modal-in .24s cubic-bezier(.22,1,.36,1); }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }

.toast { animation: toast-in .26s cubic-bezier(.22,1,.36,1); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 14px); } to { opacity: 1; transform: translate(-50%, 0); } }

.global-results, .searchdrop { animation: drop-in .15s cubic-bezier(.22,1,.36,1); transform-origin: top center; }
@keyframes drop-in { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: none; } }

/* A clash is the one thing worth a deliberate nudge for attention. */
.banner.red .dot { animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(.8); } }

.job-running { animation: pulse 1.6s ease-in-out infinite; }

.spinner::after {
  content: ""; display: inline-block; width: 13px; height: 13px; margin-left: 9px;
  vertical-align: -2px; border: 2px solid var(--border-strong);
  border-top-color: var(--red-2); border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* One switch for all of it. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
  .scroll-progress { display: none; }
}

/* =================================================================== mobile */

/* Shed the least important column first, so the song never gets squeezed. */
@media (max-width: 1280px) {
  .tracklist.card-rows .row { grid-template-columns: 34px minmax(0, 1.3fr) minmax(0, 1.6fr) 106px 100px; }
  .tracklist.card-rows.is-admin .row { grid-template-columns: 34px minmax(0, 1.3fr) minmax(0, 1.6fr) 106px 100px 128px; }
  .tracklist.card-rows .col-camp { display: none; }
  .tracklist.fighter-rows .row { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 92px 66px; }
  .tracklist.fighter-rows .col-class { display: none; }
}
@media (max-width: 1080px) {
  .tracklist.card-rows .row { grid-template-columns: 34px minmax(0, 1.3fr) minmax(0, 1.6fr) 100px; }
  .tracklist.card-rows.is-admin .row { grid-template-columns: 34px minmax(0, 1.3fr) minmax(0, 1.6fr) 100px 128px; }
  .tracklist.card-rows .col-genre { display: none; }
  .tracklist.history-rows .row { grid-template-columns: 124px minmax(0, 1.6fr) minmax(0, 1fr); }
  .tracklist.history-rows .col-status { display: none; }
}

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: 240px; z-index: 70; height: 100dvh;
    transform: translateX(-100%); transition: transform 0.18s ease;
    border-right: 1px solid var(--line);
  }
  .sidebar.open { transform: none; }
  .menu-toggle { display: block; }
  .main, .mainhead { padding-left: 16px; padding-right: 16px; }
  .grid-2, .grid-side { grid-template-columns: 1fr; }
  .hero { gap: 14px; }
  .hero .cover { width: 92px; height: 92px; }
  .hero .cover .day-num { font-size: 30px; }
  .hero .info h1 { font-size: 26px; }
  .avatar.lg { width: 84px; height: 84px; font-size: 28px; }

  /* Tracklists collapse to the columns that still matter on a phone. */
  .tracklist.card-rows .row,
  .tracklist.card-rows.is-admin .row { grid-template-columns: 26px 1fr 1.2fr; }
  .tracklist.card-rows .col-camp,
  .tracklist.card-rows .col-genre,
  .tracklist.card-rows .col-status,
  .tracklist.card-rows .col-actions { display: none; }
  .tracklist.fighter-rows .row { grid-template-columns: 1fr 96px; }
  .tracklist.fighter-rows .col-camp,
  .tracklist.fighter-rows .col-class,
  .tracklist.fighter-rows .col-tier { display: none; }
  .tracklist.song-rows .row { grid-template-columns: 40px 1fr 62px; }
  .tracklist.song-rows .col-genre, .tracklist.song-rows .col-last { display: none; }
  .tracklist.history-rows .row { grid-template-columns: 104px minmax(0, 1fr); }
  .tracklist.history-rows .col-genre, .tracklist.history-rows .col-status { display: none; }
  .tracklist.compact-rows .row { grid-template-columns: 96px minmax(0, 1fr); }
  /* Drop the "matched to" column; the badge moves under the file's own name. */
  .tracklist.import-rows .row { grid-template-columns: 40px minmax(0, 1fr) minmax(0, 1.2fr); }
  .tracklist.import-rows .row > *:nth-child(3) { display: none; }
  .corner-key { display: none; }
}

@media (max-width: 560px) {
  .topline h1 { font-size: 24px; }
  .board-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .filters input, .filters select, .filters input.wide { min-width: 0; width: 100%; }
  .filters > div { flex: 1 1 100%; }
}

/* RWS design-system refinements: near-black surfaces, generous overlay space,
   and the same red calendar state across schedule and comparison. */
:root { --panel: #0f0d0d; --grad-box: linear-gradient(152deg,#e0091c 0%,#8e0613 32%,#2a0408 66%,#0a0a0a 100%); }
body { background-color: var(--black); background-image:
  repeating-linear-gradient(115deg,rgba(239,233,220,.022) 0 1px,transparent 1px 5px),
  radial-gradient(circle at 16% 0%,rgba(92,4,13,.28),transparent 48%),
  radial-gradient(circle at 88% 70%,rgba(62,3,9,.18),transparent 45%); background-attachment:fixed; }
.login-screen { min-height: 100dvh; padding: clamp(18px,4vw,56px); }
.login-card { max-width: 540px; padding: clamp(30px,5vw,54px); gap: 20px; }
.login-card h1 { font-size: clamp(30px,5vw,48px); }
.login-card #password-login-row { display:flex; flex-direction:column; gap:14px; }
.login-card #google-login-row .btn { display:flex; width:100%; justify-content:center; }
.modal-backdrop { padding: clamp(8px,2vw,24px); }
.modal { width:min(94vw,760px); max-width:760px; max-height:calc(100dvh - 32px); min-height:min(460px,calc(100dvh - 32px)); padding:clamp(18px,3vw,34px); overflow-y:auto; overscroll-behavior:contain; }
.modal form { display:flex; flex-direction:column; gap:14px; min-height:0; }
.modal .picker, .modal input, .modal select { max-width:100%; }
.modal .searchdrop { max-height:min(38dvh,320px); overflow-y:auto; }
.tracklist.card-rows .row.item.bout-tone-1 { background:#191717; }
.tracklist.card-rows .row.item.bout-tone-0 { background:#0a0a0a; }
.tracklist.card-rows .row.item:hover { box-shadow:inset 3px 0 0 var(--red); }
.tracklist.card-rows .row.item[draggable] .ord { cursor:grab; touch-action:none; }
.tracklist.card-rows .row.item.dragging { opacity:.42; }
.fighter-photo-large { width:clamp(150px,20vw,230px); height:clamp(170px,25vw,270px); object-fit:cover; object-position:center top; display:block; border:1px solid var(--line); }
.champ-photo { width:160px; height:190px; max-width:100%; object-fit:cover; object-position:center top; margin:4px 0 14px; border:1px solid var(--line); }
.schedule-feature-grid { display:grid; grid-template-columns:minmax(0,1.5fr) repeat(2,minmax(0,1fr)); gap:1px; background:var(--line); border:1px solid var(--line); margin:18px 0 28px; }
.schedule-feature { background:var(--panel); min-height:170px; padding:clamp(20px,3vw,32px); display:flex; flex-direction:column; justify-content:space-between; gap:12px; }
.schedule-feature.current { background:var(--grad-box); }
.schedule-feature .eyebrow { font-size:10px; text-transform:uppercase; letter-spacing:.18em; color:var(--red-2); font-weight:700; }
.schedule-feature.current .eyebrow { color:var(--cream); }
.schedule-feature strong { font-family:Anton,sans-serif; text-transform:uppercase; font-size:clamp(28px,3vw,42px); font-weight:400; line-height:1.04; }
.schedule-feature.compact strong { font-size:clamp(24px,2.4vw,32px); }
.schedule-feature span:last-child { color:var(--ink-dim); font-size:12px; }
.schedule-feature:hover { outline:1px solid var(--red-2); position:relative; z-index:1; }
.schedule-calendar { margin-top:46px; }
.schedule-month { margin-bottom:44px; }
.schedule-month h2 { font:400 30px Anton,sans-serif; text-transform:uppercase; margin:0 0 14px; }
.schedule-cal-link { font-size:11px; color:var(--cream); text-align:center; margin:auto 0; line-height:1.25; }
.schedule-calendar .cal-cell.today-current,.cal-cell.today-current { background:#3a090e; outline:2px solid var(--red-2); outline-offset:-2px; box-shadow:inset 0 0 28px rgba(224,9,28,.34),0 0 18px rgba(224,9,28,.5); z-index:1; animation:glow-red 1.8s ease-in-out infinite; }
.schedule-calendar .cal-cell.upcoming { border:1px solid var(--red-deep); }
.schedule-calendar .cal-cell.has-event:hover .schedule-cal-link { color:var(--red-2); }
@media (max-width:760px) { .schedule-feature-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } .schedule-feature.current { grid-column:1/-1; } .schedule-feature { min-height:130px; } .cal-cell { min-height:64px; padding:5px 2px; } .schedule-cal-link { font-size:9px; } }
@media (max-width:480px) { .schedule-feature-grid { grid-template-columns:1fr; } .schedule-feature.current { grid-column:auto; } .login-card { max-width:100%; } .fighter-photo-large { width:130px; height:155px; } .modal { width:100%; max-height:calc(100dvh - 16px); min-height:0; } }
.fighter-thumb { object-fit:cover; object-position:center top; display:block; }
.brand-image { display:block; flex:none; background-image:url('/gsv-logo-white.png'); background-repeat:no-repeat; background-position:center; background-size:124% 302%; }
.login-logo { width:min(100%,220px); aspect-ratio:2.59; }
.sidebar-logo { width:112px; height:43px; }
.wordmark { padding:0 0 4px; }
.login-card h1 { font-size:clamp(28px,4vw,38px); }
.login-logo { width:220px; height:85px; max-width:100%; }
