/* ══════════ CitiMeet ══════════ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --font-head: 'Sora', sans-serif;
  --font-body: 'Inter', sans-serif;
  --r-lg: 20px; --r-md: 14px; --r-sm: 10px;
}

/* ── Themes ── */
:root[data-theme="midnight"] {
  --bg: #0b0d18; --bg2: #10132a; --panel: rgba(23, 26, 48, .92); --panel-solid: #171a30;
  --border: rgba(140, 150, 255, .14); --text: #eef0ff; --muted: #8b91b5;
  --accent: #5b5bf6; --accent2: #a855f7; --accent-soft: rgba(91, 91, 246, .16);
  --danger: #f43f5e; --ok: #34d399; --tile: #141731; --scheme: dark;
}
:root[data-theme="aurora"] {
  --bg: #061613; --bg2: #0a201c; --panel: rgba(14, 36, 32, .92); --panel-solid: #0e2420;
  --border: rgba(110, 231, 183, .14); --text: #e9fff8; --muted: #7fa89d;
  --accent: #10b981; --accent2: #22d3ee; --accent-soft: rgba(16, 185, 129, .16);
  --danger: #f43f5e; --ok: #34d399; --tile: #0c1e1a; --scheme: dark;
}
:root[data-theme="sunset"] {
  --bg: #170c10; --bg2: #221016; --panel: rgba(41, 20, 27, .93); --panel-solid: #29141b;
  --border: rgba(255, 160, 130, .15); --text: #fff1ec; --muted: #b18a8f;
  --accent: #f97316; --accent2: #ec4899; --accent-soft: rgba(249, 115, 22, .16);
  --danger: #ef4444; --ok: #34d399; --tile: #241219; --scheme: dark;
}
:root[data-theme="cyber"] {
  --bg: #050508; --bg2: #0b0b12; --panel: rgba(16, 16, 28, .94); --panel-solid: #10101c;
  --border: rgba(0, 255, 240, .16); --text: #eafffe; --muted: #7d86a0;
  --accent: #06b6d4; --accent2: #d946ef; --accent-soft: rgba(6, 182, 212, .16);
  --danger: #ff2d55; --ok: #22ff88; --tile: #0d0d1a; --scheme: dark;
}
:root[data-theme="daylight"] {
  --bg: #f2f4fb; --bg2: #e8ecf9; --panel: rgba(255, 255, 255, .95); --panel-solid: #ffffff;
  --border: rgba(60, 70, 140, .13); --text: #171a2e; --muted: #5d6480;
  --accent: #4f46e5; --accent2: #9333ea; --accent-soft: rgba(79, 70, 229, .1);
  --danger: #e11d48; --ok: #059669; --tile: #dde2f2; --scheme: light;
}
:root[data-theme="honey"] {
  --bg: #fdf7ec; --bg2: #f8eeda; --panel: rgba(255, 253, 247, .96); --panel-solid: #fffdf7;
  --border: rgba(160, 110, 40, .16); --text: #2c2113; --muted: #8a7a5e;
  --accent: #d97706; --accent2: #dc2626; --accent-soft: rgba(217, 119, 6, .12);
  --danger: #dc2626; --ok: #059669; --tile: #f0e5cd; --scheme: light;
}

html, body { height: 100%; }
body {
  font-family: var(--font-body); background: var(--bg); color: var(--text);
  overflow: hidden; color-scheme: var(--scheme);
  transition: background .4s ease, color .4s ease;
}

/* background blobs */
.bg-fx { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5; }
.b1 { width: 46vw; height: 46vw; background: var(--accent); top: -18vw; left: -12vw; animation: drift1 24s ease-in-out infinite alternate; }
.b2 { width: 38vw; height: 38vw; background: var(--accent2); bottom: -16vw; right: -10vw; animation: drift2 30s ease-in-out infinite alternate; }
.b3 { width: 24vw; height: 24vw; background: var(--accent); bottom: 24vh; left: 34vw; opacity: .18; animation: drift1 38s ease-in-out infinite alternate-reverse; }
:root[data-theme="daylight"] .blob, :root[data-theme="honey"] .blob { opacity: .18; }
@keyframes drift1 { to { transform: translate(9vw, 7vh) scale(1.12); } }
@keyframes drift2 { to { transform: translate(-8vw, -6vh) scale(.92); } }

