:root {
  color-scheme: dark;
  --bg: #101824;
  --panel: #19222d;
  --text: #f0ebe4;
  --muted: #aeb4bc;
  --accent: #b99cff;
  --gold: #d5aa7f;
  --green: #a3bd9a;
  --pink: #e9a9be;
  --line: #ffffff12;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: 'Segoe UI', system-ui, sans-serif;
  font-size: 16px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 1rem/1.6 var(--sans); min-height: 100vh; min-height: 100svh; position: relative; display: flex; flex-direction: column; }
body::before { content: ''; position: fixed; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 12% 68%, #42513b28, transparent 50%), radial-gradient(ellipse at 65% 24%, #68477325, transparent 50%); z-index: -1; }
button, input, select { font: inherit; }
a { color: inherit; text-decoration: none; }
button, a, input, summary, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
input:focus, select:focus { outline: 1px solid var(--accent); outline-offset: 1px; }
.ambient { position: absolute; border-radius: 50%; filter: blur(65px); opacity: .06; pointer-events: none; z-index: -1; }
.ambient-one { width: min(25rem, 100%); height: 25rem; left: 0; top: 20rem; background: var(--green); }
.ambient-two { width: 24rem; height: 24rem; right: 5%; top: 6rem; background: var(--pink); }

.site-header { width: 100%; max-width: 112rem; margin: 0 auto; padding: 1.8rem 3rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: .9rem; }
.brand img { width: 3rem; height: 3rem; }
.brand strong { font: normal 1.9rem var(--serif); letter-spacing: .04em; }
.brand small { display: block; color: var(--muted); font-size: .7rem; letter-spacing: .12em; margin-top: .2rem; }
.header-actions { display: flex; align-items: center; gap: 1.8rem; }
.header-tag { color: var(--muted); font-size: .85rem; display: flex; align-items: center; gap: .6rem; white-space: nowrap; }
.dot { display: inline-block; height: .35rem; width: .35rem; background: var(--green); border-radius: 50%; flex-shrink: 0; }
.language-switch { display: flex; gap: .2rem; padding: .25rem; border: 1px solid #d5aa7f2b; border-radius: 2rem; background: #10182470; }
.language-switch button { display: flex; align-items: center; justify-content: center; gap: .5rem; border: 0; border-radius: 1.5rem; padding: .55rem .75rem; color: var(--muted); background: none; font-size: .75rem; letter-spacing: .04em; min-height: 2.5rem; }
.language-switch button:hover { color: var(--text); background: #ffffff06; }
.language-switch button[aria-pressed=true] { background: #b99cff20; color: var(--accent); }
.language-flag { display: block; width: 1.3rem; height: .87rem; overflow: hidden; border-radius: .15rem; box-shadow: 0 0 0 1px #ffffff18; flex-shrink: 0; }

main { width: 100%; max-width: 112rem; flex: 1; margin: 0 auto; padding: 3.5rem 3rem; display: grid; grid-template-columns: minmax(0, 1fr) minmax(28rem, 32rem) minmax(0, 1fr); gap: 3rem; align-items: center; }
.story { width: 100%; max-width: 30rem; justify-self: end; }
.eyebrow { color: var(--gold); font-size: .65rem; letter-spacing: .18em; display: flex; align-items: center; gap: .65rem; }
.little-star { font-size: 1.3rem; color: var(--pink); }
h1 { font: normal clamp(2.1rem, 2.5vw, 2.9rem)/1.2 var(--serif); letter-spacing: -.025em; margin: 1.25rem 0; }
h1 em { font-weight: normal; color: var(--accent); }
.intro { color: var(--muted); font-size: .92rem; line-height: 1.85; margin: 0 0 1.8rem; max-width: 28rem; }
.scene { position: relative; max-width: 26rem; margin: 0 auto; }
.scene::before { content: ''; position: absolute; inset: -.6rem -.6rem 0; border: 1px solid #d5aa7f12; border-radius: 50% 50% 1rem 1rem; pointer-events: none; }
.scene svg { display: block; width: 100%; border: 1px solid #ffffff09; border-radius: 50% 50% .8rem .8rem; overflow: hidden; }
.scene-caption { position: absolute; bottom: .9rem; left: 0; right: 0; display: flex; justify-content: center; gap: .7rem; color: #ead9c2; font: italic 1rem var(--serif); text-shadow: 0 2px 5px #101824; }
.scene-caption>span:first-child, .scene-caption>span:last-child { color: var(--gold); }
.fireflies { animation: glimmer 5s ease-in-out infinite; }
.feature-row { display: flex; justify-content: center; flex-wrap: wrap; margin: 1.4rem 0 0; gap: .5rem 1.25rem; color: var(--muted); font-size: .7rem; }
.feature-row>span { white-space: nowrap; }
.feature-row i { font-style: normal; color: var(--green); font-size: 1rem; margin-right: .3rem; }

.voice-card { --card-padding: 2.25rem; width: 100%; background: linear-gradient(145deg, #272c3aee, #17242bf5); border: 1px solid #d0b9aa35; border-radius: 1.5rem; padding: 2rem var(--card-padding) 0; box-shadow: 0 1.5rem 6rem #050c1560, 0 1px 0 #ffffff0b inset; position: relative; justify-self: center; min-width: 0; }
.voice-card::before { content: ''; position: absolute; width: 45%; height: 1px; top: -1px; left: 27.5%; background: linear-gradient(90deg, transparent, #d6bceb70, transparent); }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: 1.5rem; }
.card-icon { width: 2.6rem; height: 2.6rem; flex-shrink: 0; border: 1px solid #d5aa7f40; border-radius: .8rem; display: grid; place-items: center; color: var(--gold); background: #d5aa7f0c; font-size: 1.65rem; }
.pill { border: 1px solid #a3bd9a2b; color: var(--green); font-size: .72rem; letter-spacing: .015em; background: #a3bd9a08; padding: .4rem .75rem; border-radius: 2rem; }
.pill.connected { background: #a3bd9a18; }
h2 { font: normal 2.2rem/1.2 var(--serif); margin: .4rem 0; letter-spacing: -.015em; }
.muted { color: var(--muted); }
p.muted { font-size: .9rem; margin: .8rem 0 1.7rem; }
label { display: block; font-size: .88rem; color: #d9d6dc; margin: 1.4rem 0 .5rem; }
input:not([type=range]), select { border: 1px solid #d5aa7f30; border-radius: .65rem; background: #1018248c; color: var(--text); width: 100%; padding: .85rem .95rem; font-size: .95rem; transition: border-color .2s; min-height: 3.25rem; }
input::placeholder { color: #929aa6; opacity: 1; }
.field-note { font-size: .74rem; color: #9da6b3; margin: .5rem 0 0; line-height: 1.65; }
.password-field { position: relative; }
.password-field input { padding-right: 4.5rem; }
.password-field button { position: absolute; right: .85rem; top: 0; bottom: 0; border: 0; padding: .3rem; color: var(--muted); background: none; font-size: .75rem; }
.primary { margin-top: 1.8rem; display: flex; align-items: center; gap: .75rem; width: 100%; min-height: 3.65rem; padding: .9rem 1.1rem; border-radius: .75rem; border: 1px solid #d2baff; background: linear-gradient(110deg, #bca0dc, #c4addf); color: #211c31; font-size: .95rem; font-weight: 650; box-shadow: 0 3px 1.5rem #b99cff16; transition: filter .2s, transform .2s; }
.primary:hover { filter: brightness(1.07); transform: translateY(-1px); }
.primary>.button-label { font-size: inherit; margin-left: 0; }
.primary>.button-arrow { margin-left: auto; font-size: 1.4rem; }
.primary svg { width: 1.4rem; height: 1.4rem; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.6; }
.primary svg rect { fill: currentColor; stroke: none; }
.text-button { border: 0; padding: .2rem 0; background: none; color: var(--muted); font-size: .85rem; text-decoration: underline; text-decoration-color: #ffffff25; text-underline-offset: 4px; }
.text-button:hover { color: var(--text); }
.mic-preview { display: flex; align-items: center; justify-content: center; gap: 1rem; margin: 1rem 0 1.75rem; }
.meter { height: .4rem; border-radius: .4rem; background: #0f1822; overflow: hidden; margin: 1rem 0; }
.meter.small { width: 4.5rem; height: .3rem; margin: 0; }
.meter span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--green), var(--accent)); transition: width .09s; border-radius: .4rem; }
.card-bottom { margin: 1.75rem calc(-1 * var(--card-padding)) 0; padding: 1rem .75rem; border-top: 1px solid var(--line); color: #a6b1b5; display: flex; justify-content: center; align-items: center; gap: .6rem; font-size: .75rem; background: #0b17122b; border-radius: 0 0 1.5rem 1.5rem; }

.setup-guide { width: 100%; max-width: 22rem; padding: .5rem 0 .5rem 1rem; }
.guide-ornament { width: 8.5rem; height: auto; display: block; margin: 0 0 1.5rem -.75rem; }
.guide-label { color: var(--gold); font-size: .65rem; letter-spacing: .14em; }
.guide-label>span:first-child { color: var(--pink); margin-right: .5rem; }
.setup-guide h2 { font-size: 1.9rem; line-height: 1.3; margin: .8rem 0 1.8rem; max-width: 17rem; }
ol { padding: 0; margin: 1rem 0; list-style: none; position: relative; }
ol::before { content: ''; position: absolute; top: 1rem; bottom: 1rem; left: .85rem; width: 1px; background: linear-gradient(var(--gold), #d5aa7f10); opacity: .18; }
li { display: flex; gap: .9rem; align-items: flex-start; margin: 1.4rem 0; font-size: .85rem; color: #c4c9ce; position: relative; }
li>span { display: grid; place-items: center; flex-shrink: 0; width: 1.75rem; height: 1.75rem; border: 1px solid #d5aa7f38; background: var(--bg); color: var(--gold); border-radius: 50%; font-size: .72rem; }
li>div { padding-top: .15rem; min-width: 0; }
li small { display: inline-block; color: #9da6b3; font-size: .76rem; line-height: 1.6; margin-top: .45rem; }
code { display: inline-block; font: .8rem/1.5 Consolas, monospace; color: var(--accent); background: #b99cff0a; border: 1px solid #b99cff20; padding: .25rem .4rem; border-radius: .3rem; overflow-wrap: anywhere; margin-top: .15rem; }
.password-note { font-size: .76rem; color: #bba898; padding-top: 1.1rem; border-top: 1px solid #d5aa7f18; margin: 1.75rem 0 0; line-height: 1.85; }
footer { width: calc(100% - 6rem); max-width: 106rem; margin: 0 auto; padding: 1.4rem 0; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 1rem; color: #939ca9; font-size: .75rem; }
footer>span:last-child { letter-spacing: .2em; color: #aaa0a3; font-size: .7rem; white-space: nowrap; }
.footer-star { color: var(--pink); }

.notice, #feedback { background: #d5aa7f10; color: #e4c7a1; border: 1px solid #d5aa7f2c; border-radius: .65rem; padding: .85rem 1rem; font-size: .9rem; margin: 1rem 0; overflow-wrap: anywhere; }
#feedback.error { color: #edb4bf; background: #e9a9be0a; border-color: #e9a9be30; }
#feedback.success { color: var(--green); background: #a3bd9a0a; border-color: #a3bd9a30; }
.live-panel { display: flex; align-items: center; gap: .8rem; background: #a3bd9a09; border: 1px solid #a3bd9a26; padding: 1rem; border-radius: .7rem; margin-top: 1.5rem; }
.live-panel strong { font-size: .9rem; font-weight: 500; }
.live-panel small { display: block; font-size: .75rem; color: var(--muted); margin-top: .25rem; }
.live-dot { width: .55rem; height: .55rem; background: var(--green); border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 14px #a3bd9a40; }
.live-panel.muted-state .live-dot { background: var(--gold); box-shadow: none; }
.sound-bars { color: var(--green); margin-left: auto; font-size: 1.5rem; letter-spacing: .1em; opacity: .5; }
.talking .sound-bars { opacity: 1; animation: glimmer .45s infinite; }
.control-row { display: flex; gap: .65rem; }
.secondary { flex: 1; border: 1px solid #ffffff20; background: #10182450; color: var(--text); padding: .7rem .8rem; border-radius: .55rem; font-size: .88rem; }
.secondary[aria-pressed=true] { color: var(--pink); border-color: #e9a9be50; background: #e9a9be10; }
.range-row { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.range-row output { color: var(--muted); font-size: .8rem; margin-top: .8rem; }
input[type=range] { accent-color: var(--accent); width: 100%; height: 1.25rem; cursor: pointer; margin: 0; }
.audio-settings { margin-top: 1.2rem; font-size: .9rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.audio-settings summary { color: var(--muted); cursor: pointer; }
.nearby { margin-top: 1.4rem; padding-top: 1.1rem; border-top: 1px solid var(--line); }
.nearby-title { display: flex; justify-content: space-between; gap: .5rem; font-size: .85rem; color: var(--green); margin-bottom: .8rem; }
.nearby-title small { color: var(--muted); font-size: .75rem; }
.nearby-list { display: flex; flex-wrap: wrap; gap: .5rem; font-size: .85rem; }
.player-chip { border: 1px solid #a3bd9a26; background: #a3bd9a09; padding: .3rem .6rem; border-radius: .4rem; overflow-wrap: anywhere; }
.disconnect { display: block; margin: 1.6rem auto .3rem; color: #c2a2a7; }
.ptt-button { background: #b99cff0b; border: 1px solid #b99cff45; color: var(--accent); border-radius: .7rem; width: 100%; padding: .9rem; margin-top: .9rem; touch-action: none; user-select: none; }
.ptt-button small { display: block; font-size: .75rem; margin-top: .2rem; color: var(--muted); }
.ptt-button.pressed { background: #a3bd9a25; color: var(--green); border-color: var(--green); }

@keyframes glimmer { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
@media (min-width: 1920px) {
  :root { font-size: clamp(16px, .9vw, 24px); }
}
@media (max-width: 1319px) {
  main { max-width: 60rem; grid-template-columns: minmax(0, 1fr); gap: 2.5rem; padding: 2.5rem 2rem; }
  .story { max-width: none; justify-self: center; display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 2rem; }
  .intro { margin-bottom: 0; }
  h1 { font-size: 2.5rem; }
  .scene { max-width: 22rem; }
  .voice-card, .setup-guide { max-width: 32rem; justify-self: center; }
  .setup-guide { padding: 1rem .75rem 0; }
  .guide-ornament { display: none; }
  .setup-guide h2 { max-width: none; margin-bottom: 1.5rem; }
  .site-header { padding: 1.5rem 2rem; }
  footer { width: calc(100% - 4rem); }
}
@media (max-width: 760px) {
  .site-header { padding: 1.2rem 1.25rem; }
  .brand { gap: .6rem; }
  .brand img { width: 2.4rem; height: 2.4rem; }
  .brand strong { font-size: 1.5rem; }
  .brand small { font-size: .6rem; letter-spacing: .07em; }
  .header-tag { display: none; }
  .header-actions { gap: 0; }
  .language-switch button { min-height: 2.6rem; padding: .5rem .6rem; gap: .4rem; }
  main { gap: 2rem; padding: 2.5rem 1.25rem; }
  .story { display: block; max-width: 32rem; text-align: center; }
  .eyebrow { justify-content: center; font-size: .6rem; letter-spacing: .13em; }
  h1 { font-size: clamp(2rem, 6vw, 2.6rem); margin: 1rem 0; }
  .intro { font-size: .85rem; max-width: 27rem; margin: 0 auto; }
  .scene { max-width: 19rem; margin: 1.75rem auto 0; }
  .scene-caption { font-size: .85rem; bottom: .65rem; }
  .feature-row { font-size: .65rem; gap: .5rem .85rem; margin-top: 1rem; }
  .voice-card { --card-padding: 1.4rem; padding-top: 1.5rem; }
  h2 { font-size: 1.9rem; }
  input:not([type=range]), select { font-size: 1rem; }
  .setup-guide { padding: .5rem .5rem 0; }
  footer { width: calc(100% - 2.5rem); flex-wrap: wrap; font-size: .7rem; }
}
@media (max-width: 380px) {
  .brand small { display: none; }
  .language-switch button { padding: .5rem; }
  .language-flag { width: 1.1rem; height: .74rem; }
  .voice-card { --card-padding: 1.1rem; }
  .pill { font-size: .65rem; }
  .mic-preview { gap: .65rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
