:root {
  --bg: #0e0f12;
  --bg-elev: #16181e;
  --bg-row: #14161c;
  --line: #2a2d36;
  --text: #ececec;
  --muted: #9aa0ab;
  --silver: #c8ccd4;
  --gold: #e0b85a;
  --gold-dim: rgba(224, 184, 90, 0.12);
  --in: #7dcc96;
  --out: #d98989;
  --buy: #dfe3ea;
  --focus: #e0b85a;
  --radius: 10px;
  --max: 920px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  background:
    radial-gradient(ellipse 80% 36% at 50% -8%, #1c1f28 0%, transparent 58%),
    var(--bg);
  color: var(--text);
  line-height: 1.45;
}

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

.banner {
  margin: 0;
  padding: 0.55rem 1rem;
  text-align: center;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: #e8d7a4;
  background: #1a1812;
  border-bottom: 1px solid #3a3424;
}

.top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.15rem 1.25rem 0.85rem;
  border-bottom: 1px solid var(--line);
}

.brand {
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--silver);
  text-decoration: none;
}

.brand:hover {
  color: #fff;
}

.top-product {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.product {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  margin-bottom: 1.35rem;
}

.product-copy {
  min-width: 0;
  flex: 1;
}

.coin {
  flex: 0 0 4.75rem;
  width: 4.75rem;
  height: 4.75rem;
  border-radius: 50%;
  display: grid;
  place-content: center;
  text-align: center;
  background: radial-gradient(circle at 32% 28%, #4a4e59, #1b1d24 58%, #0c0d10);
  border: 2px solid #8d929c;
  box-shadow:
    inset 0 0 0 5px #262930,
    0 10px 28px rgba(0, 0, 0, 0.45);
  color: var(--silver);
}

.coin span {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.coin small {
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.product-copy h1 {
  margin: 0 0 0.2rem;
  font-size: clamp(1.45rem, 3vw, 1.85rem);
  font-weight: 650;
  letter-spacing: -0.02em;
}

.lede {
  margin: 0 0 0.65rem;
  color: var(--muted);
  font-size: 0.95rem;
  overflow-wrap: break-word;
}

.spot {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
}

.spot strong {
  margin-left: 0.35rem;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-size: 1.05rem;
}

.delayed {
  margin-left: 0.35rem;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #7e848f;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  cursor: pointer;
  font-weight: 600;
  user-select: none;
}

.toggle input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.switch {
  position: relative;
  width: 2.5rem;
  height: 1.4rem;
  flex: 0 0 2.5rem;
  background: #2a2e38;
  border: 1px solid #3d424e;
  border-radius: 999px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 50%;
  background: #d7dbe3;
  transition: transform 0.15s ease;
}

.toggle input:checked + .switch {
  background: #3d3418;
  border-color: var(--gold);
}

.toggle input:checked + .switch::after {
  transform: translateX(1.1rem);
  background: var(--gold);
}

.toggle input:focus-visible + .switch {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.rank-note {
  margin: 0;
  flex: 1 1 12rem;
  min-width: 0;
  font-size: 0.82rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.board-wrap {
  overflow-x: auto;
}

.board-wrap,
.board,
#rows,
.row {
  min-width: 0;
  max-width: 100%;
}

.board {
  font-size: 0.92rem;
  background: var(--bg-row);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.board-head,
.row {
  display: grid;
  grid-template-columns:
    2rem minmax(0, 1.3fr) 6.3rem 5.4rem 5.7rem 5.3rem 6.4rem 4.3rem;
  align-items: center;
  column-gap: 0.4rem;
  padding: 0.68rem 0.75rem;
}

.board-head {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  background: #12141a;
}

.row {
  border-top: 1px solid var(--line);
}

.row.best {
  background: var(--gold-dim);
  box-shadow: inset 3px 0 0 var(--gold);
}

.row.oos {
  color: #b4b8c0;
}

.row.oos .dealer {
  color: #b4b8c0;
}

.k {
  display: none;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

.rank {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.best .rank {
  color: var(--gold);
  font-weight: 700;
}

.dealer {
  font-weight: 600;
}

.badge {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.08rem 0.4rem;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  vertical-align: 0.12em;
  color: #1a1508;
  background: var(--gold);
}

.all-in {
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
}

.ship-free {
  color: var(--in);
  font-weight: 600;
}

.stock {
  font-size: 0.8rem;
  font-weight: 600;
}

.stock.in {
  color: var(--in);
}

.stock.out {
  color: var(--out);
}

.buy-cell {
  display: flex;
  justify-content: flex-end;
}

.buy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.6rem;
  min-height: 2.1rem;
  padding: 0.3rem 0.75rem;
  border: 1px solid #5c616c;
  border-radius: 6px;
  color: var(--buy);
  text-decoration: none;
  font-weight: 650;
  font-size: 0.82rem;
}

.buy:hover {
  background: #eceff4;
  color: #12141a;
  border-color: #eceff4;
}

.buy:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.oos .buy {
  border-color: #3a3e48;
  color: #9aa0ab;
}

footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem 2.5rem;
}

footer p {
  margin: 0;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--muted);
}

.noscript {
  margin: 0.75rem 0 0;
  color: var(--out);
}

@media (max-width: 860px) {
  .board-head,
  .row {
    grid-template-columns:
      1.6rem minmax(0, 1.2fr) 5.6rem 4.8rem 5.2rem 4.8rem 5.6rem 3.8rem;
    column-gap: 0.3rem;
    padding: 0.62rem 0.6rem;
    font-size: 0.85rem;
  }
}

@media (max-width: 760px) {
  .top {
    flex-direction: column;
    gap: 0.25rem;
  }

  .controls {
    flex-direction: column;
    align-items: stretch;
  }

  .rank-note {
    flex-basis: auto;
  }

  .board-wrap {
    overflow: visible;
  }

  .board {
    background: transparent;
    border: 0;
    overflow: visible;
  }

  .board-head {
    display: none;
  }

  .row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-items: stretch;
    gap: 0.2rem;
    margin-bottom: 0.7rem;
    padding: 0.8rem 0.95rem 0.95rem;
    background: var(--bg-row);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    text-align: left;
    overflow: visible;
  }

  .row.best {
    box-shadow: inset 3px 0 0 var(--gold);
  }

  .num {
    text-align: left;
  }

  .kv {
    display: block;
    width: auto;
    max-width: 100%;
    padding: 0.22rem 0;
  }

  .k {
    display: inline-block;
    min-width: 6.75rem;
    margin-right: 0.5rem;
    color: var(--muted);
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .val {
    display: inline;
    color: var(--text);
    font-size: 0.95rem;
    font-variant-numeric: tabular-nums;
  }

  .rank {
    font-size: 0.75rem;
  }

  .dealer-cell {
    font-size: 1.05rem;
    padding-bottom: 0.35rem;
  }

  .buy-cell {
    display: block;
    padding-top: 0.5rem;
  }

  .buy {
    width: 100%;
    min-height: 2.6rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .switch,
  .switch::after {
    transition: none;
  }
}
