/* Snackbar — cartridge-shelf design system */
/* Brand font, self-hosted (SIL Open Font License, see /fonts/OFL.txt) */
@font-face {
  font-family: "Bricolage Grotesque"; font-style: normal; font-display: swap; font-weight: 200 800; font-stretch: 75% 100%;
  src: url(/fonts/bricolage-latin-ext.woff2) format("woff2-variations"), url(/fonts/bricolage-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: "Bricolage Grotesque"; font-style: normal; font-display: swap; font-weight: 200 800; font-stretch: 75% 100%;
  src: url(/fonts/bricolage-latin.woff2) format("woff2-variations"), url(/fonts/bricolage-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

:root {
  --paper: #EEF1F7;
  --paper-2: #E2E7F2;
  --card: #FFFFFF;
  --ink: #15131F;
  --ink-2: #4A4860;
  --ink-3: #5F5D77;
  /* --ink is the outline/shadow colour; --text is body text. They're the same in light
     mode, but in dark mode text flips to light while outlines stay dark. */
  --text: #15131F;
  --link: #2F3FE6;
  --edge: var(--ink);   /* outline for floating panels (menus, dialogs) */
  --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"]) {
    --edge: #4A4870; --paper: #171628; --paper-2: #24233D; --card: #26253F; --text: #F1F0FA; --ink-2: #CFCDE6; --ink-3: #A9A7C6; --link: #A9B1FF;
    --shadow: 4px 4px 0 #05040C; --shadow-lg: 7px 7px 0 #05040C; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --edge: #4A4870; --paper: #171628; --paper-2: #24233D; --card: #26253F; --text: #F1F0FA; --ink-2: #CFCDE6; --ink-3: #A9A7C6; --link: #A9B1FF;
    --shadow: 4px 4px 0 #05040C; --shadow-lg: 7px 7px 0 #05040C; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; overflow-x: hidden; background: var(--paper); color: var(--text);
  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); color: #15131F; 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(--text); }
.nav a[aria-current="page"] { color: var(--text); 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; position: relative; }
.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: 0; top: calc(100% + 12px); z-index: 30; background: var(--card); color: var(--text); border: var(--line) solid var(--edge); 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, .menu a:focus-visible, .menu button:focus-visible { background: var(--paper-2); }
.menu .menu-head { padding: 10px 12px 8px; border-bottom: 1.5px solid var(--paper-2); margin-bottom: 4px; }
.menu .menu-head b { display: block; }
.menu .menu-head small { color: var(--ink-3); }
.menu hr { border: 0; border-top: 1.5px solid var(--paper-2); margin: 4px 0; }
.burger { display: none; }

/* ---------- buttons ---------- */
.btn {
  --bg: var(--card); --fg: var(--text);
  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(--text); 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(--text); 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(--text); 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(--link); 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: #2F3FE6; }

/* ---------- 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(--link); }
.drop b { font-size: 1.05rem; }
.drop .file { font-weight: 700; color: var(--link); }
.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(--text); }
.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(--link); 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(--text); }
.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(--link); 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(--link); 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(--link); }
.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; flex-wrap: wrap; gap: 8px 18px; }
.foot a { text-decoration: none; font-weight: 600; white-space: nowrap; }
.foot a:hover { color: var(--link); }
.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; }
}
/* ---------- Snack Score (ratings) ---------- */
.bite { color: var(--ink-3); flex-shrink: 0; }
.bite.on { color: var(--ink); }
.avg-bites { display: inline-flex; gap: 2px; vertical-align: middle; }
.rating h3 { margin-bottom: 10px; }
.score-head { display: flex; align-items: center; gap: 14px; }
.score-num { font-size: 2.8rem; font-weight: 800; line-height: 1; letter-spacing: -.03em; font-variation-settings: "wdth" 80; }
.score-head small { display: block; margin-top: 4px; }
.dist { display: grid; gap: 4px; margin: 14px 0 4px; }
.drow { display: grid; grid-template-columns: 14px 1fr 28px; gap: 8px; align-items: center; font-size: .85rem; font-weight: 700; }
.drow .bar { height: 8px; border-radius: 99px; background: var(--paper-2); overflow: hidden; }
.drow .bar i { display: block; height: 100%; background: #F2B45C; border-radius: 99px; }
.drow .num { text-align: right; }
.rate-me { margin-top: 14px; padding-top: 14px; border-top: 1.5px solid var(--paper-2); display: grid; gap: 6px; }
.rate-me .lab { font-weight: 700; }
.bites { display: flex; gap: 4px; }
.bites button { background: none; border: 0; padding: 4px; border-radius: 10px; cursor: pointer; transition: transform .12s; color: var(--ink-3); }
.bites button:hover, .bites button:focus-visible { transform: translateY(-2px) rotate(-8deg); }
.bites button.hot .bite, .bites button.set .bite { color: var(--ink); }
.bites button.hot .bite circle:first-of-type { fill: #F2B45C; }
.bites button[disabled] { cursor: wait; opacity: .7; }
.rate-label { font-size: .9rem; color: var(--ink-2); min-height: 1.4em; font-weight: 600; }
.rate-why { margin-top: 12px; color: var(--ink-2); }
.rate-why a { font-weight: 700; color: var(--link); }
.cart .stats .sscore { color: var(--text); font-weight: 700; }

/* ---------- comments ---------- */
.comments { margin-top: 34px; }
.comments h2 { display: flex; align-items: baseline; gap: 10px; margin-bottom: 16px; }
.comments h2 small { font-size: 1rem; color: var(--ink-3); font-weight: 700; }
.c-form { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; margin-bottom: 20px; }
.c-form .av, .comment .av { width: 44px; height: 44px; border-radius: 14px; border: 2px solid var(--ink); overflow: hidden; background: var(--card); }
.c-form textarea { min-height: 84px; }
.c-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px; font-size: .85rem; }
.c-signin { padding: 14px 16px; background: var(--paper-2); border-radius: var(--r); margin-bottom: 18px; }
.c-signin a { font-weight: 700; color: var(--link); }
.clist { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.comment { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-bottom: 1.5px solid var(--paper-2); }
.cmeta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .9rem; }
.cmeta a { font-weight: 700; text-decoration: none; }
.cmeta .lvl { font-size: .75rem; font-weight: 700; background: var(--paper-2); padding: 1px 7px; border-radius: 99px; color: var(--ink-2); }
.cmeta .crated { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; font-size: .8rem; }
.comment p { margin-top: 4px; white-space: pre-line; overflow-wrap: anywhere; }
.cdel { margin-left: auto; background: none; border: 0; color: var(--ink-3); font-weight: 600; font-size: .8rem; cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.cdel:hover { color: var(--tomato); }
.cdel.armed { color: #fff; background: var(--tomato); }
.c-more { margin-top: 14px; }

/* ---------- Hall of Fame ---------- */
.pill { display: inline-block; padding: 4px 12px; border-radius: 99px; background: var(--lemon); color: #15131F; font-weight: 800; font-size: .85rem; border: 2px solid var(--ink); }
.crown-tag { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); }
.crown-tag .medal { width: 26px; height: 26px; }
.hof { padding-bottom: 60px; display: grid; gap: 30px; }
.race-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.race-list, .race-mini { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.race-list li { display: grid; grid-template-columns: 34px 92px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1.5px solid var(--paper-2); }
.race-list li.pending .rk { color: var(--ink-3); }
.race-list .rk, .race-mini .rk { font-weight: 800; font-size: 1.3rem; text-align: center; }
.race-list li:not(.pending):first-child .rk { color: var(--link); }
.thumb { display: block; border-radius: 10px; overflow: hidden; border: 2px solid var(--ink); aspect-ratio: 4 / 3; }
.thumb svg, .thumb img { width: 100%; height: 100%; object-fit: cover; }
.race-list .who a, .race-mini a:not(.thumb) { font-weight: 800; text-decoration: none; font-size: 1.05rem; }
.race-list small, .race-mini small { display: block; color: var(--ink-3); font-size: .85rem; }
.race-list small a { font-weight: 700; }
.race-list .how { text-align: right; display: grid; justify-items: end; gap: 2px; }
.fine { margin-top: 14px; font-size: .85rem; color: var(--ink-3); max-width: 80ch; }
.past h2 { margin-bottom: 14px; }
.month { margin-bottom: 22px; }
.month h3 { margin-bottom: 10px; }
.podium-row { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 14px; }
.spot { display: grid; grid-template-columns: 40px 86px minmax(0, 1fr); gap: 12px; align-items: center; background: var(--card); border: var(--line) solid var(--ink); border-radius: var(--r); box-shadow: var(--shadow); padding: 12px; }
.spot.p1 { background: color-mix(in srgb, var(--lemon) 22%, var(--card)); }
.spot .medal { width: 40px; height: 40px; }
.spot .place { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--ink); background: var(--paper-2); font-weight: 800; }
.spot .t { display: block; font-weight: 800; text-decoration: none; }
.spot small { display: block; color: var(--ink-3); font-size: .82rem; }
.empty-past { display: flex; gap: 14px; align-items: center; }
.empty-past .medal { width: 56px; height: 56px; flex-shrink: 0; }
.gotm { display: grid; grid-template-columns: 180px minmax(0, 1fr) auto; gap: 20px; align-items: center; }
.gotm h2 a { text-decoration: none; }
.gotm .gotm-cta { display: grid; gap: 8px; justify-items: stretch; }
.race-mini { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.race-mini li { display: grid; grid-template-columns: 28px 84px minmax(0, 1fr); gap: 10px; align-items: center; background: var(--card); border: var(--line) solid var(--ink); border-radius: var(--r); box-shadow: var(--shadow); padding: 10px; }
@media (max-width: 1020px) {
  .podium-row, .race-mini { grid-template-columns: minmax(0, 1fr); }
  .gotm { grid-template-columns: 120px minmax(0, 1fr); }
  .gotm .gotm-cta { grid-column: 1 / -1; grid-auto-flow: column; justify-content: start; }
}
@media (max-width: 680px) {
  .race-list li { grid-template-columns: 26px 64px minmax(0, 1fr); }
  .race-list .how { grid-column: 3; text-align: left; justify-items: start; }
  .spot { grid-template-columns: 34px 70px minmax(0, 1fr); }
  .gotm { grid-template-columns: 90px minmax(0, 1fr); gap: 14px; }
  .gotm .gotm-cta { grid-auto-flow: row; }
}

@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; }

/* ---------- legal pages ---------- */
.legal { max-width: 820px; padding-bottom: 60px; }
.legal-switch { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.legal-switch a { padding: 6px 14px; border: 2px solid var(--edge); border-radius: 99px; font-weight: 700; text-decoration: none; color: var(--text); }
.legal-switch a[aria-current="page"] { background: var(--text); border-color: var(--text); color: var(--paper); }
.legal-body { line-height: 1.65; }
.legal-body h2 { font-size: 1.3rem; margin: 1.8em 0 .5em; scroll-margin-top: 90px; }
.legal-body p, .legal-body li { color: var(--ink-2); }
.legal-body p { margin-bottom: .8em; }
.legal-body ul, .legal-body ol { padding-left: 1.3em; display: grid; gap: 6px; margin-bottom: .9em; }
.legal-body b { color: var(--text); }
.legal-body code { font-size: .9em; background: var(--paper-2); padding: 1px 6px; border-radius: 6px; }
.tldr { background: var(--card); border: var(--line) solid var(--ink); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px 20px; color: var(--ink-2); }
.tldr b { display: block; margin-bottom: 4px; color: var(--text); }

/* ---------- checkboxes (signup, upload) ---------- */
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .95rem; color: var(--ink-2); cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; flex-shrink: 0; accent-color: var(--cobalt); }

/* ---------- reporting ---------- */
.linkbtn { display: inline-flex; gap: 6px; align-items: center; background: none; border: 0; padding: 4px 0; color: var(--ink-3); font-weight: 600; font-size: .9rem; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.linkbtn:hover { color: var(--text); }
.report-row { margin-top: 10px; }
.cacts { margin-left: auto; display: flex; gap: 2px; }
.cacts .cdel { margin-left: 0; }
.modal.wide { max-width: 560px; text-align: left; justify-items: stretch; max-height: calc(100dvh - 40px); overflow-y: auto; }
.report-form h2 { font-size: 1.5rem; }
.report-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.btn.danger { background: #C2341A; color: #fff; }
.menu .count, .admin-tabs .count { display: inline-block; min-width: 22px; padding: 0 6px; margin-left: 6px; border-radius: 99px; background: #C2341A; color: #fff; font-size: .8rem; text-align: center; }

/* ---------- admin reports ---------- */
.reports { list-style: none; padding: 0; display: grid; gap: 14px; padding-bottom: 60px; }
.report { display: grid; gap: 8px; }
.report.urgent { border-color: var(--tomato); }
.rhead { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.rhead time { margin-left: auto; }
.pill.bad { background: #C2341A; color: #fff; }
.rtarget { font-weight: 600; }
.report blockquote { border-left: 4px solid var(--edge); padding: 4px 12px; color: var(--ink-2); white-space: pre-wrap; }
.rdetails { white-space: pre-wrap; color: var(--ink-2); }
.racts { display: flex; gap: 8px; flex-wrap: wrap; }
.small { font-size: .85rem; }

/* ---------- settings: your data ---------- */
.danger-zone { margin-bottom: 50px; display: grid; gap: 16px; }
.danger-zone h2 { font-size: 1.4rem; }
.dz-row { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding-top: 14px; border-top: 2px dashed var(--edge); }
.dz-row p { font-size: .9rem; margin-top: 2px; max-width: 52ch; }

/* ---------- motion: page enter, skeletons, progress bar, micro-interactions ----------
   Only opacity and transform are animated, so everything stays on the compositor. */
#navprog { position: fixed; left: 0; top: 0; z-index: 100; width: 100%; height: 3px; background: var(--link); transform-origin: 0 50%; transform: scaleX(0); opacity: 0; pointer-events: none; }
#navprog.run { opacity: 1; animation: np-run 6s cubic-bezier(.1, .7, .2, 1) .12s both; }
#navprog.done { animation: np-done .4s ease-out both; }
@keyframes np-run { from { transform: scaleX(0); } to { transform: scaleX(.9); } }
@keyframes np-done { 0% { transform: scaleX(.9); opacity: 1; } 50% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(1); opacity: 0; } }

.view-in { animation: view-in .3s cubic-bezier(.2, .8, .2, 1) backwards; }
@keyframes view-in { from { opacity: 0; transform: translateY(10px); } }
.view-in .shelf > :nth-child(-n+12) { animation: card-in .45s cubic-bezier(.2, .9, .3, 1.15) backwards; }
.view-in .shelf > :nth-child(1) { animation-delay: 0.055s; }
.view-in .shelf > :nth-child(2) { animation-delay: 0.090s; }
.view-in .shelf > :nth-child(3) { animation-delay: 0.125s; }
.view-in .shelf > :nth-child(4) { animation-delay: 0.160s; }
.view-in .shelf > :nth-child(5) { animation-delay: 0.195s; }
.view-in .shelf > :nth-child(6) { animation-delay: 0.230s; }
.view-in .shelf > :nth-child(7) { animation-delay: 0.265s; }
.view-in .shelf > :nth-child(8) { animation-delay: 0.300s; }
.view-in .shelf > :nth-child(9) { animation-delay: 0.335s; }
.view-in .shelf > :nth-child(10) { animation-delay: 0.370s; }
.view-in .shelf > :nth-child(11) { animation-delay: 0.405s; }
.view-in .shelf > :nth-child(12) { animation-delay: 0.440s; }
@keyframes card-in { from { opacity: 0; transform: translateY(14px) scale(.97); } }

.sk-wrap { padding-top: 34px; padding-bottom: 40px; animation: fade-in .25s backwards; }
@keyframes fade-in { from { opacity: 0; } }
.sk { position: relative; overflow: hidden; background: var(--paper-2); border-radius: 12px; }
.sk::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--card) 75%, transparent), transparent); animation: shimmer 1.4s ease-in-out infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.sk-card { display: grid; gap: 10px; }
.sk-img { aspect-ratio: 4 / 3; border-radius: var(--r); }
.sk-line { height: 14px; margin-bottom: 10px; }
.sk-line.short { width: 55%; }
.sk-line.big { height: 38px; width: min(380px, 70%); margin-bottom: 14px; }
.sk-stage { aspect-ratio: 16 / 9; border-radius: var(--r); }
.sk-panel { height: 200px; border-radius: var(--r); margin-bottom: 18px; }
.sk-panel.short { height: 120px; }
.sk-row { height: 84px; border-radius: var(--r); background: var(--paper-2); list-style: none; }

.bites button.set svg { animation: bite-pop .35s cubic-bezier(.2, 1.6, .5, 1) backwards; }
.bites button.set:nth-child(2) svg { animation-delay: .04s; } .bites button.set:nth-child(3) svg { animation-delay: .08s; }
.bites button.set:nth-child(4) svg { animation-delay: .12s; } .bites button.set:nth-child(5) svg { animation-delay: .16s; }
@keyframes bite-pop { from { transform: scale(.5) rotate(-20deg); } }
.btn.liked svg { animation: heart-pop .45s cubic-bezier(.2, 1.8, .5, 1); }
@keyframes heart-pop { 0% { transform: scale(.4); } 60% { transform: scale(1.25); } }
.player .poster:hover .go .disc { transform: scale(1.06) rotate(-4deg); }
.chip, .tile, .linkbtn, .admin-tabs a { transition: transform .12s, box-shadow .12s, background-color .12s, color .12s; }
.modal-back { animation: fade-in .18s backwards; }
.modal { animation: modal-in .25s cubic-bezier(.2, 1.2, .4, 1) backwards; }
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(.97); } }
.menu { animation: menu-in .16s ease-out backwards; transform-origin: top right; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-6px) scale(.97); } }

/* ---------- admin ---------- */
.admin-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 24px; border-bottom: 2px solid var(--edge); }
.admin-tabs a { padding: 10px 16px; font-weight: 700; text-decoration: none; color: var(--ink-2); border-bottom: 3px solid transparent; margin-bottom: -2px; }
.admin-tabs a:hover { color: var(--text); }
.admin-tabs a[aria-current="page"] { color: var(--text); border-bottom-color: var(--link); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.tile { display: grid; gap: 2px; padding: 16px 18px; background: var(--card); border: var(--line) solid var(--ink); border-radius: var(--r); box-shadow: var(--shadow); color: var(--text); text-decoration: none;
  animation: card-in .4s cubic-bezier(.2, .9, .3, 1.15) backwards; animation-delay: calc(var(--i) * 35ms); }
.tile small { font-weight: 700; color: var(--ink-2); }
.tile b { font-size: 2rem; line-height: 1.1; }
.tile span { font-size: .85rem; }
a.tile:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-lg); }
.tile.hot { border-color: #C2341A; }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; margin: 18px 0; }
.mini-chart { margin: 0; }
.mini-chart figcaption { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 8px; font-size: .9rem; }
.mini-chart svg { width: 100%; height: 72px; display: block; }
.mini-chart rect { fill: var(--link); transform-box: fill-box; transform-origin: bottom; animation: bar-grow .5s cubic-bezier(.2, .9, .3, 1) backwards; animation-delay: calc(var(--i) * 25ms); }
@keyframes bar-grow { from { transform: scaleY(0); } }
.admin-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.admin-cols h2 { font-size: 1.2rem; margin-bottom: 10px; }
.checks { list-style: none; padding: 0; display: grid; gap: 8px; margin-bottom: 10px; }
.checks li { display: flex; gap: 10px; align-items: baseline; }
.checks li::before { content: ""; width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; background: var(--mint); border: 2px solid var(--ink); }
.checks li.off::before { background: var(--paper-2); }
.alog { list-style: none; padding: 0; display: grid; gap: 6px; font-size: .9rem; }
.alog li { display: flex; gap: 6px; flex-wrap: wrap; align-items: baseline; }
.alog span { color: var(--ink-2); overflow-wrap: anywhere; }
.alog time { margin-left: auto; }
.admin .filters { justify-content: flex-start; }
.admin .seg { max-width: 100%; overflow-x: auto; }
.admin-search { margin-left: 0; max-width: 340px; min-width: 220px; }
.alist { list-style: none; padding: 0; display: grid; gap: 12px; }
.arow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 20px; align-items: center; padding: 14px 18px; background: var(--card); border: var(--line) solid var(--ink); border-radius: var(--r); box-shadow: var(--shadow); }
.arow .racts { grid-column: 1 / -1; }
.amain { display: grid; gap: 3px; min-width: 0; }
.amain .t { font-weight: 800; font-size: 1.05rem; }
.amain.user { display: flex; gap: 12px; align-items: center; }
.amain.user > div { display: grid; gap: 3px; min-width: 0; }
.amain .av { width: 46px; height: 46px; border-radius: 14px; overflow: hidden; border: 2px solid var(--ink); flex-shrink: 0; }
.amain .hosts { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pills:empty { display: none; }
.pills .pill { font-size: .75rem; padding: 1px 9px; text-decoration: none; }
.pill.ok { background: var(--mint); color: #15131F; }
.astats { display: flex; gap: 18px; }
.astats span { display: grid; font-size: .8rem; color: var(--ink-3); text-align: right; }
.astats b { font-size: 1.1rem; color: var(--text); }
.hosts-line { display: flex; gap: 6px; align-items: center; margin-top: 8px; }
@media (max-width: 760px) {
  .admin-cols { grid-template-columns: 1fr; }
  .arow { grid-template-columns: 1fr; }
  .astats span { text-align: left; }
}
