:root {
  --bg: #0b0716;
  --panel: #151024;
  --panel-2: #1d1631;
  --line: #2e2547;
  --ink: #e9e4f5;
  --dim: #a59cbf;
  --pink: #ff3fae;
  --teal: #22e6ff;
  --gold: #ffc23a;
  --red: #ff4a2a;
  --focus: #22e6ff;
  --font: 'Chakra Petch', system-ui, sans-serif;
  --neon: 'Tilt Neon', 'Chakra Petch', sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  background: radial-gradient(ellipse at 50% -10%, #2a0f3e 0%, var(--bg) 55%) no-repeat, var(--bg);
  color: var(--ink);
  font: 16px/1.5 var(--font);
  min-height: 100vh;
  padding: 0 16px 48px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip-link { position: absolute; left: 8px; top: -60px; background: var(--teal); color: #000; padding: 8px 12px; z-index: 10; }
.skip-link:focus { top: 8px; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

button, input { font: inherit; color: inherit; }
button {
  background: var(--panel-2);
  border: 1px solid #4a3d6e;
  border-radius: 6px;
  padding: 7px 14px;
  cursor: pointer;
  min-height: 40px;
}
button:hover { border-color: var(--teal); }
button.quiet { background: transparent; border-color: var(--line); color: var(--dim); }
button.quiet:hover { color: var(--ink); border-color: #4a3d6e; }
button.link { background: none; border: 0; padding: 0; min-height: 0; color: var(--dim); text-decoration: underline; }
kbd, .mono { font-family: ui-monospace, Menlo, monospace; font-size: 0.85em; }
kbd { border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; }

.top { max-width: 1100px; margin: 0 auto; padding: 20px 0 12px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 18px; }
.brand {
  font: 400 clamp(2.4rem, 7vw, 3.6rem)/1 var(--neon);
  margin: 0;
  color: #ffe1f2;
  text-shadow: 0 0 4px #fff, 0 0 10px var(--pink), 0 0 22px var(--pink), 0 0 44px #ff3fae88;
  letter-spacing: 0.02em;
}
.tag { margin: 0; color: var(--dim); }
.bits { color: var(--gold); }

main { max-width: 1100px; margin: 0 auto; }

.alley-wrap { margin: 0 0 16px; }
.alley {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 10px 40px #000a;
  background: #07051a;
}
.alley canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.alley .bg { image-rendering: pixelated; image-rendering: crisp-edges; }
.alley .fx { touch-action: none; cursor: crosshair; }
.alley .fx.move { cursor: grab; }
.alley .fx:focus-visible { outline-offset: -3px; }
/* On a phone, crop the alley's edges so the sign frame gets the width. */
@media (max-width: 600px) {
  .alley { aspect-ratio: 32 / 27; }
  .alley canvas { width: 150%; left: -25%; right: auto; }
}

.shared {
  margin-top: 10px;
  background: #1d1233; border: 1px solid #ff3fae88; border-radius: 8px;
  padding: 8px 12px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap;
}
.shared p { margin: 0; }
.shared[hidden], [hidden] { display: none !important; }

.shop { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); gap: 16px; align-items: start; }
@media (max-width: 820px) { .shop { grid-template-columns: 1fr; } }

.bench, .counter, .street {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
}
.bench { display: grid; gap: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.power-row { justify-content: space-between; }

.transformer {
  display: inline-flex; align-items: center; gap: 10px;
  background: #110d1d; border-color: #4a3d6e; padding: 6px 14px 6px 8px;
}
.lever { width: 44px; height: 24px; border-radius: 12px; background: #2a2240; position: relative; border: 1px solid #4a3d6e; transition: background 0.2s; }
.knob { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #8a83a3; transition: left 0.15s, background 0.2s, box-shadow 0.2s; }
.transformer[aria-pressed="true"] .lever { background: #5a1840; }
.transformer[aria-pressed="true"] .knob { left: 22px; background: #ffd9ef; box-shadow: 0 0 8px var(--pink), 0 0 16px var(--pink); }
.power-label { font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; font-size: 0.9rem; }

.tools { display: inline-flex; border: 1px solid #4a3d6e; border-radius: 8px; overflow: hidden; }
.tool { border: 0; border-radius: 0; background: transparent; color: var(--dim); }
.tool + .tool { border-left: 1px solid #4a3d6e; }
.tool[aria-checked="true"] { background: #2a1e48; color: #fff; box-shadow: inset 0 -2px 0 var(--teal); }

.words { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.words > label { font-weight: 600; }
.words input[type="text"], #words-in {
  flex: 1 1 180px; min-width: 0; min-height: 40px;
  background: #0d0918; border: 1px solid #4a3d6e; border-radius: 6px; padding: 6px 10px;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.sizes { border: 0; margin: 0; padding: 0; display: flex; gap: 10px; }
.sizes label { display: inline-flex; gap: 4px; align-items: center; color: var(--dim); }
.hint { margin: 0; color: var(--dim); font-size: 0.9rem; }

fieldset.gases, fieldset.effects { border: 0; padding: 0; margin: 0; }
legend { font-weight: 600; padding: 0; margin-bottom: 6px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch {
  min-height: 40px; padding: 6px 10px 6px 8px; display: inline-flex; align-items: center; gap: 8px;
  background: #0d0918; font-size: 0.85rem; color: var(--dim);
}
.swatch i { width: 18px; height: 18px; border-radius: 50%; background: var(--c); box-shadow: 0 0 6px var(--c); }
.swatch[aria-checked="true"] { color: #fff; border-color: var(--c); box-shadow: 0 0 0 1px var(--c), 0 0 12px color-mix(in srgb, var(--c) 40%, transparent); }
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid #4a3d6e; border-radius: 8px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; background: transparent; color: var(--dim); }
.seg button + button { border-left: 1px solid #4a3d6e; }
.seg button[aria-checked="true"] { background: #2a1e48; color: #fff; box-shadow: inset 0 -2px 0 var(--pink); }

.check { display: inline-flex; gap: 8px; align-items: center; }
.check input { width: 18px; height: 18px; accent-color: var(--pink); }

.mini { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--dim); margin: 0 0 6px; font-weight: 600; }
.tubes { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 210px; overflow: auto; }
.tubes li { display: flex; gap: 6px; align-items: center; }
.tubes li.empty { color: var(--dim); }
.tubes .pick {
  flex: 1; text-align: left; min-height: 36px; padding: 4px 10px;
  background: #0d0918; border-color: var(--line); display: flex; gap: 8px; align-items: center;
}
.tubes .pick i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 6px var(--c); flex: none; }
.tubes .pick[aria-pressed="true"] { border-color: var(--teal); background: #1c1533; }
.tubes .del { min-height: 36px; padding: 4px 10px; }
.msg { margin: 0; min-height: 1.5em; color: var(--teal); }

.counter { display: grid; gap: 10px; }
.ticket {
  background: #f1ead8; color: #241c14; border-radius: 4px; padding: 14px 14px 12px;
  font-family: 'Chakra Petch', sans-serif; box-shadow: 0 2px 0 #b8ad92, 0 8px 18px #0008;
  transform: rotate(-0.6deg);
}
.ticket .who { margin: 0; font-weight: 600; font-size: 1.1rem; }
.ticket .place { margin: 0 0 8px; color: #6b5d4a; font-size: 0.9rem; }
.ticket .line { margin: 0 0 10px; font-style: italic; }
.ticket .line:empty { display: none; }
.wants { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 2px; }
.wants li::before { content: '☐ '; }
.wants li.ok::before { content: '☑ '; color: #1f7a3c; }
.wants li.ok { color: #1f7a3c; }
.reply { margin: 0 0 10px; font-weight: 600; }
.stars { color: #b0700c; letter-spacing: 0.1em; }
.ticket button { background: #241c14; color: #f1ead8; border-color: #241c14; }
.ticket button.quiet { background: transparent; color: #4a3d2e; border-color: #b8ad92; }
.ticket button:focus-visible { outline-color: #b0127a; }

.street { margin-top: 16px; }
.street h2 { font: 400 1.8rem/1.1 var(--neon); margin: 0 0 4px; color: #e8fbff; text-shadow: 0 0 8px var(--teal), 0 0 20px var(--teal); }
.street-note { margin: 0 0 12px; color: var(--dim); }
.signs { list-style: none; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.signs li.empty { color: var(--dim); }
.signs figure { margin: 0; background: #08060f; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.signs canvas { display: block; width: 100%; aspect-ratio: 2 / 1; }
.signs figcaption { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 8px; font-size: 0.85rem; color: var(--dim); }
.signs figcaption button { min-height: 32px; padding: 2px 10px; font-size: 0.85rem; }

.foot { max-width: 1100px; margin: 24px auto 0; color: var(--dim); font-size: 0.9rem; }
.foot a { color: var(--dim); }
.leave {
  position: fixed; right: 16px; bottom: 16px;
  background: #0b0716e6; color: var(--ink); text-decoration: none;
  border: 1px solid #4a3d6e; border-radius: 999px; padding: 8px 16px; font-size: 0.9rem;
}
.leave:hover { border-color: var(--pink); }
.noscript { text-align: center; color: var(--dim); }

@media (prefers-reduced-motion: reduce) {
  .knob, .lever { transition: none; }
}
@media (max-width: 520px) {
  .ticket { transform: none; }
  .leave { position: static; display: inline-block; margin-top: 16px; }
}

/* #card: the share image, 1200 × 630, nothing but the alley. */
body.card { padding: 0; overflow: hidden; background: #07051a; }
body.card > :not(main), body.card main > :not(.alley-wrap), body.card .alley-wrap > :not(.alley) { display: none !important; }
body.card main { max-width: none; }
body.card .alley-wrap { margin: 0; }
body.card .alley { aspect-ratio: auto; height: 100vh; border: 0; border-radius: 0; box-shadow: none; }
body.card .alley canvas { object-fit: cover; }
