/* $FEEDME: a late-90s virtual-pet toy on a store peg. The page is the blister pack: the device is the hero,
   the sections below are the cardboard back. Everything flows from these tokens. */
:root {
  --bg: #F3EDE2; --surface: #FFFFFF; --surface-2: #E8DFCF; --border: rgba(31, 26, 20, .12);
  --line: #1F1A14; --text: #1F1A14; --text-2: #5A5146; --text-3: #8C8374;
  --shell: #FF6A3D; --shell-hi: #FFC4A8; --shell-deep: #D9481E; --bezel: #B73A15;
  --rubber: #E5471F; --rubber-deep: #93270A; --key-label: #3A1709;
  --lcd: #B9C49A; --lcd-ink: #26301C; --lcd-glow: transparent;
  --olive: #26301C; --cream: #F3EDE2; --yellow: #FFD84A; --warn: #C23A14;
  --accent: #1F1A14; --accent-ink: #FFD84A; --accent-hover: #362D22;
  --radius: 14px;
  --f-display: "Bricolage Grotesque", "Arial Black", system-ui, sans-serif;
  --f-pixel: "Silkscreen", ui-monospace, "Courier New", monospace;
  --f-digits: "VT323", ui-monospace, "Courier New", monospace;
  --f-body: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --dot: rgba(31, 26, 20, .07);
  color-scheme: light;
}
/* Lights off: the shell keeps its colour, the LCD gets a backlight. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16130F; --surface: #211C16; --surface-2: #2B241C; --border: rgba(243, 237, 226, .12);
    --line: rgba(243, 237, 226, .5); --text: #F3EDE2; --text-2: #CBBFAE; --text-3: #978C7C;
    --lcd: #10160A; --lcd-ink: #C8F07A; --lcd-glow: rgba(200, 240, 122, .5);
    --olive: #2F3B22; --warn: #FF8A63;
    --accent: #FFD84A; --accent-ink: #1F1A14; --accent-hover: #FFE37A;
    --dot: rgba(243, 237, 226, .045);
    color-scheme: dark;
  }
}
/* October: glow-in-the-dark shell. */
html.october { --shell: #7CFF6B; --shell-hi: #DAFFD4; --shell-deep: #36B82B; --bezel: #1F7A18; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 16px/1.55 var(--f-body);
  -webkit-font-smoothing: antialiased;
  background-image: radial-gradient(var(--dot) 1px, transparent 1.3px);
  background-size: 7px 7px;
  overflow-x: hidden;
}
html.has-drawer { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
img { max-width: 100%; }
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--yellow); color: #1F1A14; }
html { scrollbar-color: var(--text-3) transparent; scrollbar-width: thin; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; background: var(--accent); color: var(--accent-ink); border-radius: 10px; font-weight: 700; }
.skip:focus { top: 12px; }
.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 700px) { .wrap { padding: 0 28px; } }
.mono { font-family: var(--f-digits); font-weight: 400; font-size: 1.22em; letter-spacing: .01em; }
.mini-tag {
  display: inline-block; vertical-align: middle; font: 700 9px/1 var(--f-pixel); letter-spacing: .04em; text-transform: uppercase;
  padding: 3px 5px; border: 1.5px dashed currentColor; border-radius: 5px; color: var(--text-3);
}

/* Entrance start-state only while Motion is about to run (see head script + motion-fx.js). */
.anim-pending [data-reveal] { opacity: 0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px;
  border-radius: 12px; border: 2px solid transparent; background: transparent; font: 700 15px/1 var(--f-body);
  cursor: pointer; white-space: nowrap; transition: background-color .15s, color .15s, box-shadow .15s, translate .08s;
}
.btn:active { translate: 0 2px; }
/* The toy's "ON" sticker: the only filled thing on the page. */
.btn.primary {
  background: var(--accent); color: var(--accent-ink); border-color: var(--accent);
  box-shadow: inset 0 0 0 3px var(--accent), inset 0 0 0 4.5px var(--accent-ink);
  font-family: var(--f-display); font-weight: 800; letter-spacing: -.01em;
}
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); box-shadow: inset 0 0 0 3px var(--accent-hover), inset 0 0 0 4.5px var(--accent-ink); }
.btn.outline { border-color: var(--text); color: var(--text); }
.btn.outline:hover { background: color-mix(in srgb, var(--text) 7%, transparent); }
.btn.outline.strong { border-width: 2.5px; font-family: var(--f-display); font-weight: 800; }
.btn.ghost { color: var(--text-2); }
.btn.ghost:hover { color: var(--text); background: color-mix(in srgb, var(--text) 6%, transparent); }
.btn.lg { height: 54px; padding: 0 24px; font-size: 18px; border-radius: 14px; }
.btn.sm { height: 40px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.btn.icon { width: 44px; padding: 0; }
.btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }

/* ---------- top bar ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1.5px solid var(--border);
}
.top-in { max-width: 1160px; margin: 0 auto; padding: 8px 16px; display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-wordmark { height: 36px; width: auto; display: block; }
.ticker-tag {
  font: 700 11px/1 var(--f-pixel); letter-spacing: .03em; padding: 5px 7px 4px; border-radius: 5px;
  background: #B9C49A; color: #26301C; border: 1.5px solid #26301C; white-space: nowrap;
}
.top-nav { display: none; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
@media (max-width: 440px) { .ticker-tag { display: none; } .brand-wordmark { height: 32px; } }
@media (min-width: 700px) { .top-in { padding: 10px 28px; } .brand-wordmark { height: 42px; } }
@media (min-width: 900px) {
  .top-nav { display: flex; gap: 26px; margin-left: auto; font: 700 12px/1 var(--f-pixel); letter-spacing: .04em; text-transform: uppercase; }
  .top-nav a { padding: 10px 0; color: var(--text-2); background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat; transition: color .15s, background-size .2s; }
  .top-nav a:hover { color: var(--text); background-size: 100% 2px; }
  .top-actions { margin-left: 12px; }
}

/* ---------- hero ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "head" "stage" "act"; gap: 22px; padding-top: 24px; padding-bottom: 40px;
}
.hero-head { grid-area: head; }
.hero-stage { grid-area: stage; min-width: 0; }
.hero-act { grid-area: act; }
.eyebrow { margin: 0 0 14px; }
.tape {
  display: inline-block; font: 700 11px/1 var(--f-pixel); letter-spacing: .04em; text-transform: uppercase;
  background: var(--yellow); color: #1F1A14; padding: 8px 14px 7px; rotate: -1.5deg;
  clip-path: polygon(0 8%, 3% 0, 97% 6%, 100% 0, 99% 92%, 96% 100%, 3% 94%, 1% 100%);
}
h1 {
  margin: 0; font-family: var(--f-display); font-weight: 800; font-size: clamp(40px, 11vw, 64px);
  line-height: .92; letter-spacing: -.035em; font-variation-settings: "wdth" 86, "opsz" 96;
}
h1 span { display: block; }
.hook-2 {
  color: var(--shell); -webkit-text-stroke: .05em var(--line); paint-order: stroke fill;
  text-shadow: 0 .07em 0 var(--text); padding-bottom: .06em;
}
@media (prefers-color-scheme: dark) { .hook-2 { -webkit-text-stroke-color: #1F1A14; text-shadow: 0 .07em 0 #000; } }
.sub { font-size: 17px; line-height: 1.5; color: var(--text-2); max-width: 34rem; margin: 18px 0 0; }
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; }
.cta-row .btn { flex: 1 1 auto; }
.guilt { margin: 14px 0 0; color: var(--text-2); font-size: 15px; line-height: 1.5; min-height: 3em; }
.guilt b { color: var(--text); }
@media (min-width: 560px) { .cta-row .btn { flex: 0 0 auto; } }
@media (min-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 480px); grid-template-areas: "head stage" "act stage";
    column-gap: 56px; row-gap: 30px; align-items: end; padding-top: 56px; padding-bottom: 72px;
  }
  .hero-act { align-self: start; }
  h1 { font-size: clamp(60px, 6.6vw, 92px); }
  .sub { font-size: 19px; }
}

/* ---------- the blister pack ---------- */
.blister {
  position: relative; background-color: var(--surface-2);
  background-image: radial-gradient(var(--dot) 1px, transparent 1.3px); background-size: 6px 6px;
  border: 1.5px solid var(--line); border-radius: 24px 24px var(--radius) var(--radius);
  padding: 42px 10px 14px;
}
.peg-hole {
  position: absolute; top: 13px; left: 50%; width: 70px; height: 17px; translate: -50% 0; border-radius: 999px;
  background: var(--bg); box-shadow: inset 0 2px 3px rgba(0, 0, 0, .28), 0 0 0 1.5px var(--line);
}
.blister-print {
  position: absolute; top: 15px; left: 14px; right: 14px; display: flex; justify-content: space-between;
  font: 700 9px/1.2 var(--f-pixel); letter-spacing: .04em; text-transform: uppercase; color: var(--text-2); pointer-events: none;
}
.bubble {
  position: relative; border-radius: 28px; padding: 26px 8px 8px;
  background: linear-gradient(160deg, rgba(255, 255, 255, .72), rgba(255, 255, 255, .2) 36%, rgba(255, 255, 255, .06) 64%, rgba(255, 255, 255, .42));
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .95), inset 0 0 0 3px rgba(31, 26, 20, .07);
}
.bubble::after {
  content: ""; position: absolute; top: 6%; left: 3%; width: 5%; height: 36%; border-radius: 999px; pointer-events: none;
  background: linear-gradient(rgba(255, 255, 255, .8), rgba(255, 255, 255, 0)); rotate: 8deg;
}
@media (prefers-color-scheme: dark) {
  .bubble { background: linear-gradient(160deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .03) 40%, rgba(255, 255, 255, .02) 64%, rgba(255, 255, 255, .08)); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .22); }
  .bubble::after { background: linear-gradient(rgba(255, 255, 255, .25), rgba(255, 255, 255, 0)); }
}
.device-wrap { position: relative; max-width: 400px; margin: 0 auto; }
.practice-note { margin: 10px 0 0; text-align: center; font: 700 9.5px/1.4 var(--f-pixel); letter-spacing: .03em; text-transform: uppercase; color: var(--text-2); }
@media (max-width: 480px) { .blister { padding: 40px 6px 12px; } .bubble { padding: 24px 2px 6px; } }
@media (min-width: 900px) { .blister { padding: 50px 26px 18px; } .bubble { padding: 30px 22px 10px; } }

