:root {
  --bg: #0e0f13;
  --panel: #171923;
  --panel-2: #1f2231;
  --line: #2b2f42;
  --text: #e8eaf2;
  --muted: #969ab4;
  --accent: #ff5c8a;
  --accent-2: #7c5cff;
  --good: #35d39a;
  --male: #6ea8fe;
  --female: #ff7fa8;
  --warn: #ffb020;
  --bad: #ff5470;
  --radius: 12px;
  --shadow: 0 8px 30px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }
h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.25; }
h1 { font-size: 1.6rem; letter-spacing: -.02em; }
h2 { font-size: 1.15rem; }
h3 { font-size: .95rem; }

/* ---------- brand ---------- */

/* The app name, used on every screen. The leading words take the accent
   colour so the lockup reads as one mark rather than four loose words. */
.brand {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .14em;
  line-height: 1.2;
}
.brand .lead { color: var(--accent); }
/* Keep each phrase whole: the name may wrap between its two halves on a
   narrow screen, but never in the middle of either. */
.brand .lead, .brand .tail { display: inline-block; }
.brand-sm { font-size: .72rem; letter-spacing: .16em; }
.brand-lg { font-size: clamp(1.6rem, 4.5vw, 2.6rem); letter-spacing: .1em; }

.muted { color: var(--muted); }
.small { font-size: .82rem; }
.mono { font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace; }
.row { display: flex; gap: .5rem; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: .75rem; }
.hidden { display: none !important; }
.center { text-align: center; }

/* ---------- controls ---------- */

button {
  font: inherit;
  font-weight: 600;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: .5rem .85rem;
  cursor: pointer;
  transition: background .12s, border-color .12s, opacity .12s;
  white-space: nowrap;
}
button:hover:not(:disabled) { background: #2a2e42; }
button:disabled { opacity: .4; cursor: not-allowed; }
button.primary { background: var(--accent); border-color: var(--accent); color: #1a0a11; }
button.primary:hover:not(:disabled) { background: #ff7ba1; }
button.ghost { background: transparent; }
button.danger { border-color: #5c2733; color: #ff8ea3; }
button.danger:hover:not(:disabled) { background: #331821; }
button.good { border-color: #1e5c46; color: var(--good); }
button.sm { padding: .3rem .55rem; font-size: .8rem; border-radius: 7px; }
button.on { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }

input, select, textarea {
  font: inherit;
  color: var(--text);
  background: #0f1119;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: .5rem .65rem;
  width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-2); outline-offset: -1px; }
textarea { resize: vertical; min-height: 66px; }
label { display: block; font-size: .8rem; color: var(--muted); margin-bottom: .25rem; font-weight: 600; }
.field { margin-bottom: .8rem; }
.check { display: flex; align-items: center; gap: .5rem; font-size: .85rem; color: var(--text); }
.check input { width: auto; }

/* ---------- surfaces ---------- */

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
}

.pill {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .15rem .5rem; border-radius: 999px;
  font-size: .72rem; font-weight: 700; letter-spacing: .02em;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--muted);
}
.pill.good { color: var(--good); border-color: #1e5c46; }
.pill.warn { color: var(--warn); border-color: #5c4a1e; }
.pill.bad  { color: var(--bad);  border-color: #5c2733; }
.pill.accent { color: var(--accent); border-color: #5c2739; }

/* Sex marker. The ♂/♀ glyph carries the meaning; colour is only reinforcement. */
.sx { flex: none; font-weight: 700; line-height: 1; }
.sx.male { color: var(--male); }
.sx.female { color: var(--female); }

.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.on { background: var(--good); box-shadow: 0 0 8px rgba(53, 211, 154, .7); }
.dot.off { background: #4b5069; }

.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  font-weight: 700; font-size: .8rem; color: #10111a;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.avatar.lg { width: 64px; height: 64px; font-size: 1.3rem; }

/* ---------- video ---------- */

.video-tile {
  position: relative;
  background: #05060a;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4 / 3;
}
.video-tile video {
  width: 100%; height: 100%; object-fit: cover; display: block;
  background: #05060a;
}
.video-tile video.mirror { transform: scaleX(-1); }
.video-tile .label {
  position: absolute; left: .5rem; bottom: .5rem;
  display: flex; align-items: center; gap: .35rem;
  padding: .2rem .5rem; border-radius: 7px;
  background: rgba(5, 6, 10, .72); backdrop-filter: blur(6px);
  font-size: .78rem; font-weight: 600;
}
.video-tile .placeholder {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .6rem; color: var(--muted); text-align: center; padding: 1rem;
}

/* ---------- timer ---------- */

.timer {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: -.02em;
}
.timer.urgent { color: var(--bad); }
.timer.big { font-size: 2.4rem; }

.bar { height: 5px; border-radius: 3px; background: var(--panel-2); overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-2), var(--accent)); transition: width .5s linear; }
.bar.urgent > i { background: var(--bad); }

/* ---------- toasts ---------- */

#toasts {
  /* Clears the fixed header on both the join and host pages. */
  position: fixed; top: 3.75rem; right: 1rem; z-index: 100;
  display: flex; flex-direction: column; gap: .5rem; max-width: min(360px, 90vw);
}
.toast {
  background: var(--panel-2); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: 9px; padding: .6rem .8rem; box-shadow: var(--shadow);
  animation: slide-in .2s ease-out;
}
.toast.bad { border-left-color: var(--bad); }
.toast.good { border-left-color: var(--good); }
@keyframes slide-in { from { opacity: 0; transform: translateX(12px); } }

/* ---------- scrollbars ---------- */

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2b2f42; border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }
