:root {
  --bg: #0f1115;
  --panel: #181b22;
  --panel-2: #20242d;
  --text: #eef0f4;
  --muted: #9aa2b1;
  --accent: #7c5cff;
  --accent-2: #9b83ff;
  --danger: #ff5c7a;
  --ok: #3ddc97;
  --radius: 14px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent-2); }

.screen { display: none; min-height: 100%; }
.screen.active { display: flex; }

/* ---------- landing ---------- */
#landing, #banned { flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; }
.landing-card {
  width: 100%; max-width: 440px;
  background: var(--panel); border-radius: var(--radius); padding: 32px 24px;
}
.logo { font-size: 44px; margin: 0; letter-spacing: -1px; color: var(--accent-2); }
.tagline { color: var(--muted); margin: 8px 0 12px; }
.online { margin: 0 0 20px; font-size: 14px; color: var(--muted); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }

.hour-card {
  margin: 0 0 20px; padding: 14px 16px; border-radius: 12px;
  background: linear-gradient(135deg, #2a1f5c, #3b1f4a); border: 1px solid rgba(155, 131, 255, .35);
}
.hour-card.live { background: linear-gradient(135deg, #5c1f2e, #3b1f4a); border-color: rgba(255, 92, 122, .5); }
.hour-title { font-weight: 700; font-size: 17px; }
.hour-card.live .hour-title::before {
  content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--danger);
  margin-right: 8px; vertical-align: 2px; animation: live-pulse 1.4s ease-in-out infinite;
}
@keyframes live-pulse { 50% { opacity: .3; } }
.hour-sub { color: #d8d4ee; font-size: 14px; margin: 2px 0 8px; }
.hour-remind { font-size: 14px; font-weight: 600; text-decoration: none; }

.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 14px; margin-bottom: 4px; }
.field small, .small { color: var(--muted); font-size: 13px; }
input[type=text], select {
  width: 100%; padding: 10px 12px; border-radius: 10px;
  border: 1px solid #2c313c; background: var(--panel-2); color: var(--text); font: inherit;
}
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; margin: 18px 0 10px; }
.check input { margin-top: 4px; width: 18px; height: 18px; flex: none; }
.rules { font-size: 13px; color: var(--muted); background: var(--panel-2); padding: 10px 12px; border-radius: 10px; }
.error { color: var(--danger); font-size: 14px; }
.footer { margin-top: 20px; font-size: 13px; color: var(--muted); }

.btn {
  border: 0; border-radius: 10px; padding: 10px 16px; font: inherit; font-weight: 600;
  background: var(--panel-2); color: var(--text); cursor: pointer;
}
.btn:disabled { opacity: .4; cursor: default; }
.btn.primary { background: var(--accent); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.big { width: 100%; padding: 14px; font-size: 17px; margin-top: 6px; }
kbd { font-size: 11px; opacity: .7; border: 1px solid currentColor; border-radius: 4px; padding: 0 4px; margin-left: 4px; }

/* ---------- chat (mobile first: full-screen video like a story) ---------- */
#chat { position: fixed; inset: 0; height: 100dvh; overflow: hidden; background: #000; }
#chat:not(.active) { display: none; }
.stage { position: absolute; inset: 0; overflow: hidden; touch-action: pan-x; }

.video-box { position: absolute; background: #000; overflow: hidden; }
.video-box video { width: 100%; height: 100%; object-fit: cover; display: block; }
.video-box.remote { inset: 0; will-change: transform; }
.video-box.remote.animate { transition: transform .28s cubic-bezier(.2, .8, .2, 1); }
.video-box.blurred video { filter: blur(40px); }
.video-box.local {
  top: calc(env(safe-area-inset-top) + 12px); right: 12px; width: 28vw; max-width: 160px;
  aspect-ratio: 3 / 4; border-radius: 14px; border: 2px solid rgba(255, 255, 255, .25); z-index: 3;
}
.video-box.local.mirror video { transform: scaleX(-1); }

.status {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 24px 76px; color: #fff; font-size: 17px; white-space: pre-line; background: radial-gradient(circle, #241d45, #0f1115 70%);
}
.status[hidden] { display: none; }
.common {
  position: absolute; left: 12px; top: calc(env(safe-area-inset-top) + 12px); z-index: 2; max-width: 55vw;
  background: rgba(0, 0, 0, .55); padding: 6px 12px; border-radius: 999px; font-size: 13px;
}
.mic-badge {
  position: absolute; left: 6px; bottom: 6px; background: var(--danger); color: #fff;
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
}
.camera-paused {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 8px; text-align: center; font-size: 12px; background: rgba(0, 0, 0, .85);
}
.camera-paused p { margin: 0; }
.camera-paused .btn { padding: 6px 10px; font-size: 12px; }

/* Round icon buttons on the right, like TikTok / Reels */
.rail {
  position: absolute; right: 12px; top: 50%; transform: translateY(-40%); z-index: 4;
  display: flex; flex-direction: column; gap: 14px;
}
.icon-btn {
  width: 50px; height: 50px; border-radius: 50%; border: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: rgba(20, 20, 28, .55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); color: #fff;
}
.icon-btn svg { width: 24px; height: 24px; fill: currentColor; }
.icon-btn:active { transform: scale(.92); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn.danger { color: #ff8da1; }
.icon-btn.off { background: var(--danger); color: #fff; }
#btn-mic .i-off, #btn-mic.off .i-on { display: none; }
#btn-mic.off .i-off { display: block; }

.swipe-hint {
  position: absolute; left: 50%; bottom: 38%; transform: translateX(-50%); z-index: 4;
  display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none;
  background: rgba(0, 0, 0, .55); padding: 10px 16px; border-radius: 14px; font-size: 14px;
  animation: hint-bounce 1.2s ease-in-out infinite;
}
.swipe-hint svg { width: 28px; height: 28px; fill: #fff; }
@keyframes hint-bounce { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }

/* Messages float over the video at the bottom */
.side {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 5;
  padding: 40px 12px calc(env(safe-area-inset-bottom) + 12px);
  background: linear-gradient(transparent, rgba(0, 0, 0, .65) 40%);
  pointer-events: none;
}
.side > * { pointer-events: auto; }
.messages {
  max-height: 30vh; overflow-y: auto; margin-right: 66px; padding-bottom: 8px; font-size: 15px;
  display: flex; flex-direction: column; gap: 6px;
  mask-image: linear-gradient(transparent, #000 24px);
  -webkit-mask-image: linear-gradient(transparent, #000 24px);
}
.msg { margin: 0; align-self: flex-start; max-width: 85%; padding: 6px 12px; border-radius: 16px; word-wrap: break-word;
  background: rgba(30, 30, 40, .75); text-shadow: none; }
.msg b { display: none; }
.msg.me { align-self: flex-end; background: var(--accent); }
.msg.them { background: rgba(255, 255, 255, .92); color: #111; }
.msg.sys { align-self: center; background: none; color: #ddd; font-size: 13px; font-style: italic; text-align: center;
  text-shadow: 0 1px 3px #000; }
.chat-form { display: flex; gap: 8px; }
.chat-form input { border-radius: 999px; background: rgba(30, 30, 40, .8); border-color: rgba(255, 255, 255, .15); padding: 12px 16px; }
.chat-form .btn { border-radius: 999px; }
.next-btn kbd { display: none; }

dialog {
  border: 0; border-radius: var(--radius); background: var(--panel); color: var(--text);
  width: min(400px, calc(100% - 32px)); padding: 20px;
}
dialog::backdrop { background: rgba(0, 0, 0, .6); }
dialog h3 { margin-top: 0; }
.radio { display: flex; gap: 10px; padding: 6px 0; }
.dialog-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }

/* Desktop: video on the left, chat panel on the right */
@media (min-width: 900px) {
  .stage { right: 380px; }
  .video-box.local { width: 22%; max-width: 220px; }
  .side {
    left: auto; width: 380px; top: 0; padding: 16px; display: flex; flex-direction: column; gap: 10px;
    background: var(--panel);
  }
  .messages { flex: 1; max-height: none; margin-right: 0; mask-image: none; -webkit-mask-image: none; }
  .msg.sys { text-shadow: none; color: var(--muted); }
  .next-btn kbd { display: inline; }
}

/* ---------- static pages ---------- */
.page { max-width: 760px; margin: 0 auto; padding: 32px 16px 64px; }
.page h1 { color: var(--accent-2); }
.page .draft { background: #3a2a10; color: #ffcf7a; padding: 10px 14px; border-radius: 10px; font-size: 14px; }
