﻿[hidden] {
  display: none !important;
}

:root {
  --bg: #070b12;
  --panel: rgba(17, 24, 39, 0.72);
  --line: rgba(148, 163, 184, 0.16);
  --text: #e5edf7;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent-2: #818cf8;
  --danger: #f87171;
  --radius: 22px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

.bg-glow {
  position: fixed;
  z-index: -1;
  width: 55vw;
  height: 55vw;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.35;
  pointer-events: none;
}

.bg-glow--one {
  top: -20vw;
  left: -10vw;
  background: radial-gradient(circle, #0ea5e9, transparent 65%);
}

.bg-glow--two {
  right: -18vw;
  bottom: -25vw;
  background: radial-gradient(circle, #6366f1, transparent 65%);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.brand__mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.3), rgba(129, 140, 248, 0.3));
  color: #f0f9ff;
  font-size: 22px;
  font-weight: 800;
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.25);
}

.brand__mark--sm {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  font-size: 18px;
}

.brand__name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.brand__name em {
  color: var(--accent);
  font-style: normal;
}

.landing {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  gap: 8vw;
  align-items: center;
  width: min(1180px, calc(100vw - 48px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 56px 0;
}

.hero__badge {
  display: inline-flex;
  margin-top: 46px;
  padding: 7px 12px;
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.08);
  color: #bae6fd;
  font-size: 12px;
  letter-spacing: 0.5px;
}

.hero h1 {
  margin: 24px 0 18px;
  font-size: clamp(42px, 5.4vw, 76px);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -2px;
}

.hero h1 span {
  background: linear-gradient(100deg, #7dd3fc, #a5b4fc 60%, #f0abfc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__desc {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.hero__points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.hero__points li {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.45);
  color: #cbd5e1;
  font-size: 13px;
}

.join-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow:
    0 30px 80px rgba(2, 6, 23, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(18px);
}

.join-card form {
  display: flex;
  flex-direction: column;
  padding: 30px;
}

.join-card label {
  margin: 14px 0 8px;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.6px;
}

.join-card input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 12px;
  outline: none;
  background: rgba(2, 6, 23, 0.55);
  color: var(--text);
  font-size: 15px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.join-card input:focus {
  border-color: rgba(56, 189, 248, 0.7);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.12);
}

.btn {
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  margin-top: 24px;
  padding: 14px 18px;
  background: linear-gradient(100deg, #0ea5e9, #6366f1);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.4px;
  box-shadow: 0 12px 30px rgba(14, 165, 233, 0.25);
}

.btn--primary:hover {
  filter: brightness(1.06);
}

.btn--primary:disabled {
  opacity: 0.55;
  cursor: wait;
}

.join-card__hint {
  margin: 12px 0 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.6;
}

.join-card__foot {
  padding: 13px 30px;
  border-top: 1px solid var(--line);
  background: rgba(2, 6, 23, 0.25);
  color: #64748b;
  font-size: 11px;
}

.error {
  margin: 12px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(248, 113, 113, 0.35);
  border-radius: 10px;
  background: rgba(127, 29, 29, 0.25);
  color: #fecaca;
  font-size: 12px;
  line-height: 1.6;
}

/* ---------- room ---------- */
.room {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 16px 20px 18px;
}

.room__bar {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 4px 4px 14px;
}

.room__brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.room__brand strong {
  display: block;
  font-size: 15px;
}

.room__count {
  color: var(--muted);
  font-size: 12px;
}

.room__actions {
  display: flex;
  gap: 8px;
}

.btn--ghost,
.btn--danger-ghost {
  padding: 9px 13px;
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.55);
  color: #cbd5e1;
  font-size: 12px;
}

.btn--ghost:hover {
  border-color: rgba(56, 189, 248, 0.5);
  color: #e0f2fe;
}

.btn--danger-ghost {
  color: #fca5a5;
}

.btn--danger-ghost:hover {
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(127, 29, 29, 0.25);
}

.video-grid {
  display: grid;
  flex: 1;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 12px;
  align-content: center;
  padding: 4px;
}

.video-grid[data-count="1"] {
  grid-template-columns: minmax(0, 860px);
  justify-content: center;
}

.video-grid[data-count="2"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.video-tile {
  position: relative;
  overflow: hidden;
  min-height: 220px;
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 16px;
  background: #0b1220;
  box-shadow: 0 18px 50px rgba(2, 6, 23, 0.35);
}

.video-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #050a12;
}

.video-tile--local video {
  transform: scaleX(-1);
}

.video-tile--self-view {
  object-fit: cover;
}

.video-tile__name {
  position: absolute;
  bottom: 10px;
  left: 10px;
  max-width: calc(100% - 20px);
  overflow: hidden;
  padding: 5px 9px;
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.72);
  color: #e2e8f0;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-tile__status {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 8px;
  border-radius: 7px;
  background: rgba(127, 29, 29, 0.65);
  color: #fecaca;
  font-size: 11px;
}

.video-tile__avatar {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  background: radial-gradient(circle at 50% 40%, #1e293b, #0b1220 70%);
  color: #93c5fd;
  font-size: 44px;
  font-weight: 700;
}

.video-tile--no-video .video-tile__avatar {
  display: grid;
}

.video-tile--no-video video {
  opacity: 0;
}

.video-tile__play {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  border: 0;
  background: rgba(2, 6, 23, 0.55);
  color: #e0f2fe;
  font-size: 13px;
  cursor: pointer;
}

.controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  padding-top: 16px;
}

.control {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 120px;
  justify-content: center;
  padding: 11px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #e2e8f0;
  font-size: 13px;
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.control:hover {
  border-color: rgba(56, 189, 248, 0.45);
}

.control[aria-pressed="true"] {
  border-color: rgba(248, 113, 113, 0.4);
  background: rgba(127, 29, 29, 0.35);
  color: #fecaca;
}

.control--leave {
  border-color: rgba(248, 113, 113, 0.4);
  color: #fca5a5;
}

.control__icon {
  font-size: 16px;
  line-height: 1;
}

.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  z-index: 20;
  max-width: calc(100vw - 32px);
  padding: 10px 16px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.92);
  color: #e0f2fe;
  font-size: 12px;
  transform: translateX(-50%);
  box-shadow: 0 12px 40px rgba(2, 6, 23, 0.5);
}

@media (max-width: 860px) {
  .landing {
    grid-template-columns: 1fr;
    gap: 34px;
    width: min(100vw - 32px, 620px);
    padding: 28px 0 40px;
  }

  .hero__badge {
    margin-top: 26px;
  }

  .hero h1 {
    font-size: clamp(38px, 11vw, 56px);
  }

  .room {
    padding: 10px 10px 14px;
  }

  .room__actions .btn--ghost {
    display: none;
  }

  .video-grid {
    grid-template-columns: 1fr;
    align-content: start;
    overflow-y: auto;
  }

  .video-tile {
    min-height: 180px;
  }

  .control {
    min-width: 0;
    flex: 1;
    padding: 10px 8px;
  }

  .control__label {
    font-size: 12px;
  }
}
