/* ==========================================================================
   Wordplay: multiplayer word game
   Shares the portfolio palette: warm cream, ink black, one yellow accent.
   ========================================================================== */

:root {
  --cream: #faf2e9;
  --cream-deep: #f3e7d9;
  --white: #ffffff;
  --ink: #0e0e11;
  --ink-soft: #2a2a30;
  --muted: #5b6270;
  --line: rgba(14, 14, 17, 0.09);
  --line-strong: rgba(14, 14, 17, 0.18);
  --accent: #ffb800;
  --accent-deep: #e0a200;
  --accent-soft: #fff1c7;
  --danger: #c2410c;
  --ok: #15803d;

  --sq: #efe2d1;
  --tw: #e0634a;
  --dw: #f2a9a0;
  --tl: #3d7fc4;
  --dl: #a9cdee;

  --tile: #f7d98b;
  --tile-edge: #d9b55c;
  --tile-new: #ffe9a8;

  --radius-sm: 10px;
  --radius: 18px;
  --shadow-sm: 0 2px 8px rgba(14, 14, 17, 0.05);
  --shadow: 0 18px 40px -18px rgba(14, 14, 17, 0.22);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

body {
  font-family: var(--font);
  background: var(--cream);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input { font: inherit; color: inherit; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); }

/* ---------- Top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px clamp(16px, 4vw, 32px);
  border-bottom: 1px solid var(--line);
  background: rgba(250, 242, 233, 0.92);
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(8px);
}
.back { font-size: 0.875rem; font-weight: 600; color: var(--muted); }
.back:hover { color: var(--ink); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: -0.01em; font-size: 1rem; }
.brand-tile {
  display: inline-grid; place-items: center; width: 28px; height: 28px;
  background: var(--accent); border-radius: 7px; font-size: 0.95rem;
  box-shadow: inset 0 -3px 0 var(--accent-deep);
}
.topbar-right { display: flex; align-items: center; gap: 10px; justify-content: flex-end; min-width: 0; }
.room-pill {
  font-size: 0.8125rem; padding: 6px 12px; border-radius: 999px;
  background: var(--white); border: 1px solid var(--line-strong);
}
.room-pill strong { letter-spacing: 0.08em; }
.net { display: inline-flex; align-items: center; gap: 6px; font-size: 0.75rem; color: var(--muted); }
.net .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.net.is-bad .dot { background: var(--danger); animation: pulse 1s infinite alternate; }
@keyframes pulse { to { opacity: 0.3; } }

@media (max-width: 560px) {
  .brand span:last-child { display: none; }
  .net #net-label { display: none; }
}
/* Installed as an app: no link back to the portfolio. */
@media (display-mode: standalone) { .back { visibility: hidden; } }

main { padding: clamp(16px, 3vw, 32px) clamp(16px, 4vw, 32px) 48px; }

/* ---------- Shared bits ---------- */
.card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: clamp(18px, 3vw, 28px);
}
.screen { max-width: 520px; margin: 0 auto; display: grid; gap: 16px; }
h1 { font-size: clamp(1.6rem, 4vw, 2.1rem); line-height: 1.15; letter-spacing: -0.02em; }
h2 { font-size: 1.05rem; letter-spacing: -0.01em; }
.lede { color: var(--muted); margin-top: 8px; }
.eyebrow { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.muted { color: var(--muted); font-weight: 500; }
.hint { font-size: 0.8125rem; color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 18px; border-radius: 999px; font-weight: 700; font-size: 0.9rem;
  transition: transform 0.15s var(--ease-out), background 0.15s, opacity 0.15s;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent-deep); }
.btn-primary:not(:disabled):hover { background: #ffc21f; }
.btn-dark { background: var(--ink); color: var(--white); }
.btn-dark:hover { background: var(--ink-soft); }
.btn-ghost { background: var(--white); border: 1px solid var(--line-strong); }
.btn-ghost:not(:disabled):hover { background: var(--cream); }
.btn-link { color: var(--muted); font-weight: 600; font-size: 0.875rem; padding: 8px; }
.btn-link:hover { color: var(--ink); }
.btn-block { width: 100%; }
.btn-small { padding: 7px 12px; font-size: 0.8125rem; }

input[type="text"] {
  width: 100%; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line-strong); background: var(--white); min-width: 0;
}
input[type="text"]:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }

/* ---------- Home ---------- */
.home-card { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; font-size: 0.8125rem; font-weight: 600; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 0.8125rem; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line-strong); }
.join-row { display: flex; gap: 8px; }
#code-input { text-transform: uppercase; letter-spacing: 0.15em; font-weight: 700; }
.form-error { color: var(--danger); font-size: 0.875rem; min-height: 1.2em; }
.rules summary { font-weight: 700; cursor: pointer; }
.rules ul { margin-top: 12px; display: grid; gap: 8px; padding-left: 18px; list-style: disc; color: var(--ink-soft); font-size: 0.9rem; }

/* ---------- Lobby ---------- */
.lobby-card { display: grid; gap: 16px; text-align: center; }
.big-code { font-size: clamp(2.4rem, 10vw, 3.4rem); font-weight: 800; letter-spacing: 0.18em; line-height: 1; }
.invite { display: flex; gap: 8px; flex-wrap: wrap; }
.invite input { flex: 1 1 200px; font-size: 0.8125rem; color: var(--muted); }
.lobby-card h2 { text-align: left; margin-top: 4px; }
.lobby-players { display: grid; gap: 8px; text-align: left; }
.lobby-players li {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 12px; background: var(--cream);
}
.lobby-players .tag { margin-left: auto; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 800; font-size: 0.85rem; color: var(--ink); flex: none;
}
.host-only, .guest-only { display: grid; gap: 12px; }
body:not(.is-host) .host-only { display: none !important; }
body.is-host .guest-only { display: none !important; }

