/* Layout: a game table. Swirling felt behind, chunky Balatro UI panels on top, mod cards as the hand. */
:root {
  color-scheme: dark;
  --felt: #1b4a37;
  --felt-deep: #0e271f;
  --panel: #3a4a4f;
  --panel-deep: #263236;
  --panel-edge: #1a2326;
  --ink: #ffffff;
  --ink-dim: #c3d0d2;
  --chips: #009dff;
  --chips-deep: #0068a8;
  --mult: #fe5f55;
  --mult-deep: #b8352d;
  --gold: #f6b93b;
  --gold-deep: #b07d10;
  --green: #35bd86;
  --green-deep: #1f7d57;
  --neg: #4b3a6e;

  --f-display: "Jersey 10", "Silkscreen", ui-monospace, monospace;
  --f-body: "Pixelify Sans", ui-rounded, system-ui, sans-serif;
  --f-label: "Silkscreen", ui-monospace, monospace;

  --r: 10px;
  --shadow: 0 6px 0 var(--panel-edge);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--felt-deep);
  color: var(--ink);
  font: 400 1.0625rem/1.5 var(--f-body);
  padding-inline: 16px;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .35);
}

#swirl {
  position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: -2;
  image-rendering: pixelated;
}
#swirl.fallback { background: radial-gradient(circle at 50% 40%, var(--felt), var(--felt-deep)); }
.crt {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(0,0,0,.14) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.55));
}

a { color: var(--chips); }
a:focus-visible, .btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
img { max-width: 100%; }

/* ---------- buttons ---------- */
.btn {
  --b: var(--chips); --bd: var(--chips-deep);
  display: inline-flex; align-items: center; justify-content: center;
  font: 400 1.5rem/1 var(--f-display);
  letter-spacing: .02em;
  color: var(--ink); text-decoration: none;
  background: var(--b);
  padding: .5em 1.1em .45em;
  border-radius: 8px;
  box-shadow: 0 5px 0 var(--bd);
  transition: transform .08s, box-shadow .08s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 7px 0 var(--bd); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--bd); }
.btn-red { --b: var(--mult); --bd: var(--mult-deep); }
.btn-green { --b: var(--green); --bd: var(--green-deep); }
.btn-blue { --b: var(--chips); --bd: var(--chips-deep); }
.btn-ghost { --b: var(--panel); --bd: var(--panel-edge); }
.btn-sm { font-size: 1.25rem; padding: .4em .8em .35em; }
.btn-off { --b: var(--panel-deep); --bd: var(--panel-edge); color: var(--ink-dim); cursor: default; }
.btn-off:hover, .btn-off:active { transform: none; box-shadow: 0 5px 0 var(--bd); }

/* ---------- top bar ---------- */
.topbar {
  max-width: 1120px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding-block: 20px;
}
.logo { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.logo-card {
  display: grid; place-items: center;
  width: 40px; height: 54px;
  background: var(--ink); color: var(--mult);
  border-radius: 5px; border: 3px solid var(--panel-edge);
  font: 400 2rem/1 var(--f-display); text-shadow: none;
  transform: rotate(-8deg);
  box-shadow: 0 4px 0 var(--panel-edge);
}
.logo-text { font: 400 2rem/1 var(--f-display); letter-spacing: .02em; }
.logo-dot { color: var(--gold); }
.nav { display: flex; align-items: center; gap: 20px; }
.nav a:not(.btn) { color: var(--ink); text-decoration: none; font: 400 1.5rem/1 var(--f-display); }
.nav a:not(.btn):hover { color: var(--gold); }

main { max-width: 1120px; margin: 0 auto; display: grid; gap: 56px; padding-block: 8px 48px; }

/* ---------- hero ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  align-items: center; gap: 32px;
  padding-block: 24px;
}
.eyebrow {
  margin: 0 0 8px;
  font: .85rem/1 var(--f-label); letter-spacing: .08em; text-transform: uppercase;
  color: var(--gold);
}
h1 {
  margin: 0;
  font: 400 clamp(3.2rem, 8vw, 5.8rem)/.88 var(--f-display);
  text-wrap: balance;
  text-shadow: 0 5px 0 rgba(0,0,0,.45);
}
.hl-mult, .hl-chips {
  display: inline-block; padding: 0 .14em; border-radius: 8px;
  box-shadow: 0 5px 0 var(--bd);
}
.hl-mult { background: var(--mult); --bd: var(--mult-deep); transform: rotate(-2deg); }
.hl-chips { background: var(--chips); --bd: var(--chips-deep); transform: rotate(1.5deg); }
.lede { max-width: 46ch; font-size: 1.2rem; color: var(--ink-dim); margin: 24px 0 28px; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }

.hero-fan { position: relative; height: 260px; max-width: 100%; }
.fan-card {
  position: absolute; left: 50%; bottom: 0;
  width: 142px; height: 190px;
  margin-left: -71px;
  background: url(../img/editiondecks-decks.png) calc(var(--x) * 1%) 0 / 500% 100%;
  image-rendering: pixelated;
  transform-origin: 50% 160%;
  transform: rotate(calc((var(--i) - 2) * 11deg));
  filter: drop-shadow(0 6px 0 rgba(0,0,0,.4));
  animation: bob 4s ease-in-out infinite;
  animation-delay: calc(var(--i) * -.6s);
}
@keyframes bob {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -8px; }
}

/* ---------- section heads ---------- */
h2 {
  margin: 0;
  font: 400 clamp(2.4rem, 5vw, 3.2rem)/1 var(--f-display);
  text-wrap: balance;
}
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.count { font: .8rem/1 var(--f-label); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-dim); }

