:root {
  --bg: #07060c;
  --panel: #0f0d18;
  --line: #241f38;
  --text: #ece8f6;
  --muted: #8b86a0;
  --faint: #5d5873;
  --cyan: #38e8ff;
  --magenta: #ff3ea5;
  --gold: #f5c76a;
  --ok: #5ee0a8;
  --radius: 12px;
}
* { box-sizing: border-box }
html, body { margin: 0; background: var(--bg); color: var(--text) }
body {
  font: 15px/1.6 "PingFang SC", "Hiragino Sans", "Noto Sans", system-ui, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 20px 56px;
  background:
    radial-gradient(900px 600px at 12% -10%, rgba(96, 32, 150, .45), transparent 65%),
    radial-gradient(800px 600px at 95% 110%, rgba(10, 80, 110, .4), transparent 60%),
    var(--bg);
}
.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--panel);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 10;
}
.skip:focus { left: 8px }
.top {
  width: 100%;
  max-width: 720px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0 8px;
  gap: 16px;
}
.brand {
  font-size: 12px;
  letter-spacing: .42em;
  color: var(--muted);
  text-transform: uppercase;
  text-decoration: none;
}
.brand:hover { color: var(--text) }
.top nav { display: flex; gap: 16px; flex-wrap: wrap }
.top nav a, footer a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
}
.top nav a:hover, footer a:hover { color: var(--cyan) }
header.hero {
  text-align: center;
  margin: 10px 0 22px;
  max-width: 520px;
}
h1 {
  font-size: 28px;
  margin: 0;
  font-weight: 600;
  letter-spacing: .04em;
  line-height: 1.25;
}
h1 span {
  background: linear-gradient(96deg, var(--cyan), var(--magenta));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lede {
  color: var(--muted);
  font-size: 14px;
  margin: 10px 0 0;
}
main { width: 100%; max-width: 520px; display: flex; flex-direction: column; gap: 16px }
.stage {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 28px 70px -28px rgba(120, 60, 220, .55), 0 0 0 1px rgba(255,255,255,.03) inset;
  background: #0a0812;
}
canvas { display: block; width: 100%; height: auto }
.bar { display: flex; gap: 10px }
.field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 14px;
}
.field:focus-within {
  border-color: #3a3159;
  box-shadow: 0 0 0 3px rgba(56, 232, 255, .08);
}
label.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}
input[type="text"] {
  flex: 1;
  background: none;
  border: 0;
  outline: 0;
  color: var(--text);
  font: inherit;
  padding: 13px 0;
  min-width: 0;
}
input::placeholder { color: var(--faint) }
button, .btn {
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius);
  border: 1px solid transparent;
  padding: 13px 18px;
  color: #08070d;
  background: linear-gradient(96deg, var(--cyan), #7cf0d8);
  transition: transform .12s ease, filter .12s ease, border-color .12s ease;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
button:hover, .btn:hover { filter: brightness(1.08) }
button:active, .btn:active { transform: translateY(1px) }
button.ghost, .btn.ghost {
  background: var(--panel);
  color: var(--text);
  border-color: var(--line);
  filter: none;
}
button.ghost:hover, .btn.ghost:hover { border-color: #3a3159 }
button:focus-visible, .btn:focus-visible, a:focus-visible, input:focus-visible, .chip:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}
.actions { display: flex; gap: 10px; flex-wrap: wrap }
.actions button, .actions .btn { flex: 1; min-width: 140px }
.styles { display: flex; flex-wrap: wrap; gap: 8px }
.styles .legend {
  width: 100%;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 2px 0 0;
}
.chip {
  appearance: none;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  font: 13px/1.2 inherit;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.chip[aria-pressed="true"] {
  border-color: var(--cyan);
  box-shadow: 0 0 0 1px rgba(56, 232, 255, .25);
  color: var(--cyan);
}
.chip.is-locked { color: var(--muted) }
.chip .lock {
  font-size: 10px;
  letter-spacing: .06em;
  color: var(--gold);
  text-transform: uppercase;
}
.hint { color: var(--faint); font-size: 12px; text-align: center; min-height: 18px }
.hint.ok { color: var(--ok) }
.hint.warn { color: var(--gold) }
.upsell {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 13px;
  color: var(--muted);
}
.upsell strong { color: var(--text); font-weight: 600 }
.upsell .row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px }
.upsell .btn { padding: 10px 14px; font-size: 13px }
.btn.gold {
  background: linear-gradient(96deg, var(--gold), #ffe3a3);
  color: #1a1406;
}
footer.site {
  margin-top: 36px;
  width: 100%;
  max-width: 520px;
  color: #443f5c;
  font-size: 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
footer.site .links { display: flex; flex-wrap: wrap; gap: 8px 14px; justify-content: center }
dialog {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #100e18;
  color: var(--text);
  padding: 22px 20px 18px;
  width: min(420px, calc(100vw - 32px));
  box-shadow: 0 30px 80px rgba(0,0,0,.55);
}
dialog::backdrop { background: rgba(4, 3, 8, .72) }
dialog h2 { margin: 0 0 8px; font-size: 18px }
dialog p { margin: 0 0 16px; color: var(--muted); font-size: 14px }
dialog .row { display: flex; flex-wrap: wrap; gap: 8px }
.legal {
  width: 100%;
  max-width: 640px;
  padding-top: 8px;
}
.legal h1 { font-size: 26px; letter-spacing: 0 }
.legal h2 { font-size: 16px; margin: 28px 0 8px }
.legal p, .legal li { color: var(--muted); font-size: 15px }
.legal ul { padding-left: 20px }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em }
.placeholder-flag {
  display: inline-block;
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid rgba(245,199,106,.35);
  border-radius: 999px;
  padding: 1px 6px;
  margin-left: 6px;
  vertical-align: middle;
}
@media (max-width: 430px) {
  body { padding: 0 14px 40px }
  h1 { font-size: 22px }
  .actions button, .actions .btn { min-width: 0 }
}

.unlock {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.unlock input {
  flex: 1;
  min-width: 160px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  font: inherit;
  padding: 10px 12px;
}
.unlock-note { margin: 10px 0 0; font-size: 12px; color: var(--faint); }
#unlocked-banner { margin-top: 8px; }
.upsell.is-unlocked .unlock, .upsell.is-unlocked .row, .upsell.is-unlocked .unlock-note { display: none; }