.switch { display: flex; align-items: center; gap: 10px; font-size: 0.875rem; text-align: left; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-ui {
  width: 40px; height: 24px; border-radius: 999px; background: var(--line-strong);
  position: relative; flex: none; transition: background 0.2s;
}
.switch-ui::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
  border-radius: 50%; background: var(--white); transition: transform 0.2s var(--ease-out);
  box-shadow: var(--shadow-sm);
}
.switch input:checked + .switch-ui { background: var(--accent); }
.switch input:checked + .switch-ui::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-ui { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ---------- Game layout ---------- */
.screen.game {
  max-width: 1120px;
  grid-template-columns: minmax(0, 1fr) 300px;
  align-items: start; gap: 24px;
}
@media (max-width: 900px) {
  .screen.game { grid-template-columns: minmax(0, 1fr); max-width: 640px; }
}
.game-main { display: grid; gap: 12px; min-width: 0; }
.game-side { display: grid; gap: 16px; min-width: 0; }

/* Banner and panel buttons share one row; the buttons open a sheet on demand. */
.game-top { display: flex; gap: 8px; align-items: stretch; position: relative; z-index: 31; }
.turn-banner {
  flex: 1; min-width: 0; display: grid; place-items: center;
  text-align: center; font-weight: 700; padding: 10px 14px; border-radius: 12px;
  background: var(--white); border: 1px solid var(--line); font-size: 0.9375rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.game-tools { display: flex; gap: 6px; }
.tool {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  padding: 0 12px; min-height: 44px; border-radius: 12px; background: var(--white);
  border: 1px solid var(--line); font-size: 0.8125rem; font-weight: 700; color: var(--ink-soft);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.tool svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.tool:hover { border-color: var(--line-strong); color: var(--ink); }
.tool[aria-expanded="true"] { background: var(--ink); border-color: var(--ink); color: var(--white); }
.tool .badge { position: absolute; top: -6px; right: -6px; }
@media (max-width: 640px) {
  .tool { padding: 0; width: 44px; justify-content: center; }
  .tool span:not(.badge) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}

/* Panel: bottom sheet on phones, floating card on wider screens. */
.sheet { position: fixed; inset: 0; z-index: 30; background: rgba(14, 14, 17, 0.32); display: flex; align-items: flex-end; justify-content: center; }
.sheet-panel {
  width: 100%; max-height: min(72vh, 560px); display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 12px;
  background: var(--white); border-radius: 20px 20px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow); animation: sheet-up 0.22s var(--ease-out);
}
.sheet-panel > [data-panel] { min-height: 0; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet-head h2 { font-size: 1rem; }
.sheet-close { width: 36px; height: 36px; border-radius: 50%; background: var(--cream); font-size: 1.4rem; line-height: 1; }
.sheet .log, .sheet .chat-list { max-height: none; min-height: 0; overflow-y: auto; }
.sheet .chat { grid-template-rows: minmax(0, 1fr) auto auto; min-height: 0; }
.sheet .chat-list { min-height: 160px; }
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (min-width: 901px) {
  .sheet { background: transparent; pointer-events: none; align-items: flex-start; justify-content: flex-end; padding: 160px max(16px, calc((100vw - 1120px) / 2)) 16px; }
  .sheet-panel { pointer-events: auto; width: 360px; border-radius: 18px; border: 1px solid var(--line); padding: 16px; max-height: min(70vh, 600px); }
}
@media (prefers-reduced-motion: reduce) { .sheet-panel { animation: none; } }

.chat-list li.mine { text-align: right; }
.chat-list li.sys { color: var(--muted); font-style: italic; text-align: center; }
.chat-list time { color: var(--muted); font-size: 0.7rem; margin-left: 6px; }
.chat-rules { font-size: 0.72rem; color: var(--muted); }

/* Room: game time and chat */
.schedule, .room-chat { display: grid; gap: 10px; padding-top: 16px; border-top: 1px solid var(--line); }
.schedule-when { font-weight: 700; }
.schedule-when:empty { display: none; }
.schedule-form { display: flex; flex-wrap: wrap; gap: 6px; }
.schedule-form input { flex: 1 1 200px; padding: 8px 12px; font-size: 0.875rem; }
.room-chat .chat-list { max-height: 200px; text-align: left; }
.hub-when { font-size: 0.75rem; color: var(--ink-soft); font-weight: 700; }
.turn-banner.is-you { background: var(--accent-soft); border-color: var(--accent); }

/* ---------- Board ---------- */
/* Keep the rack and buttons in view on short desktop screens. */
.board-wrap { width: 100%; max-width: max(320px, min(640px, calc(100vh - 340px))); margin: 0 auto; }
.board {
  display: grid; grid-template-columns: repeat(15, 1fr); gap: 2px;
  padding: 4px; background: var(--cream-deep); border-radius: 12px;
  border: 1px solid var(--line-strong);
  aspect-ratio: 1; width: 100%;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.sq {
  position: relative; background: var(--sq); border-radius: 3px;
  display: grid; place-items: center; aspect-ratio: 1; min-width: 0;
  font-size: clamp(0.4rem, 1.4vw, 0.62rem); font-weight: 800; color: rgba(255, 255, 255, 0.95);
  letter-spacing: -0.02em; cursor: pointer;
}
.sq.TW { background: var(--tw); }
.sq.DW { background: var(--dw); color: #7a2b20; }
.sq.TL { background: var(--tl); }
.sq.DL { background: var(--dl); color: #1f4a73; }
.sq.center { color: #7a2b20; font-size: clamp(0.7rem, 2.6vw, 1.1rem); }
.sq.is-drop { outline: 2px solid var(--ink); outline-offset: -2px; }
.sq.is-target:hover { outline: 2px dashed var(--ink); outline-offset: -2px; }

/* ---------- Tiles ---------- */
.tile {
  position: relative; width: 100%; height: 100%;
  display: grid; place-items: center;
  background: var(--tile); color: var(--ink);
  border-radius: 4px; box-shadow: inset 0 -2px 0 var(--tile-edge);
  font-weight: 800; line-height: 1;
}
.sq .tile { position: absolute; inset: 0; font-size: clamp(0.7rem, 2.7vw, 1.15rem); }
.tile .pts {
  position: absolute; right: 8%; bottom: 6%;
  font-size: 0.5em; font-weight: 700; opacity: 0.75;
}
.tile.blank .ltr { color: #8a5a00; }
.tile.is-last { background: var(--tile-new); box-shadow: inset 0 -2px 0 var(--tile-edge), 0 0 0 2px var(--accent-deep); }
.tile.is-pending {
  background: var(--white); box-shadow: inset 0 -2px 0 var(--line-strong), 0 0 0 2px var(--ink);
  cursor: grab; z-index: 1;
}
.tile.is-dragging { opacity: 0.25; }
.tile[data-tile-id] { touch-action: none; }

.rack-area { display: grid; gap: 10px; }
.rack {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px;
  max-width: 460px; width: 100%; margin: 0 auto; padding: 8px;
  background: #b98b4f; border-radius: 12px; box-shadow: inset 0 -4px 0 #9a6f38;
  min-height: 60px; touch-action: none; user-select: none; -webkit-user-select: none;
}
.rack .tile {
  aspect-ratio: 1; font-size: clamp(1.1rem, 5vw, 1.6rem); cursor: grab;
  border-radius: 7px; box-shadow: inset 0 -3px 0 var(--tile-edge);
  transition: transform 0.15s var(--ease-out);
}
.rack .slot { aspect-ratio: 1; border-radius: 7px; background: rgba(0, 0, 0, 0.08); }
.rack .tile.is-selected { transform: translateY(-6px); box-shadow: inset 0 -3px 0 var(--tile-edge), 0 0 0 3px var(--ink); }
.rack .tile.is-swap { transform: translateY(-6px); background: var(--white); box-shadow: inset 0 -3px 0 var(--line-strong), 0 0 0 3px var(--danger); }
.rack.is-drop { box-shadow: inset 0 -4px 0 #9a6f38, 0 0 0 3px var(--ink); }

.drag-ghost {
  position: fixed; z-index: 100; pointer-events: none;
  width: 48px; height: 48px; font-size: 1.4rem;
  border-radius: 7px; box-shadow: inset 0 -3px 0 var(--tile-edge), var(--shadow);
  transform: translate(-50%, -60%) rotate(-4deg);
}

.preview { text-align: center; font-size: 0.875rem; font-weight: 600; min-height: 1.3em; color: var(--muted); }
.preview.is-ok { color: var(--ok); }
.preview.is-bad { color: var(--danger); }

.controls { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; }
.controls .btn { padding: 10px 14px; }
#play-btn { min-width: 110px; }

/* ---------- Side panel ---------- */
.side-card { padding: 18px; display: grid; gap: 12px; }
.side-head { display: flex; align-items: center; justify-content: space-between; }
.bag { font-size: 0.8125rem; color: var(--muted); font-weight: 600; }
.scoreboard { display: grid; gap: 6px; }
.scoreboard li {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px;
  border: 1px solid transparent;
}
.scoreboard li.is-turn { background: var(--accent-soft); border-color: var(--accent); }
.scoreboard .who { display: grid; min-width: 0; }
.scoreboard .name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scoreboard .sub { font-size: 0.75rem; color: var(--muted); }
.scoreboard .score { margin-left: auto; font-weight: 800; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.scoreboard .offline .name { opacity: 0.5; }

.tabs { display: flex; gap: 4px; background: var(--cream); border-radius: 999px; padding: 4px; }
.tab { flex: 1; padding: 7px; border-radius: 999px; font-size: 0.8125rem; font-weight: 700; color: var(--muted); }
.tab.is-active { background: var(--white); color: var(--ink); box-shadow: var(--shadow-sm); }
.badge {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--danger); color: var(--white); font-size: 0.7rem;
}

.log, .chat-list {
  max-height: 260px; overflow-y: auto; display: grid; gap: 6px; align-content: start;
  font-size: 0.8125rem; padding-right: 4px;
}
.log li { padding: 6px 0; border-bottom: 1px solid var(--line); color: var(--ink-soft); }
.log li:last-child { border-bottom: 0; }
.log b { color: var(--ink); }
.log .pts { float: right; font-weight: 800; color: var(--ink); }
.log .sys { color: var(--muted); font-style: italic; }
.chat { display: grid; gap: 10px; }
.chat-list li { line-height: 1.4; word-wrap: break-word; }
.chat-list b { margin-right: 4px; }
.chat-form { display: flex; gap: 6px; }
.chat-form input { padding: 8px 12px; font-size: 0.875rem; }
.empty { color: var(--muted); font-size: 0.8125rem; }

/* ---------- Modals & toast ---------- */
.modal {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px;
  background: rgba(14, 14, 17, 0.45); backdrop-filter: blur(3px);
}
.modal-card {
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 24px; width: min(420px, 100%); display: grid; gap: 14px; text-align: center;
  max-height: calc(100vh - 32px); overflow-y: auto;
}
.letter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 6px; }
.letter-grid .tile { aspect-ratio: 1; font-size: 1.1rem; cursor: pointer; border-radius: 7px; }
.letter-grid .tile:hover { background: var(--accent); }
.results { display: grid; gap: 8px; text-align: left; }
.results li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--cream); }
.results li:first-child { background: var(--accent-soft); outline: 1px solid var(--accent); }
.results .score { margin-left: auto; font-weight: 800; }
.results .adj { font-size: 0.75rem; color: var(--muted); }
.modal-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 60;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--white); padding: 10px 16px; border-radius: 999px;
  font-size: 0.875rem; font-weight: 600; max-width: calc(100vw - 32px); text-align: center;
  transition: opacity 0.2s, transform 0.25s var(--ease-out);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast.is-bad { background: var(--danger); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ==========================================================================
   Accounts, home, intro, settings
   ========================================================================== */

.topbar { padding-top: max(14px, env(safe-area-inset-top)); }
.icon-btn {
  position: relative; width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; color: var(--ink-soft);
  background: var(--white); border: 1px solid var(--line);
}
.icon-btn:hover { background: var(--cream-deep); }
.icon-btn .badge { position: absolute; top: -4px; right: -4px; }
.me-chip { width: 38px; height: 38px; border-radius: 50%; overflow: hidden; padding: 0; position: relative; }
.me-chip .avatar { width: 38px; height: 38px; font-size: 0.95rem; }

.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.lg { width: 64px; height: 64px; font-size: 1.5rem; }
.avatar-wrap { position: relative; display: inline-block; flex: none; }
.online-dot { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: var(--ok); border: 2px solid var(--white); }
.lvl {
  display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 999px;
  background: var(--accent-soft); color: #7a5600; font-size: 0.7rem; font-weight: 800; white-space: nowrap;
}
code { background: var(--cream-deep); padding: 2px 6px; border-radius: 6px; font-size: 0.9em; }

/* ---------- Intro slides ----------
   Full-height on every screen: brand and step on top, the scene fills the
   middle, title and one line under it, controls pinned to the bottom. */
body[data-screen="intro"] .topbar { display: none; }
body[data-screen="intro"] main { padding-block: 0; }
.screen.intro {
  max-width: 560px; min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; gap: 12px;
  padding-block: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-bottom));
}
.intro-top { display: flex; align-items: center; justify-content: space-between; }
.intro-brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: -0.01em; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }

.slides { flex: 1; display: flex; min-height: 0; }
.slide { display: none; flex: 1; min-height: 0; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; }
.slide.is-active { display: flex; animation: slide-in 0.5s var(--ease-out); }
@keyframes slide-in { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
.art {
  position: relative; width: 100%; flex: 1 1 auto; min-height: 240px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 28px; overflow: hidden; padding: 12px 6px;
  background:
    radial-gradient(rgba(14, 14, 17, 0.05) 1.2px, transparent 1.4px) 0 0 / 22px 22px,
    radial-gradient(120% 80% at 50% 42%, #fff8e4 0%, #fdf0d6 55%, var(--cream-deep) 100%);
}
.art svg { width: 100%; height: 100%; max-height: 620px; }
.art svg { position: relative; z-index: 1; }
.confetti { position: absolute; inset: 0; pointer-events: none; }
.confetti span {
  position: absolute; width: var(--s); height: var(--s); translate: -50% -50%; rotate: var(--r);
  display: grid; place-items: center; border-radius: 6px;
  background: var(--tile); box-shadow: inset 0 -3px 0 var(--tile-edge), 0 6px 14px -8px rgba(14, 14, 17, 0.35);
  font-weight: 800; font-size: calc(var(--s) * 0.5); color: var(--ink); opacity: 0.9;
}
.confetti i { position: absolute; right: 12%; bottom: 8%; font-style: normal; font-size: 0.42em; font-weight: 700; }
.slide.is-active .confetti span { animation: drift 5s ease-in-out infinite; }
@keyframes drift { 50% { translate: -50% calc(-50% - 7px); rotate: calc(var(--r) * -1); } }
/* Only tall stages have empty bands to fill. */
@media (orientation: landscape), (max-aspect-ratio: 1/1) and (max-height: 700px) { .confetti { display: none; } }
.slide h1 { font-size: clamp(1.7rem, 6.5vw, 2.4rem); letter-spacing: -0.025em; text-wrap: balance; }
.slide .lede { margin: 0 auto; max-width: 30ch; font-size: clamp(0.95rem, 3.6vw, 1.05rem); }

.intro-nav { display: grid; gap: 18px; padding-top: 6px; }
.dots { display: flex; justify-content: center; gap: 6px; }
.dots span { width: 8px; height: 8px; border-radius: 999px; background: var(--line-strong); transition: width 0.35s var(--ease-out), background 0.35s; }
.dots span.is-on { width: 26px; background: var(--ink); }
.intro-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }
.intro-actions .btn { padding: 15px 18px; font-size: 1rem; }

/* SVG text */
.tt { font: 800 15px var(--font); fill: var(--ink); text-anchor: middle; }
.tt.s { font-size: 12px; } .tt.xs { font-size: 10px; }
.tp { font: 700 6.5px var(--font); fill: var(--ink); text-anchor: middle; }
.hub-t { font: 800 26px var(--font); fill: var(--ink); text-anchor: middle; }
.bub-t { font: 700 12px var(--font); fill: #fff; text-anchor: middle; }
.bub-t.dark { fill: var(--ink); }
.sb-name { font: 700 12px var(--font); fill: var(--ink); }
.sb-score { font: 800 16px var(--font); fill: var(--ink); text-anchor: end; font-variant-numeric: tabular-nums; }
.lv-cap { font: 800 8px var(--font); fill: #7a5600; text-anchor: middle; letter-spacing: 2px; }
.lv-num { font: 800 32px var(--font); fill: var(--ink); text-anchor: middle; }
.stat-n { font: 800 16px var(--font); fill: var(--ink); text-anchor: middle; }
.stat-l { font: 600 9px var(--font); fill: var(--muted); text-anchor: middle; }
.stat-n.start, .stat-l.start { text-anchor: start; }

/* Resting state (also what reduced-motion users see): the finished scene. */
.g0, .b0, .c1 { opacity: 0; }

/* Shared motion */
.slide.is-active .eyes { transform-box: fill-box; transform-origin: center; animation: blink 4.2s infinite; }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.1); } }
.slide.is-active .float { animation: bob 3.4s ease-in-out infinite; }
.slide.is-active .f2 { animation-delay: -1.1s; } .slide.is-active .f3 { animation-delay: -2.2s; }
@keyframes bob { 50% { translate: 0 -6px; } }
.slide.is-active .screen-glow { animation: glow 2.4s ease-in-out infinite; }
@keyframes glow { 50% { opacity: 0.7; } }

/* 1. Connect (5s loop) */
.slide.is-active .link { animation: dash 1s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -26; } }
.slide.is-active .ring-pulse { transform-box: fill-box; transform-origin: center; animation: pulse-ring 2.2s ease-out infinite; }
@keyframes pulse-ring { from { transform: scale(0.85); opacity: 0.5; } to { transform: scale(1.9); opacity: 0; } }
.slide.is-active .hub { animation: bob 3s ease-in-out infinite; }
.slide.is-active .b-left { animation: bubble-l 5s var(--ease-out) infinite; }
.slide.is-active .b-right { animation: bubble-r 5s var(--ease-out) infinite; }
@keyframes bubble-l { 0%, 6% { opacity: 0; translate: 0 10px; } 14%, 70% { opacity: 1; translate: 0 0; } 78%, 100% { opacity: 0; translate: 0 0; } }
@keyframes bubble-r { 0%, 38% { opacity: 0; translate: 0 10px; } 46%, 88% { opacity: 1; translate: 0 0; } 94%, 100% { opacity: 0; translate: 0 0; } }

/* 2. Take turns (8s loop): Ada plays CAT, it is checked and scored, then Tunde plays TON. */
.slide.is-active .tile { animation-duration: 8s; animation-iteration-count: infinite; animation-timing-function: var(--ease-out); }
.slide.is-active .t1 { animation-name: tile-1; } .slide.is-active .t2 { animation-name: tile-2; } .slide.is-active .t3 { animation-name: tile-3; }
.slide.is-active .t4 { animation-name: tile-4; } .slide.is-active .t5 { animation-name: tile-5; }
@keyframes tile-1 { 0%, 4% { opacity: 0; translate: 0 -30px; } 9%, 94% { opacity: 1; translate: 0 0; } 100% { opacity: 0; translate: 0 0; } }
@keyframes tile-2 { 0%, 9% { opacity: 0; translate: 0 -30px; } 14%, 94% { opacity: 1; translate: 0 0; } 100% { opacity: 0; translate: 0 0; } }
@keyframes tile-3 { 0%, 14% { opacity: 0; translate: 0 -30px; } 19%, 94% { opacity: 1; translate: 0 0; } 100% { opacity: 0; translate: 0 0; } }
@keyframes tile-4 { 0%, 56% { opacity: 0; translate: 0 -30px; } 61%, 94% { opacity: 1; translate: 0 0; } 100% { opacity: 0; translate: 0 0; } }
@keyframes tile-5 { 0%, 61% { opacity: 0; translate: 0 -30px; } 66%, 94% { opacity: 1; translate: 0 0; } 100% { opacity: 0; translate: 0 0; } }
.slide.is-active .c1 { animation: check-1 8s var(--ease-out) infinite; }
.slide.is-active .c2 { animation: check-2 8s var(--ease-out) infinite; }
@keyframes check-1 { 0%, 22% { opacity: 0; translate: 0 8px; } 26%, 44% { opacity: 1; translate: 0 0; } 48%, 100% { opacity: 0; translate: 0 0; } }
@keyframes check-2 { 0%, 70% { opacity: 0; translate: 0 8px; } 74%, 92% { opacity: 1; translate: 0 0; } 96%, 100% { opacity: 0; translate: 0 0; } }
.slide.is-active .g0 { animation: score-old-a 8s infinite; } .slide.is-active .g1 { animation: score-new-a 8s infinite; }
.slide.is-active .b0 { animation: score-old-b 8s infinite; } .slide.is-active .b1 { animation: score-new-b 8s infinite; }
@keyframes score-old-a { 0%, 27% { opacity: 1; } 28%, 97% { opacity: 0; } 98%, 100% { opacity: 1; } }
@keyframes score-new-a { 0%, 27% { opacity: 0; } 28%, 97% { opacity: 1; } 98%, 100% { opacity: 0; } }
@keyframes score-old-b { 0%, 75% { opacity: 1; } 76%, 97% { opacity: 0; } 98%, 100% { opacity: 1; } }
@keyframes score-new-b { 0%, 75% { opacity: 0; } 76%, 97% { opacity: 1; } 98%, 100% { opacity: 0; } }
.slide.is-active .turn-a, .slide.is-active .arrow-a { animation: turn-a 8s infinite; }
.slide.is-active .turn-b, .slide.is-active .arrow-b { animation: turn-b 8s infinite; }
@keyframes turn-a { 0%, 48% { stroke-opacity: 1; opacity: 1; } 52%, 96% { stroke-opacity: 0; opacity: 0.55; } 100% { stroke-opacity: 1; opacity: 1; } }
@keyframes turn-b { 0%, 48% { stroke-opacity: 0; opacity: 0.55; } 52%, 96% { stroke-opacity: 1; opacity: 1; } 100% { stroke-opacity: 0; opacity: 0.55; } }

/* 3. Level up */
.slide.is-active .card-in { animation: bob 4s ease-in-out infinite; }
.slide.is-active .ring { stroke-dasharray: 100; animation: ring 3.6s var(--ease-out) infinite; }
@keyframes ring { 0% { stroke-dashoffset: 100; } 60%, 100% { stroke-dashoffset: 18; } }
.slide.is-active .xp-fill { transform-box: fill-box; transform-origin: left; animation: xp 3.6s var(--ease-out) infinite; }
@keyframes xp { 0% { transform: scaleX(0.1); } 60%, 100% { transform: scaleX(0.82); } }
.slide.is-active .flame { animation: flicker 1.4s ease-in-out infinite; transform-box: fill-box; transform-origin: bottom; }
@keyframes flicker { 50% { scale: 1.06 0.94; } }
.slide.is-active .trophy { animation: bob 2.4s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  .c1, .g0, .b0 { display: none; }
}

/* ---------- Auth ---------- */
.auth-card { display: grid; gap: 16px; }
.auth-head { text-align: center; display: grid; gap: 6px; justify-items: center; }
.brand-tile.big { width: 52px; height: 52px; font-size: 1.6rem; border-radius: 13px; box-shadow: inset 0 -4px 0 var(--accent-deep); }
.btn-google { background: var(--white); border: 1px solid var(--line-strong); gap: 10px; }
.btn-google:hover { background: var(--cream); }
.seg { display: flex; background: var(--cream); padding: 4px; border-radius: 999px; gap: 4px; }
.seg-btn { flex: 1; padding: 9px 4px; border-radius: 999px; font-size: clamp(0.72rem, 3.3vw, 0.8125rem); font-weight: 700; color: var(--muted); white-space: nowrap; }
.seg-btn.is-active { background: var(--white); color: var(--ink); box-shadow: var(--shadow-sm); }
.auth-form { display: grid; gap: 12px; }
input[type="email"], input[type="password"], input[type="search"] {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: var(--white); font: inherit; color: inherit; min-width: 0;
}
input[type="email"]:focus, input[type="password"]:focus, input[type="search"]:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
input:disabled { background: var(--cream); color: var(--muted); }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 48px; }
.pw-toggle {
  position: absolute; right: 4px; top: 50%; translate: 0 -50%;
  width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: var(--muted);
}
.pw-toggle:hover { color: var(--ink); background: var(--cream); }
.pw-toggle:focus-visible { outline: 2px solid var(--accent); }
.pw-toggle .eye-closed, .pw-toggle[aria-pressed="true"] .eye-open { display: none; }
.pw-toggle[aria-pressed="true"] .eye-closed { display: block; }
.form-ok { color: var(--ink); font-size: 0.875rem; font-weight: 600; text-align: center; }
.form-ok:empty, .form-error:empty { display: none; }
.auth-form[data-mode="signin"] .signup-only, .auth-form[data-mode="magic"] .signup-only,
.auth-form[data-mode="magic"] .password-only { display: none; }

.avatar-pick { display: grid; justify-items: center; gap: 6px; }
.avatar-drop {
  width: 72px; height: 72px; border-radius: 50%; position: relative; overflow: hidden;
  background: var(--cream); border: 2px dashed var(--line-strong); display: grid; place-items: center;
}
.avatar-drop.big { width: 104px; height: 104px; }
.avatar-drop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar-plus { font-size: 1.8rem; font-weight: 300; color: var(--muted); }
.avatar-drop:has(img:not([hidden])) .avatar-plus { display: none; }
.avatar-drop:has(img:not([hidden])) { border-style: solid; border-color: var(--accent); }
.profile-card { display: grid; gap: 14px; }

/* ---------- Home ---------- */
.screen.home { max-width: 1040px; }
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.home-grid .col { display: grid; gap: 16px; min-width: 0; }
@media (max-width: 820px) { .home-grid { grid-template-columns: minmax(0, 1fr); } }
.card h2 { margin-bottom: 12px; }
.card-head { display: flex; align-items: center; justify-content: space-between; }
.count { font-size: 0.8125rem; color: var(--muted); font-weight: 600; }
.actions-card { display: grid; gap: 10px; }
.join-row { display: flex; gap: 8px; }
#code-input { text-transform: uppercase; letter-spacing: 0.15em; font-weight: 700; }

.me-card { display: grid; gap: 16px; }
.me-top { display: flex; align-items: center; gap: 14px; }
.me-top .name { font-size: 1.15rem; font-weight: 800; line-height: 1.2; }
.me-top .title { font-size: 0.8125rem; color: var(--muted); font-weight: 600; }
.xp { display: grid; gap: 6px; }
.xp-bar { height: 10px; border-radius: 999px; background: var(--cream-deep); overflow: hidden; }
.xp-bar span { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width 0.8s var(--ease-out); }
.xp-meta { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--muted); font-weight: 600; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--cream); border-radius: 12px; padding: 10px; text-align: center; }
.stat b { display: block; font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.stat span { font-size: 0.7rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }

.list { display: grid; gap: 6px; }
.list li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--cream); min-width: 0; }
.list .who { display: grid; min-width: 0; flex: 1; }
.list .who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .who small { color: var(--muted); font-size: 0.75rem; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.list .acts { display: flex; gap: 6px; flex: none; }
.list .empty { background: none; padding: 4px 0; }
.search { margin-bottom: 10px; }
.players { max-height: 420px; overflow-y: auto; }
.leaders li .rank { width: 22px; text-align: center; font-weight: 800; color: var(--muted); }
.leaders li:nth-child(1) .rank { color: var(--accent-deep); }
.status-tag { font-size: 0.7rem; font-weight: 700; color: var(--muted); }

/* ---------- Room ---------- */
.seats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; text-align: left; }
.seats li { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: var(--cream); min-width: 0; }
.seats li.empty-seat { background: none; border: 1px dashed var(--line-strong); color: var(--muted); font-size: 0.8125rem; justify-content: center; min-height: 54px; }
.seats .who { display: grid; min-width: 0; }
.seats .who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.9rem; }
.room-invite { text-align: left; }
.room-invite .players { max-height: 260px; }
#pending-wrap { text-align: left; }

