/* a₀ clicker: a game, not a care app. Night-time waiting room: deep violet dark, a glowing amber ₀ coin,
   chunky display numbers. One look on purpose (dark only), every colour still checked for contrast.
   Layout: phone = stage on top, tabs below; desktop = stage left (sticky), menu right. */
@font-face { font-family: "Bungee"; font-weight: 400; font-display: swap; src: url(/fonts/display.woff2) format("woff2"); } /* OFL, fonts/OFL-bungee.txt */
@font-face { font-family: "Agent0 Serif"; font-weight: 400; font-display: swap; src: url(/fonts/serif-r.woff2) format("woff2"); }
@font-face { font-family: "Agent0 Mono"; font-weight: 400; font-display: swap; src: url(/fonts/mono.woff2) format("woff2"); }

:root {
  --night: #14121f;     /* page */
  --deep: #0d0b16;      /* wells */
  --panel: #1f1c30;     /* cards */
  --panel-2: #2a2640;
  --line: #3b3657;
  --ink: #f4efe4;       /* 16.9:1 on night */
  --muted: #b3aec8;     /* 8.6:1 */
  --coin: #ffb547;      /* the ₀ coin, 10.6:1 */
  --coin-hot: #ffd98a;
  --mint: #7fd1ae;      /* a₀ forest green, turned up for the dark */
  --common: #cfcbe0; --uncommon: #7fd1ae; --rare: #93b4ff; --veryRare: #ffcf5c;
  --display: "Bungee", "Agent0 Serif", Impact, sans-serif;
  --glyph: "Agent0 Serif", Georgia, serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Agent0 Mono", ui-monospace, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--ink); font: 400 1rem/1.55 var(--body);
  background:
    radial-gradient(60rem 40rem at 30% -10%, #2b1f4a 0%, transparent 60%),
    radial-gradient(40rem 30rem at 100% 100%, #10283a 0%, transparent 60%),
    var(--night);
  background-attachment: fixed;
}
a { color: var(--mint); text-underline-offset: .2em; }
:focus-visible { outline: 3px solid var(--coin); outline-offset: 3px; border-radius: 6px; }
h2 { font: 400 1.15rem/1.2 var(--display); letter-spacing: .02em; margin: 0 0 .4rem; text-wrap: balance; }
p { margin: 0 0 .7rem; }
.hint { color: var(--muted); font-size: .92rem; }
.label { font: 400 .75rem/1.5 var(--mono); letter-spacing: .06em; color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -4rem; background: var(--coin); color: var(--deep); padding: .5rem .8rem; border-radius: 8px; z-index: 30; }
.skip:focus { top: .5rem; }

.game {
  display: grid; gap: 1rem; max-width: 72rem; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: .5rem 2rem;
  grid-template-columns: 1fr; grid-template-areas: "hud" "stage" "panel";
}
@media (min-width: 900px) {
  .game { grid-template-columns: minmax(0, 1fr) minmax(0, 26rem); grid-template-areas: "hud hud" "stage panel"; align-items: start; }
  .stage { position: sticky; top: 1rem; }
}

/* HUD */
.hud { grid-area: hud; display: flex; justify-content: space-between; align-items: center; min-height: 52px; }
.mark { display: flex; align-items: center; gap: .5rem; text-decoration: none; color: var(--muted); min-height: 44px; }
.mark img { width: 34px; height: auto; display: block; }
.tag { font: 400 .8rem/1 var(--display); letter-spacing: .1em; color: var(--muted); }
.chip { font: 400 .85rem/1 var(--display); color: var(--ink); background: var(--panel); border: 2px solid var(--line); border-radius: 999px; padding: .55rem .9rem; min-height: 44px; min-width: 44px; cursor: pointer; }
.chip:hover { border-color: var(--coin); }
.hud-right { display: flex; gap: .5rem; }
#music[aria-pressed="true"] { border-color: var(--mint); color: var(--mint); }
input[type="range"] { accent-color: var(--coin); width: min(100%, 18rem); padding: 0; background: none; border: 0; }

/* Stage */
.stage { grid-area: stage; text-align: center; padding: 1rem 0 0; }
.title { font: 400 clamp(1.6rem, 1.2rem + 2vw, 2.4rem)/1.05 var(--display); margin: 0; color: var(--ink); text-shadow: 0 3px 0 #000a; }
.tagline { color: var(--muted); margin: .35rem auto 1rem; max-width: 34ch; }
.counter { margin: .5rem 0; }
.big {
  font: 400 clamp(2.6rem, 1.6rem + 6vw, 4.8rem)/1 var(--display); margin: 0; font-variant-numeric: tabular-nums;
  color: var(--coin); text-shadow: 0 0 24px #ffb54755, 0 4px 0 #6b3e00; overflow-wrap: anywhere;
}
.big.bump { animation: bump .18s ease-out; }
@keyframes bump { 50% { transform: scale(1.06); } }
.rate span { display: inline-block; font: 400 .9rem/1 var(--mono); color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: .45rem .8rem; }

.toy-stage { position: relative; margin: 1.2rem auto .4rem; width: min(17rem, 72vw); min-height: min(17rem, 72vw); display: grid; place-items: center; }
.orb-wrap { position: relative; width: 100%; aspect-ratio: 1; }
.fx { position: absolute; inset: -25%; width: 150%; height: 150%; pointer-events: none; z-index: 2; }

/* Pop-it */
.popit { display: grid; grid-template-columns: repeat(4, 1fr); gap: .45rem; padding: .7rem; width: min(17rem, 72vw); border-radius: 22px;
  background: linear-gradient(135deg, #7fd1ae, #93b4ff 50%, #ffb547); box-shadow: 0 10px 30px #0008; }
.popit.flip { animation: sheet .45s ease-in-out; }
@keyframes sheet { 50% { transform: perspective(700px) rotateY(90deg); } }
.bubble { aspect-ratio: 1; min-width: 44px; border-radius: 50%; border: 0; cursor: pointer; padding: 0;
  background: radial-gradient(circle at 35% 30%, #fff9, #fff2 40%, #0002 75%); box-shadow: inset 0 -4px 6px #0003, 0 3px 4px #0004; transition: transform .08s; }
.bubble[aria-pressed="true"] { background: radial-gradient(circle at 50% 60%, #0003, #0001 60%); box-shadow: inset 0 4px 6px #0005; transform: scale(.92); }
.bubble:active { transform: scale(.88); }

/* Wheel */
.wheel-wrap { position: relative; width: 100%; aspect-ratio: 1; }
.wheel { width: 100%; height: 100%; border-radius: 50%; touch-action: none; cursor: grab; filter: drop-shadow(0 10px 20px #0009); }
.wheel:active { cursor: grabbing; }
.wheel-pin { position: absolute; left: 50%; top: -6px; width: 0; height: 0; transform: translateX(-50%);
  border-left: 12px solid transparent; border-right: 12px solid transparent; border-top: 22px solid var(--ink); z-index: 1; }

/* Switch */
.switch-wrap { width: 100%; display: grid; place-items: center; min-height: 12rem; }
.lever { background: none; border: 0; padding: .5rem; cursor: pointer; }
.lever-track { display: block; width: 7rem; height: 13rem; border-radius: 3.5rem; background: var(--deep); border: 3px solid var(--line); position: relative; box-shadow: inset 0 6px 16px #000a; transition: background .15s; }
.lever-knob { position: absolute; left: 50%; top: .5rem; width: 5.6rem; height: 5.6rem; transform: translateX(-50%); border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff6dd, var(--coin) 50%, #8a3f0c); box-shadow: 0 6px 10px #0009; transition: top .12s cubic-bezier(.3,1.6,.5,1); }
.lever[aria-checked="true"] .lever-track { background: color-mix(in srgb, var(--mint) 30%, var(--deep)); }
.lever[aria-checked="true"] .lever-knob { top: calc(100% - 6.1rem); }
.lever.hit .lever-track { transform: scale(.98); }

.toys { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; margin: .2rem auto .8rem; }
.toys .chip[aria-pressed="true"] { border-color: var(--coin); color: var(--coin); }
html:not(.u-colour) .popit { background: #ddd; }
html:not(.u-colour) .lever-knob { background: #111; }
.orb {
  position: absolute; inset: 0; border-radius: 50%; border: 0; cursor: pointer; padding: 0;
  display: grid; place-items: center; touch-action: manipulation; -webkit-tap-highlight-color: transparent; user-select: none;
  background:
    radial-gradient(circle at 35% 30%, #fff6dd 0%, #ffd27a 18%, #ffb547 45%, #d9771f 75%, #8a3f0c 100%);
  box-shadow: 0 0 0 6px #ffb54722, 0 0 50px 8px #ffb54755, inset 0 -14px 30px #7a2f0088, inset 0 10px 24px #fff8;
  transition: transform .09s ease-out, box-shadow .2s;
  animation: breathe 3.2s ease-in-out infinite;
}
.orb:hover { box-shadow: 0 0 0 8px #ffb54733, 0 0 70px 14px #ffb54766, inset 0 -14px 30px #7a2f0088, inset 0 10px 24px #fff8; }
.orb:active, .orb.hit { transform: scale(.93); }
.orb:focus-visible { outline-offset: 8px; }
.orb-glyph { font: 400 clamp(7rem, 4rem + 14vw, 10rem)/1 var(--glyph); color: #5a2600; transform: translateY(-.2em); text-shadow: 0 2px 0 #ffe7b0aa; }
@keyframes breathe { 50% { box-shadow: 0 0 0 10px #ffb54718, 0 0 64px 12px #ffb54766, inset 0 -14px 30px #7a2f0088, inset 0 10px 24px #fff8; } }
.pops { position: absolute; inset: 0; pointer-events: none; }
.pop { position: absolute; font: 400 1.25rem/1 var(--display); color: var(--coin-hot); text-shadow: 0 2px 0 #000; animation: rise .9s ease-out forwards; white-space: nowrap; }
.pop.big-pop { font-size: 1.7rem; color: #fff; }
@keyframes rise { from { opacity: 1; transform: translate(-50%, 0) scale(1.1); } to { opacity: 0; transform: translate(-50%, -4.5rem) scale(.9); } }
.tapval { font: 400 .8rem/1.4 var(--mono); color: var(--muted); letter-spacing: .06em; margin: 0 0 1rem; }

.next { max-width: 24rem; margin: 0 auto .8rem; text-align: left; }
.next-text { display: flex; justify-content: space-between; gap: 1rem; font: 400 .8rem/1.4 var(--mono); color: var(--muted); margin-bottom: .3rem; }
.bar { height: 12px; background: var(--deep); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--mint), var(--coin)); border-radius: 999px; transition: width .25s ease-out; }
.status { min-height: 1.6em; font: 400 .9rem/1.5 var(--mono); color: var(--coin-hot); }

/* Panel and tabs */
.panel { grid-area: panel; background: #1a172acc; border: 1px solid var(--line); border-radius: 20px; padding: .6rem; box-shadow: 0 20px 50px #0008; min-width: 0; }
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: .35rem; background: var(--deep); padding: .3rem; border-radius: 14px; position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; }
.tabs [role="tab"] { font: 400 .78rem/1 var(--display); letter-spacing: .03em; color: var(--muted); background: transparent; border: 0; border-radius: 10px; min-height: 44px; cursor: pointer; padding: .4rem .2rem; display: flex; align-items: center; justify-content: center; gap: .35rem; }
.tabs [role="tab"][aria-selected="true"] { background: var(--panel-2); color: var(--ink); box-shadow: inset 0 -3px 0 var(--coin); }
.badge { font: 400 .7rem/1 var(--mono); background: var(--coin); color: var(--deep); border-radius: 999px; padding: .2rem .4rem; }
.pane { padding: 1rem .5rem .5rem; }

/* Shop cards */
.shop, .finds { list-style: none; padding: 0; margin: .8rem 0 0; }
.shop { display: grid; gap: .5rem; }
.buy {
  width: 100%; display: grid; grid-template-columns: 3rem 1fr auto; align-items: center; gap: .1rem .8rem; text-align: left;
  background: var(--panel); color: var(--ink); border: 2px solid var(--line); border-radius: 14px; padding: .55rem .75rem;
  font: inherit; cursor: pointer; min-height: 64px; transition: transform .08s, border-color .15s, background .15s;
}
.buy .icon { grid-row: span 2; font-size: 1.7rem; width: 3rem; height: 3rem; display: grid; place-items: center; background: var(--deep); border-radius: 12px; }
.buy .name { font-weight: 600; line-height: 1.25; }
.buy .count { grid-row: span 2; font: 400 1.4rem/1 var(--display); color: var(--ink); min-width: 2ch; text-align: right; }
.buy .meta { font: 400 .78rem/1.4 var(--mono); color: var(--muted); }
.buy .cost { color: var(--coin); }
.buy[aria-disabled="false"] { border-color: var(--coin); background: linear-gradient(180deg, #3a2e3e, var(--panel)); }
.buy[aria-disabled="false"]:hover { transform: translateY(-2px); }
.buy[aria-disabled="false"]:active { transform: scale(.98); }
.buy[aria-disabled="true"] { opacity: .78; }
.buy.locked .icon { filter: grayscale(1) brightness(.4); }
.buy.locked .name { color: var(--muted); font-style: italic; }
.buy.bought { animation: bought .35s ease-out; }
@keyframes bought { 40% { transform: scale(1.03); border-color: var(--mint); } }

/* Buttons */
.cta, .ghost {
  font: 400 .9rem/1.1 var(--display); letter-spacing: .03em; border-radius: 12px; padding: .75rem 1.1rem; min-height: 48px;
  cursor: pointer; margin: .25rem .5rem .25rem 0; border: 2px solid var(--coin);
}
.cta { background: var(--coin); color: #2a1500; box-shadow: 0 4px 0 #9a5a10; }
.cta:active { transform: translateY(3px); box-shadow: 0 1px 0 #9a5a10; }
.ghost { background: transparent; color: var(--coin); }
.cta[aria-disabled="true"] { background: var(--panel); color: var(--muted); border-color: var(--line); box-shadow: none; cursor: not-allowed; }
.cta.danger { background: var(--ink); border-color: var(--ink); color: var(--deep); box-shadow: 0 4px 0 #77738a; } /* no red: no alarm colours */
.row { display: flex; flex-wrap: wrap; align-items: center; }

/* Jar */
.jar-stage { display: flex; align-items: center; gap: 1rem; margin: 1rem 0; flex-wrap: wrap; }
.jar { font-size: 3.6rem; line-height: 1; filter: drop-shadow(0 6px 10px #000a); }
.jar.shake { animation: shake .5s ease-in-out; }
@keyframes shake { 20% { transform: rotate(-14deg); } 40% { transform: rotate(12deg); } 60% { transform: rotate(-8deg); } 80% { transform: rotate(5deg); } }
.card-reveal {
  --r: var(--common); display: grid; grid-template-columns: 4rem 1fr; gap: .2rem .9rem; align-items: center;
  border: 2px solid var(--r); border-radius: 16px; padding: .9rem; margin: 0 0 1rem;
  background: radial-gradient(circle at 15% 50%, color-mix(in srgb, var(--r) 22%, transparent), var(--panel) 70%);
  box-shadow: 0 0 30px color-mix(in srgb, var(--r) 35%, transparent);
}
.card-reveal .ic { grid-row: span 3; font: 400 2.8rem/1 var(--glyph); text-align: center; }
.card-reveal .what { font-weight: 700; font-size: 1.1rem; margin: 0; }
.card-reveal .line { font: 400 .78rem/1.4 var(--mono); color: var(--r); margin: 0; letter-spacing: .04em; }
.card-reveal .fact { margin: .3rem 0 0; grid-column: 1 / -1; color: var(--ink); }
.card-reveal.pop-in { animation: flip .55s cubic-bezier(.2,1.4,.4,1); }
@keyframes flip { from { opacity: 0; transform: perspective(600px) rotateY(80deg) scale(.8); } to { opacity: 1; transform: none; } }
.card-reveal.veryRare { animation: flip .55s cubic-bezier(.2,1.4,.4,1), shine 1.2s ease-out .5s 2; }
@keyframes shine { 50% { box-shadow: 0 0 60px var(--r); } }
.r-common, .finds .r-common { --r: var(--common); }
.r-uncommon, .finds .r-uncommon { --r: var(--uncommon); }
.r-rare, .finds .r-rare { --r: var(--rare); }
.r-veryRare, .finds .r-veryRare { --r: var(--veryRare); }

.odds { border-collapse: collapse; margin: .5rem 0 1rem; font-size: .9rem; width: 100%; }
.odds caption { text-align: left; color: var(--muted); font-size: .82rem; padding-bottom: .3rem; }
.odds th, .odds td { text-align: left; padding: .35rem .6rem .35rem 0; border-bottom: 1px solid var(--line); }
.odds td:first-child { color: var(--r); font-weight: 600; }
.odds td + td { font-family: var(--mono); }

/* Collection */
.finds { display: grid; grid-template-columns: repeat(auto-fill, minmax(4.4rem, 1fr)); gap: .45rem; }
.tile {
  --r: var(--common); width: 100%; aspect-ratio: 1; border-radius: 12px; border: 2px solid var(--r); background: var(--panel);
  display: grid; place-items: center; font: 400 1.9rem/1 var(--glyph); color: var(--ink); cursor: pointer; position: relative; padding: 0;
}
.tile .st { position: absolute; bottom: 3px; left: 0; right: 0; font: 400 .6rem/1 var(--mono); color: var(--coin); letter-spacing: -.05em; }
.tile.unknown { border-style: dashed; border-color: var(--line); color: var(--line); font-family: var(--display); font-size: 1.3rem; cursor: default; background: var(--deep); }
.tile[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--coin); }
.find-detail { margin-top: 1rem; }

/* More */
.box { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 1rem; margin-bottom: .7rem; }
.code { font: 400 1.3rem/1.3 var(--mono); letter-spacing: .06em; color: var(--coin); margin: .8rem 0 .2rem; }
.field { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .8rem; }
.field label { flex-basis: 100%; font-weight: 600; }
input, textarea { font: 400 1rem/1.4 var(--mono); color: var(--ink); background: var(--deep); border: 2px solid var(--line); border-radius: 10px; padding: .55rem .7rem; min-height: 44px; max-width: 100%; }
input:focus, textarea:focus { border-color: var(--coin); }
textarea { width: 100%; }
input[type="file"] { font-family: var(--body); border: 0; background: none; padding-left: 0; }
.foot { color: var(--muted); font-size: .85rem; padding: 1rem .5rem .3rem; }
.foot p { margin-bottom: .4rem; }

.rest { position: fixed; inset: 0; background: var(--night); display: grid; place-items: center; z-index: 40; text-align: center; padding: 16px; }
.big-word { font: 400 clamp(2.5rem, 2rem + 4vw, 4rem)/1.1 var(--display); color: var(--coin); margin-bottom: .5rem; }

/* About page */
.prose { max-width: 44rem; margin: 0 auto; padding: 1rem max(16px, env(safe-area-inset-right, 0px)) 3rem max(16px, env(safe-area-inset-left, 0px)); }
.prose h1 { font: 400 clamp(1.6rem, 1.2rem + 2vw, 2.4rem)/1.1 var(--display); color: var(--coin); }
.prose h2 { margin-top: 1.8rem; }
.prose li { margin-bottom: .4rem; }
.prose article + article { border-top: 1px solid var(--line); margin-top: 2.5rem; padding-top: 1rem; }
.bar-top { display: flex; justify-content: space-between; align-items: center; max-width: 44rem; margin: 0 auto; padding: .5rem max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); }

/* Rested boost */
.rest-meter { max-width: 24rem; margin: 0 auto .9rem; text-align: left; }
.rest-bar span { background: linear-gradient(90deg, #6b8cff, var(--mint)); }
.logo-on-light { display: none !important; }
html:not(.u-colour) .logo-on-light { display: block !important; }
html:not(.u-colour) .logo-on-dark { display: none !important; }
html:not(.u-colour) .title { text-shadow: none; }
html:not(.u-colour) .rest-bar span { background: #111; }

/* Unlocks */
.unlock {
  font: 400 1rem/1.2 var(--display); color: var(--deep); background: var(--mint); border: 0; border-radius: 14px;
  padding: .8rem 1.2rem; min-height: 48px; cursor: pointer; margin: 0 auto .8rem; box-shadow: 0 4px 0 #3c7d61;
  animation: wiggle 2.4s ease-in-out infinite;
}
@keyframes wiggle { 0%, 80%, 100% { transform: none; } 85% { transform: rotate(-3deg); } 90% { transform: rotate(3deg); } 95% { transform: rotate(-2deg); } }
.unlocked-card { max-width: 24rem; margin: 0 auto 1rem; padding: .8rem 1rem; border: 2px dashed var(--mint); border-radius: 14px; text-align: left; animation: flip .5s ease-out; }
.unlocked-card .what { font: 400 1rem/1.3 var(--display); color: var(--mint); margin: 0 0 .2rem; }
.unlocked-card p { margin: 0; }

/* ---- Before the unlocks: the game starts as a plain page, and grows into the look above. ---- */
html:not(.u-colour) {
  --night: #ffffff; --deep: #f2f2f2; --panel: #ffffff; --panel-2: #e8e8e8; --line: #767676;
  --ink: #111111; --muted: #4a4a4a; --coin: #111111; --coin-hot: #111111; --mint: #0b5d3a;
  --common: #111; --uncommon: #111; --rare: #111; --veryRare: #111;
  color-scheme: light;
}
html:not(.u-colour) body { background: #fff; }
html:not(.u-colour) .big { text-shadow: none; }
html:not(.u-colour) .panel { background: #fff; box-shadow: none; border-radius: 0; }
html:not(.u-colour) .cta, html:not(.u-colour) .unlock { box-shadow: none; color: #fff; }
html:not(.u-colour) .buy[aria-disabled="false"] { background: #fff; }
html:not(.u-colour) .bar span { background: #111; }
html:not(.u-fonts) { --display: "Times New Roman", Times, serif; }
html:not(.u-fonts) .title, html:not(.u-fonts) h2, html:not(.u-fonts) .tabs [role="tab"], html:not(.u-fonts) .cta, html:not(.u-fonts) .ghost, html:not(.u-fonts) .chip, html:not(.u-fonts) .unlock { letter-spacing: 0; text-transform: none; }
html:not(.u-coin) .orb-wrap { width: auto; aspect-ratio: auto; }
html:not(.u-coin) .toy-stage { min-height: 0; margin: 1rem auto .5rem; }
html:not(.u-coin) .orb {
  position: static; display: inline-block; padding: .6rem 2.2rem; border-radius: 4px; animation: none;
  background: var(--deep); border: 2px solid var(--ink); box-shadow: none; min-height: 48px;
}
html:not(.u-coin) .orb-glyph { font: 400 2.2rem/1 var(--glyph); color: var(--ink); text-shadow: none; transform: none; }
html:not(.u-coin) .orb:active, html:not(.u-coin) .orb.hit { transform: translateY(2px); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Music box */
.parts { border: 1px solid var(--line); border-radius: 12px; padding: .4rem .8rem .6rem; margin: .8rem 0 0; }
.parts legend { font-weight: 600; padding: 0 .3rem; }
.field.check { flex-wrap: nowrap; margin-top: .4rem; }
.field.check label { flex-basis: auto; font-weight: 400; }
.field.check input { width: 24px; height: 24px; min-height: 0; accent-color: var(--coin); }
#moods { gap: .4rem; margin-top: .5rem; }
#moods .chip[aria-pressed="true"] { border-color: var(--coin); color: var(--coin); }
.tracks { list-style: none; padding: 0; margin: .8rem 0 0; display: grid; gap: .5rem; }
.tracks li { display: flex; flex-wrap: wrap; align-items: center; gap: .1rem .3rem; background: var(--deep); border-radius: 12px; padding: .4rem .6rem; }
.tracks .ghost { min-height: 44px; padding: .5rem .7rem; font-size: .75rem; margin: 0; }
.code-sm { font: 400 .85rem/1.3 var(--mono); color: var(--coin); flex-basis: 100%; overflow-wrap: anywhere; }
.box h3 { font: 400 1rem/1.2 var(--display); margin: 1.2rem 0 .3rem; }

/* Coin flip and coin looks */
.orb.flipping { animation: coinflip .32s ease-out, breathe 3.2s ease-in-out infinite; }
@keyframes coinflip { 0% { transform: rotateY(0) scale(.93); } 50% { transform: rotateY(90deg) scale(1.04); } 100% { transform: rotateY(0) scale(1); } }
.orb.on-side { transform: rotateY(80deg); }
html.skin-silver .orb { background: radial-gradient(circle at 35% 30%, #ffffff 0%, #e6ecf2 20%, #b9c3cf 50%, #7c8796 78%, #3f4753 100%); }
html.skin-silver .orb-glyph { color: #2b313a; }
html.skin-copper .orb { background: radial-gradient(circle at 35% 30%, #ffe9dc 0%, #f0a77c 22%, #c96a3c 50%, #8c3f1c 78%, #4a1d0a 100%); }
html.skin-copper .orb-glyph { color: #3a1405; }
html.skin-mint .orb { background: radial-gradient(circle at 35% 30%, #f2fff9 0%, #a6f5d4 22%, #4fd6a4 50%, #1f8f68 78%, #0b4a35 100%); }
html.skin-mint .orb-glyph { color: #06301f; }
html.skin-night .orb { background: radial-gradient(circle at 35% 30%, #d9d4ff 0%, #8f84e8 20%, #4b3fb0 50%, #241c66 78%, #0e0a2e 100%); }
html.skin-night .orb-glyph { color: #ffd27a; text-shadow: 0 0 12px #ffb54799; }
.speed-data { white-space: pre-wrap; word-break: break-all; font: .75rem/1.4 var(--mono, monospace); background: #0006; padding: .6rem; border-radius: .5rem; max-height: 8rem; overflow: auto; }
@media (prefers-reduced-motion: reduce) { .orb.flipping { animation: none; } }

/* How people play: one small bar chart per toy, bar height = share of 10-second windows at that speed */
.spark-chart { margin: .6rem 0; }
.spark-chart figcaption { font-size: .85rem; color: var(--muted); }
.spark-chart .bars { display: flex; align-items: flex-end; gap: 3px; height: 4rem; margin-top: .3rem; }
.spark-chart .bars span { flex: 1; height: calc(var(--h) * 100%); min-height: 2px; background: var(--coin); border-radius: 2px 2px 0 0; }
.spark-chart .axis { font-size: .75rem; color: var(--muted); display: flex; justify-content: space-between; }

/* MonsterStory frame */
.ms-wrap { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; background: var(--night); padding: .5rem; gap: .5rem; }
.ms-wrap[hidden] { display: none; }
.ms-bar { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin: 0; }
.ms-wrap iframe { flex: 1; width: 100%; border: 1px solid var(--muted); border-radius: .6rem; background: #101923; }
#box-ms .meter { height: .5rem; background: #0006; border-radius: .3rem; overflow: hidden; margin: .3rem 0; }
#box-ms .meter i { display: block; height: 100%; width: 0; background: var(--mint); }
.ms-help { margin: 0 0 0 auto; }
