:root {
  --bg: #090411;
  --panel: rgba(25, 10, 47, .82);
  --panel-strong: #1b0b31;
  --line: rgba(232, 179, 255, .16);
  --text: #f8efff;
  --muted: #bdaecb;
  --pink: #ff75d8;
  --violet: #9a74ff;
  --cyan: #74eaff;
  --green: #6fffc2;
  --shadow: 0 24px 90px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }
html { color-scheme: dark; scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: radial-gradient(circle at 50% -20%, #2c0c51 0, var(--bg) 48%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  overflow-x: hidden;
}

button, input { font: inherit; }
a { color: inherit; }
.hidden { display: none !important; }
.shell { width: min(1160px, calc(100% - 40px)); margin-inline: auto; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid #c7a7ff; outline-offset: 3px; }
button:disabled { cursor: wait; opacity: .7; }
.ambient { position: fixed; z-index: -1; width: 460px; aspect-ratio: 1; border-radius: 50%; filter: blur(120px); opacity: .12; pointer-events: none; }
.ambient-one { background: var(--pink); top: 18%; left: -220px; }
.ambient-two { background: var(--violet); top: 65%; right: -220px; }

.site-header { height: 82px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; letter-spacing: -.03em; }
.brand img { border-radius: 14px; object-fit: cover; border: 1px solid rgba(255,255,255,.22); box-shadow: 0 0 28px rgba(255,117,216,.3); }
.brand strong { font-size: 1.1rem; }
.brand i { color: var(--pink); font-style: normal; font-weight: 800; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 11px; border-radius: 999px; font-size: .76rem; font-weight: 750; border: 1px solid var(--line); }
.pill-muted { color: var(--muted); background: rgba(255,255,255,.035); }
.pill-online { color: var(--green); background: rgba(39, 222, 148, .08); border-color: rgba(111,255,194,.24); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #786d82; box-shadow: 0 0 0 4px rgba(255,255,255,.03); }
.pill-online .dot, .connection-status.connected .dot { background: var(--green); box-shadow: 0 0 12px rgba(111,255,194,.8); }

.button { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; border: 1px solid transparent; border-radius: 13px; padding: 0 18px; color: white; text-decoration: none; cursor: pointer; font-weight: 780; transition: transform .18s ease, border-color .18s ease, background .18s ease; }
.button:hover { transform: translateY(-2px); }
.button-small { min-height: 36px; padding: 0 13px; font-size: .8rem; }
.button-primary { background: linear-gradient(135deg, #ff65cd, #9166ff); box-shadow: 0 10px 30px rgba(218,80,255,.22); }
.button-secondary { background: linear-gradient(135deg, #9b70ff, #617bff); box-shadow: 0 10px 30px rgba(100,94,255,.22); }
.button-ghost { border-color: var(--line); background: rgba(255,255,255,.04); }

.access-page { background: #0e0e10; color: #efeff1; }
.access-shell { min-height: 100svh; display: grid; place-items: center; padding: 28px; }
.access-card { width: min(100%, 390px); padding: 38px; border: 1px solid #2f2f35; border-radius: 18px; background: #18181b; box-shadow: 0 24px 70px rgba(0, 0, 0, .35); text-align: center; }
.access-kicker { margin-bottom: 7px; color: #adadb8; font-size: .76rem; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; }
.access-card h1 { margin-bottom: 27px; font-size: clamp(2rem, 9vw, 2.7rem); line-height: 1; letter-spacing: -.045em; }
.twitch-button { width: 100%; min-height: 50px; background: #9147ff; border-color: #a970ff; box-shadow: none; }
.twitch-button:hover { background: #772ce8; }
.access-message { margin: 18px 0 0; color: #ffb3bd; font-size: .86rem; }

.private-heading { padding-top: 64px; }
.private-heading h1 { margin-bottom: 12px; font-size: clamp(2.7rem, 6vw, 5rem); }
.private-heading > p:last-child { color: var(--muted); }
.private-setup { padding-top: 48px; }

.hero { position: relative; min-height: 460px; display: grid; align-items: end; margin-top: 8px; border: 1px solid var(--line); border-radius: 28px; overflow: hidden; box-shadow: var(--shadow); background: #140724; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(7,2,15,1) 0%, rgba(7,2,15,.98) 43%, rgba(7,2,15,.42) 65%, rgba(7,2,15,.06) 84%); }
.hero-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-glass { position: relative; z-index: 1; width: min(590px, 70%); padding: 50px; }
.eyebrow { margin: 0 0 10px; color: var(--pink); text-transform: uppercase; letter-spacing: .16em; font-size: .72rem; font-weight: 850; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 18px; font-size: clamp(2.5rem, 6vw, 5.2rem); line-height: .94; letter-spacing: -.065em; }
h1 span { color: transparent; -webkit-text-stroke: 1px rgba(255,255,255,.8); }
.hero-glass > p:not(.eyebrow) { max-width: 550px; color: #d9cce4; font-size: 1.02rem; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 25px; }
.hero-tags span { padding: 7px 10px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); border-radius: 9px; color: #eadff2; font-size: .78rem; }

.setup { padding-block: 100px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 40px; margin-bottom: 34px; }
.section-heading h2 { margin: 0; font-size: clamp(1.8rem, 4vw, 3.1rem); line-height: 1.04; letter-spacing: -.045em; }
.section-heading > p { max-width: 500px; margin: 0; color: var(--muted); }
.connection-grid { display: grid; grid-template-columns: 1fr 62px 1fr; align-items: stretch; }
.connection-card { position: relative; padding: 34px; border: 1px solid var(--line); border-radius: 22px; background: linear-gradient(150deg, rgba(50,22,79,.72), rgba(16,7,29,.88)); overflow: hidden; }
.connection-card::before { content: ""; position: absolute; width: 200px; height: 200px; border-radius: 50%; filter: blur(70px); opacity: .12; right: -50px; top: -80px; background: var(--pink); }
.connection-card.connected { border-color: rgba(111,255,194,.33); }
.step-number { position: absolute; right: 26px; top: 17px; font-size: 3.1rem; font-weight: 900; color: rgba(255,255,255,.045); }
.connection-icon { width: 54px; height: 54px; display: grid; place-items: center; margin-bottom: 24px; border-radius: 16px; font-size: 1.35rem; font-weight: 900; }
.bot-icon { background: linear-gradient(135deg, var(--pink), var(--violet)); }
.foxy-icon { background: linear-gradient(135deg, var(--violet), #5d78ff); }
.card-kicker { margin-bottom: 4px; color: var(--pink); font-size: .72rem; text-transform: uppercase; letter-spacing: .14em; font-weight: 850; }
.connection-card h3, .feature-card h3, .admin-card h3 { margin-bottom: 9px; font-size: 1.45rem; letter-spacing: -.035em; }
.connection-card > p:not(.card-kicker) { color: var(--muted); min-height: 50px; }
.connection-status { display: flex; align-items: center; gap: 9px; margin: 22px 0 18px; color: var(--muted); font-size: .86rem; }
.connection-status.connected { color: var(--green); }
.connection-card .button { width: 100%; }
.connection-card small { display: block; margin-top: 13px; color: #8f819a; font-size: .72rem; text-align: center; }
.link-line { display: grid; place-items: center; }
.link-line::before { content: ""; position: absolute; width: 62px; height: 1px; background: var(--line); }
.link-line span { z-index: 1; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #170a2b; border: 1px solid var(--line); color: var(--muted); }
.notice { margin-top: 18px; padding: 15px 17px; border-radius: 12px; }
.warning { color: #ffd99a; background: rgba(255,175,56,.09); border: 1px solid rgba(255,175,56,.25); }

.feature-band { padding-block: 88px; background: rgba(255,255,255,.018); border-block: 1px solid rgba(255,255,255,.055); }
.feature-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 20px; }
.feature-card { position: relative; min-height: 350px; padding: 32px; border-radius: 22px; border: 1px solid var(--line); background: var(--panel); overflow: hidden; }
.feature-card > p:not(.card-kicker) { color: var(--muted); }
.love-card { grid-column: span 7; }
.tts-card { grid-column: span 5; }
.persona-card { grid-column: span 12; min-height: 260px; }
.feature-mark { float: right; color: var(--pink); font-size: 1.5rem; font-weight: 900; }
.feature-card code { padding: 2px 8px; border-radius: 7px; background: rgba(255,117,216,.11); color: #ffabe6; font-family: inherit; }
.chat-preview { margin-top: 28px; padding: 17px 18px; border-left: 2px solid var(--pink); border-radius: 0 12px 12px 0; background: rgba(0,0,0,.22); }
.chat-preview p { margin: 4px 0 0; color: #dfd3e7; }
.chat-user { color: #ff91df; font-weight: 800; font-size: .8rem; }
.voice-levels { display: grid; gap: 9px; margin-top: 28px; }
.voice-levels span { padding: 10px 12px; border-radius: 9px; background: rgba(255,255,255,.045); color: var(--muted); }
.voice-levels b { color: var(--cyan); margin-right: 8px; }
.persona-card .meter-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 30px; }
.meter-list div { display: grid; grid-template-columns: 1fr auto; gap: 7px; color: var(--muted); font-size: .8rem; }
.meter-list i { grid-column: 1 / -1; order: 3; height: 5px; border-radius: 9px; background: linear-gradient(90deg, var(--pink) var(--value), rgba(255,255,255,.08) var(--value)); }
.meter-list b { color: white; }

.admin-panel { padding-block: 100px; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stats-grid article { padding: 23px; border-radius: 17px; background: var(--panel); border: 1px solid var(--line); }
.stats-grid strong { display: block; font-size: 2rem; line-height: 1; color: #ff9de5; }
.stats-grid span { color: var(--muted); font-size: .8rem; }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.admin-card { padding: 26px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); }
.admin-card p, .admin-card small { color: var(--muted); }
.admin-card > .button { margin-top: 18px; }
.copy-row, #tts-test-form { display: flex; gap: 8px; }
input { width: 100%; min-width: 0; height: 46px; padding: 0 13px; border-radius: 11px; border: 1px solid var(--line); background: rgba(0,0,0,.25); color: white; outline: none; }
input:focus { border-color: rgba(255,117,216,.6); box-shadow: 0 0 0 3px rgba(255,117,216,.08); }
.love-log { margin-top: 20px; }
.love-entry { padding: 13px 0; border-top: 1px solid var(--line); }
.love-entry:first-child { border-top: 0; }
.love-entry b { color: var(--pink); }
.love-entry p { margin: 4px 0 0; }
.empty { margin: 0; }

footer { display: flex; justify-content: space-between; padding-block: 32px; border-top: 1px solid var(--line); color: #74687d; font-size: .75rem; }
.toast { position: fixed; z-index: 10; right: 24px; bottom: 24px; max-width: min(420px, calc(100% - 48px)); padding: 13px 16px; border: 1px solid rgba(255,255,255,.15); border-radius: 12px; background: #231034; box-shadow: var(--shadow); }
.toast.error { border-color: rgba(255,104,145,.35); }

@media (max-width: 800px) {
  .shell { width: min(100% - 24px, 1160px); }
  .header-actions .pill { display: none; }
  .hero { min-height: 590px; align-items: end; }
  .hero::after { background: linear-gradient(0deg, rgba(7,2,15,1) 0%, rgba(7,2,15,.93) 47%, rgba(7,2,15,.22) 78%, rgba(7,2,15,.03) 100%); }
  .hero-art { object-position: 64% center; }
  .hero-glass { width: 100%; padding: 28px; }
  .section-heading { display: block; }
  .section-heading > p { margin-top: 15px; }
  .connection-grid { grid-template-columns: 1fr; gap: 14px; }
  .link-line { height: 24px; }
  .link-line::before { width: 1px; height: 38px; }
  .love-card, .tts-card, .persona-card { grid-column: 1 / -1; }
  .persona-card .meter-list, .stats-grid, .admin-grid { grid-template-columns: 1fr; }
  .copy-row, #tts-test-form { flex-direction: column; }
  footer { display: grid; gap: 6px; }
  .access-shell { padding: 18px; }
  .access-card { padding: 30px 22px; }
  .private-heading { padding-top: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