/* ---------- Game additions ---------- */
.log .word { cursor: pointer; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.log .word:hover { text-decoration-color: var(--accent-deep); }
.words-panel { display: grid; gap: 10px; }
.scoreboard .avatar-wrap .online-dot { width: 10px; height: 10px; }
.scoreboard .resigned .name { text-decoration: line-through; opacity: 0.6; }

/* ---------- Modals ---------- */
.word-card { text-align: left; }
.word-head { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.word-head h2 { font-size: 1.5rem; letter-spacing: 0.04em; }
.pill { font-size: 0.75rem; font-weight: 800; padding: 4px 10px; border-radius: 999px; }
.pill.ok { background: #dcfce7; color: var(--ok); }
.pill.bad { background: #ffedd5; color: var(--danger); }
.word-phonetic { color: var(--muted); font-size: 0.875rem; margin-top: -8px; }
.word-phonetic:empty { display: none; }
.word-body { display: grid; gap: 10px; font-size: 0.9rem; max-height: 45vh; overflow-y: auto; }
.word-body h4 { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.word-body ol { list-style: decimal; padding-left: 20px; display: grid; gap: 4px; }
.word-body .ex { color: var(--muted); font-style: italic; }

.incoming { display: grid; justify-items: center; gap: 8px; }
.incoming .avatar { width: 72px; height: 72px; font-size: 1.6rem; }
.incoming p { color: var(--muted); font-size: 0.875rem; }

.settings-card { text-align: left; gap: 18px; }
.settings-card h2 { text-align: center; }
.settings-card section { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.settings-card h3 { font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.settings-row { display: flex; gap: 8px; flex-wrap: wrap; }
.settings-card .btn-small { justify-self: start; }
body:not(.signed-in) .signed-in-only { display: none; }
.install-steps { text-align: left; list-style: decimal; padding-left: 20px; display: grid; gap: 8px; }

/* ---------- Solo play, notifications, location ---------- */
.play-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 380px) { .play-row { grid-template-columns: 1fr; } }
.solo-card { text-align: left; }
.solo-card h2 { text-align: center; }
.levels { display: grid; gap: 8px; }
.level-opt {
  display: grid; gap: 2px; text-align: left; padding: 14px 16px; border-radius: 14px;
  border: 1px solid var(--line-strong); background: var(--white);
}
.level-opt:hover, .level-opt:focus-visible { border-color: var(--accent); background: var(--accent-soft); outline: none; }
.level-opt b { font-size: 1rem; }
.level-opt span { font-size: 0.8125rem; color: var(--muted); }
body.is-solo .tool[data-tab="chat"], body.is-solo [data-panel="chat"] { display: none !important; }

.notif-card { text-align: left; gap: 16px; }
.notif-card h2 { text-align: center; }
.notif-card h3 { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 8px; }
.ann-list { display: grid; gap: 8px; max-height: 50vh; overflow-y: auto; }
.ann-list li { padding: 12px 14px; border-radius: 12px; background: var(--cream); display: grid; gap: 4px; }
.ann-list li.is-new { background: var(--accent-soft); outline: 1px solid var(--accent); }
.ann-list b { font-size: 0.95rem; }
.ann-list p { font-size: 0.875rem; color: var(--ink-soft); white-space: pre-line; }
.ann-list time { font-size: 0.72rem; color: var(--muted); }
.ann-list .empty { background: none; padding: 4px 0; color: var(--muted); font-size: 0.8125rem; }
.loc { color: var(--muted); }

/* ---------- Home hub ---------- */
.screen.hub, .screen.scorecard { max-width: 720px; }
.hub-hero {
  position: relative; overflow: hidden; border-radius: 28px; padding: 22px 22px 0;
  display: grid; gap: 4px;
  background:
    radial-gradient(rgba(14, 14, 17, 0.05) 1.2px, transparent 1.4px) 0 0 / 22px 22px,
    radial-gradient(120% 90% at 50% 20%, #fff8e4 0%, #fdf0d6 60%, var(--cream-deep) 100%);
}
.hub-hello { position: relative; z-index: 1; }
.hub-hello h1 { font-size: clamp(1.5rem, 6vw, 2.1rem); letter-spacing: -0.025em; text-wrap: balance; }
.hub-sub { color: var(--muted); font-size: 0.9rem; margin-top: 2px; }
.hub-art { width: 100%; max-width: 420px; height: auto; margin: 6px auto 0; display: block; }
.hub-art .tt.s { font-size: 13px; }
.slide.is-active .float, .hub-art .float { animation: bob 3.4s ease-in-out infinite; }
.hub-art .f2 { animation-delay: -1.2s; }
.hub-art .eyes, .ti .eyes { transform-box: fill-box; transform-origin: center; animation: blink 4.2s infinite; }
.hub-wave-a { animation: sway 4s ease-in-out infinite; transform-box: fill-box; transform-origin: bottom center; }
.hub-wave-b { animation: sway 4s ease-in-out infinite reverse; transform-box: fill-box; transform-origin: bottom center; }
@keyframes sway { 50% { rotate: -2deg; } }
.hub-spark { transform-box: fill-box; transform-origin: center; animation: twinkle 2.6s ease-in-out infinite; }
@keyframes twinkle { 50% { scale: 1.25; rotate: 20deg; opacity: 0.8; } }

.tiles-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.hub-tile {
  display: grid; gap: 4px; align-content: start; text-align: left;
  padding: 16px; border-radius: 22px; min-height: 160px;
  border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s;
}
.hub-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.hub-tile:active { transform: scale(0.98); }
.hub-tile:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.hub-tile svg { width: 76px; height: 60px; margin-bottom: 6px; overflow: visible; }
.hub-tile b { font-size: 1.05rem; letter-spacing: -0.01em; }
.hub-tile span { font-size: 0.8125rem; line-height: 1.35; opacity: 0.8; }
.tone-dark { background: var(--ink); color: var(--white); border-color: var(--ink); }
.tone-accent { background: var(--accent); color: var(--ink); }
.tone-mint { background: #dff2ec; color: var(--ink); }
.tone-blush { background: #fde4dd; color: var(--ink); }
.ti .blink-light { animation: glow 1.2s ease-in-out infinite; }
.ti .bob-tile { animation: bob 2.6s ease-in-out infinite; }
.ti .pop { transform-box: fill-box; transform-origin: center bottom; animation: pop-in 3.6s var(--ease-out) infinite; }
.ti .p2 { animation-delay: 0.25s; } .ti .p3 { animation-delay: 0.5s; }
@keyframes pop-in { 0%, 8% { scale: 0.85; opacity: 0.6; } 16%, 100% { scale: 1; opacity: 1; } }
.ti .code-in { animation: type-in 3.6s var(--ease-out) infinite; }
.ti .c2 { animation-delay: 0.3s; } .ti .c3 { animation-delay: 0.6s; }
@keyframes type-in { 0%, 6% { opacity: 0; translate: 0 6px; } 14%, 86% { opacity: 1; translate: 0 0; } 100% { opacity: 0; } }
.ti .caret { animation: glow 1s steps(2) infinite; }
.ti-trophy .ring { stroke-dasharray: 100; animation: ring 3.6s var(--ease-out) infinite; }
@media (max-width: 380px) { .hub-tile { min-height: 148px; padding: 14px; } }

.list.resume li { background: var(--accent-soft); outline: 1px solid rgba(224, 162, 0, 0.35); }
.list.resume .who small b { color: var(--ok); }

/* Scorecard */
.score-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.score-head h1 { font-size: 1.4rem; }

/* Rejoin */
.rejoin-avatars { display: flex; justify-content: center; }
.rejoin-avatars .avatar { width: 52px; height: 52px; font-size: 1.2rem; border: 3px solid var(--white); margin-left: -10px; }
.rejoin-avatars .avatar:first-child { margin-left: 0; }
.dots-loader { display: flex; justify-content: center; gap: 6px; }
.dots-loader span { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-deep); animation: bob 1s ease-in-out infinite; }
.dots-loader span:nth-child(2) { animation-delay: 0.15s; } .dots-loader span:nth-child(3) { animation-delay: 0.3s; }
#code-input { text-transform: uppercase; letter-spacing: 0.2em; font-weight: 800; text-align: center; font-size: 1.3rem; }

/* ---------- Play with friends ---------- */
.screen.friends { max-width: 720px; }
.friends-intro { margin-top: -4px; }
.friends-list li { padding: 12px; }
.friends-list .avatar { width: 46px; height: 46px; font-size: 1.1rem; }
.friends-list .who b { font-size: 1rem; }
.friends-list .place { display: flex; align-items: center; gap: 4px; color: var(--ink-soft); font-size: 0.8125rem; font-weight: 600; }
.friends-list .place svg { flex: none; color: var(--accent-deep); }
.friends-list .place.none { color: var(--muted); font-weight: 500; }
.friends-room { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.friends-room h2 { margin-bottom: 4px; }

/* Blocked chat message warning */
.warn-icon { width: 48px; height: 48px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; background: #ffedd5; color: var(--danger); font-weight: 800; font-size: 1.5rem; }
#warn-modal .modal-card { text-align: center; }
#warn-text { color: var(--ink-soft); }
