/* omoggle v2 — design system
   palette: deep void + neon plasma
   type: space grotesk + jetbrains mono
*/

:root {
  --bg: #07070d;
  --bg-2: #0d0d18;
  --bg-3: #14142a;
  --line: #1f1f3a;
  --line-soft: #161629;
  --text: #ecedf5;
  --muted: #8a8db0;
  --accent: #b8ff3a;       /* plasma green */
  --accent-2: #ff3aa1;     /* plasma pink */
  --accent-3: #6ad8ff;     /* plasma cyan */
  --warn: #ffb43a;
  --danger: #ff4d6d;
  --good: #58e08c;
  --bad:  #ff5c7a;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  --glow-accent: 0 0 0 1px rgba(184, 255, 58, 0.4), 0 0 32px rgba(184, 255, 58, 0.25);
  --glow-pink: 0 0 0 1px rgba(255, 58, 161, 0.4), 0 0 32px rgba(255, 58, 161, 0.25);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { color-scheme: dark; }
body {
  font-family: 'Space Grotesk', -apple-system, system-ui, sans-serif;
  background: radial-gradient(1200px 800px at 80% -10%, rgba(255, 58, 161, 0.12), transparent 60%),
              radial-gradient(900px 700px at -10% 110%, rgba(106, 216, 255, 0.10), transparent 60%),
              var(--bg);
  color: var(--text);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

#bg-grid {
  position: fixed; inset: 0; width: 100vw; height: 100dvh;
  z-index: -1; pointer-events: none; opacity: 0.55;
}

/* --- top bar --- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(7, 7, 13, 0.65);
  backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 20;
}
.topbar.slim { padding: 12px 20px; }
.brand {
  font-weight: 700; font-size: 20px; letter-spacing: -0.02em;
}
.brand-mark {
  display: inline-block; width: 22px; height: 22px; line-height: 22px; text-align: center;
  border-radius: 50%; background: var(--accent); color: #0b0b18;
  box-shadow: var(--glow-accent);
  margin-right: 2px;
}
.brand-v {
  margin-left: 6px; padding: 2px 6px;
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  color: var(--accent); border: 1px solid var(--accent); border-radius: 6px;
  vertical-align: 2px;
}
.topnav { display: flex; gap: 22px; font-size: 14px; color: var(--muted); }
.topnav a.active { color: var(--accent); }

/* HUD on arena page */
.hud { display: flex; gap: 10px; align-items: center; }
.hud-cell {
  display: inline-flex; flex-direction: column; padding: 6px 12px;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 10px; min-width: 64px; align-items: center;
}
.hud-cell b { font-size: 14px; font-family: 'JetBrains Mono', monospace; }
.hud-cell i { font-size: 10px; color: var(--muted); font-style: normal; text-transform: uppercase; letter-spacing: 0.1em; }
.hud-link { color: var(--accent); }

/* --- home --- */
.home {
  max-width: 1180px; margin: 0 auto; padding: 60px 28px 80px;
}
.hero { text-align: center; padding: 24px 0 36px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
  color: var(--muted);
}
.pill .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 12px var(--accent);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.85); }
}
.hero h1 {
  font-size: clamp(48px, 9vw, 108px);
  line-height: 0.95; letter-spacing: -0.04em; margin: 22px 0 14px;
  font-weight: 700;
}
.hero h1 span { display: block; }
.grad {
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-3) 50%, var(--accent-2) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.glitch {
  position: relative; color: var(--text);
}
.glitch::before, .glitch::after {
  content: attr(data-text); position: absolute; inset: 0;
  mix-blend-mode: screen; opacity: 0.7;
}
.glitch::before { color: var(--accent-2); transform: translate(-2px, 0); animation: glitch-x 3.4s infinite steps(1); }
.glitch::after { color: var(--accent-3); transform: translate(2px, 0); animation: glitch-x 4.1s infinite steps(1) reverse; }
@keyframes glitch-x {
  0%, 92%, 100% { transform: translate(0, 0); }
  93% { transform: translate(-3px, 1px); }
  95% { transform: translate(2px, -1px); }
  97% { transform: translate(-1px, 0); }
}

