:root {
  --bg: #0b1220;
  --card: #121a2b;
  --card-2: #182338;
  --line: rgba(50, 224, 196, 0.18);
  --text: #e8eef2;
  --muted: #93a0b0;
  --teal: #0d7377;
  --teal-2: #14a085;
  --mint: #32e0c4;
  --danger: #d4534b;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  color-scheme: dark;
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body, #app { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--mint); }

.home {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}
.topbar, .room-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 28px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
}
.mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--teal);
  display: grid;
  place-items: center;
  flex: none;
}
.mark svg { width: 24px; height: 24px; display: block; }
.brand-name { font-size: 22px; font-weight: 750; letter-spacing: -0.03em; }
.brand-name span { color: var(--mint); }
.who { color: var(--muted); font-size: 14px; display: flex; gap: 14px; align-items: center; }

.hero {
  width: min(1080px, calc(100% - 32px));
  margin: 12px auto 40px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 22px;
}
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 28px;
}
.panel h1 {
  margin: 0 0 8px;
  font-size: 40px;
  letter-spacing: -0.04em;
  line-height: 1.05;
}
.lede { color: var(--muted); margin: 0 0 22px; font-size: 16px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.stack { display: grid; gap: 10px; }
label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
input, textarea {
  background: var(--bg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px 14px;
  outline: none;
}
input:focus, textarea:focus { border-color: var(--teal-2); }
textarea { min-height: 90px; resize: vertical; }

.btn {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  background: var(--teal);
  color: white;
  font-weight: 650;
}
.btn:hover { background: var(--teal-2); }
.btn.secondary {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.16);
}
.btn.secondary:hover { border-color: var(--mint); color: var(--mint); background: transparent; }
.btn.danger { background: var(--danger); }
.btn.ghost { background: transparent; color: var(--muted); padding-inline: 8px; }
.btn:disabled { opacity: 0.55; cursor: default; }

.number {
  font-size: 32px;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  margin: 4px 0 12px;
}
.section-title { margin: 22px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.list { display: grid; gap: 8px; }
.list-item, .person {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  background: var(--card-2);
  border-radius: 12px;
  padding: 10px 12px;
}
.muted { color: var(--muted); }
.note { color: var(--mint); min-height: 1.2em; font-size: 14px; }
.error { color: #ffb4ae; }

.call {
  height: 100dvh;
  display: grid;
  grid-template-columns: 1fr 320px;
  grid-template-rows: auto 1fr auto;
  background: #070c16;
}
.call.chat-closed { grid-template-columns: 1fr; }
.room-top { grid-column: 1; background: var(--bg); border-bottom: 1px solid rgba(255,255,255,0.05); }
.stage {
  grid-column: 1;
  min-height: 0;
  padding: 16px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  align-content: center;
}
.tile {
  position: relative;
  background: #141c2d;
  border-radius: 16px;
  overflow: hidden;
  min-height: 220px;
  aspect-ratio: 16 / 10;
}
.tile video, .tile .placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #141c2d;
  display: grid;
  place-items: center;
  color: var(--muted);
}
.nametag, .badge {
  position: absolute;
  left: 10px;
  bottom: 10px;
  background: rgba(7, 12, 22, 0.72);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 13px;
}
.badge { left: auto; right: 10px; bottom: auto; top: 10px; }
.tile-menu {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 6px;
}
.tile .placeholder { position: absolute; inset: 0; }
.tile-menu button {
  width: auto;
  border: 0;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(7, 12, 22, 0.78);
  color: white;
  font-size: 12px;
}
.controls button.icon, .icon-btn {
  min-width: 76px;
  height: 46px;
  padding: 0 14px;
  border-radius: 999px;
  border: 0;
  background: rgba(255, 255, 255, 0.08);
  color: white;
}
.controls {
  grid-column: 1;
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 8px 16px 18px;
}
.controls button.icon.off, .icon-btn.off { background: var(--danger); }
.controls button.icon.on { background: var(--teal); }
.controls button.leave { background: var(--danger); width: auto; padding: 0 16px; border-radius: 999px; }

.side {
  grid-column: 2;
  grid-row: 1 / span 3;
  background: var(--card);
  border-left: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.call.chat-closed .side { display: none; }
.tabs { display: flex; border-bottom: 1px solid rgba(255,255,255,0.06); }
.tabs button {
  flex: 1;
  background: transparent;
  border: 0;
  padding: 14px;
  color: var(--muted);
}
.tabs button.active { color: white; box-shadow: inset 0 -2px 0 var(--mint); }
.chat-log, .people {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.is-hidden { display: none !important; }
.bubble { background: var(--card-2); border-radius: 12px; padding: 8px 10px; }
.bubble .meta { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.bubble.system { background: transparent; color: var(--muted); text-align: center; }
.composer { display: flex; gap: 8px; padding: 12px; border-top: 1px solid rgba(255,255,255,0.06); }
.composer input { flex: 1; }

.lobby, .gate {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
}
.preview {
  width: min(720px, 100%);
  display: grid;
  gap: 16px;
}
.preview video, .preview .placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 18px;
  background: #141c2d;
  object-fit: cover;
}
.modal-back {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: grid;
  place-items: center;
  padding: 18px;
  z-index: 20;
}
.modal { width: min(440px, 100%); }

.home {
  min-height: 100%;
  background: #fff;
  color: #212529;
  color-scheme: light;
  display: flex;
  flex-direction: column;
}
.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 28px;
  background: #fff;
  border-bottom: 1px solid #f3f4f6;
}
.logo {
  background: none;
  border: 0;
  padding: 0;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #0d7377;
}
.logo span { color: #14a085; }
.account { display: flex; align-items: center; gap: 12px; color: #6c757d; font-size: 14px; }
.home-hero {
  position: relative;
  text-align: center;
  padding: 64px 20px 12px;
}
.home-hero::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 20px;
  width: min(720px, 100%);
  height: 280px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(50, 224, 196, 0.22), transparent 68%);
  pointer-events: none;
}
.word {
  position: relative;
  margin: 0;
  font-size: clamp(3.4rem, 8vw, 5.6rem);
  line-height: 0.95;
  font-weight: 800;
  letter-spacing: -0.045em;
  color: #0d7377;
}
.hop {
  display: inline-block;
  filter: drop-shadow(0 0 8px rgba(13, 115, 119, 0.35));
  animation: drifturr-hop 1.15s cubic-bezier(0.6, 0.01, 0.05, 0.95) 0.35s 1 both;
}
@keyframes drifturr-hop {
  0% { transform: translateY(0); }
  40% { transform: translateY(-16px); }
  100% { transform: translateY(0); }
}
.tagline {
  position: relative;
  margin: 14px auto 0;
  max-width: 34rem;
  color: #6c757d;
  font-size: 20px;
}
.tagline.small { font-size: 15px; margin-top: 16px; }
.hero-actions { position: relative; margin-top: 28px; }
.d-btn {
  border: 0;
  border-radius: 999px;
  height: 44px;
  padding: 0 18px;
  background: #0d7377;
  color: #fff;
  font-weight: 650;
}
.d-btn:hover { background: #14a085; }
.d-btn:disabled { opacity: 0.55; cursor: default; }
.d-btn-lg { height: 52px; padding: 0 26px; font-size: 16px; }
.d-btn-line {
  background: #fff;
  color: #0d7377;
  border: 1px solid #e5e7eb;
}
.d-btn-line:hover { background: #f4fbfa; color: #0d7377; }
.join-bar {
  width: min(640px, 100%);
  margin: 16px auto 0;
  display: flex;
  gap: 10px;
  align-items: center;
}
.join-bar .d-btn { flex: none; }
.number-card .join-bar { width: 100%; }
.home .d-field {
  flex: 1;
  width: 100%;
  height: 56px;
  border-radius: 999px;
  border: 2px solid #e5e7eb;
  background: #fff;
  color: #212529;
  padding: 0 22px;
  font-size: 17px;
  box-shadow: 0 10px 28px rgba(33, 37, 41, 0.06);
}
.home .d-field:focus {
  outline: none;
  border-color: #0d7377;
  box-shadow: 0 12px 30px rgba(13, 115, 119, 0.14);
}
.home .d-field-box {
  height: auto;
  border-radius: 16px;
  padding: 12px 14px;
  margin-top: 10px;
  box-shadow: none;
}
.home textarea.d-field { min-height: 96px; resize: vertical; }
.status { min-height: 1.2em; margin: 12px 0 0; color: #0d7377; font-size: 14px; }
.status.bad { color: #b42318; }
.number-card {
  width: min(640px, 100%);
  margin: 28px auto 0;
  text-align: left;
  background: #fff;
  border: 1px solid #f3f4f6;
  border-radius: 24px;
  box-shadow: 0 16px 40px rgba(33, 37, 41, 0.06);
  padding: 22px;
}
.number-top { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.eyebrow { color: #6c757d; font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; }
.talk-number {
  margin-top: 2px;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #0d7377;
  font-variant-numeric: tabular-nums;
}
.features {
  display: flex;
  justify-content: center;
  gap: 22px;
  flex-wrap: wrap;
  margin-top: 42px;
}
.feature {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  text-align: left;
  max-width: 210px;
  color: #6c757d;
  font-size: 14px;
}
.feature strong { display: block; color: #212529; font-size: 15px; margin-bottom: 2px; }
.ficon { color: #0d7377; margin-top: 2px; }
.tools {
  width: min(960px, calc(100% - 32px));
  margin: 36px auto 56px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.sheet {
  background: #fff;
  border: 1px solid #f3f4f6;
  border-radius: 20px;
  padding: 22px;
  text-align: left;
  box-shadow: 0 8px 24px rgba(33, 37, 41, 0.04);
}
.sheet h2 { margin: 0 0 6px; font-size: 20px; color: #212529; }
.quiet { color: #6c757d; margin: 0 0 12px; font-size: 14px; }
.home .list-item {
  background: #f8fafa;
  color: #212529;
  border: 1px solid #f3f4f6;
}
.home .list-item strong { color: #0d7377; }
.site-footer {
  margin-top: auto;
  border-top: 1px solid #f3f4f6;
  background: #f9fafb;
  color: #6c757d;
  text-align: center;
  padding: 28px 16px 36px;
  font-size: 14px;
}
.site-footer a { color: #0d7377; text-decoration: none; }
.site-footer a:hover { color: #14a085; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .panel h1 { font-size: 32px; }
  .tools { grid-template-columns: 1fr; }
  .join-bar { flex-direction: column; align-items: stretch; }
  .site-header { padding: 14px 16px; }
  .account span { display: none; }
  .home-hero { padding-top: 42px; }
  .features { flex-direction: column; align-items: center; }
  .call { grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; }
  .side {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    bottom: 88px;
    z-index: 15;
    grid-column: auto;
    grid-row: auto;
  }
  .controls { position: relative; z-index: 16; background: #070c16; }
  .topbar, .room-top { padding: 14px; }
  .who { display: none; }
}
