:root {
  --brand: #0f766e;
  --brand2: #0d9488;
  --mint: #f0fdfa;
  --mint2: #ecfdf5;
  --card: #ffffff;
  --stroke: #ccfbf1;
  --stroke2: #99f6e4;
  --text: #0f172a;
  --muted: #475569;
  --faint: #94a3b8;
  --gold: #d97706;
  --red: #e53935;
  --yellow: #ffd100;
  --green: #009739;
  --blue: #0057b8;
  --danger: #dc2626;
  --ok: #059669;
  --dark: #07111f;
  --radius: 18px;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  font-family: Outfit, Inter, ui-sans-serif, system-ui, sans-serif;
  background: linear-gradient(#f0fdfa, #ecfdf5, #e6fffa);
  color: var(--text);
}
body { min-height: 100dvh; }
@media (display-mode: standalone), (display-mode: fullscreen), (display-mode: minimal-ui) {
  html, body {
    background: #f0fdfa;
    overscroll-behavior: none;
    min-height: 100dvh;
    min-height: -webkit-fill-available;
  }
  body { padding-top: env(safe-area-inset-top); }
  #install-bar, #ios-tip { display: none !important; }
  .screen { padding-top: calc(16px + env(safe-area-inset-top, 0px)); }
  .play-wrap .topbar { padding-top: calc(10px + env(safe-area-inset-top, 0px)); }
  .play-wrap { background: #07111f; }
}
html.kb-app body {
  padding-top: env(safe-area-inset-top);
  overscroll-behavior: none;
}
html.kb-app, html.kb-app body {
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
}
html.kb-app input, html.kb-app textarea, html.kb-app [contenteditable] {
  -webkit-user-select: text;
  user-select: text;
}
html.kb-app #install-bar, html.kb-app #ios-tip { display: none !important; }
html.kb-app .screen { padding-top: calc(16px + env(safe-area-inset-top, 0px)); }
html.kb-app .play-wrap .topbar { padding-top: calc(10px + env(safe-area-inset-top, 0px)); }
.hidden { display: none !important; }
button, input, select { font: inherit; }
button { cursor: pointer; }

.app-toast {
  position: fixed;
  left: 50%;
  bottom: 88px;
  transform: translateX(-50%);
  z-index: 80;
  background: #0f172a;
  color: #fff;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: .9rem;
  max-width: 90vw;
}
.app-toast.err { background: var(--danger); }

#recaptcha-container {
  position: fixed;
  right: 8px;
  bottom: 8px;
  z-index: 90;
}

.screen { min-height: 100dvh; padding: 16px; padding-bottom: calc(16px + env(safe-area-inset-bottom)); overflow-y: auto; }
.center-col {
  max-width: 420px;
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

.brand-head { text-align: center; padding-top: 12px; }
.brand-head img { width: 72px; height: 72px; border-radius: 18px; }
.brand-head h1 { margin: 10px 0 4px; font-size: 1.45rem; }
.brand-head p { margin: 0; color: var(--muted); }

.panel {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 22px;
  padding: 18px;
}
.panel h2 { margin: 0 0 6px; }
.lead { margin: 0 0 14px; color: var(--muted); font-size: .92rem; }

.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field label { font-size: .78rem; color: var(--muted); font-weight: 600; }
.field input, .field select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--stroke2);
  background: var(--mint);
  color: var(--text);
}
.phone-row {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--stroke2);
  border-radius: 14px;
  overflow: hidden;
  background: var(--mint);
}
.phone-row span {
  display: grid;
  place-items: center;
  padding: 0 12px;
  font-weight: 800;
  color: var(--brand);
  border-right: 1px solid var(--stroke2);
  white-space: nowrap;
}
.phone-row input {
  border: 0 !important;
  border-radius: 0 !important;
  flex: 1;
}
.otp-input {
  text-align: center;
  letter-spacing: .4em;
  font-weight: 800;
  font-size: 1.35rem;
}

.btn {
  border: 0;
  border-radius: 14px;
  padding: 13px 16px;
  width: 100%;
  font-weight: 800;
  background: linear-gradient(90deg, var(--brand), var(--brand2));
  color: #fff;
}
.btn:disabled { opacity: .5; }
.btn.ghost {
  background: transparent;
  color: var(--brand);
  border: 1px solid var(--stroke2);
}
.btn.gold { background: var(--gold); color: #fff; }
.btn.ai {
  margin-top: 10px;
  background: #0f172a;
  color: #fff;
}
.or {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--faint);
  font-size: .75rem;
  font-weight: 700;
  margin: 12px 0;
}
.or:before, .or:after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--stroke);
}
#google-btn { display: flex; justify-content: center; min-height: 44px; }
.hint-box {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #ecfeff;
  color: var(--muted);
  font-size: .8rem;
  border: 1px solid var(--stroke);
}
.linkish { background: none; border: 0; color: var(--brand2); font-weight: 700; padding: 8px; width: auto; }

.banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #fff;
  color: #07111f;
  border-radius: 16px;
  padding: 10px 14px;
  margin: 8px auto;
  max-width: 1120px;
  border: 1px solid var(--stroke);
}
.banner:not(.hidden) { display: flex; }
@media (min-width: 900px) {
  .banner:not(.hidden) { display: none !important; }
}

.shell {
  width: min(1120px, calc(100% - 24px));
  margin: 0 auto;
  padding: 16px 0 110px;
}
@media (min-width: 900px) {
  .shell { padding: 28px 0 48px; }
}
.hello {
  margin: 18px 4px 6px;
  font-size: clamp(1.35rem, 3vw, 2rem);
  font-weight: 800;
}
.hello span { color: var(--brand); }
.subhead {
  margin: 0 4px 16px;
  color: var(--muted);
  font-size: clamp(.9rem, 2vw, 1.05rem);
}
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--stroke);
  border-radius: 22px;
  padding: 14px 16px;
}
.avatar { width: 48px; height: 48px; }
@media (min-width: 900px) {
  .avatar { width: 56px; height: 56px; }
  .who b { font-size: 1.15rem; }
  .bal { font-size: 1.15rem; padding: 10px 16px; }
}

.games {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}
@media (min-width: 700px) {
  .games { gap: 14px; }
}
@media (min-width: 1024px) {
  .games { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
}
.game {
  aspect-ratio: 1 / 1.04;
  min-height: 0;
  border: 0;
  padding: 0;
  border-radius: 18px;
  overflow: hidden;
  position: relative;
  background: #0f766e;
  border: 1px solid var(--stroke2);
  text-align: left;
  box-shadow: 0 10px 24px rgba(15, 118, 110, .14);
}
.game img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.game span {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 28px 12px 10px;
  font-size: .92rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,.78));
}
@media (min-width: 900px) {
  .game { border-radius: 22px; }
  .game span { font-size: 1.12rem; padding: 36px 16px 14px; }
}
.quick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}
@media (min-width: 900px) {
  .quick { grid-template-columns: repeat(3, 1fr); gap: 16px; }
}
.quick button {
  background: #fff;
  border: 1px solid var(--stroke);
  border-radius: 20px;
  padding: 18px;
  text-align: left;
  font-weight: 800;
  font-size: 1rem;
}
.quick button small { display: block; font-weight: 500; color: var(--muted); margin-top: 4px; }

.nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  padding: 6px 8px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid rgba(204, 251, 241, .95);
  box-shadow: 0 -10px 28px rgba(15, 118, 110, .08);
}
.nav button {
  appearance: none;
  background: none;
  border: 0;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .01em;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 4px 2px 2px;
  min-height: 56px;
  border-radius: 16px;
}
.nav-ico {
  width: 48px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 16px;
}
.nav-ico svg { width: 24px; height: 24px; display: block; }
.nav-ico .in { display: none; }
.nav button.on {
  color: var(--brand);
  font-weight: 700;
}
.nav button.on .nav-ico {
  background: rgba(15, 118, 110, .14);
}
.nav button.on .out { display: none; }
.nav button.on .in { display: block; }
@media (min-width: 900px) {
  .nav {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(620px, calc(100% - 24px));
    bottom: 14px;
    border: 1px solid var(--stroke);
    border-radius: 28px;
    padding: 8px 10px;
    box-shadow: 0 12px 40px rgba(15, 23, 42, .12);
  }
  .shell { padding-bottom: 110px; }
}
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--brand); color: #fff;
  display: grid; place-items: center; font-weight: 800;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.who b { display: block; }
.who span { color: var(--muted); font-size: .8rem; }
.bal {
  background: var(--mint);
  border: 1px solid var(--stroke2);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 800;
  color: var(--brand);
}

.tx { display: grid; gap: 8px; }
.tx > div {
  background: #fff;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  font-size: .9rem;
}

