:root {
  --bg: #000;
  --bg-2: #0b0b0b;
  --bg-3: #141414;
  --line: rgba(255,255,255,.09);
  --line-2: rgba(255,255,255,.16);
  --text: #f4f4f2;
  --muted: #8a8a86;
  --dim: #5a5a57;
  --gold: #c9a45c;
  --gold-soft: rgba(201,164,92,.14);
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --r: 18px;
  --ease: cubic-bezier(.2,.8,.2,1);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; background: var(--bg); color: var(--text); font-family: var(--sans); font-weight: 400; -webkit-font-smoothing: antialiased; }
body { overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
em { font-style: italic; color: var(--gold); font-family: var(--serif); font-weight: 400; }
.hidden { display: none !important; }
.muted { color: var(--muted); }

/* subtle film grain + vignette */
.grain { position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(201,164,92,.07), transparent 60%),
    radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,.7));
}
.grain::after { content: ""; position: absolute; inset: 0; opacity: .05;
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence baseFrequency='.9' numOctaves='3'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* screens */
.screen { position: fixed; inset: 0; z-index: 1; display: flex; flex-direction: column;
  height: 100dvh; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: opacity .5s var(--ease), transform .5s var(--ease), visibility .5s; }
.screen.active { opacity: 1; visibility: visible; transform: none; }

.top { display: flex; align-items: center; justify-content: space-between; padding: 22px 24px; max-width: 1100px; width: 100%; margin: 0 auto; }
.logo { font-family: var(--serif); font-size: 28px; letter-spacing: -.01em; display: flex; align-items: center; gap: 4px; }
.logo.small { font-size: 22px; }
.logo .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); margin-top: 10px; }
.online { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.online #onlineCount { color: var(--text); font-variant-numeric: tabular-nums; }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 0 rgba(201,164,92,.6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(201,164,92,0); } 100% { box-shadow: 0 0 0 0 rgba(201,164,92,0); } }

/* hero */
.hero { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; padding: 0 24px; max-width: 1100px; width: 100%; margin: 0 auto; }
.eyebrow { font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); margin-bottom: 28px; }
h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(44px, 8.5vw, 104px); line-height: .98; letter-spacing: -.025em; }
.sub { margin: 28px 0 44px; color: var(--muted); font-size: 16px; line-height: 1.6; font-weight: 300; }

.btn-primary { display: inline-flex; align-items: center; gap: 14px; background: var(--text); color: #000;
  padding: 20px 28px; border-radius: 100px; font-weight: 500; font-size: 16px;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 40px -10px rgba(201,164,92,.45); background: #fff; }
.btn-primary:active { transform: scale(.97); }
.btn-primary svg { transition: transform .25s var(--ease); }
.btn-primary:hover svg { transform: translateX(4px); }
.btn-primary.sm { padding: 14px 22px; font-size: 14px; }
.btn-ghost { border: 1px solid var(--line-2); padding: 14px 22px; border-radius: 100px; font-size: 14px; color: var(--text); transition: border-color .2s, background .2s; }
.btn-ghost:hover { border-color: var(--gold); background: var(--gold-soft); }
.btn-ghost.sm { padding: 14px 22px; }
.btn-text { color: var(--muted); font-size: 14px; padding: 12px; }
.btn-text:hover { color: var(--text); }

.foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 22px 24px; font-size: 12px; color: var(--dim); max-width: 1100px; width: 100%; margin: 0 auto; }
.foot a { color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--line-2); }
.foot a:hover { color: var(--gold); border-color: var(--gold); }

/* choose */
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); border: 1px solid var(--line); transition: color .2s, border-color .2s; }
.icon-btn:hover { color: var(--text); border-color: var(--line-2); }
.icon-btn.ghost { visibility: hidden; }
.choose-wrap { flex: 1; overflow-y: auto; padding: 12px 24px 32px; max-width: 760px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; justify-content: center; }
h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(38px, 7vw, 64px); line-height: 1; letter-spacing: -.02em; margin-bottom: 36px; }

.scope { margin-bottom: 28px; }
.scope-label { display: block; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.seg { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); background: var(--bg-2); border: 1px solid var(--line); border-radius: 100px; padding: 4px; }
.seg button { position: relative; z-index: 1; padding: 12px 6px; font-size: 14px; color: var(--muted); border-radius: 100px; transition: color .3s; }
.seg button.on { color: #000; font-weight: 500; }
.seg-thumb { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / 3); background: var(--text); border-radius: 100px; transition: transform .4s var(--ease); }
.scope-hint { display: block; font-size: 13px; color: var(--dim); margin-top: 10px; padding-left: 4px; }