.sub { max-width: 720px; margin: 0 auto; color: var(--muted); font-size: 17px; line-height: 1.6; }

/* ready card — shown inline when the user already has an account on file */
.ready-card {
  margin: 32px auto 18px; max-width: 560px;
  background: var(--bg-2); border: 1px solid var(--accent);
  border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow), var(--glow-accent);
  text-align: left;
}
.ready-row { display: flex; align-items: center; gap: 18px; margin-bottom: 20px; }
.ready-pfp-wrap {
  position: relative; width: 72px; height: 72px; flex-shrink: 0;
  border-radius: 50%; overflow: hidden; background: var(--bg-3);
  border: 2px solid var(--accent);
}
.ready-pfp-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
#ready-pfp-initial {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 28px;
  background: linear-gradient(135deg, var(--accent), var(--accent-3)); color: #0a0a12;
}
.ready-meta { flex: 1; min-width: 0; }
.ready-label {
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  color: var(--muted); text-transform: uppercase; letter-spacing: 0.16em;
}
.ready-meta h2 {
  margin: 4px 0 6px; font-size: 26px; letter-spacing: -0.02em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ready-stats {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  font-size: 13px; color: var(--muted);
}
.ready-stats b { color: var(--text); font-family: 'JetBrains Mono', monospace; }
.ready-actions { display: flex; flex-direction: column; gap: 8px; }
.ready-actions .btn { width: 100%; }
.welcome-row { display: flex; align-items: center; gap: 18px; margin-bottom: 20px; text-align: left; }
.welcome-pfp-wrap {
  position: relative; width: 72px; height: 72px; flex-shrink: 0;
  border-radius: 50%; overflow: hidden; background: var(--bg-3);
  border: 2px solid var(--accent); box-shadow: var(--glow-accent);
}
.welcome-pfp-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
#welcome-pfp-initial {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 28px;
  background: linear-gradient(135deg, var(--accent), var(--accent-3)); color: #0a0a12;
}
.welcome-meta { flex: 1; min-width: 0; }
.welcome-label {
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  color: var(--muted); text-transform: uppercase; letter-spacing: 0.16em;
}
.welcome-meta h2 {
  margin: 4px 0 6px; font-size: 28px; letter-spacing: -0.02em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.welcome-stats { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--muted); }
.welcome-stats b { color: var(--text); font-family: 'JetBrains Mono', monospace; }
.welcome-actions { display: flex; flex-direction: column; gap: 8px; }
.welcome-actions .btn { width: 100%; }

.switcher-toggle { text-align: center; margin-top: 12px; }
.link-btn {
  background: none; border: none; cursor: pointer; color: var(--muted);
  font: inherit; font-size: 13px; padding: 6px 10px;
}
.link-btn:hover { color: var(--accent); }