/* Ludo board (dark play surface) */
.play-wrap { background: var(--dark); color: #f4f7fb; min-height: 100dvh; padding: 12px; padding-bottom: 24px; }
.play-wrap .topbar {
  display: flex; justify-content: space-between; align-items: center;
  background: #10233c; border: 1px solid #1d3a5c; border-radius: 16px; padding: 10px 12px; margin-bottom: 12px;
}
.play-wrap .btn { width: auto; padding: 10px 14px; }
.layout { display: grid; grid-template-columns: minmax(0,1fr) 280px; gap: 12px; }
@media (max-width: 860px) { .layout { grid-template-columns: 1fr; } }
.board-wrap { position: relative; background: #10233c; border: 1px solid #1d3a5c; border-radius: 16px; padding: 10px; display: grid; place-items: center; overflow: visible; }
.board {
  width: min(100%, 72vh, 640px);
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  grid-template-rows: repeat(15, 1fr);
  gap: 1px;
  background: #1a1a1a;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  touch-action: manipulation;
}
.cell { position: relative; background: #f7f4ee; }
.cell.void { background: #0b1220; }
.cell.red { background: var(--red); }
.cell.yellow { background: var(--yellow); }
.cell.green { background: var(--green); }
.cell.blue { background: var(--blue); }
.cell.center { background: #111; }
.cell.safe::after {
  content: "";
  position: absolute; inset: 28%;
  background: #fff7d6; border-radius: 2px; pointer-events: none;
}
.token {
  position: absolute; width: 70%; height: 70%; left: 15%; top: 15%;
  border-radius: 50%; z-index: 2; border: 2px solid #111;
}
.panel-dark { display: grid; gap: 10px; }
.panel-dark .card { background: #10233c; border: 1px solid #1d3a5c; border-radius: 16px; padding: 12px; }
.player { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 12px; border: 1px solid #1d3a5c; }
.player > div { display: grid; }
.player.active { border-color: #14b8a6; background: #0d2a32; }
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot.red { background: var(--red); }
.dot.yellow { background: var(--yellow); }
.dot.white { background: #f8fafc; border: 1px solid #111; }
.dot.black { background: #111; }
.dot.X, .dot.teal { background: #0d9488; }
.dot.O, .dot.gold { background: #d97706; }
.dot.blue { background: #38bdf8; }
.dice { width: 72px; height: 72px; border-radius: 14px; background: #fff; color: #111; display: grid; place-items: center; font-size: 2rem; font-weight: 800; margin: 0 auto; }
.dice.spin { animation: spin .35s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.log { max-height: 120px; overflow: auto; color: #93a4bb; font-size: .85rem; }
.code { font-family: ui-monospace, monospace; letter-spacing: .16em; font-size: 1.4rem; }
.friends-banner, .refer-banner {
  width: 100%;
  border: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  margin-top: 16px;
  border-radius: 18px;
  padding: 16px;
  color: #fff;
}
.friends-banner {
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
}
.refer-banner {
  background: linear-gradient(90deg, #ffe8d6, #fff1e6);
  color: #7c2d12;
  border: 1px solid #f3d5bc;
}
.friends-banner b, .refer-banner b { display: block; font-size: 1rem; }
.friends-banner small, .refer-banner small { display: block; opacity: .9; font-weight: 500; }
.ico {
  width: 46px; height: 46px; border-radius: 12px;
  display: grid; place-items: center; font-size: 1.3rem;
  background: rgba(255,255,255,.18); flex-shrink: 0;
}
.refer-banner .ico { background: #fff; }

.table-board {
  width: min(100%, 72vh, 640px);
  aspect-ratio: 1;
  margin: 0 auto;
  display: grid;
  gap: 0;
  border-radius: 12px;
  overflow: hidden;
  background: #1a1a1a;
  touch-action: manipulation;
}
.table-board.chess, .table-board.checkers { grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr); }
.table-board.chess {
  background: #2c1810 url("/web/assets/packages/flutter_chess_board/images/brown_board.png") center / 100% 100% no-repeat;
  box-shadow: 0 0 0 5px #5d4037, 0 0 0 8px #c4a35a, 0 14px 32px rgba(0,0,0,.45);
  border-radius: 4px;
  overflow: hidden;
}
.table-board.chess .sq {
  background: transparent;
  font-size: 0;
  overflow: visible;
}
.table-board.chess .sq.light,
.table-board.chess .sq.dark { background: transparent; }
.table-board.ttt { grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); gap: 6px; background: transparent; }
.table-board.quoridor { grid-template-columns: repeat(9, 1fr); grid-template-rows: repeat(9, 1fr); gap: 3px; background: #0b3d36; padding: 6px; }
.table-board.carrom-live {
  display: block;
  background: #3a2410;
  padding: 0;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(0,0,0,.4);
}
.table-board.carrom-live canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}
#view-table-play.carrom-mode {
  overflow: hidden;
  height: 100dvh;
  padding: 8px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
}
#view-table-play.carrom-mode .topbar { margin-bottom: 8px; padding: 8px 10px; }
#view-table-play.carrom-mode .panel-dark { display: none; }
#view-table-play.carrom-mode .layout { grid-template-columns: 1fr; gap: 0; }
#view-table-play.carrom-mode .board-wrap {
  background: transparent;
  border: none;
  padding: 0;
  overflow: visible;
}
#view-table-play.carrom-mode .table-board.carrom-live {
  width: min(100%, calc(100dvh - 148px), 720px);
}
.carrom-rail {
  display: flex;
  align-items: center;
  gap: 4px;
  width: min(100%, calc(100dvh - 148px), 720px);
  margin: 8px auto 0;
  background: rgba(0,0,0,.42);
  border-radius: 26px;
  padding: 2px 6px;
}
.carrom-rail button {
  width: 36px; height: 36px; border: 0; border-radius: 50%;
  background: #23262e; color: #fff; font-size: 22px; line-height: 1;
}
.carrom-rail input[type=range] {
  flex: 1; accent-color: #2a6ef0; height: 28px;
}
.table-board.paper { grid-template-columns: repeat(24, 1fr); grid-template-rows: repeat(24, 1fr); }
.sq { display: grid; place-items: center; font-size: clamp(.9rem, 4vw, 1.7rem); font-weight: 800; user-select: none; }
.sq.light { background: #f0d9b5; }
.sq.dark { background: #b58863; }
.sq.hi { outline: 3px solid #14b8a6; outline-offset: -3px; }
.sq.legal { box-shadow: inset 0 0 0 4px #22c55e; }
.sq.ttt { background: #fff; border-radius: 12px; font-size: 2.4rem; }
.sq.qcell { background: #d1fae5; border-radius: 6px; }
.sq.qcell.wall-h { box-shadow: inset 0 -6px 0 #111; }
.sq.qcell.wall-v { box-shadow: inset -6px 0 0 #111; }
.sq.pawn0 { background: #fb7185; color: #fff; border-radius: 50%; }
.sq.pawn1 { background: #38bdf8; color: #fff; border-radius: 50%; }
.sq.pocket { background: #111; }
.sq.coin-b { background: #111; color: #fff; border-radius: 50%; }
.sq.coin-w { background: #f8fafc; color: #111; border-radius: 50%; }
.sq.coin-q { background: #eab308; color: #111; border-radius: 50%; }
.sq.p0 { background: #0d9488; }
.sq.p1 { background: #d97706; }
.sq.t0 { background: #5eead4; }
.sq.t1 { background: #fbbf24; }
.sq.head { box-shadow: inset 0 0 0 3px #fff; }
.wall-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.cover-wide { width: 100%; height: 72px; object-fit: cover; border-radius: 14px; margin-bottom: 10px; }
.ios-tip { margin: 8px 12px; background: #fff4cc; color: #3b2a00; border-radius: 12px; padding: 10px; font-size: .85rem; }
.row { display: flex; gap: 8px; }
.row .btn { flex: 1; }

/* Matching lobby — Flutter stake chips */
.wide-match { max-width: 520px; width: 100%; min-width: 0; }
.match-panel { padding: 18px 16px 20px; min-width: 0; overflow: hidden; }
.match-user {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--stroke);
}
.match-user b { display: block; }
.match-user span { display: block; color: var(--brand); font-weight: 800; font-size: .92rem; }
.arena-head { display: flex; gap: 12px; align-items: center; margin-bottom: 4px; }
.arena-head h2 { margin: 0; }
.arena-head .lead { margin: 2px 0 0; }
.arena-ico {
  width: 52px; height: 52px; border-radius: 16px;
  background: var(--mint); display: grid; place-items: center; font-size: 1.5rem;
  flex-shrink: 0;
}
.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0 4px;
}
.seg button {
  border: 1px solid var(--stroke2);
  background: #fff;
  border-radius: 14px;
  padding: 10px;
  font-weight: 800;
}
.seg button.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.stake-title { margin: 14px 0 8px; font-size: .95rem; }
.stakes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
  min-width: 0;
}
.stake {
  width: 100%;
  text-align: left;
  border: 1.5px solid var(--stroke);
  background: #fff;
  border-radius: 14px;
  padding: 10px 12px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
@media (min-width: 520px) {
  .stakes { gap: 10px; }
}
.stake small {
  color: var(--muted);
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .08em;
}
.stake > b { display: block; font-size: 1.15rem; margin: 0; }
.stake .win {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(#fffbeb, #fef3c7);
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 5px 8px;
  color: #92400e;
  margin-top: 6px;
}
.stake .win small { color: #b45309; }
.stake .win strong { font-size: .9rem; }
.stake.on {
  border-color: #d97706;
  background: linear-gradient(#fff, #fff7ed);
}
.stake.on .win {
  background: linear-gradient(#fde68a, #f59e0b);
  border-color: #d97706;
  color: #78350f;
}
.stake.poor > b { color: var(--danger); }
.stake.poor { opacity: .72; }
.match-cta {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 8px;
  margin-top: 6px;
}
.match-cta .btn { width: 100%; margin: 0; }
.match-more {
  margin-top: 12px;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 0 12px;
  background: #fff;
}
.match-more summary {
  cursor: pointer;
  font-weight: 700;
  font-size: .9rem;
  padding: 12px 0;
  color: var(--muted);
  list-style: none;
}
.match-more summary::-webkit-details-marker { display: none; }
.match-more[open] summary { color: var(--text); }
.match-more .btn { width: 100%; margin: 0 0 8px; }
.join-row { display: flex; gap: 8px; margin-bottom: 12px; }
.join-row input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--stroke2);
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 800;
  letter-spacing: .08em;
}
.join-row .btn { width: auto; flex: 0 0 auto; padding: 10px 16px; margin: 0; }
.match-back {
  display: block;
  width: 100%;
  margin-top: 10px;
  border: 0;
  background: none;
  color: var(--muted);
  font-weight: 700;
  font-size: .88rem;
}
.match-sum {
  background: var(--mint);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 700;
  margin: 10px 0;
  font-size: .92rem;
}
.search-strip {
  text-align: center;
  background: linear-gradient(#ffffff, #f0fdfa);
  color: var(--text);
  border: 1px solid var(--stroke);
  border-radius: 18px;
  padding: 16px 14px 18px;
  margin: 10px 0 14px;
  box-shadow: 0 10px 24px rgba(15, 118, 110, .08);
}
.search-strip .scan-timer {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text);
}
.search-strip .search-hint {
  color: var(--muted);
  margin: 4px 0 16px;
  font-size: .82rem;
}
.vs-duel {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 8px;
}
.vs-side { display: grid; justify-items: start; gap: 6px; min-width: 0; }
.vs-side.end { justify-items: end; text-align: right; }
.vs-side b {
  font-size: .82rem;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vs-side small { font-size: .7rem; color: var(--faint); font-weight: 600; }
.vs-side .scan-lab { color: #0891b2; }
.vs-av {
  width: 72px; height: 72px; border-radius: 14px;
  overflow: hidden;
  background: #e2e8f0;
  border: 1.5px solid #cbd5e1;
  box-shadow: 0 3px 8px rgba(15, 23, 42, .18);
  display: grid; place-items: center;
  font-weight: 800; color: #64748b;
  position: relative;
}
.vs-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vs-av.scan {
  border-color: rgba(6, 182, 212, .55);
}
.vs-av.scan::after {
  content: '';
  position: absolute;
  right: 5px; bottom: 5px;
  width: 14px; height: 14px;
  border: 2px solid #22d3ee;
  border-right-color: transparent;
  border-radius: 50%;
  animation: vs-spin .9s linear infinite;
  background: rgba(255,255,255,.92);
}
.vs-av.slide img { animation: vs-slide .38s cubic-bezier(.33,1,.68,1); }
.vs-badge {
  width: 40px; height: 40px; margin-top: 16px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 900; font-size: .72rem; letter-spacing: .04em;
  color: #d97706;
  background: rgba(251, 191, 36, .18);
  border: 1px solid rgba(217, 119, 6, .55);
}
@keyframes vs-spin { to { transform: rotate(360deg); } }
@keyframes vs-slide {
  from { transform: translateY(70%); opacity: 0; }
  to { transform: none; opacity: 1; }
}

/* Ludo feel — custom coloured board, no board.png */
.play-wrap {
  background:
    linear-gradient(rgba(7, 17, 31, .84), rgba(7, 17, 31, .9)),
    url("/web/assets/images/ludo_bg.jpg") center/cover;
}
.board {
  background: #e8e2d6;
  gap: 1px;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(0,0,0,.42);
}
.board::before { display: none; content: none; }
.cell { background: #f7f4ee; }
.cell.void { background: #0b1220; }
.cell.red { background: var(--red); }
.cell.yellow { background: var(--yellow); }
.cell.green { background: var(--green); }
.cell.blue { background: var(--blue); }
.cell.center { background: #ece7dc; box-shadow: none; }
.cell.yard.red { box-shadow: none; }
.cell.yard.yellow { box-shadow: none; }
.cell.yard.green { box-shadow: none; }
.cell.yard.blue { box-shadow: none; }
.cell.yard.yard-inner {
  border-radius: 22%;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.28);
  filter: brightness(1.12);
}
.cell.yard.pad::after {
  content: '';
  position: absolute;
  inset: 14%;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, rgba(255,255,255,.95), rgba(255,255,255,.42) 52%, rgba(0,0,0,.14));
  box-shadow: inset 0 2px 5px rgba(0,0,0,.2), 0 0 0 2px rgba(255,255,255,.62);
  pointer-events: none;
  z-index: 1;
}
.ludo-hub {
  position: absolute;
  left: calc(6 * 100% / 15);
  top: calc(6 * 100% / 15);
  width: calc(3 * 100% / 15);
  height: calc(3 * 100% / 15);
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(80,80,80,.45);
}
.hub-tri { position: absolute; inset: 0; }
.hub-g { clip-path: polygon(0 0, 0 100%, 50% 50%); background: linear-gradient(135deg, #86efac, var(--green) 58%, #166534); }
.hub-y { clip-path: polygon(0 0, 100% 0, 50% 50%); background: linear-gradient(180deg, #fde047, var(--yellow) 58%, #a16207); }
.hub-b { clip-path: polygon(100% 0, 100% 100%, 50% 50%); background: linear-gradient(225deg, #93c5fd, var(--blue) 58%, #1d4ed8); }
.hub-r { clip-path: polygon(0 100%, 100% 100%, 50% 50%); background: linear-gradient(0deg, #fca5a5, var(--red) 58%, #b91c1c); }
.ludo-hub::after {
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  width: 16%; height: 16%;
  transform: translate(-50%, -50%) rotate(45deg);
  background: #f8fafc;
  box-shadow: 0 0 0 1px rgba(0,0,0,.22);
  z-index: 1;
}
.ludo-clock {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 8;
  min-width: 96px;
  padding: 6px 14px 5px;
  border-radius: 999px;
  background: rgba(15, 23, 42, .88);
  border: 1.5px solid #fbbf24;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  box-shadow: 0 8px 22px rgba(0,0,0,.38);
}
.ludo-clock b {
  font-size: 1.05rem;
  letter-spacing: .08em;
  color: #fbbf24;
  line-height: 1.1;
}
.ludo-clock span {
  font-size: .7rem;
  font-weight: 800;
  color: #e2e8f0;
}
.ludo-clock.urgent {
  border-color: #ef4444;
  animation: clockPulse 1s ease-in-out infinite;
}
.ludo-clock.urgent b { color: #fca5a5; }
@keyframes clockPulse {
  0%, 100% { box-shadow: 0 8px 22px rgba(0,0,0,.38); }
  50% { box-shadow: 0 0 0 4px rgba(239, 68, 68, .28); }
}
.cell.safe::after { opacity: .9; }
.cell.dest {
  background: rgba(34, 197, 94, .42);
  box-shadow: inset 0 0 0 2px #22c55e;
  z-index: 1;
  border-radius: 4px;
}

/* Ludo pawn hop — step 250ms, hop 220ms */
.token {
  position: absolute;
  width: calc(100% / 15 * 0.92);
  height: calc(100% / 15 * 1.28);
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  z-index: 6;
  overflow: visible;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
  will-change: left, top;
  transition: left 220ms cubic-bezier(0.215, 0.61, 0.355, 1), top 220ms cubic-bezier(0.215, 0.61, 0.355, 1);
  filter: drop-shadow(0 3px 3px rgba(0,0,0,.5));
}
.token.legal { z-index: 8; }
.pawn-ripple {
  display: none;
  position: absolute;
  left: 50%;
  top: 62%;
  width: 70%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
}
.token.legal .pawn-ripple {
  display: block;
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--pawn) 70%, transparent);
  animation: pawnRipple 1.15s ease-out infinite;
}
@keyframes pawnRipple {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--pawn) 65%, transparent); opacity: 1; }
  100% { box-shadow: 0 0 0 14px transparent; opacity: 0; }
}
.pawn {
  position: absolute;
  inset: 0;
  transform-origin: 50% 88%;
}
.token.legal .pawn { animation: pawnBob 1s ease-in-out infinite; }
.token.tapped .pawn { animation: none; transform: scale(0.92); }
.token.hop .pawn { animation: pawnHop 220ms cubic-bezier(0.215, 0.61, 0.355, 1); }
@keyframes pawnBob {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-10%) scale(1.06); }
}
@keyframes pawnHop {
  0% { transform: translateY(0) scale(1); }
  38% { transform: translateY(-48%) scale(1.12); }
  100% { transform: translateY(0) scale(1); }
}
.pawn-base, .pawn-body, .pawn-neck, .pawn-head, .pawn-band {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}
.pawn-base {
  bottom: 0;
  width: 92%;
  height: 26%;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--pawn-dark), #111);
  border: 1px solid color-mix(in srgb, var(--pawn-dark) 70%, #000);
}
.pawn-body {
  bottom: 10%;
  width: 78%;
  height: 54%;
  border-radius: 38% 38% 46% 46%;
  background: linear-gradient(135deg, var(--pawn-lite) 0%, var(--pawn) 42%, var(--pawn-dark) 100%);
  border: 1.5px solid var(--pawn-dark);
}
.pawn-neck {
  bottom: 56%;
  width: 46%;
  height: 18%;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--pawn-dark), var(--pawn), var(--pawn-lite), var(--pawn), var(--pawn-dark));
}
.pawn-head {
  top: 0;
  width: 52%;
  height: 40%;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, var(--pawn-lite), var(--pawn) 48%, var(--pawn-dark));
  border: 1.5px solid var(--pawn-dark);
  box-shadow: 0 2px 3px rgba(0,0,0,.35);
}
.pawn-head i {
  display: block;
  width: 38%;
  height: 28%;
  margin: 18% auto 0;
  border-radius: 40%;
  background: linear-gradient(180deg, rgba(255,255,255,.8), transparent);
}
.pawn-band {
  bottom: 32%;
  width: 64%;
  height: 7%;
  border-radius: 4px;
  background: rgba(255,255,255,.28);
}
.token.green { --pawn: #009739; --pawn-lite: #8af0b0; --pawn-dark: #045c28; }
.token.blue { --pawn: #1d6fd8; --pawn-lite: #9ec8ff; --pawn-dark: #063a7a; }
.token.red { --pawn: #e53935; --pawn-lite: #ffb3ab; --pawn-dark: #8b1512; }
.token.yellow { --pawn: #ffd100; --pawn-lite: #fff4b0; --pawn-dark: #b8860a; }
.dice {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  background: #fff;
  padding: 4px;
  box-shadow: 0 6px 14px rgba(0,0,0,.28);
}
.dice img { width: 100%; height: 100%; object-fit: contain; display: block; }
.dice.spin { animation: diceShake .1s linear infinite; }
@keyframes diceShake {
  0% { transform: rotate(-10deg) scale(1.04); }
  50% { transform: rotate(10deg) scale(1.08); }
  100% { transform: rotate(-6deg) scale(1.02); }
}

.sq { position: relative; }
.sq.can::before {
  content: "";
  position: absolute;
  inset: 8%;
  border: 2px solid rgba(20, 184, 166, .55);
  border-radius: 6px;
  pointer-events: none;
}
.sq.legal::after {
  content: "";
  width: 30%;
  height: 30%;
  background: rgba(20, 184, 166, .9);
  border-radius: 50%;
  pointer-events: none;
}
.sq.cap {
  box-shadow: inset 0 0 0 4px #ef4444;
}
.sq.cap::after { display: none; }
.sq.pop { animation: piecePop .18s ease-out; }
@keyframes piecePop {
  from { transform: scale(.82); }
  to { transform: scale(1); }
}

/* Flutter ChessLegalMovesPainter + CheckHighlight + Staunton pieces */
.table-board.chess .sq.can::before,
.table-board.chess .sq.legal::before,
.table-board.chess .sq.cap::before,
.table-board.chess .sq.hi::before,
.table-board.chess .sq.check::before,
.table-board.chess .sq.last::before,
.table-board.chess .sq.mate::before {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: 2;
  border-radius: 2px;
  box-sizing: border-box;
}
.table-board.chess .sq.legal::after,
.table-board.chess .sq.cap::after { display: none; }
.table-board.chess .sq.can::before {
  inset: 6%;
  border: 2.5px solid rgba(46, 125, 79, .70);
  background: transparent;
  border-radius: 2px;
}
.table-board.chess .sq.hi::before {
  inset: 1.8%;
  background: rgba(246, 201, 69, .50);
  border: 4px solid #f6c945;
}
.table-board.chess .sq.legal::before {
  inset: 6%;
  background: rgba(46, 125, 79, .38);
  border: 3px solid rgba(46, 125, 79, .95);
}
.table-board.chess .sq.cap::before {
  inset: 3%;
  background: rgba(198, 40, 40, .32);
  border: 3.5px solid #e53935;
  box-shadow: none;
}
.table-board.chess .sq.cap { box-shadow: none; }
.table-board.chess .sq.last::after {
  content: "";
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  background: rgba(246, 201, 69, .28);
  border: 0;
  border-radius: 0;
  z-index: 0;
  display: block;
  pointer-events: none;
}
.table-board.chess .sq.check::before {
  inset: 4%;
  background: rgba(255, 109, 0, .45);
  border: 4px solid #ff9100;
}
.table-board.chess .sq.mate::before {
  inset: 4%;
  background: rgba(211, 47, 47, .60);
  border: 4px solid #ff1744;
}
.ch-piece {
  position: relative;
  z-index: 1;
  width: 88%;
  height: 88%;
  display: grid;
  place-items: center;
  transform: translateY(-4%);
  filter: drop-shadow(0 1px 0 rgba(255,255,255,.28));
  pointer-events: none;
}
.ch-piece.black { filter: drop-shadow(0 0 3px rgba(196,163,90,.25)); }
.ch-piece svg { width: 100%; height: 100%; display: block; overflow: visible; }
.ch-shadow {
  position: absolute;
  left: 26%;
  right: 26%;
  bottom: 2%;
  height: 12%;
  border-radius: 50%;
  background: rgba(0,0,0,.42);
  filter: blur(2px);
  z-index: -1;
}
.ch-coord {
  position: absolute;
  font-size: clamp(7px, 1.6vw, 11px);
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
  z-index: 3;
  opacity: .85;
}
.ch-coord.rank { top: 5%; left: 6%; }
.ch-coord.file { bottom: 5%; right: 7%; }
.table-board.chess .sq.light .ch-coord { color: #6b4f35; }
.table-board.chess .sq.dark .ch-coord { color: #f3e2c7; }
.ch-fly {
  position: absolute;
  z-index: 8;
  pointer-events: none;
  will-change: transform;
  transition: transform 220ms cubic-bezier(.33, 1, .68, 1);
}
.ch-fly .ch-piece { width: 100%; height: 100%; }
.ch-hide { visibility: hidden; }
.check-banner {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9;
  padding: 6px 14px;
  border-radius: 10px;
  color: #fff;
  font-weight: 800;
  font-size: .85rem;
  background: rgba(230, 81, 0, .92);
  pointer-events: none;
}
.check-banner.mate { background: rgba(183, 28, 28, .92); }

.atm-card {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  padding: 12px 12px 10px;
  color: #fff;
  background: linear-gradient(135deg, #6d28d9 0%, #4c1d95 52%, #1e1b4b 100%);
  border: 1px solid rgba(255,255,255,.16);
  box-shadow: 0 10px 20px rgba(124, 58, 237, .32);
}
.atm-card::before, .atm-card::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.atm-card::before {
  width: 120px; height: 120px;
  right: -28px; top: -36px;
  background: rgba(255,255,255,.08);
}
.atm-card::after {
  width: 100px; height: 100px;
  left: -22px; bottom: -40px;
  background: rgba(245, 158, 11, .12);
}
.atm-head, .atm-mid, .atm-foot { position: relative; z-index: 1; }
.atm-head { display: flex; align-items: center; gap: 8px; }
.atm-av {
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(255,255,255,.18); color: #fff;
  display: grid; place-items: center; font-size: .75rem; font-weight: 800;
  overflow: hidden; flex-shrink: 0;
}
.atm-av img { width: 100%; height: 100%; object-fit: cover; }
.atm-who b { display: block; font-size: .78rem; line-height: 1.1; }
.atm-who small { color: rgba(255,255,255,.72); font-size: .72rem; }
.atm-mid {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 10px; margin-top: 10px;
}
.atm-lab { display: block; color: rgba(255,255,255,.78); font-size: .78rem; font-weight: 600; }
.atm-amt-row { display: flex; align-items: center; gap: 4px; }
.atm-amt-row strong { font-size: 1.55rem; font-weight: 800; line-height: 1.1; }
.atm-eye {
  background: none; border: 0; color: rgba(255,255,255,.7);
  font-size: .72rem; font-weight: 700; padding: 6px 4px;
}
.atm-add {
  background: #fff; color: #6d28d9; border: 0;
  border-radius: 999px; padding: 9px 12px;
  font-weight: 800; font-size: .78rem; white-space: nowrap;
}
.atm-foot {
  display: flex; align-items: flex-end; gap: 10px; margin-top: 14px;
}
.atm-foot > div { flex: 1; min-width: 0; }
.atm-foot span { display: block; color: rgba(255,255,255,.6); font-size: .72rem; }
.atm-foot b { display: block; margin-top: 2px; font-size: .95rem; }
.atm-wd {
  background: none; border: 0; color: #fff;
  font-weight: 700; font-size: .78rem; padding: 6px 4px; white-space: nowrap;
}
.qa-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0 8px;
}
#view-home .hello.home-games-title {
  margin: 8px 4px 8px;
  font-size: 1.05rem;
}
#view-home .games {
  display: grid !important;
  visibility: visible;
  margin-top: 0;
}
#view-home .game {
  aspect-ratio: 1 / 0.78;
  min-height: 118px;
}
.qa-row button {
  background: none; border: 0; padding: 0;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  font-size: .68rem; font-weight: 600; color: var(--muted);
}
.qa-ico {
  width: 44px; height: 44px; border-radius: 13px;
  display: grid; place-items: center; color: #fff; font-size: 1.05rem;
}
.qa-ico.add { background: linear-gradient(135deg, #a78bfa, #7c3aed); box-shadow: 0 2px 6px rgba(124,58,237,.22); }
.qa-ico.wd { background: linear-gradient(135deg, #34d399, #059669); box-shadow: 0 2px 6px rgba(5,150,105,.22); }
.qa-ico.hist { background: linear-gradient(135deg, #ffb24d, #c45c00); box-shadow: 0 2px 6px rgba(196,92,0,.22); }
.qa-ico.ref { background: linear-gradient(135deg, #fbbf24, #d97706); box-shadow: 0 2px 6px rgba(217,119,6,.22); }
.page-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
}
.page-head .back {
  width: 40px; height: 40px; border-radius: 12px;
  border: 1px solid var(--stroke); background: #fff; font-size: 1.1rem;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 14px; }
.chip, .gw-chip {
  border: 1px solid var(--stroke2); background: #fff;
  border-radius: 999px; padding: 8px 12px; font-weight: 700; font-size: .82rem;
}
.gw-chip.on, .chip.on { background: #6d28d9; color: #fff; border-color: #6d28d9; }
.hist-h { margin: 16px 4px 8px; font-size: .95rem; }
.hist-row, .tx .hist-row {
  background: #fff; border: 1px solid var(--stroke); border-radius: 12px;
  padding: 10px 12px; display: flex; justify-content: space-between; gap: 10px; align-items: center;
}
.hist-row b { display: block; text-transform: capitalize; }
.hist-row small { display: block; color: var(--muted); font-size: .75rem; font-weight: 500; }
.hist-row.in strong { color: var(--ok); }
.hist-row.out strong { color: var(--danger); }
.hist-empty { color: var(--muted); padding: 12px 4px; }
.support-note { text-align: center; color: var(--faint); font-size: .75rem; margin-top: 18px; }
.pay-overlay {
  position: fixed; inset: 0; z-index: 100; background: #fff;
  display: flex; flex-direction: column;
}
.pay-overlay.hidden { display: none !important; }
.pay-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; border-bottom: 1px solid var(--stroke); font-weight: 700;
}
.pay-bar button { border: 0; background: var(--mint); border-radius: 10px; padding: 8px 12px; font-weight: 700; }
.pay-overlay iframe { flex: 1; width: 100%; border: 0; }
.wallet-page { padding-bottom: 24px; }

.pl-tabs {
  display: flex; align-items: center; gap: 4px;
  border-bottom: 1px solid #e2e8f0; overflow-x: auto;
}
.pl-tabs button {
  background: none; border: 0; padding: 10px 12px;
  font-weight: 600; color: #64748b; border-bottom: 3px solid transparent;
  white-space: nowrap;
}
.pl-tabs button.on { color: #0f766e; font-weight: 800; border-bottom-color: #0f766e; }
.pl-bell { margin-left: auto; font-size: 1.1rem; }
.pl-list { display: grid; gap: 8px; margin-top: 8px; }
.pl-row {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
  padding: 8px 10px; display: flex; align-items: center; gap: 10px;
}
.pl-av {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(99,102,241,.12); color: #312e81;
  display: grid; place-items: center; font-weight: 800; overflow: hidden; flex-shrink: 0;
}
.pl-av img { width: 100%; height: 100%; object-fit: cover; }
.pl-meta { flex: 1; min-width: 0; }
.pl-meta b { display: block; }
.pl-meta small { color: var(--muted); }
.pl-meta .dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: #cbd5e1; margin-right: 6px;
}
.pl-meta .dot.on { background: #10b981; }
.pl-pill {
  border: 0; border-radius: 12px; padding: 8px 12px;
  font-weight: 800; font-size: .78rem; background: rgba(99,102,241,.12); color: #6366f1;
}
.pl-pill.on { background: #6366f1; color: #fff; }
.pl-pill.ok { background: rgba(5,150,105,.12); color: #059669; }
.pl-pill.wait { background: rgba(217,119,6,.12); color: #d97706; }
.tn-title { margin: 4px 0 12px; font-size: 1.15rem; text-align: center; }
.tn-switch {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  background: #f1f5f9; border-radius: 12px; padding: 4px; margin-bottom: 10px;
}
.tn-switch button {
  border: 0; background: none; border-radius: 10px; padding: 10px 8px;
  font-weight: 600; color: #64748b; font-size: .78rem;
}
.tn-switch button.on { background: #fff; color: #0f766e; font-weight: 800; }
.tn-list { display: grid; gap: 10px; }
.tn-card {
  display: grid; grid-template-columns: 88px 1fr; gap: 10px;
  background: #fff; border: 1px solid var(--stroke); border-radius: 12px;
  padding: 10px; text-align: left; overflow: hidden;
}
.tn-card.feat { border-color: #f59e0b; }
.tn-card img, .tn-ph {
  width: 88px; height: 64px; object-fit: cover; border-radius: 10px;
  background: #1e1b4b; color: #fff; display: grid; place-items: center; font-size: 1.4rem;
}
.tn-body { display: grid; align-content: start; gap: 4px; min-width: 0; }
.tn-body b { font-size: .9rem; }
.tn-body small { color: var(--muted); }
.tn-body .btn { width: auto; padding: 8px 12px; margin-top: 4px; justify-self: start; }

/* Tournament lobby (8P named events, etc.) */
#tn-detail { padding-bottom: 28px; }
.tn-lobby {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  padding: 22px 16px 18px;
  color: #fff;
  background:
    radial-gradient(circle at 10% 0%, rgba(251,191,36,.62), transparent 38%),
    radial-gradient(circle at 96% 8%, rgba(244,63,94,.42), transparent 36%),
    radial-gradient(circle at 78% 92%, rgba(34,211,238,.32), transparent 42%),
    linear-gradient(165deg, #0f766e 0%, #134e4a 36%, #1e1b4b 100%);
  box-shadow: 0 20px 44px rgba(15, 23, 42, .32);
}
.tn-hero-img {
  position: relative; z-index: 1;
  margin: -6px 0 14px;
  height: 168px;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(0,0,0,.28);
  border: 2px solid rgba(253, 230, 138, .55);
}
.tn-hero-img img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.tn-card.tn-8p img {
  object-position: center;
}
.tn-float-coins { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.tn-float-coins span {
  position: absolute;
  width: 26px; height: 26px; border-radius: 50%;
  background: radial-gradient(circle at 30% 28%, #fff7d6, #fbbf24 46%, #b45309);
  border: 2px solid #fde68a;
  box-shadow: 0 4px 10px rgba(180,83,9,.35);
  animation: tnCoinFloat 4.6s ease-in-out infinite;
}
.tn-float-coins span:nth-child(1) { top: 10%; left: 6%; animation-delay: 0s; }
.tn-float-coins span:nth-child(2) { top: 18%; right: 8%; animation-delay: .4s; width: 20px; height: 20px; }
.tn-float-coins span:nth-child(3) { top: 42%; left: 2%; animation-delay: .8s; width: 18px; height: 18px; }
.tn-float-coins span:nth-child(4) { top: 58%; right: 4%; animation-delay: 1.1s; }
.tn-float-coins span:nth-child(5) { top: 30%; left: 8%; animation-delay: 1.4s; width: 22px; height: 22px; }
.tn-float-coins span:nth-child(6) { top: 12%; right: 22%; animation-delay: .6s; }
.tn-float-coins span:nth-child(7) { top: 8%; left: 46%; animation-delay: 1.8s; width: 16px; height: 16px; }
.tn-float-coins span:nth-child(8) { top: 38%; right: 12%; animation-delay: 2.1s; width: 14px; height: 14px; }
.tn-kicker {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.tn-lobby h1 {
  position: relative; z-index: 1;
  margin: 12px 0 6px;
  font-size: clamp(1.7rem, 7vw, 2.4rem);
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: -.02em;
  text-shadow: 0 6px 22px rgba(0,0,0,.35);
}
.tn-sub {
  position: relative; z-index: 1;
  margin: 0 0 12px;
  opacity: .92;
  font-weight: 600;
  font-size: .86rem;
}
.tn-coin-line {
  position: relative; z-index: 1;
  display: flex; justify-content: center; gap: 10px; margin: 8px 0 14px;
}
.tn-coin-line .gold-coin {
  width: 42px; height: 42px; font-size: .85rem;
  animation: tnCoinFloat 3.2s ease-in-out infinite;
}
.tn-coin-line .gold-coin:nth-child(2) { animation-delay: .15s; }
.tn-coin-line .gold-coin:nth-child(3) { animation-delay: .3s; }
.tn-coin-line .gold-coin:nth-child(4) { animation-delay: .45s; }
.tn-prize-row {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px;
}
.tn-stat {
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 16px;
  padding: 12px 10px;
  text-align: center;
  backdrop-filter: blur(8px);
}
.tn-stat small {
  display: block; opacity: .82; font-weight: 800; font-size: .66rem; letter-spacing: .1em;
}
.tn-stat b { display: block; font-size: 1.28rem; margin-top: 4px; }
.tn-fill {
  position: relative; z-index: 1;
  display: flex; justify-content: space-between;
  font-size: .75rem; font-weight: 800; opacity: .9; margin-bottom: 6px;
}
.tn-progress {
  position: relative; z-index: 1;
  height: 10px; background: rgba(0,0,0,.28); border-radius: 99px; overflow: hidden;
}
.tn-progress i {
  display: block; height: 100%;
  background: linear-gradient(90deg, #fbbf24, #f59e0b 40%, #34d399);
  border-radius: 99px;
}
.tn-wait {
  position: relative; z-index: 1;
  margin-top: 16px;
  background: #fff;
  color: #0f172a;
  border-radius: 20px;
  padding: 16px 12px 14px;
  box-shadow: 0 14px 32px rgba(0,0,0,.2);
}
.tn-wait-head {
  display: grid; grid-template-columns: 1fr auto; align-items: start; gap: 8px;
  margin-bottom: 14px;
}
.tn-wait-head h3 {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.25;
  background: linear-gradient(90deg, #0f766e, #d97706);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.tn-wait-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff7ed; color: #c2410c;
  border-radius: 99px; padding: 6px 10px;
  font-size: .7rem; font-weight: 800; white-space: nowrap;
}
.tn-wait-badge i {
  width: 8px; height: 8px; border-radius: 50%; background: #f97316;
  animation: tnPulse 1.4s ease-in-out infinite;
}
.tn-wait-badge.full { background: #ecfdf5; color: #047857; }
.tn-wait-badge.full i { background: #10b981; animation: none; }
.tn-dots::after {
  content: '';
  animation: tnDots 1.4s steps(4, end) infinite;
}
.tn-seats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px;
}
.tn-seats.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tn-seats.n4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tn-seat { display: grid; justify-items: center; gap: 6px; }
.tn-seat-av {
  width: 58px; height: 58px; border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 900; font-size: 1.05rem;
  background: #f1f5f9;
  border: 3px dashed #cbd5e1;
  color: #94a3b8;
  overflow: hidden;
}
.tn-seat-av img { width: 100%; height: 100%; object-fit: cover; }
.tn-seat.on .tn-seat-av {
  border-style: solid; border-color: #0f766e;
  background: linear-gradient(180deg, #ccfbf1, #99f6e4);
  color: #115e59;
  box-shadow: 0 0 0 4px rgba(15,118,110,.16);
}
.tn-seat.wait .tn-seat-av { animation: tnPulse 1.8s ease-in-out infinite; }
.tn-seat small {
  font-size: .68rem; font-weight: 800; color: #64748b;
  max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tn-seat.on small { color: #0f766e; }
.tn-lobby-actions {
  position: relative; z-index: 1;
  display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap;
}
.tn-lobby-actions .btn { flex: 1; min-width: 140px; }
.tn-lobby-actions .tn-join {
  background: linear-gradient(90deg, #f59e0b, #ea580c);
  border: 0; color: #fff;
}
@keyframes tnPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
@keyframes tnCoinFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-12px) rotate(18deg); }
}
@keyframes tnDots {
  0% { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75% { content: '...'; }
}
@media (max-width: 420px) {
  .tn-seats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .tn-seat-av { width: 50px; height: 50px; }
  .tn-lobby h1 { font-size: 1.55rem; }
  .tn-wait-head { grid-template-columns: 1fr; }
}
.nav-ico svg { width: 22px; height: 22px; }

.win-overlay {
  position: fixed; inset: 0; z-index: 120;
  background: rgba(7, 17, 31, .78);
  backdrop-filter: blur(8px);
  display: grid; place-items: center; padding: 18px;
}
.win-card {
  position: relative;
  width: min(400px, 100%);
  overflow: hidden;
  background: radial-gradient(120% 90% at 50% -10%, #4c3a16 0%, #1e1b4b 46%, #0b1220 100%);
  color: #fff; border-radius: 26px; padding: 26px 18px 18px;
  text-align: center;
  box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 28px 80px rgba(0,0,0,.55), 0 0 70px rgba(251,191,36,.2);
  border: 2px solid rgba(251, 191, 36, .55);
}
.win-card::before {
  content: '';
  position: absolute;
  left: 18%; right: 18%;
  bottom: -42%;
  height: 70%;
  background: radial-gradient(circle, rgba(251,191,36,.3), transparent 70%);
  pointer-events: none;
}
.win-overlay.loss .win-card {
  border-color: rgba(148,163,184,.4);
  background: radial-gradient(120% 90% at 50% -10%, #334155 0%, #0f172a 55%, #020617 100%);
  box-shadow: 0 28px 80px rgba(0,0,0,.55);
}
.win-overlay.draw .win-card { border-color: rgba(148,163,184,.5); }
.win-ring {
  width: 88px; height: 88px; margin: 0 auto 6px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 38% 32%, #fde68a, #f59e0b 58%, #b45309);
  box-shadow: 0 10px 24px rgba(245,158,11,.5), inset 0 2px 0 rgba(255,255,255,.45);
  position: relative; z-index: 1;
}
.win-overlay.loss .win-ring,
.win-overlay.draw .win-ring {
  background: radial-gradient(circle at 38% 32%, #e2e8f0, #64748b 62%, #334155);
  box-shadow: 0 8px 18px rgba(15,23,42,.4);
}
.win-badge { font-size: 2.7rem; line-height: 1; }
.win-card h2 { margin: 8px 0 4px; font-size: 1.7rem; position: relative; z-index: 1; }
.win-amt {
  margin: 4px 0 8px; font-size: 2rem; font-weight: 800;
  color: #fbbf24; position: relative; z-index: 1;
}
.win-overlay.loss .win-amt, .win-overlay.draw .win-amt { color: #e2e8f0; font-size: 1.2rem; }
.win-card .lead { color: #cbd5e1; margin: 0 0 12px; position: relative; z-index: 1; }
.win-rows {
  list-style: none; margin: 0 0 16px; padding: 0;
  background: rgba(255,255,255,.06); border-radius: 14px; overflow: hidden;
  position: relative; z-index: 1;
}
.win-rows li {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 10px 12px; font-size: .88rem;
  border-top: 1px solid rgba(255,255,255,.06);
}
.win-rows li:first-child { border-top: 0; }
.win-rows span { color: #94a3b8; text-align: left; }
.win-rows b { color: #fff; }
.win-card .btn { background: #fbbf24; color: #1e1b4b; position: relative; z-index: 1; }

.pf-hero {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border: 1px solid var(--stroke);
  border-radius: 18px; padding: 14px; margin-bottom: 8px;
}
.pf-hero-av, .avatar.pf-hero-av {
  width: 56px; height: 56px; border-radius: 50%;
  overflow: hidden; display: grid; place-items: center;
  font-weight: 800; background: #ccfbf1; color: #0f766e;
  border: 0; padding: 0; flex-shrink: 0;
}
.pf-hero-av img { width: 100%; height: 100%; object-fit: cover; }
.pf-hero-meta { min-width: 0; flex: 1; }
.pf-hero-row { display: flex; align-items: baseline; gap: 8px; }
.pf-hero-row b { font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-ver { margin-left: auto; color: var(--muted); font-size: .72rem; font-weight: 700; }
.pf-gold { color: #d97706; font-weight: 800; margin-top: 4px; font-size: 1rem; }
.pf-sec {
  margin: 16px 2px 8px; color: var(--muted);
  font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.pf-tile {
  width: 100%; display: flex; align-items: center; gap: 12px;
  text-align: left; background: #fff; border: 1px solid var(--stroke);
  border-radius: 16px; padding: 12px; margin-bottom: 8px;
}
.pf-tile b { display: block; font-size: .95rem; }
.pf-tile small { display: block; color: var(--muted); font-weight: 500; margin-top: 2px; }
.pf-tile.danger b { color: #b91c1c; }
.pf-ico {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center; background: #f0fdfa; flex-shrink: 0;
}
.pf-logout { width: 100%; margin-top: 10px; background: #dc2626; color: #fff; }
.pf-card {
  background: #fff; border: 1px solid var(--stroke);
  border-radius: 16px; padding: 14px; margin-bottom: 10px;
}
.pf-man .field { margin-top: 10px; }
.pf-copy { white-space: pre-wrap; color: var(--muted); font-size: .9rem; line-height: 1.45; margin: 0; }
.pf-sheet {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(15, 23, 42, .45);
  display: flex; align-items: flex-end; justify-content: center;
}
.pf-sheet.hidden { display: none !important; }
.pf-sheet-card {
  width: min(560px, 100%);
  max-height: 82dvh;
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 10px 16px calc(16px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column;
}
.pf-sheet-card .grab {
  width: 40px; height: 4px; border-radius: 99px; background: #cbd5e1;
  margin: 6px auto 10px;
}
.pf-sheet-card h2 { margin: 0 0 8px; font-size: 1.1rem; }
.pf-sheet-body { overflow: auto; flex: 1; padding-bottom: 8px; }
.pf-sw {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--stroke); border-radius: 14px;
  padding: 10px 12px; margin-bottom: 8px;
}
.pf-sw span { flex: 1; min-width: 0; }
.pf-sw b { display: block; font-size: .9rem; }
.pf-sw small { display: block; color: var(--muted); font-size: .75rem; }
.pf-sw input[type="checkbox"] { width: 22px; height: 22px; }
.pf-sw select { border: 1px solid var(--stroke); border-radius: 10px; padding: 6px 8px; font-weight: 700; }

/* 2P Ludo HUD — you bottom-left (1st home), opponent top-right (2nd home) */
.ludo-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
}
.ludo-hud {
  position: absolute;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.ludo-hud .dice { pointer-events: auto; }
.ludo-hud-opp { top: 6px; right: 6px; }
.ludo-hud-me { bottom: 6px; left: 6px; }
.ludo-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: #ef4444;
  pointer-events: none;
}
.ludo-hud-opp .ludo-chip {
  flex-direction: row-reverse;
  text-align: right;
  color: #eab308;
}
.ludo-chip.active .ludo-avatar {
  box-shadow: 0 0 0 2px #0b1220, 0 0 0 4px currentColor;
}
.ludo-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 15px;
  color: #fff;
  background: #334155;
  border: 2px solid currentColor;
}
.ludo-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ludo-avatar.red { background: #b91c1c; }
.ludo-avatar.yellow { background: #a16207; }
.ludo-avatar.green { background: #047857; }
.ludo-avatar.blue { background: #1d4ed8; }
.ludo-name {
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.15;
  text-shadow: 0 1px 4px #000;
  max-width: 108px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ludo-sub {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
}
.play-wrap .ludo-dice.dice {
  position: relative;
  width: 52px;
  height: 52px;
  padding: 3px;
  margin: 0;
  border-radius: 12px;
  border: 2px solid #cbd5e1;
  flex-shrink: 0;
  cursor: default;
  overflow: visible;
}
.play-wrap .ludo-dice.dice.can-roll {
  border-color: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, .4), 0 4px 12px rgba(0,0,0,.3);
  cursor: pointer;
}
.dice-pip {
  position: absolute;
  right: -6px;
  bottom: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: #0f172a;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
}
.dice.spin .dice-pip { opacity: .35; }
#dice-opp { pointer-events: none; }
.ludo-turn-hint, .ludo-roll-btn, #view-ludo-play .ludo-side { display: none !important; }
#view-ludo-play { overflow: hidden; height: 100dvh; padding: 8px; }
#view-ludo-play .topbar { margin-bottom: 8px; padding: 8px 10px; }
#view-ludo-play .layout { grid-template-columns: 1fr; gap: 0; }
#view-ludo-play .board-wrap {
  background: transparent;
  border: none;
  padding: 0;
  width: min(100%, calc(100dvh - 72px), 720px);
}
#view-ludo-play .board {
  width: 100%;
}
#view-table-play .panel-dark { display: none; }
#view-table-play {
  overflow: hidden;
  height: 100dvh;
  padding: 8px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
}
#view-table-play .topbar { margin-bottom: 8px; padding: 8px 10px; }
#view-table-play .layout { grid-template-columns: 1fr; gap: 0; }
#view-table-play .board-wrap {
  background: transparent;
  border: none;
  padding: 0;
}
#view-table-play .table-board {
  width: min(100%, calc(100dvh - 148px), 720px);
}
.board-wrap.ludo-flip .board { transform: rotate(180deg); }
.board-wrap.ludo-flip .token { transform: rotate(180deg); }
.dot.green { background: var(--green); }

@media (min-width: 861px) {
  .play-wrap .ludo-dice.dice { width: 64px; height: 64px; }
}
@media (max-width: 860px) {
  .play-wrap .ludo-dice.dice { width: 52px; height: 52px; }
  .ludo-avatar { width: 36px; height: 36px; font-size: 13px; }
  .ludo-name { font-size: 13px; max-width: 92px; }
  .board-wrap { padding: 6px; }
}

html, body {
  touch-action: manipulation;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
}
.shell, .screen, .play-wrap { max-width: 100vw; overflow-x: hidden; }
@media (min-width: 1100px) {
  .shell { max-width: 720px; margin: 0 auto; }
  .wide-match { max-width: 560px; }
}

/* Featured tournament on home */
.feat-banner {
  width: 100%; border: 0; margin: 4px 0 12px; padding: 0; overflow: hidden;
  border-radius: 18px; display: grid; grid-template-columns: 108px 1fr; text-align: left;
  background: linear-gradient(120deg, #0f766e, #115e59 48%, #f59e0b);
  color: #fff; box-shadow: 0 12px 28px rgba(15, 118, 110, .28);
}
.feat-banner img, .feat-banner .feat-ph {
  width: 108px; height: 88px; object-fit: cover; background: rgba(0,0,0,.2);
}
.feat-banner .feat-ph { display: grid; place-items: center; font-size: 2rem; }
.feat-banner div { padding: 10px 12px 10px 0; }
.feat-banner b { display: block; font-size: .95rem; }
.feat-banner small { display: block; opacity: .9; font-weight: 600; margin-top: 2px; }

/* Colorful Points Ludo match lobby */
.match-panel.arena-lux {
  background:
    radial-gradient(circle at 12% 0%, rgba(251,191,36,.35), transparent 42%),
    radial-gradient(circle at 100% 10%, rgba(16,185,129,.28), transparent 40%),
    linear-gradient(180deg, #fffdf8, #ecfeff);
  border: 1px solid rgba(15,118,110,.18);
  overflow: hidden;
}
.arena-art {
  position: relative; height: 132px; margin: -4px -4px 12px;
  border-radius: 16px; overflow: hidden;
  background:
    linear-gradient(180deg, rgba(7,17,31,.15), rgba(7,17,31,.55)),
    url("/web/assets/images/ludo.png") center/cover;
}
.arena-art.points {
  background:
    linear-gradient(180deg, rgba(120,53,15,.1), rgba(7,17,31,.62)),
    url("/web/assets/images/ludo_points.png") center/cover;
}
.pawn-orbit {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 6px;
  pointer-events: none;
}
.mini-pawn {
  width: 22px; height: 30px; border-radius: 10px 10px 6px 6px;
  box-shadow: 0 4px 8px rgba(0,0,0,.35);
  animation: pawnFloat 2.4s ease-in-out infinite;
}
.mini-pawn:nth-child(1) { background: #e53935; animation-delay: 0s; }
.mini-pawn:nth-child(2) { background: #ffd100; animation-delay: .2s; }
.mini-pawn:nth-child(3) { background: #009739; animation-delay: .4s; }
.mini-pawn:nth-child(4) { background: #1d6fd8; animation-delay: .6s; }
.mini-pawn:nth-child(5) { background: #e53935; animation-delay: .8s; }
.mini-pawn:nth-child(6) { background: #ffd100; animation-delay: 1s; }
.mini-pawn:nth-child(7) { background: #009739; animation-delay: 1.2s; }
.mini-pawn:nth-child(8) { background: #1d6fd8; animation-delay: 1.4s; }
@keyframes pawnFloat {
  0%, 100% { transform: translateY(8px); }
  50% { transform: translateY(-10px); }
}
.coin-row { display: flex; justify-content: center; gap: 8px; margin-top: -18px; position: relative; z-index: 2; }
.gold-coin {
  width: 36px; height: 36px; border-radius: 50%;
  background: radial-gradient(circle at 30% 28%, #fff7d6, #fbbf24 46%, #b45309);
  border: 2px solid #fde68a;
  box-shadow: 0 4px 10px rgba(180,83,9,.35);
  display: grid; place-items: center;
  color: #7c2d12; font-weight: 900; font-size: .78rem;
}
.seats-8 {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 8px 0 4px;
}
.seat-chip {
  background: #fff; border: 1px dashed #cbd5e1; border-radius: 12px; padding: 8px 4px;
  text-align: center; font-size: .7rem; font-weight: 700; color: #64748b;
}
.seat-chip.on { border-style: solid; border-color: #0f766e; color: #0f766e; background: #ecfdf5; }
.stake {
  background: linear-gradient(180deg, #fff, #fffbeb);
  border: 1.5px solid #fde68a !important;
}
.stake b { color: #b45309; }
.stake .win strong { color: #047857; }
.stake::before {
  content: "🪙";
  position: absolute; top: 6px; right: 8px; font-size: .9rem;
}
.stake { position: relative; }

/* Ludo safe stars + home box */
.cell.safe {
  background:
    repeating-conic-gradient(#fff 0 12deg, #fff7d6 0 25deg) #fff7cc !important;
}
.cell.safe::after {
  content: "★" !important;
  inset: auto !important;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: auto; height: auto;
  background: none !important;
  color: #b45309;
  font-size: clamp(8px, 2.4vw, 14px);
  text-shadow: 0 1px 0 #fff, 0 0 6px #fde68a;
  z-index: 2;
  line-height: 1;
}
.cell.center {
  background: linear-gradient(135deg, #fde68a, #f59e0b) !important;
  box-shadow: inset 0 0 0 1px #b45309;
}
.ludo-hub {
  background: #fff;
  border-radius: 10%;
  box-shadow: 0 0 0 2px #fbbf24, 0 8px 18px rgba(0,0,0,.28);
}
.ludo-hub::after {
  content: "HOME";
  width: 42%; height: 42%;
  border-radius: 18%;
  transform: translate(-50%, -50%);
  background: linear-gradient(180deg, #fff, #fde68a);
  color: #7c2d12;
  font-size: clamp(6px, 1.6vw, 11px);
  font-weight: 900;
  display: grid; place-items: center;
  letter-spacing: .04em;
  box-shadow: 0 0 0 2px #b45309;
}
.hub-g { background: linear-gradient(135deg, #bbf7d0, #16a34a 70%, #14532d); }
.hub-y { background: linear-gradient(180deg, #fef08a, #eab308 70%, #854d0e); }
.hub-b { background: linear-gradient(225deg, #bfdbfe, #2563eb 70%, #1e3a8a); }
.hub-r { background: linear-gradient(0deg, #fecaca, #dc2626 70%, #7f1d1d); }

/* In-game: no fat header, leave as overlay */
.play-wrap .topbar { display: none !important; }
.play-exit {
  position: absolute; top: 8px; left: 8px; z-index: 12;
  width: 36px; height: 36px; border: 0; border-radius: 50%;
  background: rgba(15,23,42,.72); color: #fff; font-size: 18px; font-weight: 800;
}
.play-turn {
  position: absolute; top: 10px; left: 48px; right: 48px;
  text-align: center; color: #f8fafc; font-weight: 800; font-size: .85rem;
  z-index: 8; pointer-events: none; text-shadow: 0 1px 4px #000;
}
#view-ludo-play, #view-table-play {
  height: 100dvh;
  padding: 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  overflow: hidden;
}
#view-ludo-play .layout, #view-table-play .layout {
  height: 100%;
  grid-template-columns: 1fr;
}
.ludo-stage {
  height: 100%;
  width: 100%;
  max-width: 100vw;
  display: grid;
  grid-template-rows: auto 1fr auto;
  place-items: stretch;
  padding: 6px;
  gap: 4px;
}
.ludo-hud { position: relative; top: auto; bottom: auto; left: auto; right: auto; }
.ludo-hud-opp, .ludo-hud-me {
  justify-content: space-between;
  padding: 0 6px;
  min-height: 58px;
}
.ludo-hud-opp { order: 0; }
#ludo-board-wrap { order: 1; width: min(100%, calc(100dvh - 148px), 820px) !important; margin: 0 auto; }
.ludo-hud-me { order: 2; }
.play-wrap .ludo-dice.dice {
  box-shadow: 0 8px 18px rgba(0,0,0,.35);
  background: #fff;
}
#dice-opp {
  border-color: #fbbf24 !important;
  background: #fffbeb;
}
#dice-opp.spin, .dice.spin {
  outline: 3px solid #fbbf24;
}
@media (min-width: 900px) {
  .ludo-stage {
    max-width: 920px;
    margin: 0 auto;
    grid-template-rows: 64px 1fr 72px;
    padding: 12px 16px 18px;
  }
  #ludo-board-wrap { width: min(100%, calc(100dvh - 168px), 760px) !important; }
  .ludo-hud-me, .ludo-hud-opp { min-height: 64px; }
}

/* Chess path */
.sq.path::after {
  content: "";
  width: 18%; height: 18%;
  background: rgba(251, 191, 36, .9);
  border-radius: 50%;
  pointer-events: none;
}
.sq.legal::after {
  width: 34%; height: 34%;
  background: rgba(20, 184, 166, .95);
  box-shadow: 0 0 0 4px rgba(20, 184, 166, .2);
}
.sq.hi { box-shadow: inset 0 0 0 4px #fbbf24; }

/* Chat */
.chat-page { display: flex; flex-direction: column; height: calc(100dvh - 88px); }
.chat-msgs { flex: 1; overflow: auto; display: grid; gap: 8px; padding: 8px 0; }
.chat-bubble {
  max-width: 78%; padding: 8px 12px; border-radius: 14px; font-size: .9rem;
  background: #fff; border: 1px solid var(--stroke);
}
.chat-bubble.me { margin-left: auto; background: #ccfbf1; border-color: #99f6e4; }
.chat-send { display: flex; gap: 8px; }
.chat-send input { flex: 1; }

/* Integrity overlay */
.fair-lock {
  position: fixed; inset: 0; z-index: 80; background: rgba(7,17,31,.86);
  display: grid; place-items: center; padding: 24px; color: #fff; text-align: center;
}
.fair-lock.hidden { display: none !important; }
.fair-lock .panel { max-width: 420px; background: #0f172a; color: #e2e8f0; }

/* Rooms always visible */
.match-more { display: block; margin-top: 12px; }
.match-more summary { font-weight: 800; cursor: pointer; margin-bottom: 8px; }

@media (max-width: 420px) {
  .games { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .atm-card { padding: 14px; }
}