/* ---------- mod cards ---------- */
.mod-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
.mod { display: flex; flex-direction: column;
  background: var(--panel);
  border: 3px solid var(--panel-edge);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .18s ease-out;
  min-width: 0;
}
.mod-art {
  background: var(--panel-deep);
  border-bottom: 3px solid var(--panel-edge);
  height: 210px; position: relative;
  display: flex; align-items: flex-end; justify-content: center;
  overflow: hidden;
}
.mini {
  width: 107px; height: 143px; margin: 0 -14px -12px;
  transform: rotate(calc(var(--r) * 6deg)) translateY(calc(var(--o) * 6px));
  transition: transform .15s;
  filter: drop-shadow(0 5px 0 rgba(0,0,0,.4));
}
.mini:hover { transform: translateY(-14px) scale(1.04); z-index: 1; }
.deck-sprite { width: 100%; height: 100%; image-rendering: pixelated; background-repeat: no-repeat; }

.mod-body { padding: 20px 22px 22px; display: grid; gap: 14px; align-content: start; flex: 1; }
.mod-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.mod-title h3 { margin: 0; font: 400 2.4rem/1 var(--f-display); }
.badge {
  font: .75rem/1 var(--f-label); letter-spacing: .06em; text-transform: uppercase;
  background: var(--badge); padding: 6px 8px 5px; border-radius: 6px; text-shadow: none;
}
.badge-dev { background: var(--gold); color: var(--panel-edge); }
.mod-summary { margin: 0; color: var(--ink-dim); max-width: 60ch; }

.deck-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.deck-list li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px;
  background: var(--panel-deep); border-radius: 6px; padding: 6px 10px 6px 8px;
}
.deck-list li.has-thumb { grid-template-columns: 26px minmax(0, 1fr) auto; }
.deck-list li:not(.has-thumb) { padding-block: 10px; padding-left: 12px; }
.row-thumb { width: 26px; height: 35px; display: block; }
.row-name { font-weight: 600; }
.fx {
  font: 400 1.2rem/1 var(--f-display); padding: 4px 8px 2px; border-radius: 5px;
  white-space: nowrap; text-shadow: none;
}
.fx-chips { background: var(--chips); }
.fx-mult { background: var(--mult); }
.fx-xmult { background: var(--mult); outline: 2px solid var(--ink); outline-offset: -2px; }
.fx-neg { background: var(--neg); }
.fx-gold { background: var(--gold); color: var(--panel-edge); }
.fx-green { background: var(--green); }
.fx-rand { background: linear-gradient(90deg, var(--chips), var(--mult), var(--gold)); }

.mod-note { margin: 0; font-size: .95rem; color: var(--gold); }
.meta { margin: 0; display: flex; gap: 24px; flex-wrap: wrap; }
.meta div { display: grid; gap: 2px; }
.meta dt { font: .7rem/1 var(--f-label); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-dim); }
.meta dd { margin: 0; }
.mod-actions { display: flex; gap: 14px; flex-wrap: wrap; padding-top: 4px; }
.credit { margin: 0; font-size: .85rem; color: var(--ink-dim); }

/* animated icon strip (Chromite) */
.art-anim { align-items: center; }
.anim-icon {
  width: 128px; height: 128px;
  background-size: calc(var(--frames) * 128px) 128px;
  background-repeat: no-repeat;
  image-rendering: pixelated;
  filter: drop-shadow(0 6px 0 rgba(0,0,0,.4));
  animation: strip var(--dur) steps(var(--frames)) infinite, bob 3.2s ease-in-out infinite;
}
@keyframes strip { to { background-position-x: calc(var(--frames) * -128px); } }

/* coming soon strip */
.mod-soon {
  grid-column: 1 / -1;
  flex-direction: row; align-items: center; gap: 28px;
  padding: 22px 28px;
  background: var(--panel-deep);
  border-style: dashed; border-color: rgba(255,255,255,.22);
  box-shadow: none;
}
.soon-backs { display: flex; flex: none; }
.soon-backs span {
  width: 64px; height: 86px; margin-right: -22px;
  display: grid; place-items: center;
  background: var(--neg); border: 3px solid var(--panel-edge); border-radius: 6px;
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.08), 0 4px 0 rgba(0,0,0,.35);
  font: 400 2.6rem/1 var(--f-display); color: var(--gold);
}
.soon-backs span:nth-child(1) { transform: rotate(-10deg); }
.soon-backs span:nth-child(3) { transform: rotate(10deg); }
.soon-copy { min-width: 0; padding-left: 16px; }
.soon-copy h3 { margin: 0 0 4px; font: 400 2.2rem/1 var(--f-display); color: var(--gold); }
.soon-copy p { margin: 0; color: var(--ink-dim); max-width: 60ch; }

/* ---------- about ---------- */
.about {
  background: var(--panel); border: 3px solid var(--panel-edge); border-radius: var(--r);
  box-shadow: var(--shadow); padding: 24px;
}
.about h2 { font-size: 2.6rem; }
.about-intro { display: grid; gap: 12px; margin-bottom: 20px; }
.about-intro p { margin: 0; max-width: 68ch; font-size: 1.1rem; }
.about-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.about-item { background: var(--panel-deep); border-radius: 8px; padding: 16px; display: grid; gap: 6px; align-content: start; }
.about-item h3 { margin: 4px 0 0; font: 400 1.7rem/1 var(--f-display); }
.about-item p { margin: 0; color: var(--ink-dim); font-size: 1rem; }
.tag { justify-self: start; font: 400 1.2rem/1 var(--f-display); padding: 4px 8px 2px; border-radius: 5px; text-shadow: none; }
.tag-gold { background: var(--gold); color: var(--panel-edge); }
.tag-blue { background: var(--chips); }
.tag-red { background: var(--mult); }
.tag-green { background: var(--green); }

/* ---------- future plans ---------- */
.plans { display: grid; gap: 16px; }
.plan-item {
  display: flex; align-items: center; gap: 24px;
  background: rgba(14, 39, 31, .7);
  border: 3px dashed rgba(255,255,255,.22); border-radius: var(--r);
  padding: 20px 24px;
}
.plan-card {
  flex: none; width: 72px; height: 96px;
  display: grid; place-items: center;
  background: var(--ink); border: 3px solid var(--panel-edge); border-radius: 6px;
  transform: rotate(-6deg); box-shadow: 0 4px 0 rgba(0,0,0,.35);
}
.plan-suit { font-size: 2.6rem; color: var(--panel-edge); text-shadow: none; }
.plan-copy { min-width: 0; display: grid; gap: 6px; }
.plan-copy h3 { margin: 4px 0 0; font: 400 1.9rem/1 var(--f-display); }
.plan-copy p { margin: 0; color: var(--ink-dim); max-width: 62ch; }

/* ---------- mod pages ---------- */
.mod-title h3 a { color: inherit; text-decoration: none; }
.mod-title h3 a:hover { color: var(--gold); }
.badge-live { background: var(--green); }

.mod-page { gap: 28px; }
.page-back {
  justify-self: start;
  font: 400 1.5rem/1 var(--f-display); color: var(--ink-dim); text-decoration: none;
}
.page-back:hover { color: var(--gold); }

.mod-hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  background: var(--panel); border: 3px solid var(--panel-edge); border-radius: var(--r);
  box-shadow: var(--shadow); overflow: hidden;
}
.mod-hero-art {
  background: var(--panel-deep); border-right: 3px solid var(--panel-edge);
  display: flex; align-items: flex-end; justify-content: center;
  min-height: 300px; overflow: hidden; padding-inline: 16px;
}
.mod-hero-art.art-anim { align-items: center; }
.mod-hero-art .mini { width: 120px; height: 160px; margin: 0 -18px -14px; }
.anim-icon-lg { width: 192px; height: 192px; background-size: calc(var(--frames) * 192px) 192px; animation-name: strip-lg, bob; }
@keyframes strip-lg { to { background-position-x: calc(var(--frames) * -192px); } }
.mod-hero-info { padding: 28px; display: grid; gap: 16px; align-content: center; min-width: 0; }
.mod-hero-info h1 { font-size: clamp(3rem, 6vw, 4.4rem); line-height: .9; }
.mod-hero-lede { margin: 0; font-size: 1.15rem; color: var(--ink-dim); max-width: 58ch; }

.sheet {
  background: var(--panel); border: 3px solid var(--panel-edge); border-radius: var(--r);
  box-shadow: var(--shadow); padding: 24px;
  display: grid; gap: 14px; align-content: start; min-width: 0;
}
.sheet > p { margin: 0; max-width: 66ch; }
.sheet h2 { font-size: 2.4rem; }
.sheet .panel-head { margin-bottom: 0; }
.sheet-quiet { background: var(--panel-deep); box-shadow: none; }
.sheet-note { color: var(--gold); }
.sheet-small { font-size: .95rem; color: var(--ink-dim); line-height: 1.9; }
.sheet-small .fx { font-size: 1rem; }
.sheet-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: stretch; }
.sheet a { color: var(--ink); }
code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .85em; background: var(--panel-edge); padding: 2px 6px; border-radius: 4px; word-break: break-all; }

.deck-cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.deck-card {
  background: var(--panel-deep); border-radius: 8px; padding: 14px;
  display: grid; gap: 8px; align-content: start; justify-items: start;
  transition: transform .18s ease-out;
}
.deck-big { width: 100%; max-width: 142px; aspect-ratio: 142 / 190; justify-self: center; filter: drop-shadow(0 5px 0 rgba(0,0,0,.4)); }
.deck-card h3 { margin: 4px 0 0; font: 400 1.6rem/1 var(--f-display); }
.deck-card p { margin: 0; font-size: .95rem; color: var(--ink-dim); }

.settings { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.settings li { display: flex; align-items: center; gap: 12px; background: var(--panel-deep); border-radius: 6px; padding: 8px 12px; }
.switch {
  flex: none; width: 52px; text-align: center;
  font: 400 1.2rem/1 var(--f-display); padding: 5px 0 3px; border-radius: 5px;
  background: var(--panel-edge); color: var(--ink-dim); text-shadow: none;
}
.switch-on { background: var(--green); color: var(--ink); }

.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 10px; }
.steps li { counter-increment: step; position: relative; padding-left: 48px; min-height: 34px; padding-top: 4px; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  display: grid; place-items: center; width: 34px; height: 34px;
  background: var(--chips); border-radius: 6px; box-shadow: 0 3px 0 var(--chips-deep);
  font: 400 1.4rem/1 var(--f-display);
}
.path { display: block; font-size: .95rem; color: var(--ink-dim); margin-top: 4px; }

.langs { display: flex; flex-wrap: wrap; gap: 8px; }
.langs span { background: var(--panel); border-radius: 5px; padding: 4px 8px; font-size: .9rem; }

.feat-grid { columns: 2; column-gap: 16px; }
.feat-grid > .feat-group { break-inside: avoid; margin-bottom: 16px; }
.feat-group { background: var(--panel-deep); border-radius: 8px; padding: 16px; display: grid; gap: 10px; min-width: 0; }
.feat-group h3 { margin: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.feat-group h3 .fx { font-size: 1.5rem; }
.feat-count { font: .8rem/1 var(--f-label); color: var(--ink-dim); }
.feat-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.feat-list li { display: grid; gap: 2px; border-top: 2px solid rgba(255,255,255,.07); padding-top: 10px; }
.feat-list li:first-child { border-top: 0; padding-top: 0; }
.feat-name { font-weight: 600; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.feat-list p { margin: 0; font-size: .95rem; color: var(--ink-dim); }
.lobby { font: .65rem/1 var(--f-label); letter-spacing: .05em; text-transform: uppercase; background: var(--mult-deep); padding: 4px 6px 3px; border-radius: 4px; text-shadow: none; }

.compat { margin: 0; display: grid; gap: 8px; }
.compat div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; background: var(--panel-deep); border-radius: 6px; padding: 10px 12px; }
.compat dt { font: 400 1.4rem/1.1 var(--f-display); color: var(--gold); }
.compat dd { margin: 0; font-size: .95rem; color: var(--ink-dim); }

@media (max-width: 1080px) {
  .mod-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mod-soon { grid-column: auto; flex-direction: column; justify-content: center; text-align: center; }
  .soon-copy { padding-left: 0; }
  .soon-copy p { margin-inline: auto; }
}
@media (max-width: 980px) {
  .deck-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bb-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .bb-card, .bb-card:nth-child(n+4) { grid-column: auto; }
  .bb-card:last-child { grid-column: 1 / -1; }
}
@media (max-width: 880px) {
  .mod-hero { grid-template-columns: minmax(0, 1fr); }
  .mod-hero-art { border-right: 0; border-bottom: 3px solid var(--panel-edge); min-height: 220px; }
  .sheet-row { grid-template-columns: minmax(0, 1fr); }
  .feat-grid { columns: 1; }
}
@media (max-width: 520px) {
  .deck-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mod-hero-art .mini { width: 72px; height: 96px; margin: 0 -10px -10px; }
  .anim-icon-lg { width: 128px; height: 128px; background-size: calc(var(--frames) * 128px) 128px; animation-name: strip, bob; }
  .compat div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .bb-grid { grid-template-columns: minmax(0, 1fr); }
  .sky-icon-lg { width: 128px; height: 128px; }
  .sheet, .mod-hero-info { padding: 18px; }
}

/* ---------- Better Background ---------- */
.art-sky {
  align-items: center;
  background:
    linear-gradient(180deg, #2a2357 0%, #4a3a78 55%, #c0605a 100%);
}
.sky-icon {
  position: relative; width: 128px; height: 128px; image-rendering: pixelated;
  filter: drop-shadow(0 6px 0 rgba(0,0,0,.4));
  animation: bob 3.6s ease-in-out infinite;
}
.sky-icon-lg { width: 192px; height: 192px; }
.mod-hero-art.art-sky { position: relative; }

.bb-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.bb-card { grid-column: span 2; background: var(--panel-deep); border-radius: 8px; padding: 16px; display: grid; gap: 8px; align-content: start; justify-items: start; min-width: 0; }
.bb-card:nth-child(n+4) { grid-column: span 3; }
.bb-card h3 { margin: 0; font: 400 1.7rem/1 var(--f-display); }
.bb-card p { margin: 0; font-size: .95rem; color: var(--ink-dim); }
.chips-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chips-row span { background: var(--panel); border-radius: 5px; padding: 3px 8px; font-size: .85rem; color: var(--ink); }

/* ---------- footer ---------- */
.footer {
  max-width: 1120px; margin: 0 auto; padding-block: 24px 40px;
  border-top: 2px dashed rgba(255,255,255,.18);
  font-size: .9rem; color: var(--ink-dim);
}
.footer p { margin: 4px 0; }
.footer-domain a { font: 400 1.8rem/1 var(--f-display); color: var(--gold); text-decoration: none; }
.footer-domain a:hover { text-decoration: underline; }
.footer a { color: var(--ink); }

/* ---------- responsive ---------- */
@media (max-width: 880px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-fan { height: 230px; order: -1; }
  .mod-grid { grid-template-columns: minmax(0, 1fr); }
  .mod-soon { grid-column: 1 / -1; }
  .about-grid { grid-template-columns: minmax(0, 1fr); }
  .mod-soon { flex-direction: column; text-align: center; }
  .soon-copy { padding-left: 0; }
  .soon-copy p { margin-inline: auto; }
}
@media (max-width: 520px) {
  .nav a:not(.btn) { display: none; }
  .fan-card { width: 107px; height: 143px; margin-left: -53px; }
  .mini { width: 72px; height: 96px; margin: 0 -10px -10px; }
  .mod-art { height: 150px; }
  .anim-icon { width: 96px; height: 96px; background-size: calc(var(--frames) * 96px) 96px; animation-name: strip-sm, bob; }
  .plan-item { flex-direction: column; align-items: flex-start; }
  .deck-list li { grid-template-columns: minmax(0, 1fr) auto; }
  .row-thumb { display: none; }
  .deck-list li.has-thumb { grid-template-columns: minmax(0, 1fr) auto; }
}
@keyframes strip-sm { to { background-position-x: calc(var(--frames) * -96px); } }

@media (prefers-reduced-motion: reduce) {
  .fan-card, .anim-icon, .sky-icon { animation: none; }
  .deck-card { transition: none; }
  .mod, .btn, .mini { transition: none; }
}

/* Better Background grid breakpoints (after its base rules) */
@media (max-width: 980px) {
  .bb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bb-card, .bb-card:nth-child(n+4) { grid-column: auto; }
  .bb-card:last-child { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .bb-grid { grid-template-columns: minmax(0, 1fr); }
  .sky-icon-lg { width: 128px; height: 128px; }
}

/* ---------- Better Background preview ---------- */
.btn-orange { --b: var(--gold); --bd: var(--gold-deep); }
.bb-try { gap: 16px; }
.bb-stage {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  border: 3px solid var(--panel-edge); border-radius: 8px; overflow: hidden;
  background: var(--panel-edge);
}
.bb-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#bb-swirl { image-rendering: pixelated; }
#bb-swirl.fallback { background: radial-gradient(circle at 40% 40%, var(--mult), var(--chips) 60%, var(--panel-edge)); }
.bb-opener { position: absolute; left: 50%; bottom: 14%; translate: -50% 0; transition: opacity .25s, transform .08s, box-shadow .08s; }
.bb-opener.is-hidden { opacity: 0; pointer-events: none; }
.bb-window {
  position: absolute; left: 50%; top: 50%; width: min(56%, 380px);
  translate: -50% -50%;
  background: var(--panel); border: 3px solid var(--ink); border-radius: 10px;
  box-shadow: 0 6px 0 var(--panel-edge);
  padding: 14px; display: grid; gap: 8px; text-align: center;
  visibility: hidden; transform: translateY(150%);
  transition: transform .4s cubic-bezier(.3, 0, .8, .4), visibility 0s linear .4s;
}
.bb-window.is-open {
  visibility: visible; transform: none;
  transition: transform .45s cubic-bezier(.2, .9, .3, 1.12), visibility 0s;
}
.fade-mode .bb-window { transform: none; opacity: 0; transition: opacity .25s linear, visibility 0s linear .25s; }
.fade-mode .bb-window.is-open { opacity: 1; transition: opacity .25s linear, visibility 0s; }
.bb-window-title { margin: 0; font: 400 clamp(1.2rem, 3vw, 1.9rem)/1 var(--f-display); }
.bb-window-text { margin: 0; font-size: clamp(.75rem, 1.8vw, .95rem); color: var(--ink-dim); }
.bb-window-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; padding-top: 4px; }

.bb-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.bb-next { font: .75rem/1 var(--f-label); letter-spacing: .05em; text-transform: uppercase; color: var(--ink-dim); }
.bb-controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.bb-group { background: var(--panel-deep); border-radius: 8px; padding: 14px; display: grid; gap: 8px; min-width: 0; }
.bb-group h3 { margin: 0 0 2px; }
.bb-group h3 .fx { font-size: 1.4rem; }
.bb-toggle {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: var(--panel); color: var(--ink); border: 0; border-radius: 6px;
  padding: 7px 10px; font: 600 .95rem/1.2 var(--f-body); text-align: left; cursor: pointer;
  text-shadow: 0 2px 0 rgba(0,0,0,.35);
}
.bb-toggle:hover { background: #45575c; }
.bb-toggle .box {
  flex: none; width: 22px; height: 22px; border-radius: 5px;
  background: var(--panel-edge); box-shadow: inset 0 0 0 2px rgba(255,255,255,.15);
  display: grid; place-items: center;
}
.bb-toggle[aria-pressed="true"] .box { background: var(--green); box-shadow: 0 2px 0 var(--green-deep); }
.bb-toggle[aria-pressed="true"] .box::after { content: ""; width: 10px; height: 5px; border: solid var(--ink); border-width: 0 0 3px 3px; transform: translateY(-2px) rotate(-45deg); }
.bb-cycle { display: grid; gap: 4px; }
.bb-label { font: .7rem/1 var(--f-label); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-dim); }
.cyc { display: grid; grid-template-columns: 36px minmax(0, 1fr) 36px; align-items: stretch; gap: 6px; }
.cyc button {
  border: 0; border-radius: 6px; background: var(--mult); color: var(--ink); cursor: pointer;
  font: 400 1.6rem/1 var(--f-display); box-shadow: 0 3px 0 var(--mult-deep); padding: 0 0 2px;
}
.cyc button:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--mult-deep); }
.cyc output {
  display: grid; place-items: center; background: var(--panel); border-radius: 6px;
  font: 400 1.3rem/1 var(--f-display); padding: 6px 4px 4px; text-align: center;
}
.bb-toggle:focus-visible, .cyc button:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.is-idle { opacity: .6; }
.bb-sub { text-transform: none; letter-spacing: 0; font-family: var(--f-body); }
.bb-hint { margin: 2px 0 0; font-size: .85rem; color: var(--ink-dim); }