.switcher-panel {
  margin-top: 10px; padding: 14px; background: var(--bg-3);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.account-list { display: flex; flex-direction: column; gap: 6px; max-height: 280px; overflow-y: auto; margin-bottom: 12px; }
.account-item {
  display: flex; align-items: center; gap: 10px; padding: 10px;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); cursor: pointer; font: inherit; color: var(--text);
  text-align: left; width: 100%;
}
.account-item:hover { border-color: var(--accent); }
.account-item.active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.account-pfp {
  position: relative; width: 32px; height: 32px; flex-shrink: 0;
  border-radius: 50%; overflow: hidden; background: var(--bg-3);
}
.account-pfp img { width: 100%; height: 100%; object-fit: cover; display: block; }
.account-pfp-fallback {
  position: absolute; inset: 0; display: none; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-3)); color: #0a0a12;
  font-weight: 700; font-size: 14px;
}
.account-handle { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-badge {
  font-family: 'JetBrains Mono', monospace; font-size: 9px;
  padding: 2px 6px; border-radius: 999px; border: 1px solid currentColor;
  text-transform: uppercase; letter-spacing: 0.08em;
}
.account-badge.main { color: var(--accent); }
.account-badge.alt { color: var(--muted); }
.account-badge.active-tag { color: var(--accent-3); border-color: var(--accent-3); }

/* claim card — username + pfp + age */
.claim-card {
  margin: 32px auto 18px; max-width: 720px;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
  text-align: left;
}
.claim-head { text-align: center; margin-bottom: 22px; }
.claim-step {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  color: var(--accent); border: 1px solid var(--accent);
}
.claim-head h2 { margin: 10px 0 6px; font-size: 24px; letter-spacing: -0.02em; }
.claim-head p { color: var(--muted); font-size: 14px; margin: 0; }
.pfp-row { display: grid; grid-template-columns: 120px 1fr; gap: 22px; align-items: start; }
.pfp-drop {
  position: relative; width: 120px; height: 120px;
  border-radius: 50%; background: var(--bg-3); border: 2px dashed var(--line);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  overflow: hidden; transition: border-color 0.15s ease;
}
.pfp-drop:hover { border-color: var(--accent); }
.pfp-drop.has-pfp { border-style: solid; border-color: var(--accent); box-shadow: var(--glow-accent); }
.pfp-drop img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: none;
}
.pfp-drop.has-pfp img { display: block; }
.pfp-drop.has-pfp .pfp-placeholder { display: none; }
.pfp-placeholder {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: var(--muted); font-size: 11px; text-align: center;
}
.pfp-initial {
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-3));
  color: #0a0a12; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 22px;
}
.pfp-placeholder em { font-style: normal; color: var(--accent-3); }

.claim-fields { display: flex; flex-direction: column; gap: 16px; }
.field-stacked label {
  display: block; font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--muted); text-transform: uppercase;
  letter-spacing: 0.1em; margin-bottom: 6px;
}
.field-stacked input {
  width: 100%; padding: 12px 16px; font-size: 16px;
  background: var(--bg-3); border: 1px solid var(--line);
  color: var(--text); border-radius: var(--radius-sm); font-family: inherit;
}
.field-stacked input:focus { outline: none; border-color: var(--accent); }
.field-status {
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  margin-top: 6px; color: var(--muted);
}
.field-status.ok { color: var(--good); }
.field-status.err { color: var(--danger); }
.field-status.pending { color: var(--accent-3); }

.claim-actions { display: flex; gap: 10px; margin-top: 22px; }
.claim-actions .btn { flex: 1; }
@media (max-width: 580px) {
  .pfp-row { grid-template-columns: 1fr; justify-items: center; }
  .claim-fields { width: 100%; }
  .claim-actions { flex-direction: column; }
}

/* legacy .enter form kept for compatibility (unused now) */
.enter { display: none; }
.field { flex: 1; display: flex; align-items: center; }
.field input { background: transparent; border: 0; outline: 0; color: var(--text); padding: 14px 16px; font-size: 16px; }
.btn {
  font: inherit; cursor: pointer; user-select: none;
  border: 1px solid var(--line); background: var(--bg-3); color: var(--text);
  padding: 12px 20px; border-radius: 999px; font-weight: 600; letter-spacing: -0.01em;
  transition: transform 0.06s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn.primary {
  background: var(--accent); color: #07070d; border-color: var(--accent);
  box-shadow: var(--glow-accent);
}
.btn.primary:hover { box-shadow: 0 0 0 1px var(--accent), 0 0 44px rgba(184, 255, 58, 0.4); }
.btn.big { padding: 16px 26px; font-size: 16px; width: 100%; }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn.danger { background: rgba(255, 77, 109, 0.12); border-color: rgba(255, 77, 109, 0.45); color: var(--danger); }
.btn.danger:hover { background: rgba(255, 77, 109, 0.2); }
.btn.sm { padding: 8px 14px; font-size: 13px; }

.age-check {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--muted);
}
.age-check input { accent-color: var(--accent); flex-shrink: 0; }

.hero-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  max-width: 560px; margin: 32px auto 0; gap: 12px;
}
.hero-stats > div {
  display: flex; flex-direction: column; align-items: center;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px;
}
.hero-stats strong {
  font-family: 'JetBrains Mono', monospace; font-size: 22px; color: var(--accent);
}
.hero-stats span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; margin-top: 4px; }

.features {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
  margin: 80px auto 0; max-width: 1180px;
}
.features article {
  background: linear-gradient(180deg, rgba(255,255,255,0.025), transparent 80%), var(--bg-2);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 22px;
}
.features h3 {
  margin: 0 0 8px; font-size: 16px; letter-spacing: -0.01em;
  color: var(--accent);
}
.features p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }

.faq {
  max-width: 760px; margin: 80px auto 0;
}
.faq h2 { font-size: 28px; letter-spacing: -0.02em; margin-bottom: 16px; }
.faq details {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); margin-bottom: 8px; padding: 14px 18px;
}
.faq summary { cursor: pointer; font-weight: 600; }
.faq details[open] summary { color: var(--accent); }
.faq p { color: var(--muted); margin: 10px 0 0; font-size: 14px; line-height: 1.6; }

.foot {
  display: flex; justify-content: space-between; padding: 32px 28px;
  border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 13px;
  max-width: 1180px; margin: 60px auto 0;
}

/* --- arena --- */
.page-arena { background: var(--bg); }
.arena { padding: 18px; max-width: 1480px; margin: 0 auto; min-height: calc(100dvh - 64px); }
.stage { display: none; animation: fade 0.25s ease; }
.stage[data-active="true"] { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.cal-wrap {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, 420px);
  gap: 22px; align-items: start;
}
.cam-frame {
  position: relative; aspect-ratio: 4 / 3;
  background: #000; border-radius: var(--radius);
  overflow: hidden; border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.cam-frame video { width: 100%; height: 100%; object-fit: cover; background: #000; transform: scaleX(-1); }
.cam-frame canvas { position: absolute; inset: 0; width: 100%; height: 100%; transform: scaleX(-1); pointer-events: none; }
.cam-corner {
  position: absolute; width: 22px; height: 22px;
  border: 2px solid var(--accent); pointer-events: none;
}
.cam-corner.tl { top: 10px; left: 10px; border-right: 0; border-bottom: 0; }
.cam-corner.tr { top: 10px; right: 10px; border-left: 0; border-bottom: 0; }
.cam-corner.bl { bottom: 10px; left: 10px; border-right: 0; border-top: 0; }
.cam-corner.br { bottom: 10px; right: 10px; border-left: 0; border-top: 0; }

.cal-fitness {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,0.6); padding: 4px 12px; border-radius: 999px;
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  border: 1px solid var(--line);
}

.cal-panel { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.cal-panel h2 { margin: 0 0 6px; font-size: 22px; }
.cal-panel p { color: var(--muted); font-size: 14px; line-height: 1.55; }

.bar {
  display: grid; grid-template-columns: 70px 1fr 48px; gap: 12px;
  align-items: center; margin: 12px 0; font-family: 'JetBrains Mono', monospace; font-size: 12px;
}
.bar span { color: var(--muted); }
.bar-track {
  height: 6px; background: var(--bg-3); border-radius: 999px; overflow: hidden;
}
.bar-fill {
  height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent), var(--accent-3));
  transition: width 0.3s ease; border-radius: 999px;
}

.psl-readout {
  margin: 20px 0; padding: 16px; background: var(--bg-3); border: 1px solid var(--line);
  border-radius: var(--radius-sm); display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center;
}
.psl-big {
  font-family: 'JetBrains Mono', monospace; font-weight: 700;
  font-size: 56px; line-height: 1; color: var(--accent);
  text-shadow: 0 0 30px rgba(184, 255, 58, 0.35);
  min-width: 120px; text-align: center;
}
.psl-axes { display: grid; gap: 6px; }
.psl-axis {
  display: grid; grid-template-columns: 80px 1fr 40px; gap: 10px;
  align-items: center; font-family: 'JetBrains Mono', monospace; font-size: 11px;
}
.psl-axis span { color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.psl-axis b { color: var(--text); }
.axis-track { height: 4px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.axis-fill {
  height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent-3), var(--accent));
  transition: width 0.25s ease; border-radius: 999px;
}

