/* ============================================================
   Seedatabase — visual system

   Built entirely from the original Balatro assets shipped in
   assets/balatro/: the felt table, m6x11plus type, the joker
   atlas (150 cards), tag and suit sprites, booster packs and
   the UI sounds.

   Three rules hold the design together:
     1. The seed code is the loudest thing on any screen.
     2. Joker art carries the colour; chrome stays quiet.
     3. Gold means a sponsor. Nothing else is ever gold.
   ============================================================ */

@font-face {
  font-family: 'm6x11plus';
  src: url('balatro/m6x11plus.ttf') format('truetype');
  font-display: swap;
}

:root {
  /* table — bright Balatro felt */
  --felt-hi: #4d9670;
  --felt: #367355;
  --felt-lo: #234e3a;

  /* surfaces */
  --panel: #2b3a3f;
  --panel-2: #212d31;
  --panel-3: #3a4c52;
  --line: rgba(255, 255, 255, 0.13);
  --line-strong: rgba(255, 255, 255, 0.24);

  /* text */
  --text: #f6f5ee;
  --on-felt: #eef3ef;
  --muted: #b6c9c2;
  --faint: #90a69e;

  --btn-edge: #1a262c;
  --header-bg: rgba(26, 58, 43, 0.86);

  /* accents (from the game's own palette) */
  --red: #fe5f55;
  --red-edge: #a93a33;
  --blue: #0092ff;
  --blue-edge: #00589c;
  --good: #4bc292;
  --good-edge: #2b7a5a;
  --money: #f3b958;

  /* sponsors only */
  --gold: #eac058;
  --gold-line: rgba(234, 192, 88, 0.42);
  --gold-soft: rgba(234, 192, 88, 0.09);

  /* editions */
  --ed-foil: #9fd6ff;
  --ed-holo: #d49bff;
  --ed-poly-a: #ff8fa3;
  --ed-poly-b: #7fd7c4;

  --pix: 'm6x11plus', 'Courier New', monospace;

  --r: 14px;
  --r-sm: 9px;
  --maxw: 1180px;
  --header-h: 62px;

  --lift: 0 5px 0 rgba(0, 0, 0, 0.26);
  --lift-sm: 0 3px 0 rgba(0, 0, 0, 0.22);
  --ink: 0 2px 0 rgba(0, 0, 0, 0.32);
  --ink-lg: 0 4px 0 rgba(0, 0, 0, 0.38);
}

/* ---------- base ---------- */

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

html, body { margin: 0; padding: 0; }
html { background: var(--felt-lo); color-scheme: dark; }