/* The only shadow on the page: under the floating device. */
.device-shadow {
  display: block; width: 66%; height: 18px; margin: 4px auto 0; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(31, 26, 20, .38), rgba(31, 26, 20, 0));
}
@media (prefers-color-scheme: dark) { .device-shadow { background: radial-gradient(closest-side, rgba(0, 0, 0, .7), rgba(0, 0, 0, 0)); } }

/* Stickers (LCD speech bubbles from the board) */
.sticker {
  position: absolute; z-index: 3; pointer-events: none; font: 700 12px/1.1 var(--f-pixel); letter-spacing: .02em;
  background: #B9C49A; color: #26301C; border: 2px solid #26301C; border-radius: 10px; padding: 8px 11px;
  box-shadow: 0 0 0 3px #fff; white-space: nowrap;
}
.sticker::after {
  content: ""; position: absolute; bottom: -8px; left: 18px; width: 12px; height: 12px; background: #B9C49A;
  border-right: 2px solid #26301C; border-bottom: 2px solid #26301C; rotate: 45deg; clip-path: polygon(100% 0, 100% 100%, 0 100%);
}
.sticker-feed { top: 17%; left: -6px; rotate: -7deg; }
@media (min-width: 900px) { .sticker { font-size: 13px; } .sticker-feed { left: -22px; } }

