/* Hoster client shell — the single page every participant keeps open.
 * The shell itself is never reloaded: pages swap inside #stage, overlays sit
 * on top. Palette + type come from /static/theme.css; this file adds only the
 * shell layout and the full-screen states.
 */

html, body { height: 100%; }
body.client-shell {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ---- top bar ------------------------------------------------------------ */
.topbar {
  flex: none;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-height: 42px;
  padding: 0 var(--sp-4);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
}
.topbar .brand {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--text-muted);
}
.topbar .brand-mark {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: var(--r-xs);
  background: var(--accent-primary);
  color: var(--accent-fg);
  font-size: 11px;
  font-weight: 700;
}
.chip {
  margin-left: auto;
  padding: 3px var(--sp-3);
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-pill);
}

/* connection dot: JS rewrites className wholesale, so .dot stays in the base */
.dot { width: 9px; height: 9px; }
.dot-on { background: var(--success); box-shadow: 0 0 8px var(--success); }
.dot-off { background: var(--warning); }
.dot-err { background: var(--danger); }

/* ---- stage: the current page fills everything below the bar ------------- */
#stage {
  flex: 1;
  min-height: 0;
  position: relative;
  background: var(--bg-base);
}
#stage iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
}

/* ---- platform overlay (scoreboard, client info) ------------------------ */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  overflow: auto;
  background: var(--bg-base);
}
.overlay iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.whoami {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .4em;
  padding: 4vh 4vw;
  text-align: center;
  background:
    radial-gradient(1000px 600px at 50% 0%, var(--accent-soft), transparent 70%),
    var(--bg-base);
}
.whoami .w-label {
  color: var(--text-muted);
  font-size: clamp(14px, 2vw, 20px);
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.whoami .w-id {
  font-size: clamp(70px, 18vw, 220px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
  line-height: 1;
  color: var(--accent-primary);
}
.whoami .w-name { font-size: clamp(26px, 5vw, 52px); font-weight: 600; }
.whoami .w-team { font-size: clamp(18px, 3.4vw, 36px); font-weight: 600; color: var(--warning); }

/* ---- blocking screens (banned / joining closed / removed) -------------- */
.screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: var(--sp-5);
  background:
    radial-gradient(900px 480px at 50% -10%, var(--accent-soft), transparent 70%),
    var(--bg-base);
}
.screen-card {
  max-width: 440px;
  padding: var(--sp-6);
  text-align: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
}
.screen-icon { font-size: 40px; margin-bottom: var(--sp-2); }
.screen-card h1 { font-size: 21px; margin-bottom: var(--sp-2); }
.screen-card p { color: var(--text-muted); font-size: 14px; line-height: 1.55; }

/* ---- join gate: shown over everything until the participant taps Join ---- */
.gate {
  position: fixed;
  inset: 0;
  z-index: 9;               /* above .overlay, below .screen (banned etc.) */
  display: grid;
  place-items: center;
  padding: var(--sp-5);
  background:
    radial-gradient(900px 480px at 50% -10%, var(--accent-soft), transparent 70%),
    var(--bg-base);
}
.gate-card {
  width: 100%;
  max-width: 400px;
  padding: var(--sp-6);
  text-align: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
}
.gate-icon { font-size: 40px; margin-bottom: var(--sp-2); }
.gate-card h1 { font-size: 21px; margin-bottom: var(--sp-2); }
.gate-card p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.55;
  margin-bottom: var(--sp-5);
}
.gate-card .btn { height: 44px; font-size: 15px; }

/* ---- language chooser (first thing a new participant sees) ---------------- */
.lang-flags {
  display: grid;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}
.lang-flags button {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  padding: 12px var(--sp-4);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--r-lg);
  cursor: pointer;
  text-align: left;
}
.lang-flags button:hover { border-color: var(--accent-primary); }
.lang-flags .flag { font-size: 20px; line-height: 1; }
.lang-flags .lang-name { flex: 1; }
.lang-flags .lang-code { font-size: 12px; font-weight: 500; color: var(--text-muted); }

.hidden { display: none !important; }