body {
  font-family: var(--pix);
  font-size: 18px;
  line-height: 1.4;
  color: var(--text);
  background:
    radial-gradient(1200px 620px at 50% -180px, var(--felt-hi), transparent 70%),
    radial-gradient(1700px 1200px at 50% 45%, var(--felt), var(--felt-lo) 92%);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* Hidden scrollbars; wheel, trackpad and keyboard scrolling all still work. */
html, body, * { scrollbar-width: none; -ms-overflow-style: none; }
*::-webkit-scrollbar { display: none; width: 0; height: 0; }

/* every pixel asset stays crisp at any scale */
img, .spr, .spr-pack, .brand-logo, .hero-logo, .jk-atlas-card {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
img, svg { vertical-align: middle; }

a { color: #86c8ff; text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.12; margin: 0 0 0.4em; font-weight: 400; }
p { margin: 0.4em 0; }

button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

input, select {
  font: inherit;
  color: var(--text);
  background: var(--panel-2);
  border: 2px solid transparent;
  border-radius: var(--r-sm);
  padding: 7px 11px;
  outline: none;
  min-width: 0;
  box-shadow: inset 0 3px 0 rgba(0, 0, 0, 0.26);
  transition: border-color 0.12s;
}
input::placeholder { color: var(--faint); }
input:hover, select:hover { border-color: var(--line); }
input:focus, select:focus { border-color: var(--blue); }
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
::selection { background: rgba(0, 146, 255, 0.35); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--blue);
  color: #fff;
  padding: 9px 16px;
  border-radius: 0 0 10px 0;
  text-shadow: var(--ink);
}
.skip-link:focus { left: 0; }

/* ---------- sprites ---------- */

.spr { display: inline-block; background-repeat: no-repeat; flex: none; }

/* tags.png — 6 x 5 grid */
.spr-tag {
  width: 30px;
  height: 30px;
  background-image: url('balatro/tags.png');
  background-size: 600% 500%;
}
.tag-buy  { background-position: 80% 0%; }
.tag-cash { background-position: 40% 25%; }
.tag-skip { background-position: 0% 75%; }
.tag-hand { background-position: 20% 75%; }
.tag-roll { background-position: 100% 75%; }
.tag-q    { background-position: 60% 100%; }

/* ui_assets.png — 4 x 2: chip, A, crown, #; heart, diamond, club, spade */
.spr-suit {
  width: 18px;
  height: 18px;
  background-image: url('balatro/ui_assets.png');
  background-size: 400% 200%;
}
.suit-heart   { background-position: 0% 100%; }
.suit-diamond { background-position: 33.3333% 100%; }
.suit-club    { background-position: 66.6667% 100%; }
.suit-spade   { background-position: 100% 100%; }
.suit-chip    { background-position: 0% 0%; }

/* boosters.png — 4 x 9, cell chosen inline */
.spr-pack {
  display: inline-block;
  flex: none;
  width: 62px;
  aspect-ratio: 3 / 4.5;
  background-image: url('balatro/boosters.png');
  background-size: 400% 900%;
  background-repeat: no-repeat;
  filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.28));
}

/* ---------- joker cards ---------- */

.jk { display: inline-flex; flex-direction: column; align-items: center; gap: 6px; margin: 0; }

.jk-art { position: relative; display: inline-block; line-height: 0; }
.jk-art img {
  display: block;
  height: auto;
  border-radius: 6px;
  filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.3));
}
.jk-atlas-card {
  display: block;
  background-image: url('balatro/Jokers.png');
  background-repeat: no-repeat;
  background-size: 1000% 1600%;
  border-radius: 6px;
  filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.3));
}

.jk-thumb .jk-art img { width: 44px; }
.jk-thumb .jk-atlas-card { width: 44px; height: 59px; }
.jk-card .jk-art img { width: 104px; }
.jk-card .jk-atlas-card { width: 104px; height: 140px; }

.jk-name {
  font-size: 14px;
  text-align: center;
  color: var(--muted);
  max-width: 112px;
  line-height: 1.25;
}
.jk-name .ed-tag { display: block; font-style: normal; font-size: 13px; }

/* editions render only when the record says so */
.jk-art.ed-negative img,
.jk-art.ed-negative .jk-atlas-card {
  filter: invert(0.88) hue-rotate(180deg) contrast(1.05) drop-shadow(0 4px 0 rgba(0, 0, 0, 0.38));
}
.jk-art.ed-foil::after,
.jk-art.ed-holo::after,
.jk-art.ed-poly::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 6px;
  pointer-events: none;
  mix-blend-mode: overlay;
}
.jk-art.ed-foil::after { background: linear-gradient(120deg, transparent 20%, rgba(159, 214, 255, 0.85) 50%, transparent 80%); }
.jk-art.ed-holo::after { background: linear-gradient(120deg, rgba(212, 155, 255, 0.5), transparent 45%, rgba(212, 155, 255, 0.6)); }
.jk-art.ed-poly::after { background: linear-gradient(120deg, rgba(255, 143, 163, 0.55), rgba(127, 215, 196, 0.55), rgba(159, 214, 255, 0.55)); }

.jk-art img, .jk-atlas-card { transition: transform 0.14s ease-out; }
.jk:hover .jk-art img,
.jk:hover .jk-atlas-card { transform: translateY(-4px) rotate(-1.5deg); }

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
}

.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--text); padding: 9px 0; }
.brand:hover { text-decoration: none; }
.brand-logo { height: 30px; width: auto; }