/* ---------- the device ---------- */
.device { position: relative; width: 100%; aspect-ratio: 400 / 540; container-type: inline-size; isolation: isolate; }
.shell { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.shell-guts { stroke: #1F1A14; opacity: .09; }
html.october .device { filter: drop-shadow(0 0 0 transparent); }
@media (prefers-color-scheme: dark) { html.october .shell { filter: drop-shadow(0 0 14px rgba(124, 255, 107, .45)); } }
.ring {
  position: absolute; z-index: -1; top: -4.4%; left: 50%; width: 12cqw; height: 12cqw; translate: -50% 0; border-radius: 50%;
  border: 1.8cqw solid #BDB5A8; box-shadow: inset 0 0 0 .4cqw rgba(0, 0, 0, .18), 0 0 0 .4cqw rgba(0, 0, 0, .18);
}
.shell-mark { position: absolute; left: 50%; top: 8.8%; width: 40%; height: auto; translate: -50% 0; pointer-events: none; }

.lcd {
  position: absolute; left: 15%; right: 15%; top: 22.04%; height: 53.9%;
  display: flex; flex-direction: column; gap: 1.3cqw; padding: 2.4cqw 3cqw 2.4cqw;
  border-radius: 3.6cqw; color: var(--lcd-ink); background-color: var(--lcd);
  background-image:
    linear-gradient(color-mix(in srgb, var(--lcd-ink) 5%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--lcd-ink) 5%, transparent) 1px, transparent 1px);
  background-size: 1.1cqw 1.1cqw;
  box-shadow: inset 0 .9cqw 1.6cqw rgba(0, 0, 0, .2), inset 0 0 0 .4cqw rgba(0, 0, 0, .12);
  font-family: var(--f-pixel); overflow: hidden;
}
@media (prefers-color-scheme: dark) {
  .lcd { text-shadow: 0 0 .9cqw var(--lcd-glow); box-shadow: inset 0 0 7cqw rgba(200, 240, 122, .12), inset 0 0 0 .4cqw rgba(0, 0, 0, .4); }
  .lcd canvas { filter: drop-shadow(0 0 .7cqw rgba(200, 240, 122, .5)); }
}
/* RECONNECTING…: the last state freezes and the cells dim to half. */
.lcd.is-frozen .cells, .lcd.is-frozen .pet-wrap, .lcd.is-frozen .lcd-count, .lcd.is-frozen .marquee { opacity: .5; }
.lcd.is-frozen .lcd-count.is-critical { animation: none; }
/* Loading: an empty screen with a blinking cursor until the first snapshot lands. */
.lcd-boot { display: none; }
.lcd.is-loading > :not(.lcd-boot):not(.lcd-feed) { visibility: hidden; }
.lcd.is-loading .lcd-feed > :not(.lcd-alert) { visibility: hidden; }
.lcd.is-loading .lcd-boot {
  display: block; position: absolute; left: 3cqw; top: 2.6cqw; width: 2.2cqw; height: 3.4cqw; background: currentColor;
  animation: blink 1s steps(2, jump-none) infinite;
}
/* No CA yet: just the egg and "feed me". */
.lcd.is-idle .lcd-status { visibility: hidden; }
.lcd-top { position: relative; z-index: 2; display: flex; gap: 1cqw; min-height: 4.3cqw; }
.lcd-tag { font: 700 2.5cqw/1 var(--f-pixel); letter-spacing: .03em; padding: .8cqw 1cqw .7cqw; background: var(--lcd-ink); color: var(--lcd); text-shadow: none; white-space: nowrap; }
.lcd-tag.is-practice { margin-left: auto; background: none; color: inherit; border: .35cqw dashed currentColor; padding: .45cqw .8cqw .35cqw; }
.lcd-alert { display: none; font: 700 2.4cqw/1.2 var(--f-pixel); letter-spacing: .02em; white-space: nowrap; }
.lcd.is-lost .lcd-alert { display: block; animation: blink 1.4s steps(2, jump-none) infinite; }
.lcd.is-lost .marquee { display: none; }
.lcd-say[hidden] { display: none; }
.stamp { font: 700 2.5cqw/1 var(--f-pixel); letter-spacing: .03em; padding: .7cqw 1cqw .6cqw; border: .35cqw solid currentColor; white-space: nowrap; }
.stamp[data-state="live"]::before { content: ""; display: inline-block; width: 1.4cqw; height: 1.4cqw; margin-right: .8cqw; background: currentColor; vertical-align: .1cqw; }
.stamp[data-state="reconnecting"], .stamp[data-state="lost"] { animation: blink 1s steps(2, jump-none) infinite; }
.lcd-status { display: flex; justify-content: space-between; align-items: flex-end; gap: 2cqw; }
.lcd-gen { display: flex; flex-direction: column; gap: 1.1cqw; font: 400 2.7cqw/1 var(--f-pixel); white-space: nowrap; padding-bottom: .6cqw; }
.lcd-clock { display: flex; flex-direction: column; align-items: flex-end; min-width: 0; }
.lcd-k { font: 400 2.4cqw/1 var(--f-pixel); letter-spacing: .02em; white-space: nowrap; }
.lcd-count { font: 400 9cqw/.8 var(--f-digits); font-variant-numeric: tabular-nums; margin-top: .6cqw; white-space: nowrap; }
.lcd-count.is-critical { animation: blink 1s steps(2, jump-none) infinite; }
@keyframes blink { 50% { opacity: .15; } }
.lcd-stage { position: relative; flex: 0 0 auto; height: 29.5cqw; display: grid; place-items: center; }
.pet-wrap { position: relative; line-height: 0; }
.pet { display: block; width: 29.5cqw; height: 29.5cqw; image-rendering: pixelated; }
.food-layer { position: absolute; inset: 0; pointer-events: none; }
.food { position: absolute; image-rendering: pixelated; animation: drop .42s steps(3, end) both; }
.food.taken { animation: take .46s steps(3, end) both; }
@keyframes drop { from { translate: 0 calc(var(--px, 4px) * -13); } to { translate: 0 0; } }
@keyframes take { from { translate: 0 0; opacity: 1; } to { translate: calc(var(--px, 4px) * 9) calc(var(--px, 4px) * -14); opacity: 0; } }
.lcd-say {
  position: absolute; right: 0; top: 0; margin: 0; max-width: 17cqw; text-align: right;
  font: 400 2.3cqw/1.25 var(--f-pixel); padding: .8cqw 1cqw; border: .35cqw solid currentColor; border-radius: 1cqw;
}
.lcd-event {
  position: absolute; left: 3cqw; top: 36%; font: 700 2.2cqw/1 var(--f-pixel); padding: .6cqw .8cqw;
  background: var(--lcd-ink); color: var(--lcd); opacity: 0; pointer-events: none; text-shadow: none;
}
.lcd-event.show { animation: evt 1.5s steps(1, end) both; }
@keyframes evt { 0% { opacity: 1; } 20% { opacity: 0; } 30% { opacity: 1; } 85% { opacity: 1; } 100% { opacity: 0; } }
.lcd-bars { display: grid; gap: 1cqw; }
.bar { display: grid; grid-template-columns: 14cqw 1fr; align-items: center; gap: 1cqw; }
.bar-k { font: 400 2.4cqw/1 var(--f-pixel); }
.cells { display: grid; grid-template-columns: repeat(10, 1fr); gap: .6cqw; }
.cells i { display: block; height: 2.6cqw; border: .32cqw solid currentColor; opacity: .2; }
.cells i.on { background: currentColor; opacity: 1; }
.bar[data-level="low"] .cells i.on { animation: blink 1.2s steps(2, jump-none) infinite; }
.lcd-feed { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1.2cqw; align-items: center; margin-top: auto; }
.marquee { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.marquee-track { display: inline-flex; white-space: nowrap; animation: mq var(--mq-dur, 30s) linear infinite; animation-play-state: paused; }
.lcd.is-running .marquee-track { animation-play-state: running; }
.mq-group { display: inline-flex; }
.mq-item { font: 400 2.4cqw/1.2 var(--f-pixel); padding-right: 5cqw; }
@keyframes mq { to { transform: translateX(-50%); } }

/* Rubber buttons: secondary controls, never the accent. */
.keys { position: absolute; left: 0; right: 0; top: calc(84.07% - 6.25cqw); display: flex; justify-content: center; gap: 6cqw; }
.key-col { width: 12.5cqw; display: flex; flex-direction: column; align-items: center; gap: 1.7cqw; }
.key {
  width: 12.5cqw; height: 12.5cqw; min-width: 40px; min-height: 40px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  background: radial-gradient(circle at 36% 30%, #FFA383 0 10%, var(--rubber) 46%, #BE3812 100%);
  box-shadow: 0 .75cqw 0 var(--rubber-deep), inset 0 -.7cqw 1cqw rgba(0, 0, 0, .2), inset 0 .5cqw .7cqw rgba(255, 255, 255, .35);
  transition: translate .07s, box-shadow .07s; touch-action: manipulation;
}
.key:hover { filter: saturate(1.1) brightness(1.04); }
.key:active { translate: 0 .5cqw; box-shadow: 0 .25cqw 0 var(--rubber-deep), inset 0 -.4cqw .8cqw rgba(0, 0, 0, .25), inset 0 .5cqw .7cqw rgba(255, 255, 255, .25); }
.key:focus-visible { outline: .8cqw solid #1F1A14; outline-offset: .8cqw; border-radius: 50%; }
.key-label { font: 700 2.6cqw/1 var(--f-pixel); letter-spacing: .03em; color: var(--key-label); white-space: nowrap; }
html.october .key-label { color: #0E2A0B; }

/* The ⏸ pin on the shell */
.pin {
  position: absolute; left: 78.5%; top: 79.5%; width: 7cqw; height: 7cqw; min-width: 26px; min-height: 26px;
  border-radius: 50%; border: .5cqw solid #1F1A14; background: #F3EDE2; padding: 0; cursor: pointer;
  display: grid; place-items: center; transition: translate .08s;
}
.pin::before { content: ""; position: absolute; inset: -9px; border-radius: 50%; }
.pin:active { translate: 0 1px; }
.pin-ico { width: 40%; height: 40%; background: linear-gradient(90deg, #1F1A14 0 35%, transparent 35% 65%, #1F1A14 65%); }
.pin[aria-pressed="true"] .pin-ico { background: #1F1A14; clip-path: polygon(18% 0, 100% 50%, 18% 100%); }
.pin:focus-visible { outline: 3px solid #1F1A14; outline-offset: 3px; border-radius: 50%; }

/* ---------- perforation ---------- */
.perf { display: flex; align-items: center; gap: 12px; margin: 4px auto 22px; font: 700 10px/1 var(--f-pixel); letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); }
.perf::before, .perf::after { content: ""; flex: 1; border-top: 2px dashed currentColor; opacity: .6; }
.perf span { white-space: nowrap; }

/* ---------- packaging panels ---------- */
.packs { display: grid; gap: 22px; padding-bottom: 40px; }
.panel { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius); overflow: hidden; scroll-margin-top: 76px; }
.panel-tab {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--olive); color: var(--cream);
  font: 700 11px/1 var(--f-pixel); letter-spacing: .05em; text-transform: uppercase;
}
.panel-tab .num { display: inline-grid; place-items: center; min-width: 26px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--cream); color: #26301C; }
.tab-tag { margin-left: auto; padding: 4px 7px 3px; border: 1.5px dashed rgba(243, 237, 226, .7); border-radius: 5px; font-size: 9px; white-space: nowrap; }
.panel-body { padding: 24px 16px 26px; }
@media (min-width: 700px) { .panel-body { padding: 36px 40px 40px; } .panel-tab { padding: 11px 18px; font-size: 12px; } }
h2 {
  margin: 0; font-family: var(--f-display); font-weight: 800; font-size: clamp(30px, 8vw, 52px);
  line-height: 1; letter-spacing: -.035em; font-variation-settings: "wdth" 88, "opsz" 72;
}
.h2-soft { color: var(--text-3); }
.kicker { color: var(--text-2); margin: 12px 0 0; max-width: 40rem; }
.fine-print { color: var(--text-3); font-size: 13px; margin: 16px 0 0; }

/* Coin block: back-of-pack label */
.pack-back { display: grid; gap: 26px; }
@media (min-width: 880px) { .pack-back { grid-template-columns: 1.15fr .85fr; gap: 44px; align-items: start; } }
.label-h { font-size: clamp(28px, 6.6vw, 44px); line-height: 1.02; margin-bottom: 20px; }
.label-h span { display: block; }
.label-h em { font: 700 .36em/1 var(--f-pixel); letter-spacing: .04em; text-transform: uppercase; color: var(--text-2); vertical-align: .45em; margin-right: .2em; }
.facts { margin: 0; border-top: 8px solid var(--text); }
.facts div { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 11px 0; border-bottom: 1.5px solid var(--text); }
.facts div:last-child { border-bottom-width: 5px; }
.facts dt { font: 700 11px/1.3 var(--f-pixel); letter-spacing: .04em; text-transform: uppercase; }
.facts dd { margin: 0; font-weight: 600; text-align: right; display: flex; gap: 8px; align-items: center; }
.ca-card {
  display: flex; flex-direction: column; gap: 14px; padding: 20px 16px; border-radius: var(--radius);
  border: 2px dashed var(--text-3); background: var(--surface-2);
  background-image: radial-gradient(var(--dot) 1px, transparent 1.3px); background-size: 6px 6px;
}
.ca-head { display: flex; gap: 14px; align-items: center; }
.ca-egg { color: var(--text); flex: 0 0 auto; }
.ca-title { margin: 0; font: 800 22px/1.1 var(--f-display); letter-spacing: -.02em; }
.ca-line { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 5px 5px 5px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); }
.ca-k { font: 700 11px/1 var(--f-pixel); color: var(--text-3); }
.ca-line code { flex: 1; min-width: 0; display: flex; white-space: nowrap; font: 400 21px/1 var(--f-digits); }
/* Middle truncation: the head ellipsizes, the tail always shows. */
.ca-a { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ca-b { flex: none; }
.ca-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.ca-actions .btn { flex: 1 1 auto; }
.ca-note { margin: 0; font-size: 13px; color: var(--text-2); }
.barcode-row { display: flex; align-items: center; gap: 12px; padding-top: 6px; }
.barcode {
  width: 132px; height: 40px; flex: 0 0 auto;
  background: repeating-linear-gradient(90deg, var(--text) 0 2px, transparent 2px 4px, var(--text) 4px 5px, transparent 5px 8px, var(--text) 8px 11px, transparent 11px 12px, var(--text) 12px 13px, transparent 13px 16px);
}
.barcode-txt { font: 700 9px/1.5 var(--f-pixel); letter-spacing: .06em; color: var(--text-2); }

/* Care instructions */
.steps { list-style: none; margin: 26px 0 0; padding: 0; display: grid; gap: 14px; }
.step { display: grid; grid-template-columns: 112px 1fr; gap: 16px; align-items: center; padding: 12px; border-radius: 14px; background: var(--surface-2); }
.step p { margin: 0; color: var(--text-2); font-size: 16px; line-height: 1.4; }
.step b { display: block; color: var(--text); font: 800 22px/1.1 var(--f-display); letter-spacing: -.02em; margin-bottom: 4px; }
.mini-lcd {
  position: relative; aspect-ratio: 1; display: grid; place-items: center; border-radius: 16px;
  background: var(--lcd); color: var(--lcd-ink); box-shadow: inset 0 0 0 6px var(--shell), inset 0 0 0 7.5px rgba(0, 0, 0, .25), inset 0 8px 12px rgba(0, 0, 0, .18);
}
.mini-lcd canvas { width: 78%; height: auto; image-rendering: pixelated; }
@media (prefers-color-scheme: dark) { .mini-lcd canvas { filter: drop-shadow(0 0 3px rgba(200, 240, 122, .5)); } }
.step-n { position: absolute; top: 11px; left: 12px; font: 400 18px/1 var(--f-digits); }
@media (min-width: 760px) {
  .steps { grid-template-columns: repeat(3, 1fr); gap: 18px; }
  .step { grid-template-columns: 1fr; align-items: start; padding: 14px 14px 20px; }
  .step-n { font-size: 26px; top: 14px; left: 16px; }
}
.menu { margin-top: 18px; padding: 16px; border: 1.5px dashed var(--text-3); border-radius: 14px; }
.menu-k { margin: 0 0 12px; font: 700 11px/1 var(--f-pixel); letter-spacing: .05em; text-transform: uppercase; color: var(--text-2); }
.menu ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
.menu li { display: flex; align-items: center; gap: 10px; min-width: 0; }
.menu li canvas { color: var(--text); flex: 0 0 auto; }
.menu li span { display: flex; flex-direction: column; min-width: 0; }
.menu b { font: 800 17px/1.1 var(--f-display); }
.menu small { font: 400 17px/1.1 var(--f-digits); color: var(--text-2); }
.menu-note { margin: 14px 0 0; font-size: 13px; color: var(--text-3); }
@media (min-width: 760px) { .menu ul { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.extras { display: grid; gap: 12px; margin-top: 14px; }
@media (min-width: 760px) { .extras { grid-template-columns: 1fr 1fr; } }
.extra { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border: 1.5px solid var(--line); border-radius: 14px; }
.extra canvas { color: var(--text); flex: 0 0 auto; margin-top: 4px; }
.extra p { margin: 0; color: var(--text-2); font-size: 15px; }
.extra .extra-h { color: var(--text); font: 800 19px/1.2 var(--f-display); margin-bottom: 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* Leaderboard */
.lb-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px; }
.seg {
  position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 4px; width: 100%; max-width: 340px;
  border: 1.5px solid var(--line); border-radius: 13px; background: var(--surface-2);
}
.seg-thumb {
  position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 9px;
  background: var(--surface); box-shadow: 0 0 0 1.5px var(--line); transition: translate .24s cubic-bezier(.2, .8, .2, 1);
}
.seg[data-active="streak"] .seg-thumb { translate: 100% 0; }
.seg button {
  position: relative; z-index: 1; height: 42px; border: 0; background: none; cursor: pointer; padding: 0 10px;
  font: 700 11px/1 var(--f-pixel); letter-spacing: .03em; text-transform: uppercase; color: var(--text-2); border-radius: 9px;
}
.seg button[aria-selected="true"] { color: var(--text); }
.board { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 6px; }
.row {
  display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; grid-template-areas: "rank who val" "rank bar bar";
  column-gap: 12px; row-gap: 7px; align-items: center; padding: 10px 12px; border-radius: 11px; background: var(--surface-2);
}
.row.is-top { background: var(--surface); box-shadow: inset 0 0 0 2px var(--line); }
.rank { grid-area: rank; font: 400 28px/1 var(--f-digits); text-align: center; }
.who { grid-area: who; display: flex; align-items: center; gap: 8px; min-width: 0; font: 400 22px/1 var(--f-digits); }
.who .w { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); }
.who a.w:hover { text-decoration-color: currentColor; }
.row.is-skel .skel { display: block; height: 14px; border-radius: 4px; background: color-mix(in srgb, var(--text) 10%, transparent); animation: blink 1.6s steps(2, jump-none) infinite; }
.row.is-skel .who .skel { width: 110px; }
.row.is-skel .val .skel { width: 64px; margin-left: auto; }
.row.is-skel .rank { height: 28px; }
.who canvas { color: var(--text); flex: 0 0 auto; }
.lb-bar { grid-area: bar; height: 12px; }
.lb-fill {
  display: block; height: 100%; width: calc(var(--w) * 100%); min-width: 6px; transform-origin: left center;
  background: repeating-linear-gradient(90deg, var(--text) 0 7px, transparent 7px 9px);
}
.row.is-top .lb-fill { background: repeating-linear-gradient(90deg, var(--shell-deep) 0 7px, transparent 7px 9px); }
.val { grid-area: val; font: 400 24px/1 var(--f-digits); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.val small { font: 700 10px/1 var(--f-pixel); color: var(--text-3); }
.board-empty { padding: 22px 18px; border: 1.5px dashed var(--text-3); border-radius: 12px; display: grid; justify-items: center; gap: 12px; text-align: center; }
.board-empty p { margin: 0; font: 800 22px/1.1 var(--f-display); letter-spacing: -.02em; }
@media (min-width: 700px) {
  .row { grid-template-columns: 40px 190px minmax(0, 1fr) 120px; grid-template-areas: "rank who bar val"; row-gap: 0; padding: 11px 16px; }
  .lb-bar { height: 14px; }
}

/* Graveyard */
.graves {
  display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  margin: 22px -16px 0; padding: 6px 16px 16px; scrollbar-width: none;
}
.graves::-webkit-scrollbar { display: none; }
@media (min-width: 700px) { .graves { margin: 24px -40px 0; padding: 6px 40px 16px; scroll-padding: 0 40px; } }
.grave {
  flex: 0 0 232px; scroll-snap-align: start; display: flex; flex-direction: column; gap: 6px; text-align: left; cursor: pointer;
  padding: 16px 16px 14px; border: 1.5px solid var(--line); border-radius: 18px 18px var(--radius) var(--radius);
  background: var(--surface-2); color: var(--text); font: inherit; transition: translate .18s, rotate .18s;
}
.grave:hover { translate: 0 -4px; rotate: -1deg; }
.grave canvas { align-self: center; color: var(--text); margin-bottom: 4px; }
.grave-gen { font: 800 26px/1 var(--f-display); letter-spacing: -.02em; display: flex; align-items: center; gap: 8px; }
.grave-life { font: 400 22px/1 var(--f-digits); }
.grave-cause { font-size: 14px; line-height: 1.35; color: var(--text-2); min-height: 2.7em; }
.grave-k { font: 700 9px/1 var(--f-pixel); letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); margin-top: 4px; }
.grave-top { margin: 0; padding: 0 0 0 22px; font: 400 18px/1.25 var(--f-digits); }
.grave-top small { color: var(--text-3); font-size: 15px; }
.grave-none { font-size: 14px; color: var(--text-3); }
.grave-badge { font: 700 9px/1 var(--f-pixel); letter-spacing: .04em; text-transform: uppercase; padding: 4px 6px 3px; border: 1.5px solid currentColor; border-radius: 5px; color: var(--text-2); }
.grave-badge.is-zombie { background: #7CFF6B; color: #0E2A0B; border-color: #0E2A0B; }
.grave-cta { margin-top: auto; padding-top: 8px; font: 700 10px/1 var(--f-pixel); letter-spacing: .04em; text-transform: uppercase; color: var(--text-2); }
.grave:hover .grave-cta { color: var(--text); }
.empty { margin-top: 22px; padding: 28px 18px; border: 1.5px dashed var(--text-3); border-radius: var(--radius); display: grid; justify-items: center; gap: 12px; text-align: center; }
.empty canvas { color: var(--text); }
.empty p { margin: 0; font: 800 22px/1.1 var(--f-display); }

/* ---------- footer ---------- */
.foot { background: var(--olive); color: var(--cream); padding: 40px 0 48px; }
.foot-in { display: grid; gap: 18px; }
.foot-brand { display: flex; align-items: center; gap: 14px; }
.foot-brand img { width: 56px; height: 56px; border-radius: 14px; background: #F3EDE2; padding: 4px; }
.foot-brand b { display: block; font: 800 24px/1 var(--f-display); letter-spacing: -.02em; }
.foot-brand span { font-size: 14px; opacity: .8; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 22px; font: 700 12px/1 var(--f-pixel); letter-spacing: .05em; text-transform: uppercase; }
.foot-links a { padding: 12px 0; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
.foot-links a:hover { text-decoration-color: var(--yellow); }
.disclaimer { margin: 0; max-width: 46rem; font-size: 15px; line-height: 1.55; }
.fine { margin: 0; font-size: 13px; opacity: .78; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.motion-btn { height: 40px; padding: 0 14px; border-radius: 10px; border: 1.5px solid rgba(243, 237, 226, .6); background: none; color: var(--cream); cursor: pointer; font: 700 10px/1 var(--f-pixel); letter-spacing: .05em; text-transform: uppercase; }
.motion-btn:hover { border-color: var(--cream); }
.foot :focus-visible { outline-color: var(--yellow); }
@media (min-width: 860px) {
  .foot-in { grid-template-columns: auto 1fr; align-items: center; column-gap: 40px; }
  .foot-links { justify-content: flex-end; }
  .disclaimer, .fine { grid-column: 1 / -1; }
}

/* ---------- mobile sticky buy bar ---------- */
.buybar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 92%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-top: 1.5px solid var(--border); translate: 0 110%; transition: translate .22s ease;
}
.buybar.show { translate: 0 0; }
.buybar .btn { width: 100%; height: 52px; }
.has-drawer .buybar { translate: 0 110%; }
@media (max-width: 899px) { body { padding-bottom: 76px; } }
@media (min-width: 900px) { .buybar { display: none; } }

/* ---------- share-card drawer ---------- */
.drawer { position: fixed; inset: 0; z-index: 50; display: grid; align-items: end; justify-items: center; }
.drawer-scrim { position: absolute; inset: 0; background: rgba(22, 19, 15, .55); animation: fade .2s ease both; }
.sheet {
  position: relative; width: min(760px, 100%); max-height: 94vh; overflow: auto; background: var(--bg);
  border: 1.5px solid var(--line); border-bottom: 0; border-radius: 22px 22px 0 0;
  padding: 16px 16px calc(20px + env(safe-area-inset-bottom)); animation: sheet-in .3s cubic-bezier(.2, .8, .2, 1) both;
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet-head h2 { font-size: 26px; }
.sheet-close { width: 44px; height: 44px; border-radius: 12px; border: 1.5px solid var(--line); background: none; font-size: 26px; line-height: 1; cursor: pointer; }
.card-frame {
  position: relative; margin: 14px 0 0; aspect-ratio: 1200 / 675; border-radius: 12px; overflow: hidden;
  border: 1.5px solid var(--line); background: var(--surface-2);
}
.card-frame img { display: block; width: 100%; height: 100%; }
.card-frame.is-loading img { visibility: hidden; }
.card-frame.is-loading::after {
  content: "PRINTING CARD…"; position: absolute; inset: 0; display: grid; place-items: center;
  font: 700 12px/1 var(--f-pixel); letter-spacing: .05em; color: var(--text-2);
}
.sheet-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.sheet-actions .btn { flex: 1 1 160px; height: 50px; }
.sheet-note { margin: 12px 0 0; font-size: 13px; color: var(--text-3); }
.card-fail { margin: 14px 0 0; padding: 16px; border: 1.5px dashed var(--text-3); border-radius: 12px; color: var(--text-2); }
@media (min-width: 760px) {
  .drawer { align-items: center; }
  .sheet { border-radius: 22px; border-bottom: 1.5px solid var(--line); padding: 20px 22px 22px; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes sheet-in { from { translate: 0 40px; opacity: 0; } }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 60; translate: -50% 20px; opacity: 0; pointer-events: none;
  background: var(--text); color: var(--bg); padding: 11px 16px; border-radius: 12px; font: 700 14px/1.2 var(--f-body);
  transition: opacity .2s ease-out, translate .2s ease-out; max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; translate: -50% 0; }
@media (max-width: 899px) { .toast { bottom: 90px; } }

/* ---------- motion preferences ---------- */
.motion-paused .marquee-track { animation-play-state: paused !important; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .marquee-track { animation: none; display: block; }
  .marquee { -webkit-mask-image: none; mask-image: none; }
  .mq-group { display: block; }
  .mq-group[aria-hidden="true"] { display: none; }
  .mq-item:not(:first-child) { display: none; }
  .mq-item { display: block; overflow: hidden; text-overflow: ellipsis; }
  .lcd-count.is-critical, .stamp[data-state="reconnecting"], .stamp[data-state="lost"], .bar[data-level="low"] .cells i.on,
  .lcd.is-lost .lcd-alert, .lcd.is-loading .lcd-boot, .row.is-skel .skel { animation: none; }
  .lcd-count.is-critical { text-decoration: underline; }
  .food { display: none; }
  .sheet, .drawer-scrim { animation: none; }
  .grave, .btn, .key, .seg-thumb, .buybar, .toast { transition: none; }
}