.roles { display: grid; gap: 14px; }
@media (min-width: 640px) { .roles { grid-template-columns: 1fr 1fr; } }
.role-card { position: relative; text-align: left; padding: 26px 24px 24px; border-radius: var(--r); background: var(--bg-2); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 8px; overflow: hidden; transition: border-color .3s, transform .3s var(--ease), background .3s; }
.role-card::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 100% 0%, var(--gold-soft), transparent 60%); opacity: 0; transition: opacity .4s; }
.role-card:hover { border-color: rgba(201,164,92,.5); transform: translateY(-3px); }
.role-card:hover::before { opacity: 1; }
.role-card:active { transform: scale(.98); }
.role-num { font-size: 12px; color: var(--gold); letter-spacing: .12em; }
.role-title { font-family: var(--serif); font-size: 32px; line-height: 1.05; margin-top: 18px; }
.role-desc { color: var(--muted); font-size: 14px; line-height: 1.5; font-weight: 300; max-width: 30ch; }
.role-arrow { position: absolute; top: 22px; right: 24px; color: var(--muted); font-size: 20px; transition: transform .3s var(--ease), color .3s; }
.role-card:hover .role-arrow { transform: translateX(4px); color: var(--gold); }

/* search */
.search-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; text-align: center; }
.orb { position: relative; width: 180px; height: 180px; margin-bottom: 36px; }
.ring { position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(201,164,92,.5); animation: ripple 3s var(--ease) infinite; opacity: 0; }
.r2 { animation-delay: 1s; } .r3 { animation-delay: 2s; }
@keyframes ripple { 0% { transform: scale(.3); opacity: 1; } 100% { transform: scale(1.2); opacity: 0; } }
.core { position: absolute; inset: 70px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #f1dca8, var(--gold) 45%, #6b5428); box-shadow: 0 0 60px rgba(201,164,92,.5); animation: breathe 3s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.12); } }
.search-wrap h3 { font-family: var(--serif); font-weight: 400; font-size: 34px; letter-spacing: -.01em; }
.search-wrap p { font-size: 14px; margin-bottom: 18px; }

/* chat */
#chat { max-width: 760px; left: 50%; transform: translateX(-50%) translateY(12px); width: 100%; }
#chat.active { transform: translateX(-50%); }
.chat-top { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); background: rgba(0,0,0,.7); backdrop-filter: blur(14px); }
.peer { display: flex; align-items: center; gap: 12px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: conic-gradient(from 200deg, #1a1a1a, #3a3a3a, var(--gold), #1a1a1a); position: relative; }
.avatar::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: radial-gradient(circle at 50% 38%, #2a2a2a 0 22%, transparent 23%), radial-gradient(ellipse at 50% 100%, #2a2a2a 0 45%, #0d0d0d 46%); }
.peer-name { font-size: 15px; font-weight: 500; }
.peer-meta { font-size: 12px; color: var(--muted); }
.chat-actions { display: flex; gap: 8px; align-items: center; }
.pill { border: 1px solid var(--line-2); padding: 9px 18px; border-radius: 100px; font-size: 13px; font-weight: 500; transition: all .2s; }
.pill:hover { border-color: var(--gold); color: var(--gold); }

.messages { flex: 1; overflow-y: auto; padding: 22px 16px 8px; display: flex; flex-direction: column; gap: 6px; scroll-behavior: smooth; }
.sys { align-self: center; text-align: center; font-size: 12px; color: var(--dim); padding: 10px 14px; margin: 8px 0; max-width: 34ch; line-height: 1.5; }
.sys b { color: var(--gold); font-weight: 500; }
.bubble { max-width: 78%; padding: 11px 15px; border-radius: 20px; font-size: 15px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; animation: pop .35s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.97); } }
.bubble.me { align-self: flex-end; background: var(--text); color: #000; border-bottom-right-radius: 6px; }
.bubble.them { align-self: flex-start; background: var(--bg-3); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.bubble.me + .bubble.me { border-top-right-radius: 8px; }
.bubble.them + .bubble.them { border-top-left-radius: 8px; }

/* voice bubble */
.voice { display: flex; align-items: center; gap: 12px; min-width: 220px; padding: 10px 14px 10px 10px; }
.vplay { width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center; }
.me .vplay { background: #000; color: var(--gold); }
.them .vplay { background: var(--gold); color: #000; }
.vwave { flex: 1; display: flex; align-items: center; gap: 2px; height: 28px; cursor: pointer; }
.vwave i { flex: 1; border-radius: 2px; min-height: 3px; transition: background .15s; }
.me .vwave i { background: rgba(0,0,0,.25); }
.me .vwave i.p { background: #000; }
.them .vwave i { background: rgba(255,255,255,.2); }
.them .vwave i.p { background: var(--gold); }
.vtime { font-size: 12px; font-variant-numeric: tabular-nums; opacity: .7; min-width: 30px; text-align: right; }

.typing { display: flex; gap: 4px; padding: 12px 16px; margin: 0 16px 6px; background: var(--bg-3); border: 1px solid var(--line); border-radius: 20px; width: fit-content; }
.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; } .typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .25; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }

.composer { padding: 10px 12px 14px; border-top: 1px solid var(--line); background: #000; }
.compose-row { display: flex; align-items: flex-end; gap: 8px; width: 100%; min-width: 0; }
.compose-row.rec { align-items: center; }
#recTime { flex: none; }
textarea { flex: 1; resize: none; background: var(--bg-2); border: 1px solid var(--line); border-radius: 24px; padding: 13px 18px; color: var(--text); font: inherit; font-size: 16px; line-height: 1.35; max-height: 140px; outline: none; transition: border-color .2s; }
textarea:focus { border-color: rgba(201,164,92,.5); }
textarea::placeholder { color: var(--dim); }
.round { width: 48px; height: 48px; flex: none; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-2); color: var(--text); transition: all .2s var(--ease); }
.round:hover { border-color: var(--gold); color: var(--gold); }
.round:active { transform: scale(.92); }
.round.gold { background: var(--gold); border-color: var(--gold); color: #000; }
.round.gold:hover { background: #d8b673; color: #000; }

.rec-info { flex: 1 1 0; min-width: 0; overflow: hidden; height: 48px; display: flex; align-items: center; gap: 12px; padding: 0 18px; background: var(--bg-2); border: 1px solid rgba(201,164,92,.4); border-radius: 24px; font-variant-numeric: tabular-nums; font-size: 14px; }
.rec-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--gold); animation: recblink 1s infinite; }
@keyframes recblink { 50% { opacity: .2; } }
.rec-bars { flex: 1 1 0; min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 2px; height: 24px; overflow: hidden; }
.rec-bars i { width: 3px; flex: none; border-radius: 2px; background: var(--gold); }

.ended { text-align: center; padding: 8px 0 4px; }
.ended p { color: var(--muted); font-size: 14px; margin-bottom: 14px; }
.ended-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* report sheet */
.sheet-wrap { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.6); backdrop-filter: blur(6px); display: flex; align-items: flex-end; justify-content: center; animation: fade .25s var(--ease); }
@keyframes fade { from { opacity: 0; } }
.sheet { width: 100%; max-width: 520px; background: var(--bg-2); border: 1px solid var(--line); border-bottom: 0; border-radius: 24px 24px 0 0; padding: 12px 20px calc(18px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; animation: up .35s var(--ease); }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet-grip { width: 38px; height: 4px; border-radius: 2px; background: var(--line-2); align-self: center; margin-bottom: 8px; }
.sheet h4 { font-family: var(--serif); font-weight: 400; font-size: 28px; }
.sheet p { font-size: 14px; line-height: 1.5; margin-bottom: 6px; }
.reasons { display: flex; flex-direction: column; gap: 8px; }
.reasons button { text-align: left; padding: 15px 18px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg-3); font-size: 15px; transition: border-color .2s, color .2s; }
.reasons button:hover, .reasons button:active { border-color: var(--gold); color: var(--gold); }
.chat-actions .icon-btn { width: 38px; height: 38px; }
.small { font-size: 12px !important; }
#banned .logo { margin-bottom: 28px; }

.toast { position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); background: var(--text); color: #000; padding: 11px 18px; border-radius: 100px; font-size: 13px; font-weight: 500; opacity: 0; pointer-events: none; transition: all .35s var(--ease); z-index: 10; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

::-webkit-scrollbar { width: 6px; } ::-webkit-scrollbar-thumb { background: #222; border-radius: 3px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* small-screen polish */
.peer { min-width: 0; flex: 1; }
.peer > div { min-width: 0; }
.peer-name, .peer-meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-actions { flex: none; }
.toast { width: max-content; max-width: calc(100vw - 32px); text-align: center; bottom: calc(150px + env(safe-area-inset-bottom)); }