.brand-name {
  font-size: 20px;
  letter-spacing: 0.07em;
  text-shadow: var(--ink);
}
.brand-name em { font-style: normal; color: var(--red); }

.global-search { flex: 1 1 200px; display: flex; gap: 8px; max-width: 400px; }
.global-search input { flex: 1; font-size: 16px; letter-spacing: 0.05em; }
.global-search-btn { padding: 7px 15px; font-size: 16px; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  overflow-x: auto;
  white-space: nowrap;
}
.site-nav a {
  position: relative;
  color: var(--muted);
  padding: 8px 11px;
  font-size: 17px;
  border-radius: 8px;
  transition: color 0.12s;
}
.site-nav a:hover { color: var(--text); text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--text); }
/* the active tab is marked by a Balatro-red underline rather than a filled pill */
.site-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 11px;
  right: 11px;
  bottom: 2px;
  height: 3px;
  border-radius: 2px;
  background: var(--red);
}

.sound-toggle {
  margin-left: 8px;
  font-size: 12px;
  color: var(--faint);
  border: 2px solid var(--line);
  border-radius: 7px;
  padding: 3px 8px;
  letter-spacing: 0.08em;
  transition: color 0.12s, border-color 0.12s;
}
.sound-toggle:hover { color: var(--text); border-color: var(--line-strong); }
.sound-toggle[aria-pressed="true"] { color: var(--good); border-color: rgba(75, 194, 146, 0.4); }

/* ---------- layout ---------- */

.view {
  flex: 1;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 30px 24px 72px;
  outline: none;
}

.page-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: 0 0 22px;
}
.page-head h1 {
  font-size: 34px;
  letter-spacing: 0.02em;
  text-shadow: var(--ink-lg);
  margin: 0;
}
.page-head .head-count { color: var(--on-felt); font-size: 16px; }
.page-head .head-count b { color: var(--money); }

.section { margin: 34px 0 0; }
.section:first-child { margin-top: 0; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.section-head h2 {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--on-felt);
  margin: 0;
}
.section-head .section-link { font-size: 15px; color: var(--on-felt); }
.section-head .section-link:hover { color: var(--text); }

/* ---------- panels ---------- */

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--lift);
  padding: 18px;
}
.panel h2 {
  font-size: 14px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 14px;
}
.panel + .panel { margin-top: 16px; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--pix);
  font-size: 17px;
  color: #fff;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
  background: var(--panel-3);
  border-radius: 10px;
  padding: 8px 17px;
  box-shadow: 0 4px 0 var(--btn-edge);
  transition: transform 0.07s, box-shadow 0.07s, filter 0.12s;
}
.btn:hover { filter: brightness(1.13); text-decoration: none; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--btn-edge); }

.btn-red  { background: var(--red);  box-shadow: 0 4px 0 var(--red-edge); }
.btn-red:active  { box-shadow: 0 1px 0 var(--red-edge); }
.btn-blue { background: var(--blue); box-shadow: 0 4px 0 var(--blue-edge); }
.btn-blue:active { box-shadow: 0 1px 0 var(--blue-edge); }
.btn-ghost {
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  border: 2px solid var(--line);
  padding: 6px 14px;
}
.btn-ghost:hover { color: var(--text); border-color: var(--line-strong); filter: none; }
.btn-ghost:active { transform: translateY(2px); box-shadow: none; }

.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.4; pointer-events: none; }

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

.hero { text-align: center; padding: 26px 0 6px; }

.hero-logo {
  width: min(290px, 66vw);
  height: auto;
  filter: drop-shadow(0 8px 0 rgba(0, 0, 0, 0.26));
}

.hero h1 {
  font-size: clamp(26px, 4.2vw, 38px);
  letter-spacing: 0.06em;
  margin: 16px 0 4px;
  text-shadow: var(--ink-lg);
}
.hero h1 em { font-style: normal; color: var(--red); }

.hero-sub {
  color: var(--on-felt);
  font-size: 18px;
  letter-spacing: 0.03em;
  margin: 0 0 22px;
}

.hero-search { display: flex; gap: 10px; max-width: 480px; margin: 0 auto; }
.hero-search input {
  flex: 1;
  font-size: 19px;
  letter-spacing: 0.08em;
  padding: 11px 16px;
  border-radius: 11px;
}
.hero-search .btn { padding: 11px 24px; font-size: 19px; }

/* a fanned hand of real joker cards under the search */
.joker-fan {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  margin: 30px auto 0;
  min-height: 132px;
}
.joker-fan .fan-c { line-height: 0; }
.joker-fan img {
  width: clamp(78px, 10.5vw, 106px);
  height: auto;
  border-radius: 7px;
  filter: drop-shadow(0 6px 0 rgba(0, 0, 0, 0.3));
  transition: transform 0.16s ease-out;
}
.joker-fan .fan-c:nth-child(1) { transform: rotate(-12deg) translate(20px, 12px); }
.joker-fan .fan-c:nth-child(2) { transform: rotate(-4deg) translate(7px, 0); z-index: 2; }
.joker-fan .fan-c:nth-child(3) { transform: rotate(4deg) translate(-7px, 0); z-index: 3; }
.joker-fan .fan-c:nth-child(4) { transform: rotate(12deg) translate(-20px, 12px); }
.joker-fan .fan-c:hover img { transform: translateY(-14px); }

/* ---------- stats strip ---------- */

.stats-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px;
  margin: 34px 0 0;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--lift);
}
.stats-strip:empty { display: none; }
.stat-tile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  background: var(--panel);
}
.stat-txt b {
  display: block;
  font-size: 26px;
  line-height: 1.05;
  color: var(--text);
  text-shadow: var(--ink);
}
.stat-txt span {
  color: var(--faint);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ---------- shelf & grids ---------- */

.shelf {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(290px, 80vw);
  gap: 16px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  scroll-snap-type: x proximity;
}
.shelf > * { scroll-snap-align: start; }

.seed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 16px;
}

/* ---------- seed card ---------- */

.seed-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  transition: transform 0.14s ease-out, border-color 0.14s, box-shadow 0.14s;
}
.seed-card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: 0 9px 0 rgba(0, 0, 0, 0.26);
}

.seed-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.seed-code {
  font-size: 25px;
  letter-spacing: 0.13em;
  color: var(--text);
  text-shadow: var(--ink);
  transition: color 0.12s;
}
.seed-code:hover { color: var(--money); text-decoration: none; }

/* one quiet line of numbers: score, then ante, then verification */
.seed-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  font-size: 15px;
  color: var(--faint);
}
.meta-stat b { color: var(--money); }
.meta-stat { letter-spacing: 0.02em; }

/* the joker row is the card's picture — it gets the room */
.joker-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 7px;
  min-height: 59px;
}

.seed-card-sponsor { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }

.card-note { color: var(--faint); font-size: 15px; }

/* ---------- chips ---------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--panel-2);
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
}
.chip-more { color: var(--faint); align-self: center; }

.chip-verified {
  border-color: transparent;
  color: #fff;
  background: var(--good);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
}
.chip-status { text-transform: capitalize; }
.chip-status.is-live { color: #fff; background: var(--good); border-color: transparent; }

.chip-joker .ed-tag {
  font-style: normal;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.ed-foil { border-color: rgba(159, 214, 255, 0.45); }
.ed-foil .ed-tag, .ed-tag.ed-foil { color: var(--ed-foil); }
.ed-holo { border-color: rgba(212, 155, 255, 0.45); }
.ed-holo .ed-tag, .ed-tag.ed-holo { color: var(--ed-holo); }
.ed-poly { border-color: rgba(255, 143, 163, 0.42); }
.ed-poly .ed-tag, .ed-tag.ed-poly {
  background: linear-gradient(90deg, var(--ed-poly-a), var(--ed-poly-b));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
span.chip.ed-negative { background: #f2f4f2; border-color: #c9cfc9; color: #101418; }
span.chip.ed-negative .ed-tag { color: #101418; }
.ed-tag.ed-negative { color: #f2f4f2; }

/* sponsor attribution — the only gold on the site, and deliberately quiet */
.sponsor-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  color: var(--gold);
  border: 1px solid var(--gold-line);
  background: var(--gold-soft);
  border-radius: 8px;
  padding: 1px 10px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.sponsor-chip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--gold);
  transform: rotate(45deg);
  flex: none;
}
a.sponsor-chip:hover { text-decoration: none; border-color: var(--gold); }

