/* Orbital Teapot. Loaded after tokens.css and site.css, so the header, footer, kicker, title and
   lede are the site's own. This file styles the lab: the chamber, the instrument panels, missions
   and the shop. Rule of thumb: page chrome speaks the site's language (Georgia, peach, amber);
   instruments speak mono; space itself is the only place violet appears. */

button, input, select { font: inherit; }
button { cursor: pointer; }
button, select { color: inherit; }
button:disabled { cursor: default; }
:is(button, input, select, a, canvas):focus-visible { outline: 2px solid var(--peach); outline-offset: 3px; }
svg.icon { width: 1.15rem; height: 1.15rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }

.wrap.lab { width: min(100% - 2 * var(--gutter), 92rem); }
/* Zero-specificity resets, so site.css heading and paragraph spacing stays out of the instruments. */
:where(.lab, #guide) h2 { margin: 0; }
:where(.lab) p { margin: 0; }

.header-actions, .header-button, .panel-heading, .panel-heading > div, .field-row,
.gravity-control, .gravity-control label, .select-wrap, .live-label, .canvas-hints, .canvas-hints > span,
.module-label, .launch-button, .telemetry, .telemetry-title, .readings, .reading, .guide-heading { display: flex; align-items: center; }

/* Header: the site header, plus the playground's own two tools. */
.site-header .tools { position: relative; }
.header-actions { gap: .15rem; }
.header-button {
  gap: .45rem; min-height: 2.75rem; padding: .5rem .8rem; color: var(--text); background: none;
  border: 0; border-radius: var(--radius-pill); font-size: .92rem; font-weight: 600; text-decoration: none;
}
a.header-button { color: var(--text); }
.header-button:hover { color: var(--peach); background: var(--panel-2); }
.header-button .icon { width: 17px; height: 17px; color: var(--amber); }
.landing-soundtrack .header-button .icon { color: inherit; }

/* Intro */
.introduction { padding: 0 0 clamp(1.25rem, 3vh, 2rem); }
.kicker .brand-mark { width: 1.6rem; height: 1.6rem; margin: -.3rem 0; color: var(--peach); }
.lab .page-title { display: flex; align-items: baseline; gap: .17em; width: fit-content; margin-bottom: .5rem; }
.title-stars { width: .42em; height: .42em; margin-left: .015em; align-self: flex-start; margin-top: .08em; color: var(--amber); }
.lab .lede { margin: 0; color: var(--muted); }

/* Instrument labels */
.module-label, .live-label, .telemetry-title {
  font-family: var(--font-mono); font-size: .75rem; line-height: 1.35; text-transform: uppercase; letter-spacing: .095em; font-weight: 400;
}

/* The chamber: space. */
.workbench { display: grid; grid-template-columns: minmax(0,1fr) clamp(283px,23vw,340px); gap: clamp(16px,1.6vw,25px); align-items: stretch; }
.chamber {
  position: relative; overflow: hidden; isolation: isolate; background: var(--space-deep); color: var(--star);
  border: 1px solid var(--line); border-radius: var(--radius-xl); min-height: clamp(420px,54vh,665px);
  box-shadow: 0 0 0 1px #00000040, 0 1.5rem 4rem -1.5rem #0a0406;
}
.nebula, .chamber > canvas, #flyby, .chamber-top, .chamber-bottom { position: absolute; }
.nebula, .chamber > canvas, #flyby { inset: 0; width: 100%; height: 100%; }
.nebula {
  background: radial-gradient(ellipse at 32% 72%,var(--nebula),transparent 60%),radial-gradient(ellipse at 80% 22%,var(--nebula-2),transparent 55%),var(--space);
  pointer-events: none;
}
.nebula::before {
  content: ""; position: absolute; inset: 0;
  background: url("./assets/carina-nebula.jpg") center 53% / cover no-repeat;
  filter: grayscale(1) contrast(1.3);
  opacity: calc(.20 + var(--bass, 0) * .13 + var(--pulse, 0) * .05);
  transform: scale(calc(1 + var(--bass, 0) * .018));
  mix-blend-mode: screen;
}
.nebula::after {
  content:""; position: absolute; inset:0;
  /* A warm floor of espresso light, so the chamber belongs to the page around it. */
  background: radial-gradient(ellipse at 46% 48%,#5039591a,transparent 62%), linear-gradient(0deg,#1a0f10e0,transparent 30%,transparent 82%,#100e1c6b), linear-gradient(100deg,#2a160f55,transparent 60%,#1a152c45);
}
#simulation { touch-action: none; cursor: none; outline-offset: -5px; }
#simulation:focus:not(:focus-visible) { outline: none; }
#sky, #flyby { pointer-events: none; }
#flyby { overflow: hidden; }
.chamber-top, .chamber-bottom { left: clamp(15px,1.65vw,24px); right: clamp(15px,1.65vw,24px); display: flex; align-items: center; justify-content: space-between; pointer-events: none; }
.chamber-top { top: 18px; }
.chamber-bottom { bottom: 19px; gap: .4rem; }
.live-label { gap: .52rem; color: var(--star); font-size: .72rem; letter-spacing: .11em; }
.live-label > span {
  width: 7px; height: 7px; border-radius: 50%; background: var(--signal);
  transform: scale(calc(1 + var(--pulse, 0) * .35));
  box-shadow: 0 0 calc(8px + var(--pulse, 0) * 10px) rgb(172 216 184 / calc(.5 + var(--pulse, 0) * .45));
}
.expand-button, .icon-button {
  display: inline-grid; place-items: center; padding: 0; border: none; background: transparent; border-radius: var(--radius-sm);
}
.expand-button { width: 34px; height: 34px; pointer-events: auto; color: var(--text); border: 1px solid #ffd5a740; background: #20120e80; backdrop-filter: blur(6px); }
.expand-button:hover { background: #42281bcc; border-color: #ffd5a780; }
.expand-button .icon { width: 16px; height: 16px; }
.canvas-hints { gap: 12px; font-size: .82rem; font-weight: 500; color: var(--star); }
.canvas-hints > span { gap: .43rem; }
.canvas-hints .icon { width: 15px; height: 15px; color: var(--violet); }
.hint-rule { height: 13px; border-left: 1px solid #ddd5ee5c; }
.canvas-hints b { font-weight: 500; }
.touch-hint { display:none; }
.axis-marker { color: #c3bbcfe0; font: .75rem var(--font-mono); }
.axis-marker span { padding: 0 2px; color: #8d839a; }
.chamber:fullscreen, .chamber.expanded { border-radius: 0; width: 100%; height: 100%; border: 0; }
.chamber.expanded { position: fixed; inset: 0; z-index: 100; min-height: 0; }
body.expanded-view { overflow: hidden; }

/* Instruments: site panels. */
.instruments { display: grid; grid-template-rows: auto minmax(146px,1fr); gap: 15px; }
.controls {
  --brew-inset: clamp(18px,1.55vw,25px);
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--brew-inset);
}
.panel-heading { justify-content: space-between; margin: -.25rem -.25rem 1.15rem 0; }
.panel-heading > div { gap: .58rem; }
.panel-heading h2, .missions-heading h2, .shop-heading h2 { font: 400 1.55rem/1.15 var(--font-display); letter-spacing: -.03em; }
.panel-heading > div > .icon, .missions-heading .icon, .shop-heading .icon { width: 18px; height: 18px; color: var(--amber); }
.icon-button { width: 32px; height: 32px; color: var(--muted); }
.icon-button:hover { color: var(--text); background: var(--panel-2); }
.icon-button .icon { width: 16px; height: 16px; }
.blends { border: none; padding: 0; margin: 0; min-width: 0; }
.blends legend, .field-row label, .gravity-control label { font-size: .9rem; font-weight: 600; }
.blends legend { padding: 0; margin-bottom: .55rem; }
.blend-choices { display: grid; grid-template-columns: 1fr 1fr 1.05fr; gap: 5px; }
.blend { position: relative; min-width: 0; }
.blend input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; width: 100%; height: 100%; }
.blend > span {
  display: flex; justify-content: center; align-items: center; gap: 5px; min-height: 35px; padding: 3px 4px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg);
  font-size: .8rem; font-weight: 550; text-align: center; line-height: 1.15;
}
.blend span > i { width: 9px; height: 9px; border-radius: 100%; background: var(--swatch); box-shadow: 0 0 0 2px #ffffff14; flex: none; }
.blend input:checked + span { background: color-mix(in srgb,var(--swatch) 24%,var(--panel)); border-color: color-mix(in srgb,var(--swatch) 70%,var(--peach)); }
.blend input:focus-visible + span { outline: 2px solid var(--peach); outline-offset: 2px; }
.blend:hover > span { border-color: var(--amber); }
.blend.locked > span { color: var(--faint); background: repeating-linear-gradient(135deg,var(--bg) 0 6px,var(--panel) 6px 12px); border-style: dashed; }
.blend.locked span > i { background: none; box-shadow: none; width: 10px; height: 10px; border-radius: 0;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 11V8a5 5 0 0 1 10 0v3h1.5v10h-13V11zm2.5 0h5V8a2.5 2.5 0 0 0-5 0z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 11V8a5 5 0 0 1 10 0v3h1.5v10h-13V11zm2.5 0h5V8a2.5 2.5 0 0 0-5 0z'/%3E%3C/svg%3E") center/contain no-repeat;
  background-color: var(--faint); }
.blend.locked:hover > span { border-color: var(--line); }
.blend.locked input:checked + span { color: inherit; background: color-mix(in srgb,var(--swatch) 24%,var(--panel)); border-color: color-mix(in srgb,var(--swatch) 70%,var(--peach)); }
.blend.locked input { cursor: not-allowed; }
.blend-lock-note { margin-top: .55rem; color: var(--muted); font-size: .78rem; line-height: 1.4; }

/* Fill level: a peach rail, and a violet portal past 100% (the one bit of space outside the chamber). */
.fill-control {
  --fill: 65%; --spillover: 0px; --portal-inset: 5px;
  --detour-length: calc(var(--spillover) - var(--portal-inset));
  margin-top: 1.22rem;
}
.fill-control.has-infinity { --spillover: calc(var(--brew-inset) + 17px); }
.field-row { justify-content: space-between; }
.field-row output { color: var(--peach); font: .8rem var(--font-mono); }
.fill-control.is-infinite output { color: var(--violet); font: 650 1.25rem/1 var(--font-body); }
.fill-slider {
  position: relative; height: 32px; margin-inline-end: calc(-1 * var(--spillover));
  touch-action: pan-y; cursor: pointer;
}
.has-infinity .fill-slider { height: 40px; z-index: 1; }
#fill {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; pointer-events: none;
}
.fill-slider:has(#fill:focus-visible) {
  outline: 2px solid var(--peach); outline-offset: -1px; border-radius: 6px;
}
.fill-rail {
  position: absolute; top: 14px; inset-inline: 7px calc(7px + var(--spillover));
  height: 4px; border-radius: 4px; pointer-events: none;
  background: linear-gradient(to right, var(--amber) var(--fill), var(--panel-3) var(--fill));
}
.fill-thumb {
  position: absolute; top: 50%; left: var(--fill); transform: translate(-50%, -50%);
  width: 15px; height: 15px; border: 2px solid var(--panel); border-radius: 50%;
  background: var(--peach); box-shadow: 0 0 0 1px var(--peach);
}
.fill-limit, .fill-detour { display: none; }
.has-infinity .fill-limit {
  display: block; position: absolute; top: 11px; left: 100%; transform: translateX(-50%);
  color: var(--muted); font: .67rem var(--font-mono);
}
.has-infinity .fill-detour {
  display: block; position: absolute; left: 100%; top: 0; width: var(--detour-length); height: 4px;
  background: repeating-linear-gradient(90deg, #7f6aa8 0 4px, transparent 4px 7px);
  transform-origin: left center; animation: tea-detour .38s cubic-bezier(.15,.7,.25,1) both;
}
.fill-portal {
  position: absolute; top: 50%; left: 100%; transform: translate(-50%, -50%);
  display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--space); color: var(--violet); border: 1px solid #7f6aa8; box-shadow: 0 0 0 2px var(--panel);
  font: 650 1.18rem/1 var(--font-body);
}
.is-infinite .fill-detour {
  background: repeating-linear-gradient(90deg, var(--violet) 0 4px, transparent 4px 7px);
}
.is-infinite .fill-portal {
  background: var(--violet-deep); color: var(--text); border-color: var(--violet);
  box-shadow: 0 0 0 2px var(--panel), 0 0 14px #b9a6f266;
  animation: tea-portal-pop .38s cubic-bezier(.25,.85,.35,1) .18s;
}
.is-infinite .fill-portal::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; opacity: 0;
  animation: tea-portal-ring .56s ease-out .24s;
}
.is-infinite .fill-thumb {
  left: calc(100% + var(--detour-length)); opacity: 0;
  animation: tea-thumb-launch .32s ease-in both;
}
@keyframes tea-detour { from { transform: scaleX(.15); opacity: 0; } }
@keyframes tea-portal-pop { 40% { scale: .82; } }
@keyframes tea-portal-ring {
  from { opacity: .85; box-shadow: 0 0 0 2px var(--ember); }
  to { opacity: 0; box-shadow: 0 0 0 8px var(--ember); }
}
@keyframes tea-thumb-launch { from { left: 100%; opacity: 1; } 65% { opacity: 1; } }
@media (min-width: 951px) {
  .fill-control.has-infinity { --spillover: calc(var(--brew-inset) + 29px); }
}
@media (prefers-reduced-motion: reduce) {
  .fill-control .fill-detour, .fill-control .fill-portal, .fill-control .fill-portal::after,
  .fill-control .fill-thumb { animation: none; }
}
@media (forced-colors: active) {
  .fill-rail { border-top: 2px solid CanvasText; }
  .has-infinity .fill-detour { border-top: 2px dashed GrayText; }
  .fill-thumb { border-color: Highlight; }
}
.gravity-control { justify-content: space-between; margin-top: .9rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.gravity-control label { gap: .45rem; }
.gravity-control label .icon { width: 15px; height: 15px; color: var(--amber); }
.select-wrap { position: relative; }
.select-wrap > .icon { position: absolute; width: 13px; height: 13px; right: .55rem; pointer-events: none; color: var(--amber); }
select { appearance: none; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-pill); padding: .35rem 1.8rem .35rem .8rem; cursor: pointer; font-size: .85rem; }
select:hover { border-color: var(--amber); }

/* Biscuit satellite: a small window onto the same space as the chamber. */
.satellite {
  position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: center;
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: radial-gradient(ellipse at 82% 40%,#45304e,transparent 65%), linear-gradient(115deg,var(--panel),#241722 70%,#1e1527);
}
.satellite-copy { position: relative; pointer-events: none; padding: 18px clamp(18px,1.55vw,25px); }
.module-label { gap: .4rem; color: var(--violet); }
.module-label .icon { width: 14px; height: 14px; }
.satellite h2 { font: 400 clamp(1.62rem,2.1vw,2.05rem)/1.1 var(--font-display); letter-spacing: -.035em; margin: .38rem 0 .82rem; color: var(--text); }
.launch-button {
  position: relative; pointer-events: auto; gap: .43rem; min-height: 2.4rem; padding: .45rem .95rem;
  color: var(--bg); background: var(--peach); border: 1px solid transparent; border-radius: var(--radius-pill);
  font-size: .85rem; line-height: 1.2; font-weight: 650;
  box-shadow: 0 0 calc(var(--pulse, 0) * 22px) rgb(255 213 167 / calc(var(--pulse, 0) * .36));
}
.launch-button .icon { width: 14px; height: 14px; }
.launch-button:hover { background: var(--text); }
.satellite-window { position: absolute; right: -3%; top: 0; height: 100%; width: 49%; display: grid; align-items: center; padding: 0; border: 0; background: none; cursor: pointer; }
.satellite-window:focus-visible { outline-offset: -5px; }
.biscuit-ship { display: block; position: relative; width: 100%; aspect-ratio: 216 / 176; }
.biscuit-ship canvas:not([hidden]) { display: block; width: 100%; height: 100%; }
#flyby .biscuit-ship { position: absolute; width: min(145px, 19%); }
.satellite-orbits { position: absolute; inset: 0; overflow:hidden; background: radial-gradient(1.6px 1.6px at 77% 15%,#d8ccef 88%,transparent),radial-gradient(1.4px 1.4px at 60% 70%,#c6b6e0 90%,transparent),radial-gradient(1px 1px at 92% 75%,#b3a6c6 90%,transparent),radial-gradient(1px 1px at 47% 21%,#e3d8f2 80%,transparent); }
.satellite-orbits::before, .satellite-orbits::after { content:""; position:absolute; width: 67%; height: 72%; left: 54%; top: 25%; border: 1px dashed #b9a6f240; border-radius: 50%; transform: rotate(-28deg); }
.satellite-orbits::after { width: 82%; height: 96%; left: 45%; top: 11%; }
.biscuit-fallback {
  position: absolute; left: 48%; top: 50%; width: 53%; aspect-ratio: 1;
  transform: translate(-50%, calc(-50% - var(--dance-hop, 0%)))
    rotate(calc(-22deg - var(--dance-roll, 0rad))) scaleY(calc(.83 + var(--dance-pitch, 0) * .3));
  border: 3px solid #ae6b30; border-radius: 50%;
  background: radial-gradient(ellipse at 30% 22%,#754120 4%,transparent 5%),radial-gradient(ellipse at 64% 45%,#754120 4%,transparent 5%),radial-gradient(ellipse at 38% 70%,#754120 5%,transparent 6%),radial-gradient(ellipse at 35% 25%,#f4cb85,#d89c57 65%,#9d5b2a);
}
.biscuit-fallback span { position:absolute; left:-28%; top:33%; width:158%; height:42%; border:4px double #9e63368c; border-top-color:transparent; border-radius:50%; }

/* Telemetry: a mono readout strip. */
.telemetry { margin: 1.4rem 0 0; padding-top: 1.1rem; border-top: 1px solid var(--line-soft); justify-content: space-between; gap: 1rem; }
.telemetry-title { gap: .5rem; color: var(--amber); }
.telemetry-title .icon {
  width: 16px; height: 16px; color: var(--amber);
  transform: scale(calc(1 + var(--pulse, 0) * .18));
  filter: drop-shadow(0 0 calc(var(--pulse, 0) * 4px) rgb(255 213 167 / calc(var(--pulse, 0) * .55)));
}
.readings { gap: 0; flex-wrap: wrap; justify-content: flex-end; }
.reading { color: var(--muted); gap: .45rem; font-size: .8rem; line-height: 1.3; }
.reading + .reading { border-left: 1px solid var(--line); padding-left: 1rem; margin-left: 1rem; }
.reading strong { color: var(--peach); font: .77rem var(--font-mono); }
#trace { width: 46px; height: 11px; }

/* Field guide */
#guide { color: var(--text); width: min(440px,calc(100% - 32px)); max-height: calc(100dvh - 40px); border: 1px solid var(--line-strong); border-radius: var(--radius-xl); background: var(--panel); padding: 1.65rem; box-shadow: 0 20px 80px #0a0406b0; }
#guide::backdrop { background: #10080599; backdrop-filter: blur(4px); }
.guide-heading { justify-content: space-between; margin-top:-.3rem; }
#guide h2 { font: 400 3rem/1.1 var(--font-display); letter-spacing: -.04em; margin: .55rem 0 .6rem; }
#guide h2 em { color: var(--peach); }
#guide .module-label { color: var(--amber); }
#guide p { margin: 0 0 1rem; font-size: 1rem; line-height: 1.5; color: var(--muted); }
.guide-keys { margin: 1.15rem 0; }
.guide-keys > div { display: flex; gap: .6rem; justify-content: space-between; align-items: baseline; padding: .53rem 0; border-top: 1px solid var(--line); font-size: .88rem; }
.guide-keys dd { margin: 0; text-align: right; color: var(--muted); }
kbd { font: .77rem var(--font-mono); color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: 1px 4px; margin: 0 1px; }
#guide .credit { font-size: .77rem; margin: 1.25rem 0 0; color: var(--faint); }
.no-script { position: absolute; left: 1rem; bottom: 4rem; background: var(--panel); padding: .5rem; }
.sr-only { clip-path: inset(50%); width:1px; height:1px; overflow:hidden; position:absolute; white-space:nowrap; }

/* Share your brew */
.chamber-actions { display: flex; gap: .5rem; }
.share-button { display: inline-flex; align-items: center; width: auto; gap: .45rem; padding: 0 .85rem 0 .7rem; border-radius: var(--radius-pill); font-size: .8rem; font-weight: 600; }
.share-button:disabled { opacity: .6; cursor: progress; }
.chamber-toast {
  position: absolute; left: 50%; top: 64px; z-index: 3; max-width: calc(100% - 32px);
  transform: translateX(-50%); margin: 0; padding: .55rem 1rem;
  color: var(--bg); font-size: .85rem; font-weight: 650; text-align: center;
  background: var(--peach); border-radius: var(--radius-pill); box-shadow: 0 10px 30px #0006;
  pointer-events: none;
}

/* Missions: site cards. */
.missions { margin: 2.25rem 0 0; }
.missions-heading, .shop-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.missions-heading { margin: 0 0 .9rem; }
.missions-heading > div, .shop-heading > div { display: flex; align-items: center; gap: .6rem; }
#mission-count { color: var(--amber); font-family: var(--font-mono); font-size: .8rem; }
.mission-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: .6rem; margin: 0; padding: 0; list-style: none; }
.mission { display: flex; gap: .65rem; align-items: flex-start; padding: .85rem .95rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.mission .icon { flex: none; width: 20px; height: 20px; margin-top: .1rem; color: var(--faint); }
.mission strong { display: block; font-size: .92rem; letter-spacing: -.01em; }
.mission span { display: block; color: var(--muted); font-size: .8rem; line-height: 1.4; }
.mission.done { border-color: var(--ember); background: color-mix(in srgb, var(--ember) 14%, var(--panel)); }
.mission.done .icon { color: var(--peach); }
@media (max-width: 34rem) { .share-button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); } .share-button { width: 34px; padding: 0; } }

/* Tea shop: site cards around windows onto space. */
.shop { margin: 2.5rem 0 0; scroll-margin-top: 5rem; }
.shop-heading { margin: 0 0 .4rem; }
.wallet { display: inline-flex; align-items: center; gap: .4rem; margin: 0; padding: .3rem .8rem .3rem .6rem; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--panel); color: var(--muted); font-size: .85rem; }
.wallet .icon { width: 17px; height: 17px; color: var(--amber); }
.wallet strong { color: var(--peach); font-size: 1.45rem; line-height: 1; font-weight: 650; }
.shop-intro { color: var(--muted); font-size: .95rem; margin-bottom: 1rem; }
.shop-tabs { display: flex; gap: .4rem; margin-bottom: .9rem; overflow-x: auto; }
.shop-tabs [role=tab] { min-height: 2.4rem; padding: .42rem 1rem; border: 1px solid var(--line); border-radius: var(--radius-pill); background: transparent; font-size: .88rem; font-weight: 600; white-space: nowrap; }
.shop-tabs [role=tab]:hover { background: var(--panel-2); }
.shop-tabs [aria-selected=true] { background: var(--peach); border-color: var(--peach); color: var(--bg); }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: .75rem; margin: 0; padding: 0; list-style: none; }
.shop-item { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel); overflow: hidden; transition: border-color .15s; }
.shop-item:hover { border-color: var(--amber); }
.shop-item.equipped { border-color: var(--peach); box-shadow: 0 0 0 1px var(--peach); }
.item-art { position: relative; aspect-ratio: 216 / 176; background: radial-gradient(ellipse at 30% 75%,var(--nebula),transparent 62%),radial-gradient(ellipse at 80% 20%,var(--nebula-2),transparent 58%),var(--space); }
#shop-biscuits .item-art, #shop-things .item-art { background: radial-gradient(ellipse at 70% 30%,#5a3f5a,transparent 70%),linear-gradient(140deg,#2e2036,var(--space)); }
.item-art canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.item-glyph { position: absolute; inset: 0; display: grid; place-items: center; font-size: 2.6rem; }
.painted .item-glyph, #shop-silhouettes .item-glyph, #shop-glass .item-glyph, #shop-finishes .item-glyph { display: none; }
.item-copy { padding: .8rem .9rem .2rem; flex: 1; }
.item-copy h3 { margin: 0; font: 400 1.3rem/1.15 var(--font-display); letter-spacing: -.02em; }
.item-copy p { margin-top: .2rem; color: var(--muted); font-size: .8rem; line-height: 1.4; }
.item-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .55rem .9rem .85rem; }
.price { display: inline-flex; align-items: center; gap: .3rem; font: .82rem var(--font-mono); color: var(--peach); }
.price .icon { width: 16px; height: 16px; color: var(--amber); }
.owned-label { font-family: var(--font-body); font-size: .78rem; color: var(--muted); }
.item-action { display: inline-flex; align-items: center; gap: .35rem; min-height: 2.1rem; padding: 0 .95rem; border: 1px solid var(--peach); border-radius: var(--radius-pill); background: var(--peach); color: var(--bg); font-size: .8rem; font-weight: 650; }
.item-action:hover:not(:disabled) { background: var(--text); border-color: var(--text); }
.item-action:disabled { opacity: .55; }
.owned .item-action { background: transparent; color: var(--text); border-color: var(--line); }
.owned .item-action:hover:not(:disabled) { background: var(--panel-2); color: var(--text); border-color: var(--line); }
.equipped .item-action { background: transparent; border-color: var(--ember); color: var(--peach); }
.item-action .icon { width: 15px; height: 15px; }

/* Layout */
@media (min-width: 1650px) { .chamber { min-height: clamp(500px,54vh,700px); } }
@media (max-width: 950px) and (min-width: 761px) { .workbench { grid-template-columns: minmax(0,1fr) 270px; gap: 12px; } .axis-marker { display: none; } }
@media (max-width: 760px) {
  .workbench { grid-template-columns: 1fr; gap: 13px; }
  .chamber { min-height: 0; height: clamp(295px,85vw,410px); border-radius: var(--radius-lg); }
  .chamber-top { top: 14px; }
  .chamber-bottom { bottom: 15px; }
  .instruments { grid-template-columns: minmax(0,1.32fr) minmax(0,1fr); grid-template-rows: auto; gap: 12px; }
  .satellite { align-items: flex-end; }
  .satellite-window { top:-5%; height:65%; width:68%; }
  .telemetry { margin-top: 1rem; padding-top: .85rem; }
  .axis-marker { display: none; }
}
@media (max-width: 48rem) {
  .header-actions .header-button { justify-content: center; min-width: 2.75rem; padding-inline: .5rem; }
  .header-actions .header-button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .header-actions .header-button .icon { width: 19px; height: 19px; }
}
/* The playground has two more header tools than other pages, so the soundtrack goes icon-only sooner. */
@media (max-width: 36rem) {
  .site-header .landing-soundtrack .soundtrack-toggle { min-width: 2.75rem; justify-content: center; }
  .site-header .landing-soundtrack .soundtrack-toggle.is-cold svg { display: block; }
  .site-header .landing-soundtrack #soundtrack-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
@media (max-width: 575px) {
  .instruments { grid-template-columns: 1fr; gap: 12px; }
  .controls { --brew-inset: 19px; padding-block: 17px; }
  .panel-heading { margin-bottom: .8rem; }
  .fill-control { margin-top: .9rem; }
  .gravity-control { margin-top: .6rem; padding-top: .65rem; }
  .satellite { min-height: 129px; align-items: center; }
  .satellite-window { right: 0; top: 0; width: 46%; height: 100%; }
  .satellite h2 { font-size: 1.85rem; margin: .22rem 0 .55rem; }
  .telemetry { flex-wrap:wrap; gap:.7rem; }
  .readings { justify-content:flex-start; row-gap:.6rem; }
  .reading + .reading { margin-left:.62rem; padding-left:.62rem; }
  #trace { width:24px; }
  .shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
  .item-copy { padding: .6rem .65rem .1rem; }
  .item-copy h3 { font-size: 1.1rem; }
  .item-copy p { font-size: .75rem; }
  .item-foot { padding: .45rem .65rem .65rem; }
  .item-action { padding: 0 .7rem; }
}
@media (max-width: 360px) {
  .shop-link { display: none; } /* the shop is a scroll away; the menu button needs the room */
  .fill-control.has-infinity { --spillover: calc(var(--brew-inset) + 12px); --portal-inset: 3px; }
  .fill-portal { width: 20px; height: 20px; font-size: 1rem; }
}
@media (pointer: coarse), (hover: none) { .touch-hint { display: inline; } .mouse-hint { display: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } .shop-item { transition: none; } }
