/* ── Reset & base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: #0a0b0f;
  color: #e2e5ef;
  overflow: auto;
  -webkit-font-smoothing: antialiased;
}
button { cursor: pointer; font: inherit; }
select, input { font: inherit; }
.hidden { display: none !important; }

/* ── Screens ────────────────────────────────────────────────── */
.screen {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
}
.screen--active { display: flex; }

/* ── Glass surface ──────────────────────────────────────────── */
.glass {
  background: rgba(18, 20, 30, 0.72);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; border: none; border-radius: 12px;
  font-size: 15px; font-weight: 500; padding: 12px 22px;
  line-height: 1; transition: all 0.15s ease; white-space: nowrap;
}
.btn--primary   { background: #ff6b2b; color: #fff; }
.btn--primary:hover { background: #ff8347; }
.btn--outline   { background: transparent; border: 1.5px solid rgba(255,255,255,0.14); color: #e2e5ef; }
.btn--outline:hover { background: rgba(255,255,255,0.07); border-color: rgba(255,255,255,0.22); }
.btn--ghost     { background: transparent; color: #8892a4; border: none; }
.btn--ghost:hover { color: #e2e5ef; background: rgba(255,255,255,0.06); }
.btn--lg        { font-size: 16px; padding: 15px 30px; border-radius: 14px; }
.btn--full      { width: 100%; }
.btn--sm        { font-size: 13px; padding: 8px 16px; }
.btn--back {
  position: absolute; top: 20px; left: 20px;
  width: 40px; height: 40px; padding: 0; border-radius: 50%;
  background: rgba(255,255,255,0.08); color: #e2e5ef; z-index: 10;
}
.btn--back:hover { background: rgba(255,255,255,0.16); }

/* ── Lobby ──────────────────────────────────────────────────── */
.lobby {
  display: flex; flex-direction: column; align-items: center;
  gap: 44px; text-align: center; padding: 24px; width: 100%;
}
.lobby__logo { width: 120px; height: auto; border-radius: 8px; }
.lobby__brand h1 {
  font-size: 38px; font-weight: 700; letter-spacing: -0.5px;
  margin-top: 16px;
}
.lobby__brand p { margin-top: 10px; color: #8892a4; font-size: 15px; line-height: 1.5; }
.lobby__actions {
  display: flex; flex-direction: column; gap: 12px;
  width: 100%; max-width: 320px;
}
.lobby__mode {
  width: 100%; max-width: 320px;
  text-align: left;
}
.mode-toggle {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}
.mode-btn {
  flex: 1;
  padding: 12px 0;
  border-radius: 999px;
  border: 1.5px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.04);
  color: #e2e5ef;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.mode-btn--active {
  background: #ff6b2b;
  color: #fff;
  border-color: transparent;
}
.mode-hint {
  margin-top: 10px;
  color: #a0a8c0;
  font-size: 13px;
  line-height: 1.6;
}
.lobby__learn {
  margin-top: 14px;
}
.link-learn-more {
  color: #c3d0ff;
  text-decoration: none;
  font-size: 14px;
  letter-spacing: 0.02em;
  transition: color 0.15s ease;
}
.link-learn-more:hover {
  color: #ffb56a;
}
.lobby__info {
  margin-top: 26px;
  max-width: 520px;
  color: #a0a8c0;
  font-size: 14px;
  line-height: 1.7;
  opacity: 0.92;
}
.learn-page {
  position: relative;
  inset: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px;
  min-height: 100vh;
  background: radial-gradient(circle at top, rgba(255,107,43,0.12), transparent 32%),
              radial-gradient(circle at bottom, rgba(88,147,255,0.1), transparent 28%),
              #07080d;
}
.learn-card {
  width: min(780px, 100%);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  text-align: left;
  overflow: visible;
}
.learn-logo {
  width: 104px;
  height: auto;
  border-radius: 14px;
}
.learn-card h1 {
  font-size: 36px;
  font-weight: 700;
}
.learn-card p {
  color: #d8dbe8;
  font-size: 16px;
  line-height: 1.8;
}
.learn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}
.learn-grid h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #ffd3a8;
  text-shadow: 0 0 20px rgba(255, 123, 62, 0.3);
  border-left: 3px solid rgba(255, 120, 55, 0.9);
  padding-left: 10px;
  margin-bottom: 10px;
}
.learn-section {
  padding: 24px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 22px;
  box-shadow: 0 30px 70px rgba(2,4,12,0.22);
  display: grid;
  gap: 16px;
}
.learn-section-header h2 {
  font-size: 22px;
  margin-bottom: 4px;
}
.learn-section-header p {
  color: #d7d9e7;
  font-size: 15px;
  line-height: 1.75;
}
.plan-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}
.plan-list li {
  position: relative;
  padding: 16px 18px 16px 32px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  color: #f0f2ff;
  font-size: 15px;
  line-height: 1.7;
}
.plan-list li::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ff8f53, #7bb9ff);
}
.learn-actions {
  display: flex;
  justify-content: flex-start;
  gap: 10px;
}

/* ── Background video ───────────────────────────────────────── */
.bg-video {
  position: fixed; inset: 0; width: 100%; height: 100%;
  object-fit: cover; filter: brightness(0.35) saturate(0.8);
  pointer-events: none;
}
.no-cam-overlay {
  position: fixed; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px;
  background: #0a0b0f; color: #8892a4; font-size: 14px;
}

/* ── Setup screen ───────────────────────────────────────────── */
#screen-setup { align-items: flex-end; padding-bottom: 48px; }
.setup-overlay {
  position: relative; z-index: 1; width: 100%; max-width: 480px; padding: 0 20px;
}
.setup-panel {
  padding: 24px; display: flex; flex-direction: column; gap: 18px;
}
.setup-panel h3 { font-size: 17px; font-weight: 600; }
.form-row { display: flex; flex-direction: column; gap: 7px; }
.form-row label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.6px; color: #8892a4;
}
.select {
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px; color: #e2e5ef; padding: 11px 14px; font-size: 14px;
  -webkit-appearance: none; appearance: none;
}
.select:focus { outline: 2px solid #ff6b2b; outline-offset: 2px; }
.select option { background: #1c1e2a; }

/* ── Waiting screen ─────────────────────────────────────────── */
.waiting-overlay {
  position: relative; z-index: 1; display: flex;
  flex-direction: column; align-items: center; padding: 20px;
}
.code-card {
  padding: 36px 40px; display: flex; flex-direction: column;
  align-items: center; gap: 16px; text-align: center; min-width: 320px;
}
.code-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 1px; color: #8892a4;
}
.code-display {
  font-size: 48px; font-weight: 700; letter-spacing: 8px;
  color: #fff; font-variant-numeric: tabular-nums; line-height: 1;
}
.code-hint { font-size: 13px; color: #8892a4; }
.code-btns { display: flex; gap: 10px; }

/* ── Join screen ────────────────────────────────────────────── */
.join-bg {
  position: fixed; inset: 0;
  background: radial-gradient(ellipse at 50% -10%, rgba(255,107,43,0.14) 0%, transparent 65%);
}
.join-container {
  position: relative; z-index: 1; width: 100%; max-width: 390px; padding: 20px;
}
.join-card {
  padding: 36px 32px; display: flex; flex-direction: column;
  align-items: center; gap: 16px; text-align: center;
}
.join-logo { width: 80px; height: auto; border-radius: 8px; }
.join-card h2 { font-size: 24px; font-weight: 700; margin-top: 4px; }
.join-hint { font-size: 14px; color: #8892a4; margin-top: -6px; }
.code-input {
  width: 100%; background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1); border-radius: 14px;
  color: #fff; font-size: 30px; font-weight: 700;
  letter-spacing: 7px; text-align: center; padding: 18px 12px;
  text-transform: uppercase; transition: border-color 0.15s;
}
.code-input:focus { outline: none; border-color: #ff6b2b; }
.code-input::placeholder { color: rgba(255,255,255,0.18); font-size: 22px; letter-spacing: 4px; }
.error-text { font-size: 13px; color: #fc4949; }

/* ── Call screen ────────────────────────────────────────────── */
.call-layout { position: fixed; inset: 0; background: #000; }
.remote-video { width: 100%; height: 100%; object-fit: cover; display: block; }
.remote-placeholder {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px;
  color: #8892a4; background: #0d0f18;
}
.remote-placeholder p { font-size: 14px; }
.remote-photo {
  width: 240px;
  height: 240px;
  object-fit: cover;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 16px 42px rgba(0,0,0,0.35);
}
.local-video {
  position: absolute; bottom: 100px; right: 20px;
  width: 160px; height: 100px; object-fit: cover;
  border-radius: 12px; border: 2px solid rgba(255,255,255,0.15);
  background: #1a1b23; box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
.local-photo {
  position: absolute; bottom: 100px; right: 20px;
  width: 160px; height: 100px; object-fit: cover;
  border-radius: 12px; border: 2px solid rgba(255,255,255,0.15);
  background: rgba(0,0,0,0.3);
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  z-index: 1;
}
.call-toolbar {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 12px; padding: 10px 20px;
  background: rgba(12,14,22,0.88);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,0.08); border-radius: 50px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.tool-btn {
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: none; background: rgba(255,255,255,0.1); color: #fff;
  transition: background 0.15s, transform 0.1s;
}
.tool-btn:hover { background: rgba(255,255,255,0.2); }
.tool-btn:active { transform: scale(0.93); }
.tool-btn--off { background: rgba(255,255,255,0.06); color: #fc4949; }
.tool-btn--danger { background: #e53e3e; color: #fff; }
.tool-btn--danger:hover { background: #f05252; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 480px) {
  .lobby__brand h1 { font-size: 30px; }
  .code-display { font-size: 36px; letter-spacing: 6px; }
  .local-video { width: 120px; height: 75px; bottom: 94px; right: 12px; }
  .setup-panel, .code-card, .join-card { padding: 20px; }
}
@media (min-width: 768px) {
  #screen-setup { justify-content: center; align-items: flex-end; }
}