.hint { font-size: 12px; color: var(--muted); margin-top: 10px; text-align: center; }

/* queue stage */
.queue-wrap {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 80px 20px;
}
.pulse {
  width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  position: relative; margin-bottom: 24px;
  animation: ping 1.6s ease-out infinite;
}
.pulse::after {
  content: ''; position: absolute; inset: 30px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 40px var(--accent);
}
@keyframes ping {
  0% { transform: scale(0.9); opacity: 1; }
  100% { transform: scale(1.4); opacity: 0.2; }
}
.queue-wrap h2 { font-size: 32px; letter-spacing: -0.02em; margin: 0 0 6px; }
.muted { color: var(--muted); }
.queue-stats { display: flex; gap: 16px; margin: 30px 0; }
.queue-stats > div {
  background: var(--bg-2); border: 1px solid var(--line); padding: 14px 22px;
  border-radius: var(--radius-sm); text-align: center;
}
.queue-stats b { font-family: 'JetBrains Mono', monospace; font-size: 22px; color: var(--accent); display: block; }
.queue-stats span { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; }

/* battle stage */
.battle-grid {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 20px;
  align-items: start;
}
.seat { display: flex; flex-direction: column; gap: 12px; }
.seat .cam-frame { aspect-ratio: 4 / 3; }
.seat-tag {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 0 6px;
}
.seat-tag b { font-size: 16px; }
.seat-tag span {
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
  color: var(--muted);
}
.seat.me .cam-frame { border-color: var(--accent); box-shadow: var(--glow-accent); }
.seat.opp .cam-frame { border-color: var(--accent-2); box-shadow: var(--glow-pink); }
.psl-tag {
  position: absolute; bottom: 14px; left: 14px;
  background: rgba(0,0,0,0.7); border: 1px solid var(--line);
  padding: 6px 12px; border-radius: 8px; display: flex; gap: 8px; align-items: baseline;
  backdrop-filter: blur(6px);
}
.psl-tag span { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; }
.psl-tag b { font-family: 'JetBrains Mono', monospace; font-size: 22px; color: var(--accent); }
.seat.opp .psl-tag b { color: var(--accent-2); }
.opp-waiting {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-family: 'JetBrains Mono', monospace; font-size: 13px;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.6));
}
.opp-waiting.hide { display: none; }

/* safety / NSFW veil */
.safety-veil {
  position: absolute; inset: 0;
  backdrop-filter: blur(28px) saturate(0.6);
  -webkit-backdrop-filter: blur(28px) saturate(0.6);
  background: rgba(20, 0, 0, 0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 5; padding: 16px; text-align: center;
  border: 2px solid var(--danger);
  border-radius: var(--radius);
  animation: safety-pulse 1.2s ease-in-out infinite;
}
.safety-veil.hide { display: none; }
.safety-msg b {
  display: block; font-size: 18px; color: var(--danger);
  letter-spacing: -0.01em; margin-bottom: 8px;
  text-transform: uppercase; font-family: 'JetBrains Mono', monospace;
}
.safety-msg span {
  display: block; color: var(--text); font-size: 13px; line-height: 1.5;
  text-shadow: 0 1px 2px rgba(0,0,0,0.7);
}
@keyframes safety-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 77, 109, 0.5); }
  50%      { box-shadow: 0 0 0 12px rgba(255, 77, 109, 0); }
}

/* nsfw-blocked queue button hint */
.cal-hint.bad { color: var(--danger); }

/* face-merge result hero (battle preview removed — it pushed the second
   video below the fold on mobile; merger now renders to a hidden canvas
   and the result screen blits the final composite from it) */
.merge-final-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.16em;
}
.merge-final {
  display: flex; flex-direction: column; align-items: center;
  gap: 12px; margin: 8px 0 28px;
}
.merge-final canvas {
  width: min(420px, 80vw);
  aspect-ratio: 1 / 1; height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--accent);
  box-shadow: var(--glow-accent);
  background: #0a0a12;
}

.axes { background: var(--bg-2); border: 1px solid var(--line); padding: 14px; border-radius: var(--radius-sm); display: grid; gap: 6px; }

