/* ================= Splash ================= */
.splash {
  justify-content: center;
  align-items: center;
  gap: 12px;
  text-align: center;
}
.splash-mark { margin-bottom: 8px; animation: popIn .55s var(--ease) both; }
.splash-title { font-size: 32px; font-weight: 700; letter-spacing: -.4px; }
.splash-sub { font-size: 14px; color: var(--muted); }
.splash-dots { display: flex; gap: 6px; margin-top: 10px; }
.splash-dots i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold); opacity: .25;
  animation: pulse 1.1s infinite ease-in-out;
}
.splash-dots i:nth-child(2) { animation-delay: .16s; }
.splash-dots i:nth-child(3) { animation-delay: .32s; }
@keyframes pulse { 0%, 100% { opacity: .22; transform: scale(.9); } 50% { opacity: 1; transform: scale(1.15); } }
.splash-foot { position: absolute; bottom: calc(26px + env(safe-area-inset-bottom)); font-size: 11px; color: #4B5468; }

/* ================= Onboarding ================= */
.onb { padding: 0 var(--pad) calc(28px + env(safe-area-inset-bottom)); gap: 0; }
.onb-top {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-height: 48px;
  padding-top: calc(10px + env(safe-area-inset-top));
}
.onb-skip { font-size: 15px; font-weight: 600; color: var(--gold-text); padding: 8px 2px; }
.onb-art { position: relative; display: grid; place-items: center; height: 288px; margin-top: 4px; }
.onb-ring {
  position: absolute;
  width: 248px; height: 248px;
  border-radius: 50%;
  border: 1px dashed #373022;
}
.onb-ring::after {
  content: "";
  position: absolute; inset: 34px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(228, 176, 74, .09), transparent 68%);
}
.onb-tile-wrap { position: relative; z-index: 1; }
.onb-chip {
  position: absolute;
  z-index: 2;
  inset-inline-start: 18px;
  top: 22px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  background: #27241C;
  border: 1px solid #5E4E2F;
  color: var(--gold-text);
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .4);
}
.onb-chip i { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.onb-code {
  width: 156px;
  padding: 16px 14px;
  border-radius: 20px;
  background: linear-gradient(180deg, #17203A, #121828);
  border: 1px solid #3B4664;
  display: grid;
  gap: 6px;
  transform: rotate(-3deg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, .5);
}
.onb-code small { font-size: 10px; color: var(--muted); }
.onb-code b {
  font-family: var(--font-code);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: .12em;
  color: var(--gold-code);
  line-height: 1.1;
}
.onb-code span { display: flex; gap: 3px; }
.onb-code span i { flex: 1; height: 3px; border-radius: 2px; background: #2A3145; }
.onb-code span i.on { background: var(--gold); }
.onb-body { display: grid; gap: 10px; text-align: center; margin-top: 6px; }
.onb-title { font-size: 30px; line-height: 1.24; font-weight: 700; letter-spacing: -.3px; }
.onb-text { font-size: 16px; line-height: 1.65; color: #C8CEDA; }
.onb-dots { display: flex; justify-content: center; align-items: center; gap: 7px; margin-top: 20px; }
.onb-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--inactive); transition: all var(--speed) var(--ease); }
.onb-dots i.is-on { width: 22px; border-radius: 4px; background: var(--gold); }
.onb-actions { display: grid; gap: 4px; margin-top: auto; padding-top: 24px; }
.onb-direct { height: 46px; font-size: 15px; font-weight: 500; color: #C7CEDC; }

/* ================= Login ================= */
.login { justify-content: center; gap: 18px; padding-top: calc(30px + env(safe-area-inset-top)); }
.login-head { display: grid; gap: 8px; justify-items: center; text-align: center; }
.login-title { font-size: 26px; font-weight: 700; }
.login-sub { font-size: 13px; color: var(--muted); line-height: 1.6; max-width: 280px; }
.avatar-picker { display: grid; justify-items: center; gap: 12px; }
.avatar-edit {
  position: absolute;
  inset-inline-end: -4px;
  bottom: -4px;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: #1B1D22;
  border: 1px solid var(--gold-border);
  color: var(--gold-text);
}
.swatches { display: flex; gap: 10px; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; transition: all var(--speed); }
.swatch.is-on { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(228, 176, 74, .18); }
.login-form { display: grid; gap: 13px; }

/* ================= Home ================= */
.home { gap: 16px; }
.home-hdr { display: flex; align-items: center; gap: 12px; padding-top: calc(12px + env(safe-area-inset-top)); }
.home-greet { font-size: 20px; font-weight: 700; line-height: 1.3; }
.home-greet-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.home-hero {
  height: 255px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.home-hero::after {
  content: "";
  position: absolute;
  inset-inline-start: -40px;
  top: -60px;
  width: 210px; height: 210px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(228, 176, 74, .13), transparent 70%);
  pointer-events: none;
}
.home-hero .tiles { display: flex; gap: 8px; }
.home-hero h2 { font-size: 30px; line-height: 1.16; font-weight: 700; letter-spacing: -.4px; margin-top: 15px; }
.home-hero p { font-size: 15px; line-height: 1.6; color: var(--text-2); margin-top: 8px; max-width: 270px; }
.home-hero .btn { margin-top: auto; height: 61px; position: relative; z-index: 1; }

.home-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.quick {
  height: 138px;
  padding: 14px;
  border-radius: 24px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: start;
  transition: transform var(--speed) var(--ease), border-color var(--speed);
}
.quick:active { transform: translateY(1px); border-color: #3B3F48; }
.quick-ico {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: #2F2B24;
  color: var(--gold-text);
}
.quick-ico--green { background: #183031; color: #6FD3AB; }
.quick b { font-size: 15px; font-weight: 600; margin-top: auto; }
.quick small { font-size: 11px; color: var(--muted); margin-top: 3px; }

.home-last {
  height: 78px;
  width: 100%;
  padding: 0 14px;
  border-radius: 22px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: start;
}
.home-last .meta { flex: 1; min-width: 0; }
.home-last .meta b { display: block; font-size: 15px; font-weight: 600; }
.home-last .meta small { display: block; font-size: 11px; margin-top: 2px; }
.home-last .score { font-size: 20px; font-weight: 700; color: var(--gold); }
.home-empty {
  padding: 18px;
  border-radius: 22px;
  border: 1px dashed #33373F;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  background: rgba(255, 255, 255, .012);
}
.guest-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px 11px 14px;
  border-radius: 18px;
  background: #14171F;
  border: 1px solid var(--gold-border-2);
}
.guest-banner p { flex: 1; font-size: 12px; line-height: 1.5; color: var(--text-2); }
.guest-banner .btn { height: 38px; padding: 0 16px; font-size: 13px; border-radius: 12px; flex: none; }

/* ================= Modes ================= */
.modes { gap: 13px; }
.mode-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 17px;
  border-radius: 22px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  text-align: start;
  transition: transform var(--speed) var(--ease), border-color var(--speed);
}
.mode-card:active { transform: translateY(1px); }
.mode-card.is-blue { border-color: #2A3A50; }
.mode-card.is-gold { border-color: var(--gold-border-3); }
.mode-ico {
  width: 48px; height: 48px;
  flex: none;
  display: grid; place-items: center;
  border-radius: 14px;
  background: #27241C;
  color: var(--gold-text);
}
.mode-card.is-blue .mode-ico { background: #1C2A3E; color: var(--info); }
.mode-card h3 { font-size: 17px; font-weight: 600; }
.mode-card p { font-size: 13px; line-height: 1.55; color: var(--muted); margin-top: 3px; }
.chev { color: var(--muted); flex: none; }

/* ================= Room setup ================= */
.setup { gap: 14px; }
.setup-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.setup-head b { font-size: 22px; font-weight: 700; }
.setup-head span { font-size: 13px; font-weight: 600; color: var(--gold-text); }
.setup-card {
  background: var(--surface-4);
  border: 1px solid var(--border);
  border-radius: 22px;
  overflow: hidden;
}
.opt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 68px;
  padding: 13px 15px;
}
.opt-row + .opt-row { border-top: 1px solid #26282E; }
.opt-row .lbl { display: grid; gap: 2px; min-width: 0; }
.opt-row .lbl b { font-size: 14px; font-weight: 500; color: var(--text); }
.opt-row .lbl small { font-size: 11px; }
.setup-block { display: grid; gap: 10px; }
.setup-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}
.setup-label b { font-size: 15px; font-weight: 600; color: var(--text); }
.setup-label .count { font-size: 12px; color: var(--gold-text); font-weight: 600; }
.cat-grid .chip svg { opacity: .8; }
.cat-grid .chip.is-on svg { opacity: 1; color: var(--gold-text); }

/* ================= Lobby ================= */
.lobby { gap: 14px; }
.lobby-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.lobby-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 11px;
  border-radius: var(--r-pill);
  background: #27241C;
  border: 1px solid var(--gold-border-2);
  color: var(--gold-text);
  font-size: 12px;
  font-weight: 600;
}
.lobby-badge i { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px rgba(63, 214, 168, .8); }
.code-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, var(--hero-a), var(--hero-b));
  border: 1px solid var(--hero-border);
}
.code-val { flex: 1; min-width: 0; text-align: center; }
.code-val small { display: block; font-size: 11px; color: var(--muted); }
.code-val b {
  display: block;
  margin-top: 2px;
  font-family: var(--font-code);
  font-size: 42px;
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: .12em;
  color: var(--gold-code);
}
.code-actions { display: flex; flex-direction: column; gap: 8px; flex: none; }
.code-actions .btn { height: 44px; border-radius: 13px; font-size: 13px; padding: 0 10px; gap: 5px; }
.code-actions .btn:first-child { width: 84px; }
.code-actions .btn:last-child { width: 66px; }

.players-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.player-card {
  height: 69px;
  padding: 0 10px;
  border-radius: 18px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 9px;
  text-align: start;
}
.player-card .who { min-width: 0; }
.player-card b { display: block; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-card small { display: block; font-size: 10px; color: #8F96A9; margin-top: 1px; }
.player-card.is-ready small { color: #6FD3AB; }
.player-card.is-me { border-color: var(--gold-border-3); background: #1D1C19; }
.player-card.is-empty {
  justify-content: center;
  gap: 6px;
  border-style: dashed;
  color: var(--muted);
  font-size: 13px;
  background: transparent;
}
.lobby-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.lobby-link { font-size: 13px; font-weight: 500; color: var(--text-2); text-align: center; padding: 6px; }
.lobby-link b { color: var(--gold-text); font-weight: 600; }

/* ================= Game ================= */
.game {
  padding-inline: var(--pad-tight);
  gap: 6px;
  padding-bottom: calc(104px + env(safe-area-inset-bottom));
}
.game-hdr {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: calc(8px + env(safe-area-inset-top));
}
.game-hdr-main { flex: 1; min-width: 0; }
.game-round { font-size: 17px; font-weight: 700; line-height: 1.3; }
.game-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.letter-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 27px;
  padding: 0 11px;
  flex: none;
  border-radius: var(--r-pill);
  background: #312A1E;
  border: 1px solid var(--gold-text);
  color: var(--gold-text);
  font-size: 12px;
  font-weight: 600;
}
.game-stage {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 10px 0 6px;
}
.game-count { display: grid; gap: 1px; }
.game-count small { font-size: 11px; color: var(--muted); }
.game-count b { font-size: 17px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.game-count b em { font-style: normal; color: var(--muted); font-weight: 500; font-size: 13px; }

.answers { display: grid; gap: 10px; align-content: start; flex: 1; }
.ans-row {
  display: grid;
  grid-template-columns: 31px 1fr 14px;
  align-items: center;
  gap: 10px;
  min-height: 61px;
  padding: 8px 12px;
  border-radius: 20px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  transition: border-color var(--speed), background var(--speed);
}
.ans-row.is-valid { border-color: var(--ok-border); background: #172A27; }
.ans-row.is-invalid { border-color: #5A3540; background: #241C24; }
.ans-row .tile-field { transition: background var(--speed), color var(--speed); }
.ans-body { display: grid; gap: 0; min-width: 0; }
.ans-cat { font-size: 13px; line-height: 1.35; color: var(--muted); }
.answer-input {
  width: 100%;
  padding: 0;
  background: none;
  border: 0;
  outline: none;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--text);
}
.answer-input::placeholder { font-size: 16px; font-weight: 400; color: var(--placeholder); }
.answer-mark { font-size: 13px; font-weight: 700; color: var(--ok); text-align: center; }
.ans-row.is-invalid .answer-mark { color: var(--bad); }
.ai-live {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 11px;
  color: var(--info);
  padding: 2px 0 0;
}
.ai-live .dots { display: inline-flex; gap: 3px; }
.ai-live .dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--info); animation: pulse 1s infinite; }
.ai-live .dots i:nth-child(2) { animation-delay: .15s; }
.ai-live .dots i:nth-child(3) { animation-delay: .3s; }

.game-foot {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 20;
  max-width: var(--app-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px var(--pad-tight) calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(7, 11, 20, 0), rgba(7, 11, 20, .94) 30%, #070B14 66%);
}
.game-foot .btn { flex: 1; height: 61px; font-size: 19px; }
.foot-progress { display: grid; gap: 5px; justify-items: center; min-width: 54px; flex: none; }
.foot-progress small { font-size: 11px; line-height: 1.2; color: var(--muted); white-space: nowrap; }
.foot-dots { display: flex; gap: 3px; }
.foot-dots i { width: 6px; height: 6px; border-radius: 50%; background: #31353C; transition: background var(--speed); }
.foot-dots i.is-on { background: var(--gold); }

/* ================= Round reveal ================= */
.reveal {
  padding-inline: var(--pad-tight);
  gap: 12px;
  padding-bottom: calc(112px + env(safe-area-inset-bottom));
}
.rev-hdr {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding-top: calc(10px + env(safe-area-inset-top));
}
.rev-hdr-main { flex: 1; min-width: 0; }
.rev-title { font-size: 20px; font-weight: 700; line-height: 1.3; }
.rev-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.rev-step { font-size: 13px; font-weight: 700; color: var(--gold-text); white-space: nowrap; padding-top: 4px; }
.seg-track { margin-top: 2px; }

.cat-card {
  padding: 14px;
  border-radius: 24px;
  background: linear-gradient(180deg, #131B2C 0%, #101725 100%);
  border: 1px solid var(--gold-border-3);
}
.cat-top { display: flex; align-items: center; gap: 12px; }
.cat-top .cat-name { flex: 1; min-width: 0; }
.cat-top h3 { font-size: 24px; font-weight: 700; line-height: 1.15; }
.cat-top small { font-size: 11px; color: var(--muted); display: block; margin-top: 3px; }
.cat-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }

.res-list { display: grid; gap: 8px; }
.res-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 9px 12px;
  border-radius: 22px;
  background: var(--surface-2);
  border: 1px solid transparent;
}
.res-row.has-sub { min-height: 67px; }
.res-row.is-me { background: #1D1C19; border-color: var(--gold-border-3); }
.res-main { flex: 1; min-width: 0; }
.res-name { font-size: 11px; color: var(--muted); line-height: 1.2; }
.res-word {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.res-word.is-empty { color: var(--placeholder); font-weight: 400; }
.res-sub { font-size: 11px; color: var(--muted); margin-top: 1px; }
.res-badge { flex: none; height: 26px; font-size: 11px; padding: 0 9px; }

.duel-card { padding: 14px; }
.duel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.duel-head b { font-size: 13px; font-weight: 600; color: var(--text-2); }
.duel-pill { height: 22px; padding: 0 9px; font-size: 11px; }
.duel-sides { display: grid; gap: 8px; margin-top: 11px; }
.duel-line { display: flex; align-items: center; gap: 8px; }
.duel-line .who { font-size: 11px; color: var(--muted); width: 46px; flex: none; }
.duel-bar { flex: 1; height: 6px; border-radius: 3px; background: var(--review-track); overflow: hidden; }
.duel-bar i { display: block; height: 100%; border-radius: 3px; transition: width .4s var(--ease); }
.duel-bar.me i { background: #F2CC7C; }
.duel-bar.ai i { background: var(--review-bar); }
.duel-val { font-size: 20px; font-weight: 700; color: var(--gold); min-width: 34px; text-align: end; }

.rev-foot {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 20;
  max-width: var(--app-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px var(--pad-tight) calc(14px + env(safe-area-inset-bottom));
  background: #080C14;
  border-top: 1px solid #1E2128;
}
.rev-foot .btn { flex: 1; height: 61px; font-size: 18px; max-width: 278px; }
.rev-totals { display: grid; gap: 2px; min-width: 62px; }
.rev-totals span { font-size: 10px; color: var(--muted); line-height: 1.25; }
.rev-totals b { font-size: 13px; font-weight: 700; color: var(--text); }

/* ================= Final results ================= */
.results { gap: 14px; padding-bottom: calc(150px + env(safe-area-inset-bottom)); }
.res-top {
  display: grid;
  gap: 7px;
  justify-items: center;
  text-align: center;
  padding-top: calc(14px + env(safe-area-inset-top));
}
.res-top h1 { font-size: 27px; font-weight: 700; }
.res-top p { font-size: 12px; color: var(--muted); }

.podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  height: 196px;
  padding-top: 20px;
}
.podium-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  min-width: 0;
}
.podium-name {
  font-size: 13px;
  font-weight: 600;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.podium-bar {
  width: 100%;
  border-radius: 16px 16px 6px 6px;
  display: grid;
  place-items: center;
  font-size: 17px;
  font-weight: 700;
  background: #191B20;
  border: 1px solid var(--border);
}
.podium-col.p1 .podium-bar { height: 116px; background: linear-gradient(180deg, #3B2E16, #241E12); border-color: #6A5629; color: var(--gold-text); }
.podium-col.p2 .podium-bar { height: 86px; background: linear-gradient(180deg, #262A33, #1A1D24); border-color: #3B4150; color: var(--text-2); }
.podium-col.p3 .podium-bar { height: 68px; background: linear-gradient(180deg, #2A2119, #1D1812); border-color: #4A3A28; color: #C9A98A; }

.awards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.award {
  padding: 13px;
  border-radius: 18px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: grid;
  gap: 4px;
}
.award small { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); }
.award b { font-size: 15px; font-weight: 600; }

.rank-list { display: grid; gap: 8px; }
.rank-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 9px 12px;
  border-radius: 20px;
  background: var(--surface-2);
  border: 1px solid transparent;
}
.rank-row.is-me { background: #1D1C19; border-color: var(--gold-border-3); }
.rank-num { width: 20px; text-align: center; font-size: 13px; font-weight: 700; color: var(--muted); }
.rank-row.is-me .rank-num { color: var(--gold); }

/* ================= Profile ================= */
.profile { gap: 14px; }
.prof-head { display: grid; justify-items: center; gap: 9px; padding: 6px 0 2px; }
.prof-name { font-size: 22px; font-weight: 700; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat {
  padding: 14px 8px;
  border-radius: 18px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: grid;
  gap: 2px;
  justify-items: center;
  text-align: center;
}
.stat b { font-size: 20px; font-weight: 700; }
.stat small { font-size: 11px; }
.row-list {
  background: var(--surface-4);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
}
.row-list > * + * { border-top: 1px solid #26282E; }
.list-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; min-height: 56px; }
.list-row .body { flex: 1; min-width: 0; }
.list-row b { font-size: 14px; font-weight: 600; display: block; }
.list-row small { font-size: 11px; display: block; margin-top: 1px; }
.badge-list { display: flex; flex-wrap: wrap; gap: 8px; }

/* ================= Settings ================= */
.settings { gap: 14px; }
.set-group { background: var(--surface-4); border: 1px solid var(--border); border-radius: 20px; overflow: hidden; }
.set-group > * + * { border-top: 1px solid #26282E; }
.set-row { display: flex; align-items: center; gap: 12px; padding: 13px 14px; cursor: pointer; }
.set-row.static { cursor: default; }
.s-ico { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 11px; background: #1B1D22; color: var(--gold-text); }
.s-body { flex: 1; min-width: 0; }
.s-body b { font-size: 14px; font-weight: 600; display: block; }
.s-body small { font-size: 11px; display: block; margin-top: 1px; }

/* ================= Join ================= */
.join { gap: 16px; }
.join-badge { display: grid; justify-items: center; gap: 12px; margin-top: 4px; }
.join-mark {
  width: 72px; height: 72px;
  display: grid; place-items: center;
  border-radius: 22px;
  background: #27241C;
  border: 1px solid var(--gold-border-2);
  color: var(--gold-text);
}
.join-form { display: grid; gap: 12px; }
.player-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.player-row .name { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; }
.player-row .name small { display: block; font-size: 11px; font-weight: 400; margin-top: 1px; }
.players-list { display: grid; gap: 8px; }

/* ================= 404 ================= */
.notfound {
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 12px;
}
.notfound .tile { margin-bottom: 8px; }

/* ================= Small utilities ================= */
.stack-8 { display: grid; gap: 8px; }
.stack-12 { display: grid; gap: 12px; }
.stack-16 { display: grid; gap: 16px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.center { text-align: center; }
.mono { font-family: var(--font-code); letter-spacing: .12em; }

/* ================= Compatibility aliases ================= */
.setup { padding-bottom: calc(122px + env(safe-area-inset-bottom)); }
.profile-head { display: grid; justify-items: center; gap: 9px; padding: 6px 0 2px; }
.profile-name { font-size: 22px; font-weight: 700; }
.profile-level { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--gold-text); }
.stat-box {
  padding: 14px 8px;
  border-radius: 18px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: grid;
  gap: 2px;
  justify-items: center;
  text-align: center;
}
.stat-box b { font-size: 20px; font-weight: 700; }
.stat-box small { font-size: 11px; }
.history-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  background: var(--surface-4);
  border: 1px solid var(--border);
  border-radius: 16px;
}
.h-meta { flex: 1; min-width: 0; }
.h-meta b { font-size: 14px; display: block; }
.h-meta small { font-size: 11px; display: block; }
.empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
  padding: 26px 18px;
  border-radius: 20px;
  border: 1px dashed #33373F;
  color: var(--muted);
}
.empty b { font-size: 15px; color: var(--text); }
.empty p { font-size: 12px; max-width: 260px; line-height: 1.6; }
.board-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 9px 12px;
  border-radius: 18px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.board-row.is-me { background: #1D1C19; border-color: var(--gold-border-3); }
.b-meta { flex: 1; min-width: 0; }
.b-meta b { font-size: 14px; display: block; }
.b-meta small { font-size: 11px; display: block; }
.b-score { font-size: 13px; font-weight: 700; color: var(--gold-text); }
.board-tabs { display: flex; }

/* ---------- Fine tuning against 390pt ---------- */
.opt-row { flex-wrap: wrap; }
.opt-row .segmented { padding: 3px; flex: none; }
.opt-row .segmented button { min-width: 38px; height: 32px; padding: 0 9px; font-size: 13px; }
.code-actions .btn { font-size: 12px; padding: 0 6px; letter-spacing: -0.1px; }
.tabbar button span { line-height: 1; }
.game-count b { white-space: nowrap; }
.rev-totals span { white-space: nowrap; }
.res-badge { white-space: nowrap; }
.duel-head b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
