@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@500;600;700;800&display=swap");

:root {
  --blue: #1655ff;
  --blue-dark: #0e46dc;
  --ink: #08090b;
  --muted: #667085;
  --line: #e8ecf4;
  --soft: #f4f7ff;
  --white: #fff;
  --shadow: 0 24px 70px rgba(13, 28, 61, 0.12);
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  min-height: 100vh;
  background: #fff;
  color: var(--ink);
  font-family: Montserrat, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input { font: inherit; }
button { cursor: pointer; }

.shell { min-height: 100vh; padding: 28px; background: radial-gradient(circle at 50% 0%, #edf3ff 0, #fff 42%); }
.wrap { width: min(1180px, 100%); margin: 0 auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 38px; }
.brand-logo-link { display: inline-flex; align-items: center; width: fit-content; padding: 8px 12px; border-radius: 12px; background: #08090b; text-decoration: none; }
.brand-logo-center { margin: 0 auto; }
.brand-logo { display: block; width: clamp(150px, 20vw, 205px); height: auto; }
.brand-logo-room { padding: 6px 10px; }
.secure { color: var(--muted); font-size: 12px; font-weight: 700; }
.eyebrow { display: inline-flex; align-items: center; gap: 7px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.8); font-size: 12px; font-weight: 800; }
.eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 5px rgba(22,85,255,.12); }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(34px, 6vw, 68px); line-height: 1.03; letter-spacing: -0.055em; margin: 20px 0 18px; }
h2 { font-size: clamp(26px, 3vw, 40px); line-height: 1.08; letter-spacing: -0.04em; }
.blue { color: var(--blue); }
.lead { color: #434956; line-height: 1.75; font-size: 16px; }
.card { background: rgba(255,255,255,.94); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); }
.btn {
  position: relative; width: 100%; min-height: 55px; border: 0; border-radius: 10px; padding: 0 20px;
  color: #fff; background: linear-gradient(180deg, #2269ff 0%, #0e55ed 100%);
  box-shadow: 0 14px 36px rgba(22,85,255,.32), 0 4px 14px rgba(0,0,0,.12), inset 0 1px rgba(255,255,255,.18);
  font-size: 12px; font-weight: 800; letter-spacing: .025em;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 18px 42px rgba(22,85,255,.38), 0 4px 14px rgba(0,0,0,.12); }
.btn:focus-visible, input:focus-visible { outline: 3px solid rgba(22,85,255,.24); outline-offset: 2px; }
.btn:disabled { opacity: .65; cursor: wait; }
.status { min-height: 22px; color: #c52b2b; font-size: 13px; line-height: 1.5; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

.waiting-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr); gap: 34px; align-items: center; min-height: calc(100vh - 130px); }
.waiting-copy { padding: 22px 0 60px; }
.countdown-card { padding: 30px; text-align: center; overflow: hidden; position: relative; }
.countdown-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 5px; background: linear-gradient(90deg, var(--blue), #69a1ff); }
.countdown-label { color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.countdown { margin: 16px 0; font-size: clamp(48px, 8vw, 78px); line-height: 1; font-weight: 800; letter-spacing: -.06em; font-variant-numeric: tabular-nums; }
.session-time { font-weight: 700; }
.waiting-note { margin-top: 28px; padding: 20px; border-radius: 16px; background: var(--soft); color: #3d4658; font-size: 14px; line-height: 1.6; }

.room-shell { min-height: 100vh; background: #08090b; color: #fff; padding: 18px; }
.room-wrap { width: min(1380px, 100%); margin: 0 auto; }
.room-top { display: flex; align-items: center; justify-content: space-between; min-height: 52px; }
.live-pill { display: inline-flex; gap: 7px; align-items: center; color: #cdd5e4; font-size: 12px; font-weight: 700; }
.live-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #ff385c; box-shadow: 0 0 0 5px rgba(255,56,92,.12); }
.room-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.stage { min-width: 0; }
.video-wrap { position: relative; overflow: hidden; background: #000; border: 1px solid #20242d; border-radius: 16px; aspect-ratio: 16 / 9; }
video { width: 100%; height: 100%; display: block; object-fit: contain; }
.sound-gate { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.3); backdrop-filter: blur(4px); }
.sound-gate button { width: auto; padding: 0 28px; }
.video-error { position: absolute; inset: 0; display: grid; place-items: center; padding: 30px; text-align: center; background: #11141a; }
.room-title { margin: 18px 4px 0; font-size: clamp(20px, 2.5vw, 32px); letter-spacing: -.04em; }
.hostline { margin: 8px 4px 20px; color: #aeb8ca; font-size: 13px; }
.chat-card { height: min(76vh, 760px); display: flex; flex-direction: column; background: #fff; color: var(--ink); border-radius: 16px; overflow: hidden; }
.chat-head { padding: 18px 20px; border-bottom: 1px solid var(--line); }
.chat-head strong { display: block; }
.chat-head small { display: block; color: var(--muted); line-height: 1.45; margin-top: 5px; }
.chat-list { flex: 1; overflow: auto; padding: 16px; scroll-behavior: smooth; }
.message { display: grid; grid-template-columns: 34px 1fr; gap: 10px; margin-bottom: 16px; animation: enter .25s ease-out; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: #8592aa; font-size: 12px; font-weight: 800; }
.message.host .avatar { background: var(--blue); }
.message.system { display: block; padding: 12px 13px; border-radius: 10px; background: var(--soft); color: #46516a; font-size: 12px; line-height: 1.55; }
.message-meta { display: flex; gap: 8px; align-items: baseline; margin-bottom: 4px; }
.message-name { font-size: 12px; font-weight: 800; }
.message-time { color: #98a2b3; font-size: 10px; }
.message-text { color: #344054; font-size: 13px; line-height: 1.5; }
.cta-card { margin-top: 16px; padding: 22px; border: 1px solid rgba(75,124,255,.35); border-radius: 16px; background: linear-gradient(145deg, #111725, #0b0e14); }
.cta-card h3 { font-size: 22px; margin-bottom: 8px; }
.cta-card p { color: #aeb8ca; font-size: 13px; line-height: 1.55; }
.cta-card .btn { margin-top: 8px; }

.admin-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 30px; }
.metric { padding: 20px; }
.metric span { color: var(--muted); font-size: 12px; font-weight: 700; }
.metric strong { display: block; margin-top: 8px; font-size: 30px; }
.admin-table { width: 100%; border-collapse: collapse; margin-top: 24px; font-size: 13px; }
.admin-table th, .admin-table td { text-align: left; padding: 12px; border-bottom: 1px solid var(--line); }
.token-form { display: flex; gap: 10px; max-width: 620px; }
input { width: 100%; min-height: 52px; padding: 0 15px; border: 1px solid #d6dce8; border-radius: 10px; background: #fff; }

@keyframes enter { from { opacity: 0; transform: translateY(5px); } }
@media (max-width: 900px) {
  .waiting-grid, .room-grid { grid-template-columns: 1fr; }
  .waiting-grid { min-height: auto; }
  .waiting-copy { padding-bottom: 0; }
  .chat-card { height: 440px; }
  .admin-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .shell { padding: 18px; }
  .topbar { margin-bottom: 22px; }
  .brand-logo { width: 150px; }
  .secure { display: none; }
  .card { border-radius: 18px; }
  .countdown-card { padding: 24px 18px; }
  .room-shell { padding: 10px; }
  .room-grid { gap: 10px; }
  .video-wrap, .chat-card, .cta-card { border-radius: 12px; }
  .admin-grid { grid-template-columns: 1fr; }
  .token-form { flex-direction: column; }
}