.vs {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 16px; padding: 12px;
  align-self: stretch;
}
.timer {
  font-family: 'JetBrains Mono', monospace; font-weight: 700;
  font-size: 88px; line-height: 1; color: var(--accent);
  text-shadow: 0 0 40px rgba(184, 255, 58, 0.4);
  min-width: 130px; text-align: center;
}
.timer.warn { color: var(--warn); text-shadow: 0 0 40px rgba(255, 180, 58, 0.5); }
.timer.danger { color: var(--danger); text-shadow: 0 0 40px rgba(255, 77, 109, 0.5); animation: tick 0.5s steps(1) infinite; }
@keyframes tick { 50% { transform: scale(1.06); } }
.vs-label {
  font-family: 'Space Grotesk', sans-serif; font-weight: 700;
  font-size: 22px; color: var(--muted); letter-spacing: 0.1em;
}
.round-badge {
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  padding: 4px 10px; border-radius: 999px;
  background: var(--bg-3); border: 1px solid var(--line); color: var(--muted);
}
.battle-actions { display: flex; flex-direction: column; gap: 8px; width: 100%; }

/* result stage */
.result-wrap {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: 60px 20px;
}
.result-banner {
  font-size: clamp(48px, 9vw, 96px); font-weight: 700;
  letter-spacing: -0.04em; line-height: 1;
  background: linear-gradient(90deg, var(--accent), var(--accent-3));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; margin-bottom: 30px;
}
.result-banner.loss { background: linear-gradient(90deg, var(--danger), var(--accent-2)); -webkit-background-clip: text; background-clip: text; }
.result-banner.draw { background: linear-gradient(90deg, var(--muted), var(--accent-3)); -webkit-background-clip: text; background-clip: text; }

.result-numbers {
  display: grid; grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px; margin-bottom: 32px;
}
.rn {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; min-width: 140px;
}
.rn span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; display: block; }
.rn b { font-family: 'JetBrains Mono', monospace; font-size: 28px; color: var(--accent); display: block; margin-top: 6px; }
.result-actions { display: flex; gap: 10px; }

