/* Snackbar — cartridge-shelf design system */
:root {
  --paper: #EEF1F7;
  --paper-2: #E2E7F2;
  --card: #FFFFFF;
  --ink: #15131F;
  --ink-2: #4A4860;
  --ink-3: #7C7A93;
  --cobalt: #3346FF;
  --cobalt-dark: #2230C9;
  --lemon: #FFD23F;
  --gum: #FF5DA2;
  --mint: #22C79A;
  --tomato: #FF5A36;
  --line: 2.5px;
  --shadow: 4px 4px 0 var(--ink);
  --shadow-lg: 7px 7px 0 var(--ink);
  --r-sm: 8px;
  --r: 14px;
  --r-lg: 22px;
  --font: "Bricolage Grotesque", ui-rounded, system-ui, sans-serif;
  --wrap: 1240px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #171628; --paper-2: #201F36; --card: #24233C; --ink-2: #C9C7E0; --ink-3: #9593B2;
    --shadow: 4px 4px 0 #05040C; --shadow-lg: 7px 7px 0 #05040C; color-scheme: dark;
  }
  :root:not([data-theme="light"]) body { color: #F1F0FA; }
  :root:not([data-theme="light"]) .cart, :root:not([data-theme="light"]) .panel,
  :root:not([data-theme="light"]) .btn, :root:not([data-theme="light"]) .field input,
  :root:not([data-theme="light"]) .field textarea, :root:not([data-theme="light"]) .field select,
  :root:not([data-theme="light"]) .chip, :root:not([data-theme="light"]) .search input { border-color: #05040C; }
}
:root[data-theme="dark"] {
  --paper: #171628; --paper-2: #201F36; --card: #24233C; --ink-2: #C9C7E0; --ink-3: #9593B2;
  --shadow: 4px 4px 0 #05040C; --shadow-lg: 7px 7px 0 #05040C; color-scheme: dark;
}
:root[data-theme="dark"] body { color: #F1F0FA; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; overflow-x: hidden; background: var(--paper); color: var(--ink);
  font-family: var(--font); font-size: 16px; line-height: 1.5; font-optical-sizing: auto;
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; outline: none; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--lemon); padding: 8px 14px; border: var(--line) solid var(--ink); z-index: 99; }
.skip:focus { left: 8px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

h1, h2, h3 { margin: 0; line-height: 1.05; letter-spacing: -.02em; font-variation-settings: "wdth" 80; }
h1 { font-size: clamp(2.4rem, 5.4vw, 4.6rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 800; }
h3 { font-size: 1.15rem; font-weight: 700; letter-spacing: -.01em; font-variation-settings: "wdth" 90; }
p { margin: 0; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--paper); border-bottom: var(--line) solid var(--ink); }
.topbar .wrap { display: flex; align-items: center; gap: 16px; height: 68px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 1.5rem; letter-spacing: -.03em; font-variation-settings: "wdth" 78; flex-shrink: 0; }
.logo svg { width: 42px; height: 42px; transition: transform .25s; }
.logo:hover svg { transform: rotate(-10deg) scale(1.06); }
.nav { display: flex; gap: 4px; }
.nav a { text-decoration: none; padding: 8px 12px; border-radius: 10px; font-weight: 600; color: var(--ink-2); }
.nav a:hover { background: var(--paper-2); color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--paper-2); }
.search { flex: 1; max-width: 420px; position: relative; margin-left: auto; }
.search input { width: 100%; height: 44px; border: var(--line) solid var(--ink); border-radius: 999px; padding: 0 16px 0 42px; background: var(--card); }
.search svg { position: absolute; left: 14px; top: 12px; width: 20px; height: 20px; color: var(--ink-3); pointer-events: none; }
.me { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.xpchip { display: flex; align-items: center; gap: 8px; text-decoration: none; padding: 4px 12px 4px 4px; border: var(--line) solid var(--ink); border-radius: 999px; background: var(--card); font-weight: 700; }
.xpchip .ring { width: 34px; height: 34px; }
.xpchip small { display: block; font-size: .72rem; color: var(--ink-3); font-weight: 600; line-height: 1; }
.xpchip b { display: block; line-height: 1.1; font-size: .92rem; }
.avatar-btn { width: 44px; height: 44px; border-radius: 50%; border: var(--line) solid var(--ink); background: var(--card); padding: 0; overflow: hidden; cursor: pointer; }
.menu { position: absolute; right: 20px; top: 64px; background: var(--card); border: var(--line) solid var(--ink); border-radius: var(--r); box-shadow: var(--shadow); padding: 6px; min-width: 200px; display: grid; }
.menu a, .menu button { text-align: left; background: none; border: 0; padding: 10px 12px; border-radius: 8px; text-decoration: none; cursor: pointer; font-weight: 600; }
.menu a:hover, .menu button:hover { background: var(--paper-2); }
.burger { display: none; }

/* ---------- buttons ---------- */
.btn {
  --bg: var(--card); --fg: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px;
  border: var(--line) solid var(--ink); border-radius: 12px; background: var(--bg); color: var(--fg);
  font-weight: 700; text-decoration: none; cursor: pointer; box-shadow: 3px 3px 0 var(--ink); white-space: nowrap;
  transition: transform .08s, box-shadow .08s;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn.primary { --bg: var(--cobalt); --fg: #fff; }
.btn.lemon { --bg: var(--lemon); --fg: #15131F; }
.btn.gum { --bg: var(--gum); --fg: #15131F; }
.btn.big { height: 56px; padding: 0 26px; font-size: 1.1rem; border-radius: 16px; }
.btn.ghost { box-shadow: none; background: transparent; }
.btn.ghost:hover { background: var(--paper-2); transform: none; }
.btn.small { height: 36px; padding: 0 12px; font-size: .9rem; border-radius: 10px; }
.btn.liked { --bg: var(--gum); }

/* ---------- cartridges (the signature element) ---------- */
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(208px, 1fr)); gap: 26px 22px; }
.shelf.row { grid-auto-flow: column; grid-auto-columns: clamp(190px, calc((100% - 88px) / 5), 250px); grid-template-columns: none; overflow-x: auto; padding: 4px 8px 14px 4px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.shelf.row > * { scroll-snap-align: start; }
.cart {
  position: relative; display: flex; flex-direction: column; text-decoration: none;
  background: var(--card); border: var(--line) solid var(--ink); border-radius: var(--r) var(--r) 10px 10px;
  box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s; padding: 10px 10px 0;
}
.cart::before { /* the notch on top of a cartridge */
  content: ""; position: absolute; left: 50%; top: -2.5px; width: 34%; height: 9px; transform: translateX(-50%);
  background: var(--paper); border: var(--line) solid var(--ink); border-top: 0; border-radius: 0 0 8px 8px;
}
.cart:hover { transform: translate(-3px, -3px); box-shadow: var(--shadow-lg); }
.cart:active { transform: translate(1px, 1px); box-shadow: 2px 2px 0 var(--ink); }
.cart .label { position: relative; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; border: 2px solid var(--ink); background: var(--paper-2); }
.cart .label img, .cart .label svg { width: 100%; height: 100%; object-fit: cover; }
.cart .tag { position: absolute; left: 8px; top: 8px; background: var(--lemon); color: #15131F; border: 2px solid var(--ink); border-radius: 999px; font-size: .74rem; font-weight: 700; padding: 1px 8px; }
.cart .tag.new { background: var(--mint); }
.cart .meta { padding: 10px 2px 8px; display: grid; gap: 2px; }
.cart .meta h3 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart .by { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--ink-3); font-size: .85rem; }
.cart .by span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart .stats { display: flex; gap: 10px; flex-shrink: 0; }
.cart .stats i { font-style: normal; display: inline-flex; align-items: center; gap: 3px; }
.cart .stats svg { width: 14px; height: 14px; }
.cart .grip { height: 14px; margin: 0 -10px; border-top: 2px solid var(--ink); border-radius: 0 0 8px 8px;
  background: repeating-linear-gradient(90deg, transparent 0 9px, color-mix(in srgb, var(--ink) 22%, transparent) 9px 11px); }
.cart.wide { grid-column: span 2; }

/* ---------- home ---------- */
.hero { padding: 44px 0 36px; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 44px; align-items: center; }
.hero h1 { max-width: 11ch; }
.hero .lede { margin-top: 16px; font-size: 1.18rem; color: var(--ink-2); max-width: 38ch; }
.hero .cta { margin-top: 26px; display: flex; gap: 12px; flex-wrap: wrap; }
.hero .facts { margin-top: 28px; display: flex; gap: 22px; color: var(--ink-2); font-size: .95rem; }
.hero .facts b { color: var(--ink); font-size: 1.25rem; display: block; line-height: 1.1; }
.cabinet { position: relative; }
.cabinet .screen {
  position: relative; display: block; border: var(--line) solid var(--ink); border-radius: var(--r-lg);
  overflow: hidden; box-shadow: var(--shadow-lg); background: var(--ink); aspect-ratio: 16 / 10; text-decoration: none;
}
.cabinet .screen > svg, .cabinet .screen > img { width: 100%; height: 100%; object-fit: cover; }
.cabinet .screen .play-overlay { position: absolute; left: 18px; right: 18px; bottom: 18px; display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; }
.cabinet .screen .title-plate { background: var(--card); color: var(--ink); border: var(--line) solid var(--ink); border-radius: 14px; padding: 10px 16px; box-shadow: 3px 3px 0 var(--ink); }
.cabinet .screen .title-plate h2 { font-size: 1.6rem; }
.cabinet .screen .title-plate p { color: var(--ink-3); font-size: .9rem; }
.cabinet .picks { display: flex; gap: 10px; margin-top: 18px; }
.cabinet .picks button { flex: 1; display: flex; align-items: center; gap: 10px; padding: 6px; border: var(--line) solid var(--ink); background: var(--card); border-radius: 12px; cursor: pointer; text-align: left; font-weight: 700; min-width: 0; }
.cabinet .picks button[aria-pressed="true"] { background: var(--lemon); color: #15131F; box-shadow: 3px 3px 0 var(--ink); }
.cabinet .picks .thumb { width: 52px; height: 40px; border-radius: 6px; overflow: hidden; border: 2px solid var(--ink); flex-shrink: 0; }
.cabinet .picks span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

.cats { display: flex; gap: 10px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px 7px 8px; border: var(--line) solid var(--ink); border-radius: 999px; background: var(--card); text-decoration: none; font-weight: 700; cursor: pointer; }
.chip .dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--ink); }
.chip .dot svg { width: 16px; height: 16px; }
.chip small { color: var(--ink-3); font-weight: 600; }
.chip[aria-pressed="true"], .chip.on { background: var(--ink); color: var(--paper); }
.chip[aria-pressed="true"] small, .chip.on small { color: inherit; opacity: .7; }

.section { padding: 30px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-head p { color: var(--ink-3); margin-top: 4px; }
.section-head a { font-weight: 700; color: var(--cobalt); text-decoration: none; white-space: nowrap; }
.section-head a:hover { text-decoration: underline; }

.maker-band { margin: 34px 0 10px; background: var(--cobalt); color: #fff; border-top: var(--line) solid var(--ink); border-bottom: var(--line) solid var(--ink); }
.maker-band .wrap { display: grid; grid-template-columns: 1fr 1.1fr; gap: 40px; padding-top: 46px; padding-bottom: 46px; align-items: center; }
.maker-band h2 { font-size: clamp(2rem, 3.6vw, 3rem); }
.maker-band p { margin-top: 12px; color: #D9DDFF; max-width: 44ch; font-size: 1.08rem; }
.maker-band .btn { margin-top: 22px; }
.ladder { display: grid; gap: 10px; }
.ladder .rung { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center; background: #fff; color: #15131F; border: var(--line) solid var(--ink); border-radius: 14px; padding: 10px 16px 10px 10px; box-shadow: 3px 3px 0 var(--ink); }
.ladder .rung:nth-child(2) { margin-left: 22px; }
.ladder .rung:nth-child(3) { margin-left: 44px; }
.ladder .rung:nth-child(4) { margin-left: 66px; }
.ladder .lvl { width: 64px; height: 44px; border-radius: 10px; background: var(--lemon); border: 2px solid var(--ink); display: grid; place-items: center; font-weight: 800; font-size: 1.1rem; }
.ladder .xp { font-weight: 800; color: var(--cobalt); }

/* ---------- panels & forms ---------- */
.panel { background: var(--card); border: var(--line) solid var(--ink); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px; }
.field { display: grid; gap: 6px; }
.field label, .field .lab { font-weight: 700; font-size: .95rem; }
.field .hint { color: var(--ink-3); font-size: .85rem; }
.field input, .field textarea, .field select { width: 100%; border: var(--line) solid var(--ink); border-radius: 12px; padding: 10px 14px; background: var(--card); min-height: 46px; }
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--cobalt) 35%, transparent); }
.form-grid { display: grid; gap: 18px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.err { background: #FFE3EC; color: #8A0F3C; border: 2px solid #8A0F3C; border-radius: 10px; padding: 10px 14px; font-weight: 600; }
.ok { background: #D7F7EC; color: #0C5B44; border: 2px solid #0C5B44; border-radius: 10px; padding: 10px 14px; font-weight: 600; }

/* ---------- browse ---------- */
.page-head { padding: 34px 0 20px; }
.page-head p { margin-top: 8px; color: var(--ink-2); max-width: 60ch; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.seg { display: inline-flex; border: var(--line) solid var(--ink); border-radius: 12px; overflow: hidden; background: var(--card); }
.seg button { border: 0; background: none; padding: 8px 14px; font-weight: 700; cursor: pointer; }
.seg button + button { border-left: 2px solid var(--ink); }
.seg button[aria-pressed="true"] { background: var(--lemon); color: #15131F; }
.empty { text-align: center; padding: 50px 20px; display: grid; justify-items: center; gap: 12px; }
.empty svg { width: 140px; }

/* ---------- game page ---------- */
.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 26px; padding: 26px 0 40px; align-items: start; }
.player { position: relative; background: #0C0B14; border: var(--line) solid var(--ink); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-lg); }
.player .stage { position: relative; width: 100%; aspect-ratio: var(--ar, 16 / 9); max-height: calc(100vh - 190px); margin: 0 auto; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #0C0B14; }
.player .poster { position: absolute; inset: 0; display: grid; place-items: center; cursor: pointer; border: 0; padding: 0; background: #0C0B14; }
.player .poster > svg, .player .poster > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: saturate(1.05) brightness(.62); }
.player .poster .go { position: relative; display: grid; justify-items: center; gap: 12px; color: #fff; }
.player .poster .go .disc { width: 96px; height: 96px; border-radius: 50%; background: var(--lemon); border: 3px solid var(--ink); box-shadow: 5px 5px 0 var(--ink); display: grid; place-items: center; transition: transform .15s; }
.player .poster:hover .disc { transform: scale(1.07) rotate(-6deg); }
.player .poster .go .disc svg { width: 40px; height: 40px; color: #15131F; margin-left: 6px; }
.player .poster .go b { font-size: 1.2rem; text-shadow: 0 2px 0 #000; }
.player-bar { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--card); border-top: var(--line) solid var(--ink); }
.player-bar .spacer { flex: 1; }
.player.theatre { border-radius: 0; }
.game-info { margin-top: 24px; display: grid; gap: 14px; }
.game-info .title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.game-info .byline { display: flex; align-items: center; gap: 10px; color: var(--ink-2); margin-top: 8px; flex-wrap: wrap; }
.game-info .byline a { font-weight: 700; text-decoration: none; }
.game-info .byline .av { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--ink); overflow: hidden; }
.game-info .desc { color: var(--ink-2); max-width: 70ch; white-space: pre-line; }
.howto { background: var(--paper-2); border-radius: var(--r); padding: 14px 18px; border: 2px dashed var(--ink-3); }
.howto h3 { margin-bottom: 4px; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tags a { font-size: .85rem; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--paper-2); text-decoration: none; color: var(--ink-2); }
.side { display: grid; gap: 20px; }
.board ol { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.board li { display: grid; grid-template-columns: 28px 30px 1fr auto; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 10px; }
.board li:nth-child(1) { background: color-mix(in srgb, var(--lemon) 45%, transparent); }
.board li .rk { font-weight: 800; text-align: center; }
.board li .av { width: 30px; height: 30px; border-radius: 50%; overflow: hidden; border: 2px solid var(--ink); }
.board li a { text-decoration: none; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board li b { font-variant-numeric: tabular-nums; }
.board .mine { margin-top: 10px; color: var(--ink-2); font-size: .92rem; }

/* ---------- upload ---------- */
.upload-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; padding-bottom: 50px; align-items: start; }
.kinds { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.kind { display: grid; gap: 6px; justify-items: start; text-align: left; padding: 12px; border: var(--line) solid var(--ink); border-radius: 14px; background: var(--card); cursor: pointer; }
.kind svg { width: 30px; height: 30px; }
.kind b { line-height: 1.15; }
.kind small { color: var(--ink-3); line-height: 1.3; font-size: .8rem; }
.kind[aria-pressed="true"] { background: var(--lemon); color: #15131F; box-shadow: 3px 3px 0 var(--ink); }
.kind[aria-pressed="true"] small { color: #4A4860; }
.drop { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 30px 20px; border: 2.5px dashed var(--ink-3); border-radius: var(--r); background: var(--paper-2); cursor: pointer; }
.drop.over { border-color: var(--cobalt); background: color-mix(in srgb, var(--cobalt) 12%, var(--paper-2)); }
.drop svg { width: 46px; height: 46px; color: var(--cobalt); }
.drop b { font-size: 1.05rem; }
.drop .file { font-weight: 700; color: var(--cobalt); }
.progress { height: 14px; border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; background: var(--card); }
.progress i { display: block; height: 100%; width: 0; background: var(--cobalt); transition: width .2s; }
.preview-cart { max-width: 260px; }
.reward { display: flex; gap: 12px; align-items: center; background: var(--lemon); color: #15131F; border: var(--line) solid var(--ink); border-radius: 14px; padding: 12px 14px; }
.reward b { font-size: 1.4rem; }
.tips { display: grid; gap: 10px; color: var(--ink-2); font-size: .93rem; }
.tips code { background: var(--paper-2); padding: 1px 6px; border-radius: 6px; font-size: .88em; }

/* ---------- profile ---------- */
.profile-head { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; padding: 36px 0 24px; }
.profile-head .big-av { width: 150px; height: 150px; border-radius: 36px; border: var(--line) solid var(--ink); box-shadow: var(--shadow); overflow: hidden; background: var(--card); }
.profile-head .handle { color: var(--ink-3); font-weight: 600; margin-top: 4px; }
.profile-head .bio { margin-top: 10px; color: var(--ink-2); max-width: 60ch; }
.levelbar { margin-top: 16px; display: grid; gap: 6px; max-width: 520px; }
.levelbar .track { height: 18px; border: var(--line) solid var(--ink); border-radius: 999px; background: var(--card); overflow: hidden; }
.levelbar .fill { height: 100%; background: linear-gradient(90deg, var(--lemon), #FFB800); border-right: 2px solid var(--ink); }
.levelbar .row { display: flex; justify-content: space-between; font-size: .9rem; color: var(--ink-2); }
.levelbar .row b { color: var(--ink); }
.statgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 28px; }
.stat { background: var(--card); border: var(--line) solid var(--ink); border-radius: 14px; padding: 12px 14px; }
.stat b { display: block; font-size: 1.6rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { color: var(--ink-3); font-size: .88rem; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.badge { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 14px 10px; border: var(--line) solid var(--ink); border-radius: 16px; background: var(--card); }
.badge .medal { width: 64px; height: 64px; }
.badge b { line-height: 1.15; }
.badge small { color: var(--ink-3); font-size: .8rem; line-height: 1.3; }
.badge.locked { border-style: dashed; border-color: var(--ink-3); background: transparent; }
.badge.locked .medal { filter: grayscale(1); opacity: .35; }
.activity { list-style: none; padding: 0; margin: 0; display: grid; }
.activity li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1.5px solid var(--paper-2); }
.activity li b { color: var(--cobalt); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tabs { display: flex; gap: 6px; border-bottom: var(--line) solid var(--ink); margin-bottom: 22px; }
.tabs button { border: var(--line) solid transparent; border-bottom: 0; background: none; padding: 10px 16px; font-weight: 700; cursor: pointer; border-radius: 12px 12px 0 0; margin-bottom: -2.5px; color: var(--ink-2); }
.tabs button[aria-selected="true"] { background: var(--card); border-color: var(--ink); color: var(--ink); }
.av-builder { display: grid; grid-template-columns: 150px 1fr; gap: 20px; align-items: start; }
.av-builder .opts { display: grid; gap: 10px; }
.av-builder .opt-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.av-builder .opt-row > span { width: 64px; font-weight: 700; font-size: .9rem; }
.av-builder .opt-row button { width: 36px; height: 36px; border-radius: 10px; border: 2px solid var(--ink); background: var(--card); cursor: pointer; padding: 3px; }
.av-builder .opt-row button[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--cobalt); }

/* ---------- leaderboard ---------- */
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 16px; align-items: end; margin-bottom: 26px; }
.podium .place { display: grid; justify-items: center; gap: 6px; text-align: center; text-decoration: none; }
.podium .place .av { width: 84px; height: 84px; border-radius: 24px; border: var(--line) solid var(--ink); overflow: hidden; background: var(--card); }
.podium .place:nth-child(2) .av { width: 104px; height: 104px; }
.podium .block { width: 100%; border: var(--line) solid var(--ink); border-radius: 14px 14px 0 0; display: grid; place-items: center; font-size: 2.2rem; font-weight: 800; box-shadow: var(--shadow); }
.podium .place:nth-child(1) .block { height: 90px; background: #C9D3E8; color: #15131F; }
.podium .place:nth-child(2) .block { height: 130px; background: var(--lemon); color: #15131F; }
.podium .place:nth-child(3) .block { height: 70px; background: #F2B98C; color: #15131F; }
.ranklist { list-style: none; margin: 0; padding: 0; }
.ranklist li { display: grid; grid-template-columns: 44px 40px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border-bottom: 1.5px solid var(--paper-2); }
.ranklist .rk { font-weight: 800; color: var(--ink-3); text-align: center; }
.ranklist .av { width: 40px; height: 40px; border-radius: 12px; border: 2px solid var(--ink); overflow: hidden; }
.ranklist a { text-decoration: none; font-weight: 700; }
.ranklist small { display: block; color: var(--ink-3); font-weight: 500; }
.ranklist b { font-variant-numeric: tabular-nums; }
.lb-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; padding-bottom: 50px; align-items: start; }
.rules { display: grid; gap: 0; }
.rules div { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1.5px solid var(--paper-2); }
.rules div b { color: var(--cobalt); white-space: nowrap; }
.rules small { display: block; color: var(--ink-3); font-size: .8rem; }

/* ---------- auth ---------- */
.auth { max-width: 460px; margin: 40px auto 60px; }
.auth h1 { font-size: 2.6rem; margin-bottom: 6px; }
.auth .switch { margin-top: 16px; color: var(--ink-2); }
.auth .switch a { color: var(--cobalt); font-weight: 700; }

/* ---------- toasts / modal ---------- */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 60; display: grid; gap: 10px; justify-items: end; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; background: var(--card); border: var(--line) solid var(--ink); border-radius: 14px; box-shadow: var(--shadow); padding: 10px 16px 10px 10px; max-width: 360px; animation: toast-in .25s cubic-bezier(.2, 1.4, .5, 1); }
.toast .pip { min-width: 52px; height: 36px; padding: 0 8px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; background: var(--lemon); color: #15131F; border: 2px solid var(--ink); }
.toast .pip.badge-pip { background: var(--gum); }
.toast.error .pip { background: var(--tomato); }
.toast.out { animation: toast-out .2s forwards; }
@keyframes toast-in { from { transform: translateY(16px) scale(.9); opacity: 0; } }
@keyframes toast-out { to { transform: translateX(30px); opacity: 0; } }
.modal-back { position: fixed; inset: 0; z-index: 70; background: rgba(21, 19, 31, .55); display: grid; place-items: center; padding: 20px; }
.modal { position: relative; background: var(--card); border: var(--line) solid var(--ink); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 30px; max-width: 420px; width: 100%; text-align: center; display: grid; gap: 12px; justify-items: center; }
.levelup .big { font-size: 5.5rem; font-weight: 800; line-height: 1; font-variation-settings: "wdth" 75; color: var(--cobalt); }
.levelup .medal { width: 120px; height: 120px; animation: pop .6s cubic-bezier(.2, 1.6, .5, 1); }
@keyframes pop { from { transform: scale(.2) rotate(-30deg); } }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 80; }

/* ---------- footer ---------- */
main:has(> .maker-band:last-child) + .foot { margin-top: 0; border-top: 0; }
.maker-band:last-child { margin-bottom: 0; }
.foot { border-top: var(--line) solid var(--ink); margin-top: 30px; padding: 26px 0; color: var(--ink-2); font-size: .92rem; }
.foot .wrap { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: center; }
.foot nav { display: flex; gap: 18px; }
.foot a { text-decoration: none; font-weight: 600; }
.foot a:hover { color: var(--cobalt); }
.theme-toggle { background: none; border: 2px solid var(--ink-3); border-radius: 999px; padding: 4px 12px; cursor: pointer; font-weight: 600; color: var(--ink-2); }

.loading { padding: 80px 0; display: grid; place-items: center; }
.loading svg { width: 70px; animation: bob 1s ease-in-out infinite alternate; }
@keyframes bob { to { transform: translateY(-10px) rotate(6deg); } }
.skeleton { background: var(--paper-2); border-radius: var(--r); min-height: 200px; }

/* ---------- responsive ---------- */
@media (max-width: 1020px) {
  .hero .wrap, .maker-band .wrap { grid-template-columns: minmax(0, 1fr); }
  .game-layout, .upload-layout, .lb-layout { grid-template-columns: minmax(0, 1fr); }
  .kinds { grid-template-columns: repeat(3, 1fr); }
  .statgrid { grid-template-columns: repeat(3, 1fr); }
  .nav { display: none; }
}
@media (max-width: 680px) {
  .topbar .wrap { height: auto; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; gap: 10px; }
  .search { order: 3; max-width: none; flex-basis: 100%; }
  .xpchip small, .xpchip b { display: none; }
  .xpchip { padding: 2px; }
  .me { margin-left: auto; }
  .me .btn.upload-btn span { display: none; }
  .me .btn.upload-btn { padding: 0 12px; }
  .shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 14px; }
  .cart .stats { display: none; }
  .kinds { grid-template-columns: repeat(2, 1fr); }
  .two { grid-template-columns: minmax(0, 1fr); }
  .cabinet .picks .thumb { display: none; }
  .cabinet .picks button { padding: 8px 10px; }
  .statgrid { grid-template-columns: repeat(2, 1fr); }
  .profile-head { grid-template-columns: 1fr; }
  .profile-head .big-av { width: 110px; height: 110px; }
  .av-builder { grid-template-columns: 1fr; }
  .ladder .rung:nth-child(n) { margin-left: 0; }
  .cabinet .screen .title-plate h2 { font-size: 1.2rem; }
  .cabinet .screen .play-overlay .btn span { display: none; }
  .hero .facts { gap: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- fixes ---------- */
main:focus, main:focus-visible { outline: none; }
.reward b { white-space: nowrap; }
.field input[type="file"] { padding: 7px 10px; }
.field input[type="file"]::file-selector-button {
  font: inherit; font-weight: 700; margin-right: 12px; padding: 6px 14px; cursor: pointer;
  border: 2px solid var(--ink); border-radius: 9px; background: var(--lemon); color: #15131F;
}
@media (max-width: 680px) {
  #theatre { display: none; }
  .player-bar { gap: 6px; padding: 8px; }
  .player-bar .btn.small { padding: 0 10px; }
}

/* Server-rendered first paint (what search engines and link previews read). The app replaces it on load. */
.ssr { padding: 48px 20px 64px; max-width: 860px; }
.ssr h1 { font-size: clamp(2rem, 4vw, 3.2rem); margin-bottom: .4em; }
.ssr h2 { font-size: 1.3rem; margin: 1.6em 0 .5em; }
.ssr p, .ssr li span { color: var(--ink-2); }
.ssr p { margin-bottom: .7em; }
.ssr-list, .ssr-cats { padding-left: 1.2em; display: grid; gap: 6px; }
.ssr-cats { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 16px; }
.ssr a { font-weight: 700; }
.ssr-crumbs { font-size: .9rem; color: var(--ink-3); margin-bottom: 10px; }
