/* NetVibing: a cinematic 3D sea fills the frame; one column of large light type sits on the left
   (bottom on phones) while the camera flies from shot to shot as you move between pages. */

@font-face { font-family: Outfit; src: url(/fonts/outfit-latin-300-normal.woff2) format('woff2'); font-weight: 300; font-display: swap; }
@font-face { font-family: Outfit; src: url(/fonts/outfit-latin-400-normal.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: Outfit; src: url(/fonts/outfit-latin-500-normal.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: Outfit; src: url(/fonts/outfit-latin-600-normal.woff2) format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url(/fonts/ibm-plex-mono-latin-400-normal.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url(/fonts/ibm-plex-mono-latin-500-normal.woff2) format('woff2'); font-weight: 500; font-display: swap; }

:root {
  color-scheme: dark;
  --ink: #05070f;
  --paper: #fbf6ee;
  --muted: #d5d0d8;
  --sun: #ffc27a;
  --line: rgba(251, 246, 238, .38);
  --faint: rgba(251, 246, 238, .14);
  --glass: rgba(5, 7, 15, .4);
  --display: Outfit, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Avenir Next', 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  --pad: clamp(18px, 4vw, 56px);
  /* Wide screens: the page (copy, panels, chrome) lives in a centered stage instead of hugging the far
     edges. The 3D slab is sized by the viewport height, so the stage grows with height up to a 16:9 box,
     between 1440px and 2400px. world.js mirrors this formula (stageWidth) so the slab stays inside it. */
  --gut: 0px;
  --side: calc(var(--gut) + var(--pad));
}
@media (min-aspect-ratio: 1/1) {
  :root { --gut: max(0px, (100vw - clamp(1440px, 178vh, 2400px)) / 2); }
}
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--ink); scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; color: var(--paper);
  font: 300 16px/1.5 var(--display); -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
::selection { background: var(--sun); color: var(--ink); }
:focus-visible { outline: 2px solid var(--sun); outline-offset: 3px; }

#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: -2; }
.no-webgl { background: linear-gradient(180deg, #232a52 0%, #a8603c 62%, #0b1820 63%, #05070f 100%) fixed; }
.scrim { position: fixed; inset: 0; z-index: -1; pointer-events: none;
  /* the shade follows the stage: 0-32-60% of the stage width, starting from its left edge */
  background: linear-gradient(90deg, rgba(4, 6, 14, .5) 0, rgba(4, 6, 14, .66) var(--gut), rgba(4, 6, 14, .36) calc(var(--gut) + (100% - 2 * var(--gut)) * .32), rgba(4, 6, 14, 0) calc(var(--gut) + (100% - 2 * var(--gut)) * .6)); }

/* ---------- chrome ---------- */
.top {
  position: absolute; inset: 0 0 auto; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px var(--side); font: 400 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  text-shadow: 0 1px 12px rgba(0, 0, 0, .5);
}
.brand { color: var(--paper); display: inline-flex; align-items: center; gap: 9px; font: 600 22px/1 var(--display); letter-spacing: -.02em; text-transform: none; }
.brand-mark { width: 30px; height: auto; flex: none; }
.top-nav { display: flex; align-items: center; gap: 10px; }
.top-nav select { width: auto; padding: 8px 30px 8px 14px; background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; font: 400 12px var(--mono); letter-spacing: .06em; border-radius: 999px; }
.foot {
  display: flex; justify-content: space-between; gap: 16px; padding: 22px var(--side) 26px;
  font: 400 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); text-shadow: 0 1px 12px rgba(0, 0, 0, .5);
}

main { padding: 0 var(--side); min-height: 100vh; transition: opacity .32s ease, transform .32s ease; }
main.leaving { opacity: 0; transform: translateY(-8px); }

/* ---------- type ---------- */
.copy { max-width: 40rem; display: flex; flex-direction: column; gap: 22px; padding: 0 0 72px; text-shadow: 0 2px 30px rgba(0, 0, 0, .55), 0 0 2px rgba(0, 0, 0, .25); }
.hero { min-height: 92vh; justify-content: center; padding-top: 120px; }
.hero + .copy { padding-top: 24px; }
.kicker { font: 500 13px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--sun); margin: 0; }
.display { font: 400 clamp(2.7rem, 7vw, 5.6rem)/1 var(--display); letter-spacing: -.025em; margin: 0; text-wrap: balance; overflow-wrap: anywhere; }
html[lang=zh] .display { letter-spacing: 0; line-height: 1.12; }
.lede { margin: 0; font-size: clamp(1.05rem, 1.55vw, 1.3rem); line-height: 1.45; max-width: 31rem; color: var(--paper); white-space: pre-line; }
.muted { color: var(--muted); margin: 0; font-size: 15px; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px; cursor: pointer;
  font: 400 15px var(--display); color: var(--paper); background: var(--glass);
  border: 1px solid var(--line); border-radius: 999px; padding: 12px 22px;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: border-color .25s, color .25s, background .25s;
}
.btn:hover { border-color: var(--sun); color: var(--sun); }
.btn:disabled { opacity: .45; cursor: progress; }
.btn-sun { border-color: var(--sun); color: var(--sun); }
.btn-sun:hover { background: var(--sun); color: var(--ink); }
.btn-quiet { border-color: transparent; background: transparent; padding-inline: 4px; color: var(--muted); backdrop-filter: none; }
.btn-quiet:hover { border-color: transparent; }
.btn-small { padding: 8px 16px; font: 400 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.btn-big { padding: 15px 28px; font-size: 17px; align-self: flex-start; }
.btn[aria-pressed=true] { border-color: var(--sun); color: var(--sun); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: 400 13px var(--mono); letter-spacing: .04em; color: var(--muted);
  padding: 8px 14px; border: 1px solid var(--faint); border-radius: 999px; background: rgba(5, 7, 15, .3);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); transition: border-color .25s, color .25s;
}
a.chip:hover, .chip-sun { border-color: var(--sun); color: var(--sun); }
.back { font: 400 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.back:hover { color: var(--sun); }

input, textarea, select {
  width: 100%; padding: 12px 14px; font: 300 16px var(--display); color: var(--paper);
  background: rgba(4, 6, 14, .45); border: 1px solid var(--faint); border-radius: 6px;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); transition: border-color .2s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--sun); }
input[readonly] { color: var(--muted); }
textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
::placeholder { color: rgba(213, 208, 216, .55); }
label { display: grid; gap: 8px; font: 400 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.form { display: flex; flex-direction: column; gap: 20px; text-shadow: none; max-width: 36rem; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
[role=status] { margin: 0; color: var(--sun); font: 400 13px var(--mono); min-height: 1em; }
.avatar-field { display: flex; gap: 18px; align-items: center; }
.avatar-pic {
  width: 76px; height: 76px; border-radius: 50%; flex: none; overflow: hidden; display: grid; place-items: center;
  background: #e7ddcd; color: #1b1712; font: 300 34px var(--display); box-shadow: 0 0 0 2px var(--ink), 0 0 0 3.5px var(--sun);
}
.avatar-pic img { width: 100%; height: 100%; object-fit: cover; }
.avatar-side { display: grid; gap: 8px; min-width: 0; }
.avatar-label { font: 400 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.avatar-row { display: flex; gap: 8px; flex-wrap: wrap; }
.avatar-side small { font-size: 12.5px; line-height: 1.4; }
.avatar-error { color: #ff9b8a; }
.avatar-error:empty { display: none; }
.avatar-crop { border: 1px solid var(--line); border-radius: 14px; padding: 22px; background: rgba(8, 10, 20, .94); color: var(--paper); max-width: calc(100vw - 32px); }
.avatar-crop::backdrop { background: rgba(0, 0, 0, .6); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.avatar-crop form { display: grid; gap: 14px; width: min(260px, calc(100vw - 80px)); }
.avatar-stage { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: #111; }
.avatar-stage canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.avatar-stage canvas:active { cursor: grabbing; }
.avatar-stage::after { content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: 50%; box-shadow: 0 0 0 999px rgba(0, 0, 0, .5), inset 0 0 0 2px var(--sun); }
.avatar-crop input[type=range] { padding: 0; border: 0; background: none; accent-color: var(--sun); -webkit-backdrop-filter: none; backdrop-filter: none; }
.avatar-crop-row { display: flex; justify-content: flex-end; gap: 8px; }

/* ---------- home ---------- */
.composer { border: 1px dashed var(--line); border-radius: 6px; background: rgba(4, 6, 14, .35); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); text-shadow: none; }
.composer:focus-within { border-color: var(--sun); border-style: solid; }
.composer textarea { border: 0; background: transparent; backdrop-filter: none; font-size: 17px; padding: 16px 18px 6px; min-height: 120px; }
.composer-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px 10px 18px; }
.composer-row small { font: 400 11px var(--mono); letter-spacing: .08em; color: var(--muted); }
.draft { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; padding: 4px 0 4px 18px; border-left: 1px solid var(--sun); animation: rise .8s ease both; }
.draft h2 { font: 400 clamp(1.8rem, 3.4vw, 2.6rem)/1.05 var(--display); letter-spacing: -.02em; margin: 0; }
.draft p { margin: 0; white-space: pre-line; color: var(--muted); }
.group { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }

/* ---------- card ---------- */
.meta { display: flex; flex-direction: column; gap: 16px; }
.scroll-cue { margin-top: 18px; font: 400 12px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); align-self: flex-start; }
.scroll-cue:hover { color: var(--sun); }
.copy.wide { max-width: 46rem; gap: 0; }
.kicker.rule { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.kicker.rule span:last-child, .kicker.split span:last-child { color: var(--muted); }
.kicker.split { display: flex; justify-content: space-between; gap: 16px; }
.works { display: grid; column-gap: 36px; }
.works.grid { grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); }
.work {
  display: grid; grid-template-columns: 2.4rem 1fr auto; align-items: baseline; gap: 4px 12px;
  padding: 20px 0; border-bottom: 1px solid var(--faint);
}
.work small { font: 400 12px var(--mono); letter-spacing: .08em; color: var(--sun); }
.work-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.work strong { font: 400 clamp(1.3rem, 2vw, 1.65rem)/1.15 var(--display); letter-spacing: -.01em; transition: color .25s; }
.work-body span { color: var(--muted); font-size: 15px; line-height: 1.45; }
.work em { font: 400 12px var(--mono); font-style: normal; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); white-space: nowrap; transition: color .25s, transform .3s; }
.work:hover strong, .work:hover em { color: var(--sun); }
.work:hover em { transform: translateX(4px); }
.screen { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #000; box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .8); }
.screen video { display: block; width: 100%; }

/* ---------- editor ---------- */
.meter { display: flex; flex-direction: column; gap: 10px; max-width: 36rem; }
.meter-row { display: flex; justify-content: space-between; align-items: baseline; }
.meter-row small { font: 400 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.meter-row b { font: 400 28px var(--display); color: var(--sun); }
.bar { height: 1px; background: var(--line); position: relative; }
.bar i { position: absolute; inset: -1px auto -1px 0; width: 100%; background: var(--sun); transform-origin: left; transform: scaleX(0); transition: transform .8s ease; }
.choices { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.choices legend { font: 400 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; padding: 0; }
.choice { display: flex; cursor: pointer; text-transform: none; letter-spacing: 0; }
.choice input { position: absolute; opacity: 0; width: 1px; pointer-events: none; }
.choice span { display: inline-flex; align-items: center; gap: 10px; padding: 9px 16px; border: 1px solid var(--faint); border-radius: 999px; font: 300 15px var(--display); color: var(--paper); background: rgba(4, 6, 14, .35); }
.choice span::before { content: ""; width: 12px; height: 12px; border-radius: 50%; }
.choice-mint span::before { background: linear-gradient(135deg, #ffc27a, #ff8a4c); }
.choice-peach span::before { background: linear-gradient(135deg, #ff9fb2, #8a5cff); }
.choice-ice span::before { background: linear-gradient(135deg, #cfe3ff, #3a5cff); }
.choice-space span::before { background: radial-gradient(circle at 35% 35%, #ffb070, #7a2a8c 55%, #0b0620); }
.choice-forest span::before { background: linear-gradient(160deg, #7dffc4, #3a2a7a 55%, #0c1a1a); }
.choice-stage span::before { background: radial-gradient(circle at 50% 30%, #f4efe6, #6a6660 45%, #111 75%); }
.choice-candy span::before { background: conic-gradient(#ff8fc2 0 25%, #fff 0 50%, #8fe3d0 0 75%, #fff 0); }
.choice-arcade span::before { background: linear-gradient(135deg, #ff3fb4, #4a2bff 50%, #18f0ff); }
.choice-islands span::before { background: linear-gradient(180deg, #7cc4ff, #e8f6ff 55%, #6fbf5a 56%, #6a4a32); }
.choice-lava span::before { background: radial-gradient(circle at 35% 70%, #ffcf4a, #ff4a12 35%, #3a1030 70%, #47e0ff); }
.choice-desert span::before { background: linear-gradient(180deg, #4a3a8a, #ff9a5a 50%, #e0a868 51%, #a0663a); }
.choice-cyber span::before { background: linear-gradient(135deg, #18f0ff, #2a1060 50%, #ff2a8a); }
.choice-globe span::before { background: radial-gradient(circle at 40% 35%, #e8c88a, #a8743c 45%, #5a1a1a 70%, #20140c); }
.choice-mars span::before { background: radial-gradient(circle at 35% 30%, #ffc48a, #c2502a 45%, #3a1208 80%); }
.choice input:checked + span { border-color: var(--sun); color: var(--sun); }
.choice input:focus-visible + span { outline: 2px solid var(--sun); outline-offset: 3px; }
.section-kicker { margin-top: 18px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.row { margin: 0; padding: 4px 0 4px 16px; border: 0; border-left: 1px solid var(--sun); display: grid; gap: 8px; }
#links, #projects { display: flex; flex-direction: column; gap: 18px; }
#links:empty, #projects:empty { display: none; }
.row .btn { justify-self: start; }

/* ---------- account ---------- */
.milestones { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); column-gap: 32px; }
.milestones li { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--faint); color: var(--muted); font-size: 15px; }
.milestones li::before { content: "○"; color: var(--muted); font-size: 11px; margin-right: 2px; }
.milestones li.got { color: var(--paper); }
.milestones li.got::before { content: "●"; color: var(--sun); }
.milestones li { justify-content: flex-start; }
.milestones small { margin-left: auto; font: 400 12px var(--mono); color: var(--muted); }
.milestones li.got small { color: var(--sun); }

/* ---------- toasts ---------- */
.toasts { position: fixed; right: var(--side); bottom: 24px; z-index: 20; display: grid; gap: 8px; }
.toast {
  display: grid; gap: 2px; padding: 12px 16px; min-width: 200px; border-left: 1px solid var(--sun);
  background: rgba(5, 7, 15, .6); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  animation: rise .7s ease both;
}
.toast b { font: 400 16px var(--display); }
.toast span { font: 400 12px var(--mono); letter-spacing: .06em; color: var(--sun); }
.toast.out { opacity: 0; transform: translateY(6px); transition: opacity .8s ease, transform .8s ease; }

/* ---------- editor: assistant on the left, form beside it, the slab stays visible on the right ---------- */
.studio { max-width: none; display: grid; justify-content: start; align-content: start; grid-template-columns: minmax(300px, 380px) minmax(320px, 440px); grid-template-areas: 'head head' 'agent form'; column-gap: 28px; align-items: start; }
.studio-head { grid-area: head; display: flex; flex-direction: column; gap: 14px; }
.studio-form { grid-area: form; display: flex; flex-direction: column; gap: 22px; }
.agent { grid-area: agent; position: sticky; top: 24px; display: flex; flex-direction: column; height: min(72vh, 640px); text-shadow: none;
  background: rgba(4, 6, 14, .5); border: 1px solid var(--faint); border-radius: 8px; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); transition: border-color .2s; }
.agent.drop { border-color: var(--sun); border-style: dashed; }
.agent-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--faint); }
.agent-head b { font-weight: 500; }
.agent-head small, .agent-row small { font: 400 11px var(--mono); letter-spacing: .06em; color: var(--muted); }
.agent-log { list-style: none; margin: 0; padding: 14px 16px; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 92%; padding: 9px 12px; border-radius: 10px; line-height: 1.45; font-size: 14.5px; white-space: pre-line; overflow-wrap: anywhere; animation: rise .4s ease both; }
.msg-assistant { align-self: flex-start; background: rgba(255, 255, 255, .07); }
.msg-user { align-self: flex-end; background: rgba(255, 194, 122, .16); border: 1px solid rgba(255, 194, 122, .3); }
.msg-wait { color: var(--muted); }
.msg-error { color: #ffb4a0; }
.msg-file { font: 400 12.5px var(--mono); }
.agent-input { border-top: 1px solid var(--faint); padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.agent-input textarea { min-height: 64px; border: 0; background: transparent; backdrop-filter: none; padding: 6px; font-size: 15px; }
.agent-row { display: flex; align-items: center; gap: 10px; }
.agent-row small { flex: 1; }
.agent-attach { cursor: pointer; }
@media (max-width: 980px) {
  .studio { grid-template-columns: 1fr; grid-template-areas: 'head' 'agent' 'form'; row-gap: 22px; }
  .agent { position: static; height: 420px; }
}

/* ---------- motion ---------- */
[data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity 1s ease var(--delay, 0ms), transform 1.1s ease var(--delay, 0ms); }
[data-reveal].in { opacity: 1; transform: none; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* ---------- portrait screens: the world sits on top, copy below ---------- */
@media (max-aspect-ratio: 1/1) {
  .scrim { background: linear-gradient(0deg, rgba(4, 6, 14, .9) 0%, rgba(4, 6, 14, .66) 40%, rgba(4, 6, 14, 0) 62%); }
  .hero { min-height: 0; padding-top: 60vh; }
  .copy { gap: 16px; }
  .copy:not(.hero) {
    max-width: none; margin: 0 calc(-1 * var(--pad)); padding: 28px var(--pad) 56px;
    background: linear-gradient(rgba(4, 6, 14, 0), rgba(4, 6, 14, .82) 80px); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    mask: linear-gradient(transparent, #000 60px);
  }
}
@media (max-width: 520px) {
  .top-nav select { max-width: 86px; }
  .foot { flex-direction: column; gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  [data-reveal], main { transition: none; }
  [data-reveal] { opacity: 1; transform: none; }
  .draft, .toast { animation: none; }
}

/* ---------- friend messages ---------- */
.inbox { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.inbox a { display: flex; align-items: baseline; gap: 12px; padding: 10px 12px; border: 1px solid var(--faint); border-radius: 8px; background: rgba(4, 6, 14, .4); color: inherit; text-decoration: none; }
.inbox a:hover { border-color: var(--sun); }
.inbox span { flex: 1; color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.inbox i { font: 400 11px var(--mono); font-style: normal; color: #05060c; background: var(--sun); border-radius: 99px; padding: 1px 7px; }
.chat { max-width: 560px; height: min(70vh, 620px); position: static; }
.chat .msg time { display: block; font: 400 10.5px var(--mono); color: var(--muted); margin-top: 4px; }
.chat-note { padding: 10px 16px; color: var(--muted); font-size: 13.5px; border-top: 1px solid var(--faint); }

/* ---------- template moods and personalization ---------- */
.variants { margin-top: -6px; }
.variants[hidden] { display: none; }
.variants > .choices { gap: 6px; }
.variants .choice span { padding: 6px 13px; font-size: 14px; }
.choice-sea span::before { background: linear-gradient(135deg, #ffc27a, #3a5cff); }
.choice-nebula span::before { background: radial-gradient(circle at 35% 35%, #ff8ad0, #3a2a8c 60%, #0b0620); }
.choice-deep span::before { background: radial-gradient(circle at 35% 35%, #9fb8ff, #0b1030 60%, #000); }
.choice-aurora span::before { background: linear-gradient(160deg, #7dffc4, #3a2a7a); }
.choice-starry span::before { background: radial-gradient(circle, #fff 10%, #1a1440 30%); }
.choice-silent span::before { background: linear-gradient(135deg, #f4efe6, #111); }
.choice-color span::before { background: linear-gradient(135deg, #ffcf6a, #c2302a); }
.choice-sweet span::before { background: linear-gradient(135deg, #ff9fc8, #ffcf8a); }
.choice-sugarnight span::before { background: radial-gradient(circle at 35% 35%, #ffc4e8, #4a2a6a 60%, #120a20); }
.choice-neon span::before { background: linear-gradient(135deg, #ff3fb4, #18f0ff); }
.choice-vapor span::before { background: linear-gradient(135deg, #ff7ad8, #8a5cff 60%, #2a0a3a); }
.choice-daybreak span::before { background: linear-gradient(180deg, #5a8aff, #ffd2b0); }
.choice-afterglow span::before { background: linear-gradient(180deg, #3a2a7a, #ff7a3a); }
.choice-ember span::before { background: radial-gradient(circle at 40% 70%, #ffd04a, #ff3a0a 50%, #2a0808); }
.choice-abyss span::before { background: radial-gradient(circle at 40% 60%, #a05cff, #1a0a3a 60%, #000); }
.choice-dusk span::before { background: linear-gradient(180deg, #4a3a8a, #ff9a5a); }
.choice-moonlit span::before { background: radial-gradient(circle at 65% 30%, #fff4dc 12%, #1a2448 30%, #0a0c18); }
.choice-rain span::before { background: linear-gradient(135deg, #18f0ff, #2a1060 60%, #ff2a8a); }
.choice-smog span::before { background: linear-gradient(135deg, #b8ff4a, #1a3a18 60%, #050a05); }
.choice-plain span::before { display: none; }
.personal { border: 1px solid var(--faint); border-radius: 8px; padding: 0 14px; background: rgba(4, 6, 14, .35); }
.personal summary { cursor: pointer; padding: 12px 0; font: 400 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.personal summary small { text-transform: none; letter-spacing: 0; margin-left: 8px; opacity: .7; }
.personal[open] summary { color: var(--sun); }
.personal-body { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; padding-bottom: 16px; }
.personal-side { display: flex; flex-direction: column; gap: 12px; flex: 1; min-width: 180px; }
.wheel { position: relative; width: 136px; height: 136px; border-radius: 50%; cursor: crosshair; touch-action: none; flex: none; }
.wheel::before { content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(hsl(0 90% 65%), hsl(60 90% 65%), hsl(120 90% 65%), hsl(180 90% 65%), hsl(240 90% 65%), hsl(300 90% 65%), hsl(360 90% 65%));
  -webkit-mask: radial-gradient(circle, transparent 53%, #000 54%); mask: radial-gradient(circle, transparent 53%, #000 54%); }
.wheel-dot { position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .5), 0 2px 8px rgba(0, 0, 0, .5); pointer-events: none; display: none; }
.wheel.set .wheel-dot { display: block; }
.wheel-reset { position: absolute; left: 50%; top: 50%; width: 66px; height: 66px; margin: -33px; border-radius: 50%; border: 1px solid var(--faint); background: rgba(255, 255, 255, .06); color: var(--paper); font: 400 11px var(--mono); cursor: pointer; }
.wheel.set .wheel-reset { color: #05060c; }
.look-note { display: flex; align-items: center; gap: 10px; margin: 0; color: var(--sun); font-size: 13.5px; }
.look-note[hidden] { display: none; }
.scene-bg { position: fixed; inset: 0; width: 100%; height: 100%; border: 0; z-index: -1; pointer-events: none; opacity: 0; transition: opacity .9s ease; background: #000; }
.scene-bg.ready { opacity: 1; }
.msg-stage { display: flex; flex-direction: column; gap: 6px; }
.msg-stage label { font: 400 11px var(--mono); color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.msg-stage .addr { text-transform: none; letter-spacing: 0; font: 400 12.5px var(--mono); color: var(--paper); display: flex; align-items: center; flex-wrap: wrap; overflow-wrap: anywhere; }
.msg-stage .hint { font: 400 11px var(--mono); color: var(--muted); }
.msg-stage .hint[data-state=taken] { color: #f0a070; }
.msg-stage input { width: 22ch; max-width: 100%; padding: 3px 6px; font: inherit; border-radius: 4px; background: rgba(0, 0, 0, .35); }
.choice-cabin span::before { background: radial-gradient(circle, #141518 28%, #e88a2e 30%, #e88a2e 42%, #b7b8b4 44%); }
.choice-opera span::before { background: radial-gradient(circle at 35% 30%, #ffe2a0, #b0702a 40%, #5a0c10 75%); }
.choice-base span::before { background: linear-gradient(170deg, #f7b26a, #d9774a 45%, #f2efe8 47%, #8a3a1c 60%, #4a1a0c); }
.choice-orbital span::before { background: radial-gradient(circle at 50% 120%, #e0703a 40%, #7a2810 55%, #05060a 58%); }
.msg-github .gh-url { width: 100%; }
.msg-stage details summary { cursor: pointer; font: 400 11px var(--mono); color: var(--muted); }
.msg-stage details label { margin-top: 6px; }
.msg-actions { flex-direction: row; flex-wrap: wrap; }
.agent-github { cursor: pointer; }
@media (max-width: 520px) { .agent-row { flex-wrap: wrap; } .agent-row small { flex-basis: 100%; order: 3; } }
.msg-stage select { max-width: 100%; padding: 4px 6px; font: inherit; border-radius: 4px; background: rgba(0, 0, 0, .35); color: var(--paper); }
.msg-stage .gh-manage, .msg .gh-connect { font: 400 11px var(--mono); color: var(--sun); text-transform: none; letter-spacing: 0; }
.msg .gh-connect { display: block; margin-top: 6px; }

/* ---------- card music: a little record player (CSS only, transform/opacity animations) ---------- */
.music-player {
  position: fixed; z-index: 20; top: 70px; right: var(--side); display: flex; align-items: center; gap: 12px;
  max-width: min(270px, calc(100vw - 32px)); padding: 7px 16px 7px 8px; border: 1px solid var(--faint); border-radius: 999px;
  background: rgba(8, 10, 20, .66); color: var(--paper); font: inherit; text-align: left; cursor: pointer;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .38), inset 0 1px 0 rgba(255, 255, 255, .08);
  transition: transform .2s, border-color .2s; animation: mp-in .55s cubic-bezier(.2, .9, .3, 1.3) both;
}
.music-player:hover { transform: translateY(-1px); border-color: var(--sun); }
.mp-deck { position: relative; width: 44px; height: 44px; flex: none; }
.mp-record {
  position: absolute; inset: 0; border-radius: 50%;
  background: repeating-radial-gradient(circle, #121214 0 1.4px, #222226 1.4px 2.8px);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .07), 0 4px 12px rgba(0, 0, 0, .55);
  animation: mp-spin 3.2s linear infinite paused;
}
.mp-sheen { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 20deg, transparent 0 10%, rgba(255, 255, 255, .2) 15%, transparent 21% 60%, rgba(255, 255, 255, .13) 65%, transparent 71%); }
.mp-label { position: absolute; inset: 31%; border-radius: 50%; background: radial-gradient(circle, #0c0c0e 0 13%, var(--sun) 15% 100%); box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .22); }
.mp-label::after { content: ''; position: absolute; inset: 24%; border-radius: 50%; border: 1px dashed rgba(0, 0, 0, .28); }
.mp-arm { position: absolute; top: -3px; right: -5px; width: 8px; height: 34px; transform-origin: 4px 4px; transform: rotate(-32deg); transition: transform .7s cubic-bezier(.3, 1.5, .5, 1); }
.mp-arm::before { content: ''; position: absolute; top: 0; left: 0; width: 8px; height: 8px; border-radius: 50%; background: radial-gradient(circle, #f6f0e4 0 30%, #8d877c 34%); box-shadow: 0 1px 4px rgba(0, 0, 0, .5); }
.mp-arm i { position: absolute; top: 4px; left: 3px; width: 2px; height: 26px; border-radius: 2px; background: linear-gradient(#efe9dd, #a49e93); }
.mp-arm::after { content: ''; position: absolute; bottom: 0; left: 1px; width: 6px; height: 6px; border-radius: 1.5px; background: var(--sun); box-shadow: 0 1px 3px rgba(0, 0, 0, .5); }
.music-player:not(.on) .mp-deck::after {
  content: ''; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid var(--sun);
  opacity: 0; animation: mp-ping 2.2s ease-out infinite;
}
.mp-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mp-text small { font: 400 10px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--sun); white-space: nowrap; }
.mp-text b { font-weight: 500; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-bars { display: flex; align-items: flex-end; gap: 2px; height: 16px; flex: none; }
.mp-bars i { width: 3px; height: 100%; border-radius: 2px; background: var(--sun); transform-origin: bottom; transform: scaleY(.22); transition: transform .3s; }
.music-player.on .mp-record { animation-play-state: running; }
.music-player.on .mp-arm { transform: rotate(16deg); }
.music-player.on .mp-bars i { animation: mp-eq .8s ease-in-out infinite alternate; }
.music-player.on .mp-bars i:nth-child(2) { animation-duration: .55s; animation-delay: -.2s; }
.music-player.on .mp-bars i:nth-child(3) { animation-duration: .95s; animation-delay: -.5s; }
.music-player.on .mp-bars i:nth-child(4) { animation-duration: .7s; animation-delay: -.35s; }
.music-dock {
  position: fixed; z-index: 20; top: 132px; right: var(--side); width: min(320px, calc(100vw - 32px)); height: 80px;
  border-radius: 14px; overflow: hidden; box-shadow: 0 12px 32px rgba(0, 0, 0, .4); animation: mp-in .45s cubic-bezier(.2, .9, .3, 1.2) both;
}
.music-dock iframe { display: block; width: 100%; height: 80px; border: 0; }
.music-hidden { position: fixed; left: -10px; bottom: 0; width: 1px; height: 1px; border: 0; opacity: 0; pointer-events: none; }
/* the mobile ticket has its own header, so there the player shrinks to just the record, under it on the right */
html.pocket .music-player { top: calc(env(safe-area-inset-top) + 118px); right: 26px; padding: 6px; gap: 0; }
html.pocket .music-player .mp-text, html.pocket .music-player .mp-bars { display: none; }
html.pocket .music-dock { top: calc(env(safe-area-inset-top) + 180px); right: 26px; width: calc(100vw - 52px); }
@keyframes mp-spin { to { transform: rotate(360deg); } }
@keyframes mp-eq { from { transform: scaleY(.2); } to { transform: scaleY(1); } }
@keyframes mp-ping { 0% { transform: scale(.9); opacity: .7; } 70%, 100% { transform: scale(1.35); opacity: 0; } }
@keyframes mp-in { from { transform: translateY(-10px) scale(.92); opacity: 0; } }
@media (max-width: 560px) { html:not(.pocket) .music-player { top: 64px; } html:not(.pocket) .music-dock { top: 124px; } }
@media (prefers-reduced-motion: reduce) {
  .music-player, .music-dock, .mp-record, .music-player .mp-bars i, .music-player .mp-deck::after { animation: none !important; }
}
.music-field { display: flex; flex-direction: column; gap: 10px; }
.music-row { display: flex; gap: 10px; align-items: center; }
.music-row input { flex: 1; min-width: 0; }
.music-upload { flex: none; }
.music-picked { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.music-picked[hidden] { display: none; }
.music-what { font: 400 12px var(--mono); color: var(--sun); }
.music-picked audio { height: 34px; max-width: 100%; }
.music-title { flex: 1; min-width: 160px; }
.music-hint { color: var(--muted); font-size: 12px; line-height: 1.5; }
