/* ==================================================================
   soccer — tier list
   flat, dark, monospace. hairline dividers. no fluff.
   ================================================================== */

:root {
  --bg:        #0b0b0d;
  --panel:     #101012;
  --panel-2:   #131316;
  --line:      #212125;
  --line-soft: #1a1a1e;

  --text:      #e6e6e9;
  --text-dim:  #9a9aa4;
  --text-mute: #5f5f6a;

  --row-h:     40px;
  --head-h:    46px;
  --rail-w:    60px;
  --col-min:   172px;
  --pad-x:     18px;

  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

/* the hidden attribute must beat the layout rules below */
[hidden] { display: none !important; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

::selection { background: #2f3a4d; }

/* ── layout ──────────────────────────────────────────────────── */

.app {
  display: flex;
  height: 100vh;
  height: 100dvh;
}

/* ── left rail ───────────────────────────────────────────────── */

.rail {
  width: var(--rail-w);
  flex: 0 0 var(--rail-w);
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 0 12px;
  gap: 10px;
}

.rail-logo {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  text-decoration: none;
}

.rail-logo-mark {
  width: 26px;
  height: 26px;
  object-fit: contain;
  opacity: .92;
  transition: opacity .12s;
}

.rail-logo:hover .rail-logo-mark { opacity: 1; }

.rail-nav {
  margin-top: auto;
  margin-bottom: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.rail-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: none;
  border: 0;
  border-radius: 6px;
  padding: 0;
  cursor: pointer;
  color: var(--text-mute);
  transition: color .12s, background .12s;
}

.rail-btn:hover { color: var(--text); background: #1b1b20; }
.rail-btn.is-on { color: var(--text); background: #1f1f25; }

.rail-btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
}

.rail-btn svg.fill { fill: currentColor; stroke: none; }

.rail-btn[aria-disabled="true"] { opacity: .35; cursor: default; }
.rail-btn[aria-disabled="true"]:hover { background: none; color: var(--text-mute); }

.rail-sep {
  width: 18px;
  height: 1px;
  background: var(--line);
  margin: 7px 0;
}

.rail-foot {
  font-size: 10px;
  letter-spacing: .08em;
  color: var(--text-mute);
  font-variant-numeric: tabular-nums;
}

/* ── board ───────────────────────────────────────────────────── */

.board {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

/* ── search bar ──────────────────────────────────────────────── */

.searchbar,
.filterbar {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  flex: 0 0 44px;
  padding: 0 var(--pad-x);
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  animation: drop .16s ease;
}

@keyframes drop {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}

.searchbar-icon {
  width: 15px; height: 15px;
  flex: 0 0 15px;
  fill: none; stroke: var(--text-mute);
  stroke-width: 1.8; stroke-linecap: round;
}

#search-input {
  flex: 1 1 auto;
  min-width: 0;
  background: none;
  border: 0;
  outline: 0;
  color: var(--text);
  font-family: var(--mono);
  font-size: 13.5px;
  letter-spacing: .01em;
}

#search-input::placeholder { color: var(--text-mute); }

.searchbar-hint {
  font-size: 11px;
  color: var(--text-mute);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.searchbar-close {
  background: none;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text-mute);
  font-family: var(--mono);
  font-size: 10px;
  padding: 3px 6px;
  cursor: pointer;
}
.searchbar-close:hover { color: var(--text); border-color: #33333a; }

/* ── filter bar ──────────────────────────────────────────────── */

.filterbar-label {
  font-size: 10.5px;
  letter-spacing: .1em;
  color: var(--text-mute);
  text-transform: uppercase;
}

.filterbar-sep {
  width: 1px;
  height: 16px;
  background: var(--line);
  margin: 0 4px;
}

.chips { display: flex; gap: 4px; flex-wrap: wrap; }

.chip {
  background: none;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text-mute);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .04em;
  padding: 4px 8px;
  cursor: pointer;
  transition: color .12s, border-color .12s, background .12s;
  white-space: nowrap;
}

.chip:hover { color: var(--text-dim); border-color: #2c2c33; }

.chip.is-on {
  color: var(--text);
  border-color: #34343d;
  background: #1c1c22;
}

.chip.is-on[data-tier] {
  border-color: color-mix(in srgb, var(--c) 55%, transparent);
  background: color-mix(in srgb, var(--c) 12%, transparent);
  color: var(--c);
}

/* ── columns ─────────────────────────────────────────────────── */

.columns {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: #2a2a31 transparent;
}

.columns::-webkit-scrollbar { height: 9px; }
.columns::-webkit-scrollbar-track { background: var(--panel); }
.columns::-webkit-scrollbar-thumb { background: #2a2a31; border-radius: 0; }
.columns::-webkit-scrollbar-thumb:hover { background: #3a3a44; }

.col {
  flex: 1 1 0;
  min-width: var(--col-min);
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--line);
  background: var(--bg);
}

.col:last-child { border-right: 0; }
.col.is-hidden { display: none; }

/* header */

.col-head {
  height: var(--head-h);
  flex: 0 0 var(--head-h);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 var(--pad-x);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  position: relative;
}

.col-head::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: var(--c);
  opacity: .5;
}

.col-title {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .06em;
  color: var(--text);
}

/* scroll body */

.col-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-top: 8px;
  padding-bottom: 28px;
  scrollbar-width: thin;
  scrollbar-color: #26262c transparent;
}

.col-body::-webkit-scrollbar { width: 7px; }
.col-body::-webkit-scrollbar-track { background: transparent; }
.col-body::-webkit-scrollbar-thumb { background: #26262c; }
.col-body::-webkit-scrollbar-thumb:hover { background: #35353d; }

/* band (high / low group) */

.band {
  border-left: 2px solid var(--c);
  position: relative;
}

.band.low {
  border-left-color: color-mix(in srgb, var(--c) 34%, transparent);
}

.band.high { background: color-mix(in srgb, var(--c) 3.5%, transparent); }

/* the gap is the only thing separating the two shades of rail */
.band + .band { margin-top: 9px; }
.band.is-hidden { display: none; }

/* row */

.row {
  height: var(--row-h);
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 var(--pad-x);
  cursor: pointer;
  border-bottom: 1px solid var(--line-soft);
  transition: background .1s, opacity .12s;
}

/* Opt-in, so a re-render doesn't replay the entrance on every row. Only the
   first paint adds this class; the row drops it again on animationend. */
.row.reveal {
  opacity: 0;
  animation: rowIn .24s ease forwards;
}

@keyframes rowIn { to { opacity: 1; } }

.row:hover { background: #17171b; }
.row:last-child { border-bottom-color: transparent; }

/* !important because a row still mid-reveal has an animated opacity, and an
   animated value outranks a normal declaration. */
.row.is-dim { opacity: .14 !important; }
.row.is-hit { background: color-mix(in srgb, var(--c) 14%, transparent); }
.row.is-hit .row-name { color: #fff; }

.row-head {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 2px;
  background: #1c1c21;
  image-rendering: pixelated;
  object-fit: cover;
}

.row-name {
  font-size: 13.5px;
  letter-spacing: .005em;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* empty band */

.band-empty {
  height: var(--row-h);
  display: flex;
  align-items: center;
  padding: 0 var(--pad-x);
  font-size: 11.5px;
  color: var(--text-mute);
  letter-spacing: .05em;
}

/* ── player card ─────────────────────────────────────────────── */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 4, 6, .74);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 50;
  animation: fade .14s ease;
}

@keyframes fade { from { opacity: 0 } to { opacity: 1 } }

.card {
  position: relative;
  width: min(420px, 100%);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-top: 2px solid var(--c, #ffcf4a);
  border-radius: 5px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .6);
  animation: pop .16s ease;
}

@keyframes pop {
  from { opacity: 0; transform: translateY(8px) scale(.985); }
  to   { opacity: 1; transform: none; }
}

.card-close {
  position: absolute;
  top: 8px; right: 10px;
  background: none;
  border: 0;
  color: var(--text-mute);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  font-family: var(--mono);
}
.card-close:hover { color: var(--text); }

.card-body {
  display: flex;
  gap: 20px;
  padding: 26px 24px 24px;
  align-items: flex-start;
}

.card-skin {
  width: 74px;
  flex: 0 0 74px;
  image-rendering: pixelated;
}

.card-info { min-width: 0; padding-top: 2px; }

.card-rank {
  display: inline-block;
  font-size: 10.5px;
  letter-spacing: .12em;
  padding: 3px 7px;
  border-radius: 3px;
  color: var(--c, #ffcf4a);
  border: 1px solid color-mix(in srgb, var(--c, #ffcf4a) 45%, transparent);
  background: color-mix(in srgb, var(--c, #ffcf4a) 11%, transparent);
  margin-bottom: 11px;
}

.card-name {
  margin: 0 0 8px;
  font-size: 21px;
  font-weight: 500;
  letter-spacing: -.01em;
  word-break: break-all;
}

.card-meta {
  font-size: 11.5px;
  line-height: 1.75;
  color: var(--text-dim);
}

.card-meta i { color: var(--text-mute); font-style: normal; }

.card-links { margin-top: 14px; }

.card-links a {
  font-size: 11px;
  letter-spacing: .05em;
  color: var(--text-mute);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1px;
}

.card-links a:hover { color: var(--text); border-color: #3a3a44; }

/* ── mobile ──────────────────────────────────────────────────── */

@media (max-width: 720px) {
  :root { --rail-w: 48px; --col-min: 180px; --pad-x: 14px; }
  .rail-btn { width: 30px; height: 30px; }
  .card-body { flex-direction: column; align-items: center; text-align: center; }
  .card-info { text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }

  /* .reveal starts at opacity 0 and is meant to be animated up. With the
     animation suppressed above, animationend never fires and the class never
     drops — so this has to beat .row.reveal on specificity or every row stays
     invisible. */
  .row, .row.reveal { opacity: 1 !important; }
}

/* ── load failure banner ─────────────────────────────────────── */

.panic {
  margin: 28px var(--pad-x);
  padding: 18px 20px;
  max-width: 620px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #17110f;
  border: 1px solid #4a2723;
  border-left: 2px solid #ff5f6d;
  border-radius: 4px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-dim);
}

.panic b { color: #ff8f8f; font-weight: 500; letter-spacing: .03em; }
.panic-hint { color: var(--text-mute); }
.panic code { color: var(--text); background: #221a19; padding: 1px 4px; border-radius: 3px; }