@media (max-width: 980px) {
  .bb-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bb-controls .bb-group:last-child { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .bb-controls { grid-template-columns: minmax(0, 1fr); }
  .bb-opener { font-size: 1.1rem; bottom: 10%; }
  .bb-window { width: 78%; padding: 8px; gap: 4px; }
  .bb-window .btn-sm { font-size: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  .bb-window, .bb-window.is-open { transition: visibility 0s; }
}

.notfound { justify-items: start; padding-block: 40px; }
.notfound h1 { font-size: clamp(2.6rem, 6vw, 4rem); line-height: .95; }

/* ---------- FAQ, guide, footer links ---------- */
.faq-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.faq-item { background: var(--panel-deep); border-radius: 8px; padding: 14px 16px; display: grid; gap: 6px; align-content: start; }
.faq-item h3 { margin: 0; font: 400 1.5rem/1.05 var(--f-display); color: var(--gold); }
.faq-item p { margin: 0; font-size: .95rem; color: var(--ink-dim); }
.guide-head { justify-items: start; }
.guide-head h1 { font-size: clamp(2.6rem, 6vw, 4rem); line-height: .95; }
.step-no {
  display: inline-grid; place-items: center; width: 40px; height: 40px; margin-right: 8px; vertical-align: 4px;
  background: var(--chips); border-radius: 6px; box-shadow: 0 3px 0 var(--chips-deep); font-size: 1.8rem;
}
.guide-table { width: 100%; border-collapse: separate; border-spacing: 0 6px; font-size: .95rem; }
.guide-table caption { text-align: left; font: .8rem/1 var(--f-label); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-dim); padding-bottom: 4px; }
.guide-table th, .guide-table td { text-align: left; padding: 10px 12px; background: var(--panel-deep); vertical-align: middle; }
.guide-table thead th { background: none; padding-block: 0; font: 400 1.3rem/1 var(--f-display); color: var(--gold); }
.guide-table tbody th { font: 400 1.4rem/1.1 var(--f-display); border-radius: 6px 0 0 6px; }
.guide-table tbody td:last-child { border-radius: 0 6px 6px 0; color: var(--ink-dim); }
.guide-table .badge { font-size: .7rem; vertical-align: 3px; margin-left: 4px; }
.collection-foot { margin: 20px 0 0; color: var(--ink-dim); }
.collection-foot a { color: var(--ink); }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 10px 0; }
.footer-links a { font: 400 1.3rem/1 var(--f-display); text-decoration: none; }
.footer-links a:hover { color: var(--gold); }
.nav a[aria-current="page"] { color: var(--gold); }
.compat-wide div { grid-template-columns: 210px minmax(0, 1fr); }
@media (max-width: 760px) {
  .faq-list { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .guide-table thead { display: none; }
  .guide-table tr { display: grid; margin-bottom: 8px; background: var(--panel-deep); border-radius: 6px; }
  .guide-table th, .guide-table td { border-radius: 0 !important; padding: 6px 12px; }
  .guide-table tbody td:nth-child(2)::before { content: "Lovely: "; color: var(--ink-dim); }
  .guide-table tbody td:nth-child(3)::before { content: "Steamodded: "; color: var(--ink-dim); }
}
.bb-noscript { position: absolute; inset: auto 16px 16px; margin: 0; background: var(--panel-deep); padding: 10px 12px; border-radius: 6px; }
@media (max-width: 520px) { .compat-wide div { grid-template-columns: minmax(0, 1fr); } }

/* ---------- skip link, top bar menus ---------- */
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  background: var(--gold); color: var(--panel-edge); text-shadow: none;
  padding: 10px 14px; border-radius: 6px; font: 400 1.3rem/1 var(--f-display); text-decoration: none;
}
.skip-link:focus { top: 12px; }
.topbar-right { display: flex; align-items: center; gap: 20px; }
.nav-toggle {
  display: none; cursor: pointer;
  background: var(--panel); color: var(--ink); border: 3px solid var(--panel-edge); border-radius: 6px;
  font: 400 1.3rem/1 var(--f-display); padding: 6px 12px 5px; box-shadow: 0 3px 0 var(--panel-edge);
}
.lang { position: relative; }
.lang summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px;
  font: 400 1.3rem/1 var(--f-display); color: var(--ink);
  background: var(--panel); border: 3px solid var(--panel-edge); border-radius: 6px; padding: 6px 10px 5px;
  box-shadow: 0 3px 0 var(--panel-edge);
}
.lang summary::-webkit-details-marker { display: none; }
.lang summary::after { content: "\25BE"; font-size: .9rem; color: var(--ink-dim); }
.lang summary:focus-visible, .nav-toggle:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.lang ul {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; min-width: 160px;
  margin: 0; padding: 6px; list-style: none;
  background: var(--panel); border: 3px solid var(--panel-edge); border-radius: 8px; box-shadow: var(--shadow);
}
.lang li a { display: block; padding: 8px 10px; border-radius: 5px; color: var(--ink); text-decoration: none; font-family: var(--f-body); }
.lang li a:hover, .lang li a:focus-visible { background: var(--panel-deep); }
.lang li a[aria-current="true"] { color: var(--gold); }
.lang-offer {
  position: fixed; left: 50%; bottom: 16px; translate: -50% 0; z-index: 40;
  width: min(560px, calc(100% - 32px));
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  background: var(--panel); border: 3px solid var(--panel-edge); border-radius: var(--r); box-shadow: var(--shadow);
  padding: 12px 14px;
}
.lang-offer p { margin: 0; flex: 1 1 220px; }
@media (max-width: 600px) {
  .topbar { position: relative; }
  .topbar-right { gap: 10px; }
  .nav-toggle { display: block; }
  .nav { display: none; }
  .nav.is-open {
    display: grid; gap: 4px; position: absolute; right: 0; top: calc(100% - 6px); z-index: 30; min-width: 200px;
    background: var(--panel); border: 3px solid var(--panel-edge); border-radius: 8px; box-shadow: var(--shadow); padding: 8px;
  }
  .nav.is-open a:not(.btn) { display: block; padding: 8px 10px; border-radius: 5px; }
  .nav.is-open a:not(.btn):hover { background: var(--panel-deep); }
}

/* ---------- Korean, Japanese and Chinese ---------- */
:lang(ko) {
  --f-display: "Jersey 10", "Fusion Pixel KR", ui-monospace, monospace;
  --f-body: "Pixelify Sans", "Fusion Pixel KR", system-ui, sans-serif;
  --f-label: "Silkscreen", "Fusion Pixel KR", ui-monospace, monospace;
}
:lang(ja) {
  --f-display: "Jersey 10", "Fusion Pixel JP", ui-monospace, monospace;
  --f-body: "Pixelify Sans", "Fusion Pixel JP", system-ui, sans-serif;
  --f-label: "Silkscreen", "Fusion Pixel JP", ui-monospace, monospace;
}
:lang(zh) {
  --f-display: "Jersey 10", "Fusion Pixel SC", ui-monospace, monospace;
  --f-body: "Pixelify Sans", "Fusion Pixel SC", system-ui, sans-serif;
  --f-label: "Silkscreen", "Fusion Pixel SC", ui-monospace, monospace;
}
:lang(ko) body { word-break: keep-all; overflow-wrap: anywhere; }
:lang(ja) body, :lang(zh) body { line-break: strict; }
:lang(ko) .eyebrow, :lang(ja) .eyebrow, :lang(zh) .eyebrow,
:lang(ko) .count, :lang(ja) .count, :lang(zh) .count { letter-spacing: .02em; }
.lang a[lang], .lang-offer p { font-family: var(--f-body); }
:lang(ko) h1, :lang(ja) h1, :lang(zh) h1 { line-height: 1.18; }
:lang(ko) .hero h1, :lang(ja) .hero h1, :lang(zh) .hero h1 { font-size: clamp(2.4rem, 5.6vw, 4.2rem); }
:lang(ko) .hero .eyebrow, :lang(ja) .hero .eyebrow, :lang(zh) .hero .eyebrow { margin-bottom: 14px; }
:lang(ko) h2, :lang(ja) h2, :lang(zh) h2 { line-height: 1.15; }