/* board */
.board { max-width: 1080px; margin: 0 auto; padding: 60px 28px; }
.board h1 { font-size: clamp(40px, 6vw, 64px); letter-spacing: -0.04em; margin: 0 0 24px; }
.tabs { display: flex; gap: 6px; margin-bottom: 20px; }
.tab {
  font: inherit; cursor: pointer; border: 1px solid var(--line);
  background: var(--bg-2); color: var(--muted); padding: 10px 18px;
  border-radius: 999px;
}
.tab.active { background: var(--accent); color: #07070d; border-color: var(--accent); }
.board-card { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.board-head, .board-row {
  display: grid; grid-template-columns: 60px 1fr 100px 80px 120px 80px;
  align-items: center; padding: 12px 18px; gap: 10px;
}
.board-head {
  background: var(--bg-3); font-family: 'JetBrains Mono', monospace; font-size: 11px;
  color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em;
  border-bottom: 1px solid var(--line);
}
.board-row { border-top: 1px solid var(--line-soft); font-size: 14px; }
.board-row:nth-child(odd) { background: rgba(255,255,255,0.012); }
.board-row .rank { font-family: 'JetBrains Mono', monospace; color: var(--muted); }
.board-row .rank.top1 { color: var(--accent); }
.board-row .rank.top2 { color: var(--accent-3); }
.board-row .rank.top3 { color: var(--accent-2); }
.board-row .elo { font-family: 'JetBrains Mono', monospace; color: var(--accent); font-weight: 600; }
.board-row .psl { font-family: 'JetBrains Mono', monospace; color: var(--text); }
.board-row .wld { font-family: 'JetBrains Mono', monospace; color: var(--muted); font-size: 13px; }
.board-row .mogs { font-family: 'JetBrains Mono', monospace; color: var(--accent-2); font-weight: 600; }
.board-empty { padding: 40px; text-align: center; color: var(--muted); }

/* doc pages */
.page-doc { background: var(--bg); }
.doc { max-width: 720px; margin: 40px auto 80px; padding: 0 28px; }
.doc h1 { font-size: 40px; letter-spacing: -0.03em; margin-bottom: 16px; }
.doc h2 { margin-top: 32px; color: var(--accent); font-size: 18px; }
.doc p, .doc li { color: var(--muted); line-height: 1.65; font-size: 15px; }
.doc ul { padding-left: 18px; }

/* responsive */
/* HUD pfp avatar */
.hud-cell.hud-pfp {
  padding: 0; min-width: 0; width: 36px; height: 36px;
  overflow: hidden; border-radius: 50%; align-items: center; justify-content: center;
  background: var(--bg-3);
}
.hud-cell.hud-pfp img { width: 36px; height: 36px; object-fit: cover; }
#hud-tier { color: var(--accent); }

/* rank tier pills */
.tier-pill {
  display: inline-block; font-family: 'JetBrains Mono', monospace;
  font-size: 10px; padding: 2px 8px; border-radius: 999px;
  margin-left: 6px; text-transform: lowercase; letter-spacing: 0.06em;
  border: 1px solid currentColor; opacity: 0.95;
}
.tier-unranked          { color: var(--muted); }
.tier-chud              { color: #ff5c7a; }
.tier-ugly              { color: #ff8c5a; }
.tier-little-small-chad { color: #ffd35a; }
.tier-chadlike          { color: #b8ff3a; }
.tier-chad-beast {
  color: #fff;
  background: linear-gradient(135deg, rgba(184,255,58,0.22), rgba(255,58,161,0.22));
  border-color: rgba(255,255,255,0.6);
  text-shadow: 0 0 8px rgba(255,255,255,0.4);
}

/* mode banner during battle */
.mode-banner {
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  letter-spacing: 0.18em; text-transform: uppercase;
  padding: 6px 12px; border-radius: 999px; display: inline-block;
  margin: 0 0 10px;
}
.mode-banner.ranked  { color: var(--accent);   border: 1px solid var(--accent);  background: rgba(184,255,58,0.06); }
.mode-banner.private { color: var(--accent-2); border: 1px solid var(--accent-2); background: rgba(255,58,161,0.06); }
#r-delta.unranked    { color: var(--muted); font-family: 'JetBrains Mono', monospace; font-size: 14px; }

/* leaderboard handle + pfp + tier */
.board-row .handle { display: flex; align-items: center; gap: 10px; min-width: 0; }
.board-row .handle-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-pfp {
  width: 28px; height: 28px; border-radius: 50%;
  object-fit: cover; background: var(--bg-3);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.board-pfp.ph {
  background: linear-gradient(135deg, var(--accent), var(--accent-3));
  color: #07070d; font-weight: 700; font-family: 'Space Grotesk'; font-size: 13px;
}

/* friend overlay */
.friend-overlay {
  position: fixed; inset: 0; background: rgba(7,7,13,0.82);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 20px;
}
.friend-overlay[hidden] { display: none; }
.friend-card {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 32px; max-width: 460px; width: 100%;
  position: relative; box-shadow: var(--shadow);
}
.friend-close {
  position: absolute; top: 12px; right: 16px;
  background: none; border: none; color: var(--muted);
  font-size: 24px; line-height: 1; cursor: pointer;
}
.friend-close:hover { color: var(--text); }
.friend-card h3 { margin: 0 0 6px; font-size: 22px; }
.friend-tabs { display: flex; gap: 6px; margin: 18px 0; }
.friend-panel { display: flex; flex-direction: column; gap: 14px; }
.friend-panel[hidden] { display: none; }
.host-result, .host-card {
  display: flex; flex-direction: column; gap: 12px; align-items: center;
  margin: 18px 0 8px; padding: 16px;
  background: var(--bg-2); border: 1px solid var(--accent-2);
  border-radius: var(--radius); box-shadow: var(--glow-pink);
}
.host-card[hidden] { display: none; }
.host-card .muted { font-family: 'JetBrains Mono', monospace; font-size: 11px; text-transform: uppercase; letter-spacing: 0.16em; }
.room-code {
  font-family: 'JetBrains Mono', monospace; font-weight: 700;
  font-size: 40px; letter-spacing: 0.12em; color: var(--accent);
  text-shadow: 0 0 20px rgba(184, 255, 58, 0.35);
  padding: 14px 22px; background: var(--bg-3);
  border: 1px solid var(--accent); border-radius: var(--radius);
}
.room-actions { display: flex; align-items: center; gap: 10px; }
.copy-toast { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--good); }
.hint { font-size: 12px; color: var(--muted); text-align: center; }
#join-code {
  width: 100%; padding: 14px; font-size: 22px; text-align: center;
  font-family: 'JetBrains Mono', monospace; letter-spacing: 0.12em;
  background: var(--bg-3); border: 1px solid var(--line);
  color: var(--text); border-radius: var(--radius-sm); text-transform: uppercase;
}
#join-code:focus { outline: none; border-color: var(--accent); }

@media (max-width: 980px) {
  .features { grid-template-columns: repeat(2, 1fr); }
  .cal-wrap { grid-template-columns: 1fr; }

  /* Portrait phones: keep the cam frame at 4:3 so the camera stream
     (which is also ~4:3 from a phone selfie cam in this orientation)
     fills the whole box edge-to-edge with object-fit: cover. 16:9
     was pillarboxing because the camera is narrower than the box. */
  .arena { padding: 10px; }
  .cam-frame { aspect-ratio: 4 / 3; }
  .battle-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    gap: 6px;
  }
  .seat { gap: 4px; }
  .seat .cam-frame {
    width: 100%;
    aspect-ratio: 4 / 3;
    height: auto;
  }
  .axes { display: none; }            /* free up the vertical budget */
  .seat-tag { padding: 0 2px; font-size: 13px; }
  .seat-tag b { font-size: 13px; }
  .vs {
    flex-direction: row; flex-wrap: nowrap;
    justify-content: space-between; align-items: center;
    padding: 4px 10px; gap: 10px;
  }
  .timer { font-size: 38px; min-width: 56px; }
  .vs-label { font-size: 14px; }
  .round-badge { padding: 2px 8px; font-size: 10px; }
  .battle-actions { flex-direction: row; width: auto; gap: 6px; }
  .battle-actions .btn { padding: 6px 12px; font-size: 12px; }
  .psl-tag { padding: 4px 8px; bottom: 8px; left: 8px; }
  .psl-tag b { font-size: 16px; }

  /* fix: HUD + queue stats overflowed off the right edge on mobile because
     they were 1-line flex rows that wouldn't wrap. */
  .topbar.slim { flex-wrap: wrap; gap: 8px; padding: 8px 12px; }
  .hud { flex-wrap: wrap; gap: 6px; justify-content: flex-end; min-width: 0; flex: 1; }
  .hud-cell { padding: 4px 8px; min-width: 0; }
  .hud-cell b { font-size: 12px; }
  .hud-cell.hud-pfp { width: 30px; height: 30px; }
  .hud-cell.hud-pfp img { width: 30px; height: 30px; }
  .topnav { gap: 14px; font-size: 13px; }

  .queue-wrap { padding: 28px 14px 16px; }
  .queue-wrap h2 { font-size: 26px; }
  .pulse { width: 80px; height: 80px; margin-bottom: 18px; }
  .pulse::after { inset: 22px; }
  .queue-stats {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
    width: 100%; max-width: 380px; margin: 22px 0;
  }
  .queue-stats > div { padding: 10px 12px; min-width: 0; }
  .queue-stats b { font-size: 18px; }

  .board-head, .board-row {
    grid-template-columns: 40px 1fr 70px 60px 80px 60px;
    font-size: 12px; padding: 10px 12px;
  }
  .result-numbers { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 580px) {
  .enter { flex-direction: column; border-radius: var(--radius); }
  .field { width: 100%; }
  .field span { border-right: 0; border-bottom: 1px solid var(--line); padding: 10px 14px; }
  .btn.primary { width: 100%; }
  .hero-stats { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr; }
  .topnav { display: none; }
  .home { padding: 32px 18px 60px; }
}