/* ---------- copy button ---------- */

.copy-btn {
  flex: none;
  font-family: var(--pix);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--muted);
  background: var(--panel-2);
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 4px 10px;
  transition: color 0.12s, background-color 0.12s, border-color 0.12s, transform 0.07s;
}
.copy-btn:hover { color: #fff; background: var(--blue); border-color: transparent; }
.copy-btn:active { transform: translateY(2px); }
.copy-btn .copy-face { display: inline-block; transition: transform 0.35s; }
.copy-btn.copied { color: #fff; background: var(--good); border-color: transparent; }
.copy-btn.copied .copy-face { transform: rotateX(360deg); }
.copy-btn.copy-failed { color: #fff; background: var(--red); border-color: transparent; }

.copy-btn.copy-lg { font-size: 14px; padding: 7px 14px; }

/* ---------- seeds page ---------- */

.load-more-wrap { text-align: center; margin: 26px 0 0; }

/* ---------- seed detail ---------- */

.seed-hero { margin-bottom: 20px; padding: 24px; }
.seed-hero-top { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; }

.seed-code-big {
  font-size: clamp(34px, 6vw, 52px);
  letter-spacing: 0.14em;
  line-height: 1;
  text-shadow: var(--ink-lg);
}
.seed-hero-badges { display: inline-flex; flex-wrap: wrap; gap: 8px; }
.seed-hero-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; flex-wrap: wrap; }

/* facts read as a row of numbers, separated by space rather than boxes */
.facts-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 34px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.fact b {
  display: block;
  font-size: 23px;
  line-height: 1.1;
  color: var(--money);
  text-shadow: var(--ink);
}
.fact span {
  color: var(--faint);
  font-size: 12px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.attribution {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  font-size: 15px;
  color: var(--faint);
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 22px;
  align-items: start;
}

.joker-gallery { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }

.spoiler { position: relative; cursor: pointer; border-radius: var(--r-sm); }
.spoiler .spoiler-body { filter: blur(9px); user-select: none; transition: filter 0.25s; }
.spoiler .spoiler-cta {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 15px;
  letter-spacing: 0.06em;
}
.spoiler.revealed { cursor: auto; }
.spoiler.revealed .spoiler-body { filter: none; user-select: auto; }
.spoiler.revealed .spoiler-cta { display: none; }

.raw-record { margin-top: 16px; }
.raw-record summary {
  cursor: pointer;
  color: var(--faint);
  font-size: 13px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  padding: 4px 0;
}
.raw-record summary:hover { color: var(--muted); }
.raw-record pre {
  background: rgba(0, 0, 0, 0.20);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 14px;
  font-family: var(--pix);
  font-size: 13px;
  overflow-x: auto;
  color: var(--muted);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---------- route timeline ---------- */

.timeline { list-style: none; margin: 0; padding: 0; }

.tl-group + .tl-group { margin-top: 22px; }
.tl-ante {
  display: inline-block;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 2px 11px;
  margin-bottom: 10px;
}

.tl-steps { list-style: none; margin: 0; padding: 0 0 0 6px; }
.tl-step {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 7px 8px;
  border-radius: var(--r-sm);
  transition: background-color 0.12s;
}
.tl-step:hover { background: rgba(255, 255, 255, 0.06); }

/* a critical step is flagged by a red rail, not a paragraph of warning */
.tl-step.is-critical { background: rgba(254, 95, 85, 0.12); }
.tl-step.is-critical::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 2px;
  background: var(--red);
}

.tl-ico { flex: none; width: 34px; display: flex; justify-content: center; margin-top: 1px; }

.act-badge {
  font-family: var(--pix);
  font-size: 11px;
  letter-spacing: 0.09em;
  border-radius: 6px;
  padding: 3px 6px;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  background: var(--panel-2);
  min-width: 34px;
  text-align: center;
}
.act-buy  { color: #86c8ff; border-color: rgba(134, 200, 255, 0.35); }
.act-sell { color: #ffb27e; border-color: rgba(255, 178, 126, 0.35); }
.act-skip { color: var(--faint); }
.act-play { color: var(--good); border-color: rgba(75, 194, 146, 0.4); }
.act-pack { color: var(--ed-holo); border-color: rgba(212, 155, 255, 0.35); }
.act-roll { color: #f2e26a; border-color: rgba(242, 226, 106, 0.32); }
.act-use  { color: var(--ed-foil); border-color: rgba(159, 214, 255, 0.35); }

.tl-body { flex: 1; min-width: 0; font-size: 17px; }
.tl-text { display: block; }
.tl-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 2px;
  font-size: 13px;
  color: var(--faint);
}
.tl-note { font-style: italic; }
.tl-blind { letter-spacing: 0.08em; text-transform: uppercase; }
.tl-money { flex: none; font-size: 16px; color: var(--money); margin-top: 3px; }

/* ---------- companion mode ---------- */

body.companion-active .site-header { display: none; }
body.companion-active .view { max-width: none; padding: 0; }

.companion {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 620px at 50% -180px, var(--felt-hi), transparent 70%),
    radial-gradient(1700px 1200px at 50% 45%, var(--felt), var(--felt-lo) 92%);
}

.comp-top { display: flex; align-items: center; gap: 14px; padding: 14px 18px; }
.comp-seed { font-size: 21px; letter-spacing: 0.14em; text-shadow: var(--ink); }
.comp-count { margin-left: auto; font-size: 15px; color: var(--on-felt); letter-spacing: 0.08em; }

.comp-bar {
  height: 6px;
  background: rgba(0, 0, 0, 0.24);
  margin: 0 18px;
  border-radius: 3px;
  overflow: hidden;
}
.comp-bar i { display: block; height: 100%; background: var(--money); transition: width 0.22s; }

.comp-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px clamp(24px, 14vw, 170px);
  gap: 18px;
  position: relative;
}
.comp-context { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.comp-action .spr-tag { width: 52px; height: 52px; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.28)); }
.comp-action .act-badge { font-size: 18px; padding: 6px 14px; min-width: 0; }
.comp-text {
  font-size: clamp(28px, 4.6vw, 44px);
  line-height: 1.22;
  max-width: 22ch;
  text-shadow: var(--ink-lg);
}
.comp-money { font-size: clamp(19px, 2.5vw, 24px); color: var(--money); }
.comp-note { color: var(--on-felt); font-size: clamp(15px, 2vw, 18px); max-width: 46ch; margin: 0; }
.comp-critical {
  color: #fff;
  background: var(--red);
  border-radius: 8px;
  padding: 2px 12px;
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow: 0 3px 0 var(--red-edge);
}
.comp-done { color: var(--good); }

.comp-controls { display: flex; justify-content: center; gap: 12px; padding: 16px; }
.comp-controls .btn { min-width: 140px; font-size: 19px; }

.comp-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 22%;
  display: flex;
  align-items: center;
  color: transparent;
  font-size: 38px;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
  transition: color 0.14s;
}
.comp-zone:hover { color: var(--on-felt); }
.comp-zone-left { left: 0; justify-content: flex-start; padding-left: 18px; }
.comp-zone-right { right: 0; justify-content: flex-end; padding-right: 18px; }

.comp-kbd-hint { text-align: center; color: var(--on-felt); font-size: 12px; padding-bottom: 14px; margin: 0; }
.comp-kbd-hint kbd {
  font-family: var(--pix);
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 6px;
  font-size: 12px;
}

/* ---------- expeditions & sponsors ---------- */

.exp-list, .sponsor-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.exp-card { display: flex; gap: 16px; align-items: flex-start; }
.exp-main { display: flex; flex-direction: column; gap: 8px; min-width: 0; flex: 1; }
.exp-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.exp-name { font-size: 20px; text-shadow: var(--ink); }
.exp-target { color: var(--muted); font-size: 15px; margin: 0; }
.exp-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: 14px;
  color: var(--faint);
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.exp-stats b { color: var(--money); }

.sponsor-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-left: 3px solid var(--gold-line);
}
.sponsor-name { font-size: 20px; color: var(--gold); text-shadow: var(--ink); }
.sponsor-blurb { color: var(--muted); font-size: 15px; margin: 0; }
.sponsor-link { font-size: 14px; }

.sponsor-inline-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 9px 11px;
  color: var(--on-felt);
  font-size: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 34px;
}

/* ---------- leaderboard ---------- */

.lb-table-wrap { overflow-x: auto; padding: 6px; }
.lb-table { width: 100%; border-collapse: collapse; font-size: 17px; }
.lb-table th {
  text-align: left;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 400;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line-strong);
}
.lb-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.lb-table tr:last-child td { border-bottom: none; }
.lb-table tbody tr { transition: background-color 0.12s; }
.lb-table tbody tr:hover td { background: rgba(255, 255, 255, 0.06); }
.lb-rank { color: var(--faint); width: 44px; font-size: 15px; }
/* the top three ranks read as medals without leaving the palette */
.lb-table tr:nth-child(1) .lb-rank { color: var(--money); }
.lb-table .num { text-align: right; color: var(--money); }
.lb-table .seed-code { font-size: 19px; letter-spacing: 0.1em; }

/* ---------- prose (about) ---------- */

.prose { max-width: 60ch; }
.prose p { color: var(--muted); font-size: 17px; margin: 0 0 1em; }
.prose strong { color: var(--text); font-weight: 400; }
.prose .footer-fine { margin-top: 26px; }

/* ---------- states ---------- */

.state-panel {
  border: 1px dashed var(--line-strong);
  border-radius: var(--r);
  padding: 44px 24px;
  text-align: center;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.10);
}
.state-tag { width: 40px; height: 40px; margin-bottom: 12px; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.26)); }
.state-panel h3 { font-size: 20px; color: var(--text); margin: 0 0 6px; text-shadow: var(--ink); }
.state-panel p { font-size: 15px; margin: 0; color: var(--faint); }
.state-panel .btn { margin-top: 18px; }
.state-panel.state-error { border-color: rgba(254, 95, 85, 0.4); }
.state-panel.state-error .state-tag { filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.26)) hue-rotate(140deg); }
.state-panel.state-compact { padding: 24px 18px; }

