:root {
  --bg: #15121f;
  --bg-2: #1e1a2d;
  --card: #262139;
  --card-2: #2f2946;
  --text: #f4efe7;
  --muted: #aaa3bb;
  --line: rgba(255, 255, 255, 0.09);
  --accent: #f3a85c;
  --accent-ink: #2a1a08;
  --rose: #e8737a;
  --ok: #7fc8a3;
  --radius: 18px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: 'Rubik', system-ui, sans-serif;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(243, 168, 92, 0.13), transparent 60%),
    radial-gradient(900px 500px at 0% 110%, rgba(232, 115, 122, 0.10), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.55;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }

.wrap { max-width: 520px; margin: 0 auto; padding: 24px 16px 48px; min-height: 100dvh; display: flex; flex-direction: column; }
.center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.6rem; letter-spacing: 0.5px; }
.brand .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 18px var(--accent); }
.tag { color: var(--muted); margin: 4px 0 0; }

h1 { font-size: 1.7rem; margin: 0; line-height: 1.25; }
h2 { font-size: 1.2rem; margin: 0 0 8px; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 0.88rem; }
a { color: var(--accent); }

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

/* ---------- buttons ---------- */
button, .btn {
  font: inherit; border: 0; cursor: pointer; border-radius: 999px; padding: 13px 22px;
  background: var(--card-2); color: var(--text); font-weight: 500; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform 0.12s ease, background 0.2s ease, opacity 0.2s;
}
button:active, .btn:active { transform: scale(0.97); }
button:disabled { opacity: 0.5; cursor: default; }
.primary { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.danger { background: rgba(232, 115, 122, 0.16); color: var(--rose); }
.ghost { background: transparent; color: var(--muted); padding: 8px 12px; }
.wide { width: 100%; }

/* ---------- lobby ---------- */
.top { display: flex; align-items: center; justify-content: space-between; }
.big-go {
  width: 210px; height: 210px; border-radius: 50%; font-size: 1.45rem; font-weight: 700;
  background: radial-gradient(circle at 35% 30%, #ffc98a, var(--accent) 55%, #d9833a);
  color: var(--accent-ink); box-shadow: 0 18px 60px rgba(243, 168, 92, 0.35), inset 0 -8px 20px rgba(0,0,0,0.15);
  flex-direction: column; gap: 2px;
}
.online { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.online::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 6px; margin-top: 24px; }

/* ---------- searching ---------- */
.pulse { position: relative; width: 150px; height: 150px; display: grid; place-items: center; margin-bottom: 18px; }
.pulse::before, .pulse::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--accent);
  animation: ripple 2.4s ease-out infinite;
}
.pulse::after { animation-delay: 1.2s; }
.pulse span { width: 70px; height: 70px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 40px var(--accent); }
@keyframes ripple { from { transform: scale(0.45); opacity: 1; } to { transform: scale(1.25); opacity: 0; } }

/* ---------- call ---------- */
.call { gap: 10px; }
/* The orb stands in for the other person: it swells and glows when they speak. */
.orb {
  --level: 0; width: 190px; height: 190px; border-radius: 50%; margin-bottom: 18px;
  background: radial-gradient(circle at 38% 32%, #ffd3a1, var(--accent) 50%, #c9643f);
  transform: scale(calc(1 + var(--level) * 0.12));
  box-shadow:
    0 0 calc(30px + var(--level) * 70px) rgba(243, 168, 92, calc(0.35 + var(--level) * 0.5)),
    0 0 0 calc(6px + var(--level) * 22px) rgba(243, 168, 92, calc(0.10 + var(--level) * 0.25));
  transition: transform 0.08s linear, box-shadow 0.08s linear;
}
.status { font-size: 0.9rem; color: var(--muted); min-height: 1.4em; }
.timer { font-variant-numeric: tabular-nums; font-size: 1.1rem; color: var(--muted); }
.controls { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; max-width: 380px; margin-top: 12px; }
.controls button { padding: 16px 22px; font-size: 1.05rem; }
.safety { display: flex; gap: 6px; margin-top: 6px; }

/* ---------- overlays ---------- */
dialog {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--text);
  padding: 22px; width: min(420px, calc(100vw - 32px));
}
dialog::backdrop { background: rgba(10, 8, 18, 0.7); backdrop-filter: blur(3px); }
dialog .reasons { display: grid; gap: 8px; margin: 14px 0; }
dialog .reasons button { justify-content: flex-start; border-radius: 12px; }
dialog .row-end { display: flex; gap: 8px; justify-content: flex-start; }

.toast {
  position: fixed; bottom: 24px; inset-inline: 16px; margin: 0 auto; max-width: 420px; text-align: center;
  background: var(--card-2); border: 1px solid var(--line); padding: 12px 16px; border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4); z-index: 10;
}

/* ---------- admin ---------- */
.admin-wrap { max-width: 980px; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.8rem; background: var(--card-2); color: var(--muted); }
.pill.warn { background: rgba(232, 115, 122, 0.18); color: var(--rose); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.member { display: grid; gap: 10px; }
.member .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.member .acts button { padding: 8px 14px; font-size: 0.9rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-top: 18px; }
.stat { display: grid; gap: 2px; text-align: center; padding: 16px; }
.stat strong { font-size: 1.8rem; }
.error { color: var(--rose); min-height: 1.4em; font-size: 0.92rem; }
input { font: inherit; color: var(--text); background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; width: 100%; }
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