.view { position: relative; z-index: 1; height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
.hidden { display: none !important; }

/* ── shared bits ── */
.logo { font-family: var(--font-head); font-weight: 800; font-size: 22px; display: flex; align-items: center; gap: 10px; letter-spacing: -.5px; }
.logo-sm { font-size: 17px; }
.logo-mark { display: flex; }
.grad-text { background: linear-gradient(100deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }

.btn {
  font-family: var(--font-body); font-weight: 600; font-size: 15px; border: none; cursor: pointer;
  border-radius: var(--r-md); padding: 12px 22px; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, filter .2s;
  color: var(--text);
}
.btn:active { transform: scale(.97); }
.btn-primary { background: linear-gradient(100deg, var(--accent), var(--accent2)); color: #fff; box-shadow: 0 8px 26px -8px var(--accent); }
.btn-primary:hover { filter: brightness(1.12); box-shadow: 0 10px 32px -6px var(--accent); }
.btn-ghost { background: var(--accent-soft); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--accent-soft); filter: brightness(1.18); }
.btn-lg { padding: 15px 26px; font-size: 16px; }
.btn-sm { padding: 8px 16px; font-size: 13px; border-radius: var(--r-sm); }
.btn-wide { width: 100%; }

.icon-btn {
  background: var(--accent-soft); border: 1px solid var(--border); color: var(--text);
  width: 42px; height: 42px; border-radius: 12px; cursor: pointer; display: inline-flex;
  align-items: center; justify-content: center; font-size: 17px; transition: filter .2s, transform .15s;
}
.icon-btn:hover { filter: brightness(1.25); }
.icon-btn:active { transform: scale(.94); }
.icon-btn.sm { width: 36px; height: 36px; border-radius: 10px; }
.icon-btn.accent { background: linear-gradient(100deg, var(--accent), var(--accent2)); color: #fff; border: none; }

.text-input {
  width: 100%; background: var(--bg2); border: 1.5px solid var(--border); color: var(--text);
  font-family: var(--font-body); font-size: 15px; padding: 13px 16px; border-radius: var(--r-md); outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.text-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.text-input::placeholder { color: var(--muted); }

.field-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; margin: 0 0 8px 2px; }

/* ══════════ LANDING ══════════ */
.land-head { display: flex; justify-content: space-between; align-items: center; padding: 22px 34px; }
.land-center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 20px 6vh; text-align: center; }
.land-title { font-family: var(--font-head); font-size: clamp(38px, 6vw, 64px); font-weight: 800; letter-spacing: -2px; line-height: 1.05; }
.land-sub { color: var(--muted); font-size: 16.5px; max-width: 520px; margin: 18px auto 34px; line-height: 1.6; }
.land-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 28px; width: min(460px, 92vw); text-align: left;
  box-shadow: 0 24px 60px -24px rgba(0,0,0,.5);
}
.land-actions { margin-top: 18px; display: flex; flex-direction: column; gap: 14px; }
.or-sep { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }
.or-sep::before, .or-sep::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.join-row { display: flex; gap: 10px; }
.code-input { letter-spacing: 2px; font-variant-numeric: tabular-nums; }
.land-feats { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: 30px; justify-content: center; }
.feat { color: var(--muted); font-size: 13.5px; font-weight: 500; display: flex; align-items: center; gap: 7px; }
.feat-ic { font-size: 15px; }

/* ══════════ PRE-JOIN ══════════ */
.prejoin-wrap { flex: 1; display: flex; align-items: center; justify-content: center; gap: 46px; padding: 24px; flex-wrap: wrap; }
.prejoin-preview { width: min(620px, 92vw); }
.pv-frame { position: relative; aspect-ratio: 16/9; border-radius: var(--r-lg); overflow: hidden; background: var(--tile); border: 1px solid var(--border); box-shadow: 0 24px 60px -24px rgba(0,0,0,.55); }
.pv-frame video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.pv-avatar { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: var(--tile); }
.pv-avatar span, .tile-avatar span { width: 96px; height: 96px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--font-head); font-size: 38px; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent2)); }
.pv-name { position: absolute; left: 14px; bottom: 12px; font-size: 14px; font-weight: 600; text-shadow: 0 1px 6px rgba(0,0,0,.6); color: #fff; }
.pv-toggles { position: absolute; bottom: 12px; left: 0; right: 0; display: flex; justify-content: center; gap: 12px; }
.pv-devices { display: flex; gap: 10px; margin-top: 14px; }
.dev-select {
  flex: 1; min-width: 0; background: var(--panel-solid); color: var(--text); border: 1.5px solid var(--border);
  border-radius: var(--r-sm); padding: 10px 12px; font-family: var(--font-body); font-size: 13px; outline: none; cursor: pointer;
}
.dev-select.wide { width: 100%; margin-bottom: 16px; }
.prejoin-side { width: min(340px, 92vw); display: flex; flex-direction: column; gap: 14px; }
.prejoin-side h2 { font-family: var(--font-head); font-size: 30px; letter-spacing: -1px; }
.pj-code-wrap { display: flex; flex-direction: column; gap: 4px; background: var(--panel); border: 1px solid var(--border); padding: 14px 18px; border-radius: var(--r-md); }
.pj-code-label { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }
.pj-code { font-family: var(--font-head); font-size: 30px; font-weight: 700; letter-spacing: 4px; font-variant-numeric: tabular-nums; }
.pj-hint { color: var(--muted); font-size: 14px; line-height: 1.5; }

/* ══════════ MEETING ══════════ */
.meet-top { display: flex; align-items: center; gap: 16px; padding: 12px 20px; border-bottom: 1px solid var(--border); background: var(--panel); }
.code-chip {
  display: flex; align-items: center; gap: 8px; background: var(--accent-soft); border: 1px solid var(--border);
  color: var(--text); font-family: var(--font-body); font-weight: 600; font-size: 13.5px; letter-spacing: 1.5px;
  padding: 7px 14px; border-radius: 999px; cursor: pointer; transition: filter .2s; font-variant-numeric: tabular-nums;
}
.code-chip:hover { filter: brightness(1.25); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.meet-timer { font-size: 13.5px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.net-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.net-dot.on { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.net-dot.bad { background: var(--danger); box-shadow: 0 0 8px var(--danger); }

.meet-main { flex: 1; display: flex; min-height: 0; }
.stage { flex: 1; position: relative; min-width: 0; padding: 14px; }
.grid { height: 100%; display: grid; gap: 12px; grid-template-columns: repeat(var(--cols, 1), 1fr); align-content: center; }

.tile {
  position: relative; border-radius: var(--r-md); overflow: hidden; background: var(--tile);
  border: 2px solid transparent; min-height: 0; aspect-ratio: 16/9; align-self: center;
  transition: border-color .25s, box-shadow .25s; cursor: pointer; animation: tileIn .35s ease;
}
@keyframes tileIn { from { opacity: 0; transform: scale(.92); } }
.tile.speaking { border-color: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 30%, transparent); }
.tile.pinned { grid-column: 1 / -1; aspect-ratio: auto; height: 100%; }
.tile video { width: 100%; height: 100%; object-fit: cover; }
.tile.mirror video { transform: scaleX(-1); }
.tile-avatar { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: var(--tile); }
.tile-avatar span { width: 72px; height: 72px; font-size: 28px; }
.tile-label {
  position: absolute; left: 10px; bottom: 9px; display: flex; align-items: center; gap: 7px;
  background: rgba(0,0,0,.55); color: #fff; font-size: 12.5px; font-weight: 600;
  padding: 4px 10px; border-radius: 999px; max-width: calc(100% - 20px);
}
.tile-label .lbl-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-label .mic-off { color: #ff7b93; display: none; }
.tile.is-muted .mic-off { display: inline; }
.tile-hand { position: absolute; top: 8px; left: 10px; font-size: 22px; display: none; animation: handWave 1s ease infinite; }
.tile.hand-up .tile-hand { display: block; }
@keyframes handWave { 0%,100% { transform: rotate(0); } 50% { transform: rotate(18deg); } }
.tile-pin-ic { position: absolute; top: 8px; right: 10px; font-size: 14px; opacity: 0; transition: opacity .2s; background: rgba(0,0,0,.5); color: #fff; padding: 4px 8px; border-radius: 8px; }
.tile:hover .tile-pin-ic { opacity: 1; }

.reactions-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.float-emoji { position: absolute; bottom: 8%; font-size: 42px; animation: floatUp 2.6s ease-out forwards; }
@keyframes floatUp {
  0% { transform: translateY(0) scale(.6); opacity: 0; }
  12% { opacity: 1; transform: translateY(-6vh) scale(1.15); }
  100% { transform: translateY(-64vh) scale(1); opacity: 0; }
}

/* race overlay */
.race-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.55); z-index: 20; border-radius: var(--r-md); }
.race-box { font-family: var(--font-head); font-size: clamp(30px, 5vw, 54px); font-weight: 800; color: #fff; padding: 40px 70px; border-radius: 24px; background: var(--panel-solid); border: 1px solid var(--border); cursor: pointer; user-select: none; text-align: center; }
.race-box.go { background: var(--ok); color: #04150c; animation: pulseGo .5s ease infinite alternate; }
@keyframes pulseGo { to { transform: scale(1.05); } }

/* ── side panel ── */
.side-panel { width: 340px; display: flex; flex-direction: column; border-left: 1px solid var(--border); background: var(--panel); min-height: 0; }
.side-panel.collapsed { display: none; }
.panel-tabs { display: flex; padding: 10px 10px 0; gap: 4px; }
.ptab {
  flex: 1; background: none; border: none; color: var(--muted); font-family: var(--font-body); font-weight: 600;
  font-size: 13px; padding: 10px 4px; cursor: pointer; border-radius: 10px 10px 0 0; position: relative;
  border-bottom: 2px solid transparent; transition: color .2s, border-color .2s; display: flex; align-items: center; justify-content: center; gap: 5px;
}
.ptab:hover { color: var(--text); }
.ptab.active { color: var(--text); border-bottom-color: var(--accent); }
.pcount { background: var(--accent-soft); border-radius: 999px; padding: 1px 7px; font-size: 11px; }
.badge { background: var(--danger); color: #fff; border-radius: 999px; padding: 1px 6px; font-size: 10px; position: absolute; top: 4px; right: 2px; }
.panel-body { flex: 1; min-height: 0; position: relative; }
.tabpane { position: absolute; inset: 0; display: none; flex-direction: column; }
.tabpane.active { display: flex; }

/* chat */
.chat-scroll { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.chat-msg { max-width: 86%; animation: msgIn .25s ease; }
@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } }
.chat-msg .m-head { font-size: 11.5px; color: var(--muted); margin-bottom: 3px; display: flex; gap: 8px; align-items: baseline; }
.chat-msg .m-head b { color: var(--text); font-size: 12px; }
.chat-msg .m-body { background: var(--bg2); border: 1px solid var(--border); padding: 9px 13px; border-radius: 4px 14px 14px 14px; font-size: 14px; line-height: 1.45; word-wrap: break-word; }
.chat-msg.mine { align-self: flex-end; }
.chat-msg.mine .m-body { background: linear-gradient(115deg, var(--accent), var(--accent2)); color: #fff; border: none; border-radius: 14px 4px 14px 14px; }
.chat-msg.mine .m-head { justify-content: flex-end; }
.chat-sys { align-self: center; color: var(--muted); font-size: 12px; background: var(--accent-soft); padding: 4px 12px; border-radius: 999px; }
.chat-input-row { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); align-items: center; }
.chat-input { flex: 1; padding: 10px 14px; font-size: 14px; }
.emoji-tray { position: absolute; bottom: 64px; left: 10px; right: 10px; background: var(--panel-solid); border: 1px solid var(--border); border-radius: var(--r-md); padding: 10px; display: flex; flex-wrap: wrap; gap: 4px; box-shadow: 0 16px 40px -12px rgba(0,0,0,.5); z-index: 5; }
.emoji-tray button { background: none; border: none; font-size: 21px; cursor: pointer; padding: 5px; border-radius: 8px; transition: background .15s, transform .15s; }
.emoji-tray button:hover { background: var(--accent-soft); transform: scale(1.2); }

/* people */
.people-list { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.person { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: var(--r-sm); background: var(--bg2); border: 1px solid var(--border); }
.person .p-ava { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent2)); flex: none; }
.person .p-name { flex: 1; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person .p-tag { font-size: 10.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.person .p-ics { display: flex; gap: 6px; font-size: 14px; }
.person .p-kick { background: none; border: none; color: var(--danger); cursor: pointer; font-size: 15px; padding: 4px; border-radius: 6px; }
.person .p-kick:hover { background: var(--accent-soft); }

/* games */
.games-list { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.game-card { display: flex; align-items: center; gap: 12px; background: var(--bg2); border: 1px solid var(--border); padding: 13px 14px; border-radius: var(--r-md); }
.game-emoji { font-size: 26px; }
.game-info { flex: 1; display: flex; flex-direction: column; }
.game-info strong { font-size: 14.5px; }
.game-info span { font-size: 12px; color: var(--muted); }
.race-results { margin: 0 14px; padding: 12px 14px; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--r-md); font-size: 13.5px; }
.race-results .rr-row { display: flex; justify-content: space-between; padding: 4px 0; }
.race-results .rr-row:first-child { color: var(--ok); font-weight: 700; }

/* whiteboard */
.wb-tools { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.wb-colors { display: flex; gap: 6px; }
.wb-color { width: 24px; height: 24px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; transition: transform .15s; }
.wb-color:hover { transform: scale(1.15); }
.wb-color.active { border-color: var(--text); transform: scale(1.12); }
#wbSize { width: 70px; accent-color: var(--accent); }
.wb-wrap { flex: 1; min-height: 0; position: relative; background: #fff; margin: 10px; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--border); }
#wbCanvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }

/* ── controls bar ── */
.controls { display: flex; align-items: center; padding: 12px 20px; gap: 14px; border-top: 1px solid var(--border); background: var(--panel); }
.ctl-left, .ctl-right { flex: 1; display: flex; }
.ctl-right { justify-content: flex-end; }
.ctl-name { font-size: 13.5px; font-weight: 600; color: var(--muted); align-self: center; }
.kbd-hint { font-size: 11.5px; color: var(--muted); align-self: center; }
.ctl-center { display: flex; gap: 10px; }
.ctl-btn {
  width: 50px; height: 50px; border-radius: 16px; border: 1px solid var(--border);
  background: var(--accent-soft); color: var(--text); cursor: pointer; font-size: 20px;
  display: inline-flex; align-items: center; justify-content: center; transition: filter .2s, transform .12s, background .2s;
}
.ctl-btn:hover { filter: brightness(1.3); }
.ctl-btn:active { transform: scale(.93); }
.ctl-btn.off { background: var(--danger); border-color: var(--danger); color: #fff; }
.ctl-btn.on-accent { background: linear-gradient(115deg, var(--accent), var(--accent2)); border-color: transparent; color: #fff; }
.ctl-btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; width: 64px; }
.ctl-btn.danger:hover { filter: brightness(1.15); }

.react-tray {
  position: fixed; bottom: 86px; left: 50%; transform: translateX(-50%);
  background: var(--panel-solid); border: 1px solid var(--border); border-radius: 999px;
  padding: 8px 12px; display: flex; gap: 4px; z-index: 40; box-shadow: 0 18px 44px -12px rgba(0,0,0,.55);
  animation: msgIn .2s ease;
}
.react-tray button { background: none; border: none; font-size: 26px; cursor: pointer; padding: 6px; border-radius: 50%; transition: transform .15s; }
.react-tray button:hover { transform: scale(1.35); }

/* ── modals ── */
.modal-veil { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 60; display: flex; align-items: center; justify-content: center; animation: veilIn .2s ease; }
@keyframes veilIn { from { opacity: 0; } }
.modal { background: var(--panel-solid); border: 1px solid var(--border); border-radius: var(--r-lg); width: min(430px, 92vw); max-height: 86vh; overflow: auto; box-shadow: 0 30px 80px -20px rgba(0,0,0,.6); animation: modalIn .25s cubic-bezier(.2,.9,.3,1.2); }
@keyframes modalIn { from { opacity: 0; transform: scale(.9) translateY(14px); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 0; }
.modal-head h3 { font-family: var(--font-head); font-size: 19px; letter-spacing: -.4px; }
.modal-body { padding: 18px 22px 24px; }
.check-row { display: flex; align-items: center; gap: 10px; font-size: 14px; margin-top: 6px; cursor: pointer; }
.check-row input { accent-color: var(--accent); width: 16px; height: 16px; }

.theme-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.theme-sw { border: 2px solid var(--border); border-radius: var(--r-sm); padding: 8px; cursor: pointer; background: none; display: flex; flex-direction: column; gap: 7px; align-items: center; transition: border-color .2s, transform .15s; }
.theme-sw:hover { transform: translateY(-2px); }
.theme-sw.active { border-color: var(--accent); }
.theme-sw .sw-strip { width: 100%; height: 34px; border-radius: 7px; }
.theme-sw .sw-name { font-size: 11.5px; font-weight: 600; color: var(--text); }

.opp-list { display: flex; flex-direction: column; gap: 8px; }
.opp-list .btn { justify-content: flex-start; }

/* game modal */
.game-modal { width: min(400px, 92vw); }
.ttt-board { display: grid; grid-template-columns: repeat(3, 84px); gap: 8px; justify-content: center; margin: 6px 0 14px; }
.ttt-cell { width: 84px; height: 84px; border-radius: 14px; background: var(--bg2); border: 1.5px solid var(--border); font-size: 38px; font-family: var(--font-head); font-weight: 800; color: var(--text); cursor: pointer; transition: background .15s, transform .1s; display: flex; align-items: center; justify-content: center; }
.ttt-cell:hover:empty { background: var(--accent-soft); }
.ttt-cell:active { transform: scale(.95); }
.ttt-cell.x { color: var(--accent); } .ttt-cell.o { color: var(--accent2); }
.ttt-cell.win { background: var(--accent-soft); border-color: var(--ok); }
.game-status { text-align: center; font-size: 14.5px; font-weight: 600; margin-bottom: 12px; color: var(--muted); }
.game-status.hot { color: var(--ok); }
.game-actions { display: flex; gap: 10px; justify-content: center; }
.rps-row { display: flex; gap: 12px; justify-content: center; margin: 10px 0 16px; }
.rps-pick { font-size: 40px; background: var(--bg2); border: 1.5px solid var(--border); border-radius: 16px; width: 84px; height: 84px; cursor: pointer; transition: transform .15s, background .15s, border-color .2s; }
.rps-pick:hover { transform: translateY(-4px) scale(1.06); background: var(--accent-soft); }
.rps-pick.sel { border-color: var(--accent); background: var(--accent-soft); }
.rps-score { display: flex; justify-content: space-around; font-family: var(--font-head); font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.rps-reveal { text-align: center; font-size: 44px; letter-spacing: 18px; margin: 6px 0; min-height: 56px; }

/* toasts */
.toasts { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: var(--panel-solid); border: 1px solid var(--border); color: var(--text);
  padding: 11px 20px; border-radius: 999px; font-size: 13.5px; font-weight: 600;
  box-shadow: 0 14px 40px -10px rgba(0,0,0,.5); animation: toastIn .3s cubic-bezier(.2,.9,.3,1.2);
  display: flex; align-items: center; gap: 9px; pointer-events: auto;
}
.toast.leaving { animation: toastOut .3s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-16px) scale(.9); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-14px); } }
.toast .t-btns { display: flex; gap: 6px; margin-left: 6px; }

/* scrollbars */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }
::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 900px) {
  .side-panel { position: fixed; right: 0; top: 54px; bottom: 76px; z-index: 30; width: min(340px, 88vw); box-shadow: -20px 0 50px rgba(0,0,0,.4); }
  .kbd-hint, .ctl-name { display: none; }
  .ctl-left, .ctl-right { flex: 0; }
  .ctl-center { flex: 1; justify-content: center; }
}

/* ── phones ── */
@media (max-width: 640px) {
  .text-input, .dev-select { font-size: 16px; }   /* stop iOS focus zoom */
  .land-head { padding: 16px 18px; }
  .land-card { padding: 20px; }
  .land-sub { font-size: 15px; margin: 14px auto 24px; }
  .join-row { flex-wrap: wrap; }
  .join-row .btn { flex: 1; }
  .land-feats { gap: 8px 16px; }
  .prejoin-wrap { gap: 20px; align-content: flex-start; overflow-y: auto; }
  .prejoin-side { padding-bottom: 20px; }
  .pv-avatar span { width: 68px; height: 68px; font-size: 27px; }

  .meet-top { padding: 8px 10px; gap: 8px; }
  .meet-top .logo-sm { font-size: 0; gap: 0; }  /* icon-only logo on phones */
  .code-chip { font-size: 12.5px; padding: 6px 11px; }
  .stage { padding: 8px; }
  .grid { gap: 8px; }
  .tile-label { font-size: 11px; padding: 3px 8px; }
  .tile-avatar span { width: 54px; height: 54px; font-size: 21px; }

  .controls { padding: 10px 8px calc(10px + env(safe-area-inset-bottom)); gap: 6px; }
  .ctl-center { gap: 6px; }
  .ctl-btn { width: 42px; height: 42px; border-radius: 13px; font-size: 17px; }
  .ctl-btn svg { width: 19px; height: 19px; }
  .ctl-btn.danger { width: 52px; }

  .side-panel { top: 46px; bottom: calc(66px + env(safe-area-inset-bottom)); width: 100vw; border-left: none; }
  .react-tray { bottom: calc(72px + env(safe-area-inset-bottom)); max-width: 96vw; overflow-x: auto; }
  .react-tray button { font-size: 22px; }
  .race-box { padding: 26px 34px; }
  .ttt-cell { width: 72px; height: 72px; font-size: 32px; }
  .ttt-board { grid-template-columns: repeat(3, 72px); }
  .rps-pick { width: 72px; height: 72px; font-size: 34px; }
  .float-emoji { font-size: 34px; }
  .toasts { top: 10px; width: 96vw; }
  .toast { font-size: 12.5px; padding: 9px 14px; text-align: center; flex-wrap: wrap; justify-content: center; }
}

@media (max-width: 430px) {
  .controls { padding-left: 6px; padding-right: 6px; }
  .ctl-center { gap: 4px; }
  .ctl-btn { width: 38px; height: 38px; border-radius: 12px; }
  .ctl-btn svg { width: 17px; height: 17px; }
  .ctl-btn.danger { width: 48px; }
}