.skeleton-card { min-height: 132px; display: flex; flex-direction: column; gap: 13px; }
.skeleton-line {
  height: 13px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--panel-2) 25%, var(--panel-3) 50%, var(--panel-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite linear;
}
.skeleton-line.w40 { width: 40%; }
.skeleton-line.w60 { width: 60%; }
.skeleton-line.w80 { width: 80%; }

@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

.footer-fine { color: var(--faint); font-size: 13px; margin: 0; max-width: 46ch; }

.noscript-panel { max-width: 520px; margin: 60px auto; text-align: center; color: var(--muted); }

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

@media (max-width: 980px) {
  .detail-layout { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  body { font-size: 17px; }
  .header-inner { padding: 8px 16px 10px; row-gap: 6px; }
  .brand-logo { height: 26px; }
  .brand-name { font-size: 18px; }
  .global-search { order: 3; flex-basis: 100%; max-width: none; }
  .site-nav { margin-left: auto; }
  .view { padding: 22px 16px 56px; }
  .hero { padding-top: 16px; }
  .hero-search { flex-direction: column; }
  .seed-hero { padding: 18px 16px; }
  .seed-hero-actions { margin-left: 0; width: 100%; }
  .seed-hero-actions .btn { flex: 1; }
  .facts-row { gap: 14px 24px; }
  .comp-controls .btn { min-width: 0; flex: 1; }
  .comp-zone { display: none; } /* full-width buttons advance on touch */
  .exp-card { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .seed-card:hover, .jk:hover .jk-art img, .jk:hover .jk-atlas-card,
  .joker-fan .fan-c:hover img { transform: none; }
}
