/* Day (white) and Night (dark), red highlight. Coins are always gold. Game boards and cards are white objects in both;
   the Ludo board keeps its four colors.
   Ancient Greek layer: black, white and red are the colors of Greek pottery, so the style adds what those vases and
   temples carry: the Greek key band (meander), inscription letters (Marcellus) for titles, laurel wreaths for winners,
   and mosaic tiles in the logo. See "Ancient Greek layer" at the end of this file. */

@font-face { font-family: 'Outfit'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('/fonts/outfit-latin-wght-normal.woff2') format('woff2-variations'), url('/fonts/outfit-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Outfit'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('/fonts/outfit-latin-ext-wght-normal.woff2') format('woff2-variations'), url('/fonts/outfit-latin-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
/* Marcellus: classical inscription letters for titles and big numbers (the Ancient Greek layer). */
@font-face { font-family: 'Marcellus'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/marcellus-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Marcellus'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/marcellus-latin-ext-400-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
/* Amharic (Ge'ez script): only downloaded when Ethiopic letters appear on screen. */
@font-face { font-family: 'Noto Sans Ethiopic'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/noto-sans-ethiopic-ethiopic-600-normal.woff2') format('woff2');
  unicode-range: U+1200-139F, U+2D80-2DDF, U+AB01-AB2F, U+1E7E0-1E7FF, U+0020, U+00A0; }

:root, :root[data-theme="night"] {
  --bg: #0E0E11;
  --surface: #18181C;
  --surface-2: #222227;
  --surface-3: #2C2C33;
  --line: #25252B;
  --line-strong: #34343C;
  --text: #F5F5F7;
  --muted: #9B9BA6;
  --faint: #64646E;
  --accent: #FF3347;
  --accent-press: #E3233A;
  --accent-text: #FF5A6A;
  --on-accent: #FFFFFF;
  --accent-tint: rgba(255, 51, 71, .14);
  --accent-glow: rgba(255, 51, 71, .45);
  --seg-bg: #18181C;
  --seg-pill: #2C2C33;
  --hero-bg: #1D1D22;
  --ok: #3DDC97;
  --ok-tint: rgba(61, 220, 151, .14);
  --danger: #FF5A6A;
  --danger-tint: rgba(255, 90, 106, .14);
  --gold-text: #F5C04F;
  --gold-tint: rgba(245, 184, 61, .16);
  --streak: #FF8A50;
  --tabbar: rgba(14, 14, 17, .9);
  --backdrop: rgba(0, 0, 0, .62);
  --card: 0 0 0 1px var(--line);
  --raise: 0 24px 48px -12px rgba(0, 0, 0, .6);
  --bubble-bg: #FFFFFF;
  --bubble-text: #111114;
  --toast-bg: #F5F5F7;
  --toast-text: #111114;
  --input-bg: #0E0E11;
  color-scheme: dark;
}

:root[data-theme="day"] {
  --bg: #F5F5F7;
  --surface: #FFFFFF;
  --surface-2: #F0F0F3;
  --surface-3: #E6E6EB;
  --line: #ECECF0;
  --line-strong: #DCDCE2;
  --text: #0F0F12;
  --muted: #6B6B76;
  --faint: #A3A3AD;
  --accent: #E5182D;
  --accent-press: #C4101F;
  --accent-text: #D9142A;
  --on-accent: #FFFFFF;
  --accent-tint: rgba(229, 24, 45, .08);
  --accent-glow: rgba(229, 24, 45, .35);
  --seg-bg: #EAEAEE;
  --seg-pill: #FFFFFF;
  --hero-bg: #111114;
  --ok: #0E9F62;
  --ok-tint: rgba(14, 159, 98, .1);
  --danger: #D9142A;
  --danger-tint: rgba(217, 20, 42, .08);
  --gold-text: #B07605;
  --gold-tint: rgba(245, 184, 61, .2);
  --streak: #C2410C;
  --tabbar: rgba(255, 255, 255, .9);
  --backdrop: rgba(15, 15, 18, .42);
  --card: 0 0 0 1px rgba(15, 15, 18, .04), 0 1px 2px rgba(15, 15, 18, .05), 0 4px 14px -6px rgba(15, 15, 18, .08);
  --raise: 0 24px 48px -12px rgba(15, 15, 18, .22);
  --bubble-bg: #111114;
  --bubble-text: #FFFFFF;
  --toast-bg: #111114;
  --toast-text: #FFFFFF;
  --input-bg: #F5F5F7;
  color-scheme: light;
}

:root {
  --coin: #F5B83D;
  --coin-deep: #B07A12;
  --coin-light: #FFD77F;
  --on-coin: #3A2503;
  --red: #E5484D;
  --green: #2FB673;
  --yellow: #F2C230;
  --blue: #3B82F6;

  --font: 'Outfit', system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', 'Noto Sans Ethiopic', sans-serif;
  --display: 'Marcellus', 'Noto Sans Ethiopic', Georgia, 'Times New Roman', serif;
  /* Greek key (running meander), used as a mask so it takes any color. */
  --meander: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='12' viewBox='0 0 18 12'%3E%3Cpath d='M0 11H3V1H15V9H7V5H11M15 11H18' fill='none' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E");
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.3, 1.35, .5, 1);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ---------- base ---------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 400 15px/1.45 var(--font); overscroll-behavior: none; -webkit-font-smoothing: antialiased; transition: background-color .3s var(--ease), color .3s var(--ease); }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; -webkit-user-select: none; user-select: none; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.icon { flex: none; display: block; }
h1, h2, h3 { margin: 0; font-family: var(--font); }
h1 { font-size: 28px; line-height: 1.1; font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 21px; line-height: 1.25; font-weight: 650; letter-spacing: -.01em; }
h3 { font-size: 13px; line-height: 1.3; font-weight: 600; color: var(--muted); }
.lead { color: var(--muted); margin: 6px 0 16px; font-size: 14.5px; }
.mini-note { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.section { margin-top: 20px; }
.section > h3 { margin: 0 2px 8px; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }

#app { max-width: 480px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; }
.view { flex: 1; padding: 4px 16px calc(96px + var(--safe-bottom)); }
.view.in-game { padding: calc(6px + var(--safe-top)) 12px calc(12px + var(--safe-bottom)); }

/* ---------- screen transitions ---------- */
.enter-right { animation: enter-right .32s var(--ease) both; }
.enter-left { animation: enter-left .32s var(--ease) both; }
.enter-up { animation: enter-up .38s var(--ease) both; }
.enter-zoom { animation: enter-zoom .4s var(--ease) both; }
.enter-fade { animation: fade-in .25s ease both; }
@keyframes enter-right { from { opacity: 0; transform: translateX(32px); } }
@keyframes enter-left { from { opacity: 0; transform: translateX(-32px); } }
@keyframes enter-up { from { opacity: 0; transform: translateY(22px); } }
@keyframes enter-zoom { from { opacity: 0; transform: scale(.96); } }
@keyframes fade-in { from { opacity: 0; } }
.fade-in { animation: fade-in .25s ease both; }

/* ---------- splash ---------- */
.splash { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: var(--bg); transition: opacity .42s var(--ease), transform .42s var(--ease); }
.splash.out { opacity: 0; transform: scale(1.06); pointer-events: none; }
.splash-mark { display: grid; grid-template-columns: repeat(2, 30px); gap: 7px; animation: mark-turn .7s var(--ease) .62s both; }
.splash-mark i { width: 30px; height: 30px; border-radius: 9px; animation: tile-pop .5s var(--spring) both; }
/* Kairos mark: four tiles for four games; the red one is "your moment". */
.splash-mark i:nth-child(1) { background: var(--text); }
.splash-mark i:nth-child(2) { background: var(--accent); animation-delay: .08s; box-shadow: 0 6px 18px -4px var(--accent-glow); }
.splash-mark i:nth-child(3) { background: var(--text); animation-delay: .24s; }
.splash-mark i:nth-child(4) { background: var(--text); animation-delay: .16s; }
.splash.waiting .splash-mark { animation: mark-turn .7s var(--ease) .62s both, mark-spin 1.6s var(--ease) 1.4s infinite; }
@keyframes tile-pop { from { transform: scale(.2); opacity: 0; } }
@keyframes mark-turn { from { transform: rotate(-90deg); } }
@keyframes mark-spin { 0%, 40% { transform: rotate(0); } 70%, 100% { transform: rotate(90deg); } }
.splash-name { display: flex; flex-direction: column; align-items: center; gap: 5px; animation: enter-up .5s var(--ease) .38s both; }
.splash-name .wm { font-size: 34px; font-weight: 800; letter-spacing: -.035em; line-height: 1.05; }
.splash-name .wm span { font-weight: 400; color: var(--muted); letter-spacing: -.02em; }
.splash-name .am { font-family: 'Noto Sans Ethiopic', var(--font); font-size: 17px; font-weight: 600; color: var(--accent-text); }
.splash-name .tag { font-family: 'Noto Sans Ethiopic', var(--font); margin-top: 2px; font-size: 14px; font-weight: 600; color: var(--muted); }
.splash-bar { width: 116px; height: 3px; border-radius: 2px; background: var(--surface-3); overflow: hidden; animation: fade-in .3s ease .5s both; }
.splash-bar i { display: block; width: 40%; height: 100%; border-radius: 2px; background: var(--accent); animation: bar-run 1.1s var(--ease) infinite; }
@keyframes bar-run { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
.splash-msg { min-height: 20px; margin: 0; color: var(--muted); font-size: 14px; text-align: center; padding: 0 32px; }
.splash.fatal .splash-bar { display: none; }

/* ---------- top bar ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(10px + var(--safe-top)) 16px 10px; }
.me-chip { display: flex; align-items: center; gap: 10px; min-width: 0; text-align: left; }
.me-chip .name { font-size: 16px; font-weight: 600; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
.me-chip .sub { color: var(--muted); font-size: 12.5px; }
.coin-chip { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 5px 0 10px; border-radius: 999px; background: var(--surface); box-shadow: var(--card); font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; transition: transform .15s var(--ease); }
.coin-chip:active { transform: scale(.96); }
.coin-dot { width: 18px; height: 18px; border-radius: 50%; background: var(--coin); box-shadow: inset 0 -2.5px 0 var(--coin-deep), inset 0 0 0 2.5px var(--coin-light); flex: none; }
.coin-plus { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; }
.coin-chip.bump { animation: bump .55s var(--spring); }
@keyframes bump { 35% { transform: scale(1.1); } }

/* ---------- avatars & badges ---------- */
.ava { position: relative; width: 44px; height: 44px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-size: 24px; flex: none; }
.ava img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.ava.sm { width: 36px; height: 36px; font-size: 19px; }
.ava.lg { width: 72px; height: 72px; font-size: 40px; }
.ava .lvl { position: absolute; right: -3px; bottom: -3px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--text); color: var(--bg); border: 2px solid var(--surface); font-size: 11px; font-weight: 700; line-height: 16px; text-align: center; }
.ava.sm .lvl { display: none; }
.ava.frame-bronze { box-shadow: 0 0 0 2.5px #C9824B; }
.ava.frame-silver { box-shadow: 0 0 0 2.5px #B8C0D0; }
.ava.frame-gold { box-shadow: 0 0 0 2.5px var(--coin), 0 0 0 5px rgba(245, 184, 61, .25); }
.ava.frame-crown { box-shadow: 0 0 0 2.5px var(--coin), 0 0 0 5px rgba(245, 184, 61, .3); }
.ava.frame-crown::before { content: '👑'; position: absolute; top: -16px; left: 50%; transform: translateX(-50%) rotate(-8deg); font-size: 17px; }
.ava.sm.frame-crown::before { font-size: 12px; top: -11px; }
.badge-pill { display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--gold-text); background: var(--gold-tint); white-space: nowrap; vertical-align: middle; }
.streak-pill { color: var(--streak); background: rgba(255, 122, 69, .14); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 18px; border-radius: 14px; font-size: 16px; font-weight: 600; background: var(--surface); color: var(--text); box-shadow: var(--card); transition: transform .16s var(--ease), background-color .2s, box-shadow .2s, opacity .2s; white-space: nowrap; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn.primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 10px 24px -12px var(--accent-glow); }
.btn.primary:active:not(:disabled) { background: var(--accent-press); }
.btn.ghost { background: var(--surface); }
.btn.danger { background: var(--danger-tint); color: var(--danger); box-shadow: none; }
.btn.plain { background: transparent; box-shadow: none; color: var(--muted); }
.btn.sm { height: 36px; padding: 0 14px; font-size: 14px; border-radius: 11px; }
.btn.xl { height: 62px; border-radius: 18px; font-size: 18px; font-weight: 700; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .42; cursor: not-allowed; box-shadow: none; }
.btn .stack { display: flex; flex-direction: column; align-items: center; line-height: 1.15; }
.btn .stack small { font-size: 12.5px; font-weight: 500; opacity: .78; margin-top: 2px; }
.menu { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.menu .btn { justify-content: flex-start; }

/* ---------- segmented control (sliding pill) ---------- */
.seg { position: relative; display: grid; grid-template-columns: repeat(var(--n, 2), 1fr); padding: 4px; border-radius: 14px; background: var(--seg-bg); box-shadow: inset 0 0 0 1px var(--line); }
.seg-pill { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / var(--n, 2)); border-radius: 10px; background: var(--seg-pill); box-shadow: 0 1px 2px rgba(0, 0, 0, .12), 0 2px 8px -2px rgba(0, 0, 0, .12); transform: translateX(calc(var(--i, 0) * 100%)); transition: transform .34s var(--ease); }
.seg button { position: relative; z-index: 1; min-height: 40px; padding: 6px 4px; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; color: var(--muted); transition: color .2s; }
.seg button.ico-row { flex-direction: row; gap: 6px; }
.seg button b { font-size: 15px; font-weight: 600; }
.seg button small { font-size: 12px; }
.seg button[aria-checked="true"] { color: var(--text); }

/* ---------- lobby ---------- */
.daily { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; margin: 4px 0; border-radius: 18px; background: var(--surface); box-shadow: var(--card); overflow: hidden; transition: height .3s var(--ease), opacity .25s, margin .3s var(--ease), padding .3s var(--ease); }
.daily .daily-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-tint); color: var(--accent-text); flex: none; }
.daily .daily-txt { flex: 1; min-width: 0; }
.daily b { display: block; font-size: 15px; font-weight: 600; }
.daily small { display: block; color: var(--muted); font-size: 13px; }
.daily.collapse { opacity: 0; margin: 0; padding-top: 0; padding-bottom: 0; }
.notice { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 16px; background: var(--accent-tint); color: var(--text); margin: 4px 0; }
.notice .icon { color: var(--accent-text); }

.coins-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 10px; }
.coin-token { position: relative; justify-self: center; width: 100%; max-width: 86px; aspect-ratio: 1; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 40%, var(--coin-light) 0 50%, var(--coin) 52% 100%); color: #5A3A05; box-shadow: inset 0 -5px 0 var(--coin-deep), 0 3px 8px -2px rgba(0, 0, 0, .25);
  transition: transform .28s var(--spring), box-shadow .2s, opacity .2s, filter .2s; }
.coin-token .fee { font-size: 22px; font-weight: 800; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.coin-token .win { font-size: 11px; font-weight: 600; opacity: .8; margin-top: 3px; }
.coin-token:active:not(:disabled) { transform: scale(.94); }
.coin-token[aria-pressed="true"] { transform: translateY(-4px); box-shadow: inset 0 -5px 0 var(--coin-deep), 0 0 0 3px var(--bg), 0 0 0 5.5px var(--accent), 0 12px 20px -8px rgba(0, 0, 0, .35); }
.coin-token:disabled { opacity: .35; filter: grayscale(.8); cursor: not-allowed; }
.coin-token .waiting { position: absolute; top: -6px; right: -4px; height: 20px; padding: 0 7px; border-radius: 10px; background: var(--ok); color: #fff; font-size: 11px; font-weight: 700; line-height: 16px; border: 2px solid var(--bg); animation: pop-in .3s var(--spring); }
.coin-token .lock { position: absolute; bottom: -6px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--muted); box-shadow: var(--card); }
@keyframes pop-in { from { transform: scale(.4); opacity: 0; } }

.play-bar { position: sticky; bottom: calc(80px + var(--safe-bottom)); z-index: 2; margin-top: 18px; padding-top: 14px; background: linear-gradient(to bottom, transparent, var(--bg) 45%); }
.play-bar .btn { width: 100%; }
.online-line { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-size: 13px; margin-top: 14px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-tint); }

/* ---------- tab bar ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: grid; grid-template-columns: repeat(5, 1fr); max-width: 480px; margin: 0 auto; padding: 6px 6px calc(6px + var(--safe-bottom));
  background: var(--tabbar); -webkit-backdrop-filter: blur(20px) saturate(1.4); backdrop-filter: blur(20px) saturate(1.4); border-top: 1px solid var(--line); }
.tabbar.slide-in { animation: tab-in .38s var(--ease) both; }
@keyframes tab-in { from { transform: translateY(100%); } }
.tab-pill { position: absolute; top: 8px; width: 56px; height: 30px; border-radius: 15px; background: var(--accent-tint); left: calc(6px + (100% - 12px) * (2 * var(--tab-i, 0) + 1) / 10 - 28px); transition: left .38s var(--ease); pointer-events: none; }
.tabbar button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 0 2px; color: var(--faint); font-size: 11.5px; font-weight: 500; transition: color .2s; }
.tabbar button .icon { width: 56px; height: 30px; padding: 4px 16px; transition: transform .25s var(--spring); }
.tabbar button[aria-current="page"] { color: var(--text); }
.tabbar button[aria-current="page"] .icon { color: var(--accent-text); }
.tabbar button:active .icon { transform: scale(.88); }
.tab-badge { position: absolute; top: 2px; left: calc(50% + 8px); min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 13px; border: 2px solid var(--bg); }

/* ---------- waiting ---------- */
.waiting-screen { min-height: 68vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 12px; }
.loader-mark { display: grid; grid-template-columns: repeat(2, 22px); gap: 6px; margin-bottom: 8px; animation: mark-spin 1.6s var(--ease) infinite; }
.loader-mark i { width: 22px; height: 22px; border-radius: 7px; }
.loader-mark i:nth-child(1) { background: var(--red); } .loader-mark i:nth-child(2) { background: var(--green); }
.loader-mark i:nth-child(3) { background: var(--blue); } .loader-mark i:nth-child(4) { background: var(--yellow); }
.timer-pill { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; background: var(--surface); box-shadow: var(--card); color: var(--muted); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.seat-row { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin: 12px 0; }
.seat { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 74px; font-size: 13px; color: var(--muted); animation: pop-in .35s var(--spring); }
.seat .empty { width: 44px; height: 44px; border-radius: 50%; border: 2px dashed var(--line-strong); }
.code-box { font-size: 32px; font-weight: 700; letter-spacing: .32em; padding: 12px 10px 12px 24px; border-radius: 18px; background: var(--surface); box-shadow: var(--card); font-variant-numeric: tabular-nums; }
.private-card { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 14px; }

/* ---------- game ---------- */
.game-top { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; gap: 8px; padding: 2px 0 10px; }
.icon-btn { position: relative; width: 40px; height: 40px; border-radius: 12px; background: var(--surface); box-shadow: var(--card); display: grid; place-items: center; transition: transform .15s var(--ease); }
.icon-btn:active { transform: scale(.92); }
.icon-btn .dot { position: absolute; top: 7px; right: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface); }
.pot { text-align: center; }
.pot b { display: block; font-size: 17px; font-weight: 700; }
.pot small { color: var(--muted); font-size: 12.5px; }
.clock { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; border-radius: 12px; background: var(--surface); box-shadow: var(--card); font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.clock.low { color: var(--danger); }

.players { display: grid; grid-template-columns: repeat(var(--n, 4), 1fr); gap: 8px; margin-bottom: 10px; }
.pcard { position: relative; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px 8px; border-radius: 16px; background: var(--surface); box-shadow: var(--card); text-align: center; transition: box-shadow .25s, opacity .25s, transform .25s var(--ease); }
.pcard .pname { max-width: 100%; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard .pmeta { min-height: 18px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; color: var(--muted); font-size: 11.5px; }
.pcard .stripe { position: absolute; top: 0; left: 14px; right: 14px; height: 3px; border-radius: 0 0 3px 3px; }
.pcard.turn { box-shadow: inset 0 0 0 2px var(--turn-color, var(--accent)), var(--card); transform: translateY(-2px); }
.pcard.out { opacity: .38; }
.pcard .ring { position: absolute; inset: -4px; border-radius: 50%; pointer-events: none; }
.pcard .ava-wrap { position: relative; }
.pcard.me .pname::after { content: ' (you)'; color: var(--muted); font-weight: 400; }
.offline-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); display: inline-block; }
.bubble { position: absolute; top: 50px; left: 50%; z-index: 4; transform: translateX(-50%); max-width: 156px; width: max-content; padding: 7px 11px; border-radius: 14px; background: var(--bubble-bg); color: var(--bubble-text); font-size: 13px; line-height: 1.3; box-shadow: var(--raise); overflow-wrap: anywhere; animation: bubble-in .3s var(--spring); }
.bubble::before { content: ''; position: absolute; top: -6px; left: 50%; margin-left: -6px; border: 6px solid transparent; border-top: 0; border-bottom-color: var(--bubble-bg); }
.bubble.out { opacity: 0; transition: opacity .25s; }
@keyframes bubble-in { from { transform: translateX(-50%) translateY(4px) scale(.7); opacity: 0; } }

.board-wrap { position: relative; width: 100%; max-width: 460px; aspect-ratio: 1; margin: 0 auto; }
.board-svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 10px 24px rgba(0, 0, 0, .18)); }
.piece { transition: transform .1s linear; cursor: pointer; }
.piece .piece-ring { opacity: 0; }
.piece.legal .piece-ring { opacity: 1; stroke: #111114; animation: ring-pulse .9s ease-in-out infinite; }
@keyframes ring-pulse { 50% { stroke-width: 6; } }
.piece.moving { transition: transform .1s ease-out; }
.piece.captured { opacity: .3; transition: opacity .15s, transform .25s ease-in; }
.piece.gone { opacity: 0; pointer-events: none; }

.smart { display: flex; gap: 6px; overflow-x: auto; padding: 10px 2px 4px; margin: 0 -2px; scrollbar-width: none; min-height: 48px; }
.smart::-webkit-scrollbar { display: none; }
.smart button, .quick-row button { flex: none; height: 34px; padding: 0 13px; border-radius: 999px; background: var(--surface); box-shadow: var(--card); font-size: 13.5px; font-weight: 500; transition: transform .15s var(--ease), background-color .2s; }
.smart button:active, .quick-row button:active { transform: scale(.95); }
.smart button.hot { background: var(--accent-tint); color: var(--accent-text); box-shadow: inset 0 0 0 1px var(--accent-glow); animation: pop-in .3s var(--spring); }
.action-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; min-height: 92px; margin-top: 8px; }
.status-text { font-size: 15px; font-weight: 500; line-height: 1.3; color: var(--muted); }
.status-text.mine { color: var(--text); font-weight: 600; }
.right-tools { display: flex; justify-content: flex-end; }
.dice { width: 76px; height: 76px; padding: 13px; border-radius: 20px; background: #FFFFFF; display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); gap: 2px;
  box-shadow: inset 0 -5px 0 #E3E3E8, 0 0 0 4px var(--dice-ring, transparent), 0 10px 22px -8px rgba(0, 0, 0, .35); transition: box-shadow .25s, opacity .25s; }
.dice i { width: 12px; height: 12px; border-radius: 50%; background: #111114; place-self: center; visibility: hidden; }
.dice.idle { opacity: .5; }
.dice.can-roll { cursor: pointer; animation: nudge 1.2s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.dice.rolling { animation: roll .5s var(--ease); }
@keyframes roll { 0% { transform: rotate(0) scale(.8); } 60% { transform: rotate(320deg) scale(1.08); } 100% { transform: rotate(360deg) scale(1); } }

/* ---------- game picker ---------- */
.game-picker { display: grid; grid-template-columns: repeat(var(--n, 4), 1fr); gap: 8px; }
.game-tile { position: relative; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 2px 11px; border-radius: 18px; background: var(--surface); box-shadow: var(--card); transition: transform .2s var(--ease), box-shadow .2s; }
.game-tile .art { width: 46px; height: 46px; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .16)); }
.game-tile .art.pop { animation: art-pop .45s var(--spring); }
@keyframes art-pop { 40% { transform: scale(1.14) rotate(-5deg); } }
.game-tile .gname { max-width: 100%; font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.01em; transition: color .2s; }
.game-tile:active { transform: scale(.96); }
.game-tile[aria-checked="true"] { box-shadow: inset 0 0 0 2px var(--accent), var(--card); }
.game-tile[aria-checked="true"] .gname { color: var(--text); }
.game-picker.compact .game-tile { padding: 11px 2px 9px; gap: 6px; background: var(--surface-2); box-shadow: none; }
.game-picker.compact .game-tile[aria-checked="true"] { box-shadow: inset 0 0 0 2px var(--accent); }
.game-picker.compact .art { width: 36px; height: 36px; }
.game-tag { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 2px 0; color: var(--muted); font-size: 14px; line-height: 1.35; }
.rules-link { flex: none; display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 12px; border-radius: 999px; background: var(--surface); box-shadow: var(--card); color: var(--text); font-size: 13px; font-weight: 600; transition: transform .15s var(--ease); }
.rules-link:active { transform: scale(.95); }
.rules-head { display: flex; align-items: center; gap: 12px; margin: 2px 0 14px; }
.rules-head .art { width: 44px; height: 44px; flex: none; }
.rules { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.rules li { padding: 12px 14px; border-radius: 14px; background: var(--surface-2); font-size: 14.5px; line-height: 1.45; }
.private-art .art { width: 60px; height: 60px; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, .18)); }
.loader-art { margin-bottom: 8px; animation: bob 1.4s ease-in-out infinite; }
.loader-art .art { width: 64px; height: 64px; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .2)); }
@keyframes bob { 50% { transform: translateY(-8px) rotate(-3deg); } }

/* ---------- shared game bits ---------- */
.stage { position: relative; }
.action-center { display: flex; justify-content: center; }
.game:not(.game-ludo) .action-bar { grid-template-columns: 1fr auto auto; min-height: 64px; }
.game:not(.game-ludo) .right-tools:empty { display: none; }
.seat-flag { position: absolute; top: -11px; left: 50%; z-index: 5; transform: translateX(-50%); height: 22px; padding: 0 9px; border-radius: 11px; background: var(--text); color: var(--bg); font-size: 12px; font-weight: 700; line-height: 22px; white-space: nowrap; box-shadow: var(--raise); animation: flag-in .3s var(--spring); }
.seat-flag.accent { background: var(--accent); color: #FFFFFF; }
.seat-flag.good { background: var(--ok); color: #0E0E11; }
.seat-flag.out { opacity: 0; transition: opacity .25s; }
@keyframes flag-in { from { transform: translateX(-50%) translateY(6px) scale(.7); opacity: 0; } }
.board-banner { position: absolute; left: 50%; top: 50%; z-index: 4; transform: translate(-50%, -50%); padding: 10px 16px; border-radius: 14px; background: #111114; color: #FFFFFF; font-size: 15px; font-weight: 650; white-space: nowrap; box-shadow: 0 16px 32px -10px rgba(0, 0, 0, .5); pointer-events: none; }
.board-banner.pop { animation: banner-pop .35s var(--spring); }
@keyframes banner-pop { from { transform: translate(-50%, -50%) scale(.7); opacity: 0; } }
.round-chip, .quiet-chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 999px; background: var(--surface); box-shadow: var(--card); font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.quiet-chip { padding: 0 11px; font-size: 13px; color: var(--muted); }

/* ---------- tic-tac-toe ---------- */
.stage-ttt { display: flex; justify-content: center; padding: 4px 0; }
.ttt-board { position: relative; width: min(100%, 340px); aspect-ratio: 1; display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 12px; border-radius: 28px; background: #FFFFFF; box-shadow: 0 0 0 1px rgba(15, 15, 18, .05), 0 10px 24px rgba(0, 0, 0, .18); }
.ttt-board::before { content: ''; position: absolute; inset: 12px; pointer-events: none;
  background: linear-gradient(#E7E7EC 0 0) 33.4% 50% / 3px 90% no-repeat, linear-gradient(#E7E7EC 0 0) 66.6% 50% / 3px 90% no-repeat,
    linear-gradient(#E7E7EC 0 0) 50% 33.4% / 90% 3px no-repeat, linear-gradient(#E7E7EC 0 0) 50% 66.6% / 90% 3px no-repeat; }
.ttt-cell { position: relative; display: grid; place-items: center; border-radius: 16px; transition: background-color .2s; }
.ttt-cell:disabled { cursor: default; }
.ttt-cell.open:active { background: #F1F1F4; }
.mk { width: 62%; height: 62%; overflow: visible; }
.mk path, .mk circle { fill: none; stroke-width: 12; stroke-linecap: round; }
.mk-x path { stroke: #E5182D; }
.mk-o circle { stroke: #111114; }
.mk.draw path, .mk.draw circle { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw-in .26s var(--ease) forwards; }
.mk.draw path:nth-child(2) { animation-delay: .12s; }
@keyframes draw-in { to { stroke-dashoffset: 0; } }
.mk.vanish { animation: vanish .3s ease-in forwards; }
@keyframes vanish { to { opacity: 0; transform: scale(.55); } }
.ttt-cell.fading .mk { animation: fade-pulse 1.5s ease-in-out infinite; }
@keyframes fade-pulse { 0%, 100% { opacity: .34; } 50% { opacity: .16; } }
.ttt-board.clearing .mk { animation: vanish .25s ease-in forwards; }
.ttt-line { position: absolute; inset: 12px; width: calc(100% - 24px); height: calc(100% - 24px); pointer-events: none; overflow: visible; z-index: 2; }
.ttt-line path { fill: none; stroke-width: 10; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw-in .4s var(--ease) forwards; }
.ttt-line .win-x { stroke: #E5182D; }
.ttt-line .win-o { stroke: #111114; }
.mark-chip { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 6px; font-size: 12px; font-weight: 800; line-height: 1; }
.mark-chip.x { background: var(--accent-tint); color: var(--accent-text); }
.mark-chip.o { background: var(--surface-3); color: var(--text); }
.pips { display: inline-flex; gap: 3px; }
.pips i { width: 7px; height: 7px; border-radius: 50%; background: var(--surface-3); transition: background-color .3s; }
.pips i.on { background: var(--accent); }

/* ---------- checkers ---------- */
.stage-ck { display: flex; justify-content: center; }
.ck-frame { width: min(100%, 400px); padding: 8px; border-radius: 20px; background: #FFFFFF; box-shadow: 0 0 0 1px rgba(15, 15, 18, .05), 0 10px 24px rgba(0, 0, 0, .18); }
.ck-board { position: relative; width: 100%; aspect-ratio: 1; display: grid; grid-template: repeat(8, 1fr) / repeat(8, 1fr); border-radius: 12px; overflow: hidden; }
.ck-sq.light { background: #EEEEF2; }
.ck-sq.dark { position: relative; background: #2E2E35; cursor: pointer; transition: background-color .25s; }
.ck-sq.last { background: #4A4A54; }
.ck-sq.dest::after { content: ''; position: absolute; left: 35%; top: 35%; width: 30%; height: 30%; border-radius: 50%; background: #F5B83D; box-shadow: 0 0 0 4px rgba(245, 184, 61, .25); animation: pop-in .25s var(--spring); }
.ck-sq.cap::after { background: #FF3347; box-shadow: 0 0 0 4px rgba(255, 51, 71, .3); }
.ck-piece { position: absolute; left: 0; top: 0; z-index: 1; width: 12.5%; height: 12.5%; padding: 1.5%; cursor: pointer; transition: transform .22s var(--ease); }
.ck-piece .face { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; transition: transform .2s var(--ease), opacity .3s; }
.ck-piece.red .face { color: #FFFFFF; background: radial-gradient(circle at 50% 38%, #FF4A5D, #D5132A 72%); box-shadow: inset 0 -3px 0 #9E0E1F, inset 0 0 0 3px rgba(255, 255, 255, .16), 0 2px 5px rgba(0, 0, 0, .45); }
.ck-piece.white .face { color: #E5182D; background: radial-gradient(circle at 50% 38%, #FFFFFF, #E2E2E8 72%); box-shadow: inset 0 -3px 0 #B4B4BE, inset 0 0 0 3px rgba(0, 0, 0, .05), 0 2px 5px rgba(0, 0, 0, .45); }
.ck-piece .face .icon { width: 54%; height: 54%; stroke-width: 2.4; opacity: 0; transform: scale(.4); transition: opacity .2s, transform .35s var(--spring); }
.ck-piece.king .face .icon { opacity: 1; transform: none; }
.ck-piece::after { content: ''; position: absolute; inset: 1.5%; border-radius: 50%; pointer-events: none; transition: box-shadow .2s; }
.ck-piece.can::after { box-shadow: 0 0 0 2px rgba(245, 184, 61, .75); animation: ck-glow 1.3s ease-in-out infinite; }
@keyframes ck-glow { 50% { box-shadow: 0 0 0 2px rgba(245, 184, 61, .25); } }
.ck-piece.sel { z-index: 2; }
.ck-piece.sel .face { transform: translateY(-4px) scale(1.1); }
.ck-piece.sel::after { box-shadow: 0 0 0 3.5px #F5B83D, 0 10px 18px rgba(0, 0, 0, .55); transform: translateY(-4px) scale(1.1); }
.ck-piece.moving { z-index: 3; }
.ck-piece.taken .face { opacity: 0; transform: scale(.4); }
.ck-piece.crowned .face { animation: crown-pop .5s var(--spring); }
@keyframes crown-pop { 40% { transform: scale(1.2); } }
.ck-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.ck-dot.red { background: #E5182D; }
.ck-dot.white { background: #F5F5F7; box-shadow: inset 0 0 0 1.5px #B4B4BE; }

/* ---------- Crazy Eights ---------- */
.stage-c8 { display: flex; flex-direction: column; gap: 6px; }
.c8-table { padding: 18px 12px 14px; border-radius: 24px; background: var(--surface); box-shadow: var(--card); }
.c8-piles { display: flex; justify-content: center; align-items: center; gap: 36px; }
.pc { --cw: 76px; position: relative; flex: none; width: var(--cw); aspect-ratio: 5 / 7; border-radius: calc(var(--cw) * .13); background: #FFFFFF; color: #111114; box-shadow: 0 0 0 1px rgba(15, 15, 18, .09), 0 4px 10px -2px rgba(0, 0, 0, .28); overflow: hidden; }
.pc.red { color: #E5182D; }
.pc.wild { box-shadow: inset 0 0 0 2px rgba(229, 24, 45, .45), 0 0 0 1px rgba(15, 15, 18, .09), 0 4px 10px -2px rgba(0, 0, 0, .28); }
.pc .idx { position: absolute; left: 8%; top: 5%; display: flex; flex-direction: column; align-items: center; line-height: 1; }
.pc .idx b { font-size: calc(var(--cw) * .26); font-weight: 750; letter-spacing: -.05em; }
.pc .suit { fill: currentColor; }
.pc .suit.mini { width: calc(var(--cw) * .17); height: calc(var(--cw) * .17); margin-top: 2px; }
.pc .suit.pip { position: absolute; right: 9%; bottom: 8%; width: 50%; height: 50%; }
.pc.back { background: #1B1B20; box-shadow: 0 0 0 1px rgba(255, 255, 255, .07), 0 4px 10px -2px rgba(0, 0, 0, .4); }
.pc.back::before { content: ''; position: absolute; inset: 8%; border-radius: calc(var(--cw) * .07); border: 2px solid #E5182D; background: repeating-linear-gradient(45deg, rgba(229, 24, 45, .18) 0 3px, transparent 3px 8px); }
.c8-deck { position: relative; width: 76px; aspect-ratio: 5 / 7; border-radius: 10px; }
.c8-deck .pc { position: absolute; left: 0; top: 0; }
.c8-deck .pc:first-child { transform: translate(4px, 4px); }
.c8-deck { transition: transform .16s var(--ease); }
.c8-deck:not(:disabled):active { transform: scale(.95); }
.c8-deck:disabled { cursor: default; }
.deck-count { position: absolute; left: 50%; bottom: -24px; transform: translateX(-50%); color: var(--muted); font-size: 12.5px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.c8-pile { position: relative; width: 76px; aspect-ratio: 5 / 7; }
.c8-pile .pc { position: absolute; left: 0; top: 0; transform: rotate(var(--tilt, 0deg)); }
.c8-info { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 30px; }
.suit-chip, .next-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; background: var(--surface-2); font-size: 13.5px; font-weight: 600; }
.suit-chip .suit { width: 15px; height: 15px; fill: currentColor; }
.suit-chip.red { color: var(--accent-text); }
.suit-chip.changed { box-shadow: inset 0 0 0 1.5px currentColor; }
.suit-chip.pop, .next-chip.pop { animation: pop-in .35s var(--spring); }
.next-chip { color: var(--muted); }
.c8-hand { overflow-x: auto; padding: 18px 4px 4px; margin: 0 -4px; scrollbar-width: none; }
.c8-hand::-webkit-scrollbar { display: none; }
.c8-fan { display: flex; justify-content: center; padding: 0 4px; }
.c8-fan.scroll { justify-content: flex-start; }
.hand-card { position: relative; flex: none; border-radius: 9px; transition: transform .22s var(--ease), opacity .2s; }
.hand-card .pc { --cw: 62px; }
.hand-card.ok { transform: translateY(-12px); }
.hand-card.ok .pc { box-shadow: 0 0 0 2px var(--accent), 0 10px 18px -6px rgba(0, 0, 0, .4); }
.hand-card.ok:active { transform: translateY(-8px) scale(.97); }
.hand-card.dim { opacity: .5; }
.hand-card.fresh .pc { animation: pop-in .35s var(--spring); }
.flying-card { pointer-events: none; will-change: transform; }
.last-pill { height: 18px; padding: 0 7px; border-radius: 9px; background: var(--accent); color: #FFFFFF; font-size: 11px; font-weight: 700; line-height: 18px; animation: pop-in .3s var(--spring); }
.cards-meta { display: inline-flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; }
.mini-back { display: inline-block; width: 9px; height: 12px; border-radius: 2px; background: #1B1B20; box-shadow: inset 0 0 0 1.5px #E5182D; }
.suit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
.suit-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px 8px 14px; border-radius: 18px; background: var(--surface-2); transition: transform .16s var(--ease); }
.suit-btn .suit { width: 46px; height: 46px; margin-bottom: 4px; fill: var(--text); }
.suit-btn.red .suit { fill: var(--accent); }
.suit-btn b { font-size: 16px; font-weight: 650; }
.suit-btn small { color: var(--muted); font-size: 12.5px; }
.suit-btn.best { box-shadow: inset 0 0 0 2px var(--accent); }
.suit-btn:active { transform: scale(.96); }

/* ---------- chat ---------- */
.chat-log { max-height: 38vh; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 2px 12px; }
.chat-line { display: flex; align-items: flex-end; gap: 8px; }
.chat-line.new { animation: enter-up .25s var(--ease); }
.chat-line .msg { max-width: 78%; padding: 8px 12px; border-radius: 16px 16px 16px 6px; background: var(--surface-2); overflow-wrap: anywhere; }
.chat-line .who { font-size: 12px; color: var(--muted); margin-bottom: 1px; }
.chat-line.mine { flex-direction: row-reverse; }
.chat-line.mine .msg { background: var(--accent); color: var(--on-accent); border-radius: 16px 16px 6px 16px; }
.chat-line.mine .who { color: rgba(255, 255, 255, .78); }
.chat-empty { color: var(--muted); text-align: center; padding: 18px 0; }
.chat-input { display: flex; gap: 8px; margin-top: 12px; }
.chat-input input, .field input { flex: 1; min-width: 0; height: 48px; padding: 0 14px; border-radius: 14px; background: var(--input-bg); border: 1px solid var(--line-strong); outline: none; transition: border-color .2s, box-shadow .2s; }
.chat-input input:focus, .field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.chat-input .btn { width: 48px; padding: 0; }
.quick-row { display: flex; flex-wrap: wrap; gap: 6px; }
.quick-row button { background: var(--surface-2); box-shadow: none; }
.react-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 4px 0 12px; }
.react-row button { aspect-ratio: 1; border-radius: 14px; background: var(--surface-2); font-size: 26px; transition: transform .2s var(--spring); }
.react-row button:active { transform: scale(.86); }
.flying { position: fixed; z-index: 50; font-size: 34px; pointer-events: none; transition: transform .7s cubic-bezier(.3, .6, .3, 1), opacity .3s; }
.fx-layer { position: fixed; inset: 0; pointer-events: none; z-index: 40; }

/* ---------- result ---------- */
.result-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 4px 0 6px; }
.result-badge { width: 68px; height: 68px; border-radius: 22px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); animation: pop-in .45s var(--spring); }
.result-badge.win { background: var(--gold-tint); color: var(--gold-text); }
.result-head .lead { margin: 0; }
.result-list { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 10px; }
.result-row { display: grid; grid-template-columns: 24px auto 1fr auto; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; background: var(--surface-2); animation: enter-up .35s var(--ease) both; }
.result-row:nth-child(2) { animation-delay: .06s; } .result-row:nth-child(3) { animation-delay: .12s; } .result-row:nth-child(4) { animation-delay: .18s; }
.result-row .ava { background: var(--surface); }
.result-row .place { font-size: 17px; font-weight: 700; color: var(--muted); text-align: center; }
.result-row.win .place { color: var(--gold-text); }
.result-row .nm { font-weight: 600; }
.result-row .amt { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.result-row .amt.plus { color: var(--ok); }
.result-row .amt.minus { color: var(--muted); }
.pot-line { text-align: center; color: var(--muted); font-size: 13px; margin: 0 0 12px; }
.unlock { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-bottom: 8px; border-radius: 16px; background: var(--gold-tint); }
.unlock .ico { font-size: 26px; }
.unlock b { display: block; }
.xp-line { color: var(--muted); text-align: center; font-size: 13.5px; margin-bottom: 12px; }
.rematch-line { text-align: center; color: var(--muted); font-size: 13px; margin: 10px 0 0; }

/* ---------- lists ---------- */
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 14px -16px 4px; padding: 2px 16px 4px; }
.chips::-webkit-scrollbar { display: none; }
.chips button { flex: none; height: 36px; padding: 0 14px; border-radius: 999px; background: var(--surface); box-shadow: var(--card); color: var(--muted); font-size: 14px; font-weight: 500; transition: background-color .2s, color .2s, transform .15s var(--ease); }
.chips button:active { transform: scale(.95); }
.chips button[aria-pressed="true"] { background: var(--text); color: var(--bg); box-shadow: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
.list { background: var(--surface); border-radius: 18px; box-shadow: var(--card); padding: 0 14px; }
.li { width: 100%; display: grid; grid-template-columns: 28px 36px 1fr auto; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); text-align: left; }
.li:last-child { border-bottom: 0; }
.li .rank { font-size: 15px; font-weight: 700; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; display: grid; place-items: center; }
.li .rank.top { color: var(--gold-text); }
.li .nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .meta { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.li .val { font-size: 15px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.li .val.plus { color: var(--ok); }
.li.me { position: relative; }
.li.me::before { content: ''; position: absolute; inset: 4px -8px; border-radius: 12px; background: var(--accent-tint); z-index: 0; }
.li.me > * { position: relative; z-index: 1; }
.li .btns { display: flex; gap: 6px; }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; color: var(--muted); padding: 32px 20px; }
.empty-state .empty-ico { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; background: var(--surface); box-shadow: var(--card); color: var(--muted); }
.status-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--faint); }
.status-dot.online { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-tint); }
.status-dot.playing { background: var(--coin); box-shadow: 0 0 0 3px var(--gold-tint); }
.summary-line { margin: 12px 2px; color: var(--muted); font-size: 14px; }

/* ---------- profile ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.page-head > :first-child { flex: 1; }
.profile-head { display: flex; align-items: center; gap: 16px; margin: 16px 0 6px; }
.profile-head .who { flex: 1; min-width: 0; }
.profile-head .who h2 { word-break: break-word; }
.level-line { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; margin-top: 2px; }
.xpbar { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; margin-top: 10px; }
.xpbar i { display: block; height: 100%; border-radius: 3px; background: var(--accent); transform-origin: left; animation: grow .8s var(--ease) .15s both; }
@keyframes grow { from { transform: scaleX(0); } }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 16px; }
.stat { padding: 12px 4px 10px; border-radius: 16px; background: var(--surface); box-shadow: var(--card); text-align: center; }
.stat b { display: block; font-size: 20px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat b.plus { color: var(--ok); }
.stat small { color: var(--muted); font-size: 12px; }
.ach-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.ach { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border-radius: 16px; background: var(--surface); box-shadow: var(--card); text-align: left; }
.ach .ico { font-size: 24px; line-height: 1; filter: grayscale(1); opacity: .45; }
.ach.t1 .ico, .ach.t2 .ico, .ach.t3 .ico { filter: none; opacity: 1; }
.ach b { display: block; font-size: 14px; font-weight: 600; }
.ach small { display: block; color: var(--muted); font-size: 12px; line-height: 1.3; }
.ach.chosen { box-shadow: inset 0 0 0 2px var(--accent), var(--card); }
.tiers { display: flex; gap: 3px; margin: 7px 0 3px; }
.tiers i { width: 16px; height: 4px; border-radius: 2px; background: var(--surface-3); }
.tiers i.on1 { background: #C9824B; } .tiers i.on2 { background: #B8C0D0; } .tiers i.on3 { background: var(--coin); }
.settings-card { margin-top: 20px; padding: 14px; border-radius: 18px; background: var(--surface); box-shadow: var(--card); }
.set-row { display: flex; flex-direction: column; gap: 10px; }
.set-row + .set-row { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.set-label { font-size: 14px; font-weight: 600; }
.link-row { display: flex; align-items: center; gap: 12px; width: 100%; font-size: 15px; font-weight: 500; text-align: left; }
.link-row .grow { flex: 1; }
.link-row .icon:last-child { color: var(--faint); }
.ava-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.ava-grid button { position: relative; aspect-ratio: 1; border-radius: 14px; background: var(--surface-2); font-size: 25px; display: grid; place-items: center; overflow: hidden; transition: transform .2s var(--spring), box-shadow .2s; }
.ava-grid button:active:not(:disabled) { transform: scale(.9); }
.ava-grid button[aria-pressed="true"] { box-shadow: inset 0 0 0 2.5px var(--accent); background: var(--accent-tint); }
.ava-grid button:disabled { opacity: .35; }
.ava-grid button .req { position: absolute; bottom: 3px; font-size: 9.5px; font-weight: 600; color: var(--muted); }
.ava-grid img { width: 100%; height: 100%; object-fit: cover; }
.field { display: flex; gap: 8px; }
.field-error { color: var(--danger); font-size: 13px; min-height: 18px; margin-top: 6px; }
.id-line { color: var(--faint); font-size: 12.5px; margin: 20px 0 0; text-align: center; }

/* ---------- wallet ---------- */
.wallet-hero { position: relative; overflow: hidden; isolation: isolate; margin-top: 14px; padding: 20px 20px 26px; border-radius: 24px; background: var(--hero-bg); color: #FFFFFF; box-shadow: var(--raise); }
:root[data-theme="night"] .wallet-hero { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); }
.wallet-hero::before, .wallet-hero::after { content: ''; position: absolute; z-index: -1; border-radius: 50%; border: 22px solid var(--accent); }
.wallet-hero::before { width: 176px; height: 176px; right: -74px; top: -88px; border-width: 20px; opacity: .95; }
.wallet-hero::after { width: 104px; height: 104px; right: 56px; bottom: -74px; border-width: 12px; opacity: .45; }
.wallet-hero .label { font-size: 14px; font-weight: 500; color: rgba(255, 255, 255, .7); }
.wallet-hero .amount { display: flex; align-items: center; gap: 12px; margin: 8px 0 6px; font-size: 46px; font-weight: 700; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.wallet-hero .amount .coin-dot { width: 32px; height: 32px; box-shadow: inset 0 -4px 0 var(--coin-deep), inset 0 0 0 4px var(--coin-light); }
.wallet-hero .note { max-width: 230px; font-size: 13px; color: rgba(255, 255, 255, .62); }
.wallet-hero .held { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; height: 28px; padding: 0 11px; border-radius: 999px; background: rgba(255, 255, 255, .12); font-size: 13px; font-weight: 500; }
.ludo-stripe { position: absolute; left: 20px; bottom: 12px; display: flex; gap: 5px; }
.ludo-stripe i { width: 14px; height: 3px; border-radius: 2px; }
.wallet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.wallet-actions .btn { height: 58px; }
.wk { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.history .day { margin: 18px 2px 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.history .group { padding: 0 14px; border-radius: 18px; background: var(--surface); box-shadow: var(--card); }
.hrow { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.hrow:last-child { border-bottom: 0; }
.hrow > div { min-width: 0; }
.tone { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); flex: none; }
.tone.ok { background: var(--ok-tint); color: var(--ok); }
.tone.accent { background: var(--accent-tint); color: var(--accent-text); }
.tone.gold { background: var(--gold-tint); color: var(--gold-text); }
.hrow .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hrow .d { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hrow .a { font-size: 16px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.hrow .a.plus { color: var(--ok); }
.hrow .a.minus { color: var(--text); }
.cur-switch { margin-top: 14px; }

/* ---------- shop ---------- */
.packs { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.pack { display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 14px; padding: 12px 12px 12px 14px; border-radius: 18px; background: var(--surface-2); text-align: left; transition: transform .16s var(--ease); }
.pack:active { transform: scale(.98); }
.pack .tone { width: 48px; height: 48px; border-radius: 14px; }
.pack b { display: block; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pack small { color: var(--muted); font-size: 13px; }
.pack .price { display: inline-flex; align-items: center; gap: 5px; height: 36px; padding: 0 12px; border-radius: 11px; background: var(--accent); color: var(--on-accent); font-size: 15px; font-weight: 700; white-space: nowrap; }
.first-deal { display: flex; align-items: center; gap: 8px; padding: 10px 12px; margin-bottom: 12px; border-radius: 14px; background: var(--ok-tint); color: var(--ok); font-size: 14px; font-weight: 500; }

/* ---------- sheets ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 30; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: var(--backdrop); animation: fade-in .25s ease both; }
.sheet { position: relative; width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; padding: 8px 16px calc(20px + var(--safe-bottom)); border-radius: 26px 26px 0 0; background: var(--surface); box-shadow: var(--raise); animation: sheet-up .38s var(--ease) both; }
:root[data-theme="night"] .sheet { background: #17171B; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06); }
.sheet-grip { width: 38px; height: 5px; border-radius: 3px; background: var(--line-strong); margin: 4px auto 14px; }
.sheet h2 { margin-bottom: 4px; }
.sheet-wrap.closing .sheet { animation: sheet-down .22s ease-in both; }
.sheet-wrap.closing .sheet-backdrop { animation: fade-out .22s ease-in both; }
.sheet-swap { animation: fade-in .2s ease both; }
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes sheet-down { to { transform: translateY(100%); } }
@keyframes fade-out { to { opacity: 0; } }

/* ---------- toasts ---------- */
.toasts { position: fixed; left: 0; right: 0; top: calc(12px + var(--safe-top)); z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 16px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; max-width: 440px; padding: 12px 16px; border-radius: 16px; background: var(--toast-bg); color: var(--toast-text); font-size: 14.5px; font-weight: 500; box-shadow: var(--raise); pointer-events: auto; animation: toast-in .4s var(--spring) both; }
.toast.err { background: var(--accent); color: #FFFFFF; }
.toast.gold { background: var(--coin); color: var(--on-coin); }
.toast.out { animation: toast-out .25s ease-in both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-16px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-10px) scale(.98); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}
@media (max-width: 380px) {
  .game-tile .gname { font-size: 12px; }
  .game-tile .art { width: 40px; height: 40px; }
  .c8-piles { gap: 28px; }
}
@media (max-width: 360px) {
  .coin-token .fee { font-size: 19px; }
  .dice { width: 66px; height: 66px; padding: 11px; }
  .wallet-hero .amount { font-size: 40px; }
}


/* ==========================================================================
   Ancient Greek layer
   Colors stay exactly the same. Adds: Greek key bands (like the bands on a vase or a temple frieze),
   classical inscription letters for titles and big numbers, laurel wreaths for winners, square mosaic tiles.
   ========================================================================== */
.meander { display: block; height: 12px; background: var(--accent); -webkit-mask: var(--meander) repeat-x left center / 18px 12px; mask: var(--meander) repeat-x left center / 18px 12px; }
.meander.soft { opacity: .55; }

/* Titles in inscription letters */
h1, h2 { font-family: var(--display); font-weight: 400; letter-spacing: .01em; }
h1 { font-size: 31px; }
h2 { font-size: 24px; line-height: 1.2; }
.section h3 { font-family: var(--display); font-size: 16px; font-weight: 400; letter-spacing: .02em; color: var(--muted); }
.pot b { font-family: var(--display); font-size: 20px; font-weight: 400; letter-spacing: .02em; }
.wallet-hero .amount { font-family: var(--display); font-weight: 400; letter-spacing: 0; }
.round-chip { font-family: var(--display); font-weight: 400; font-size: 15.5px; letter-spacing: .03em; }

/* A frieze under the top bar, like the band under a temple roof */
.topbar { position: relative; padding-bottom: 20px; }
.topbar::after { content: ''; position: absolute; left: 16px; right: 16px; bottom: 6px; height: 10px; background: var(--accent); opacity: .9;
  -webkit-mask: var(--meander) repeat-x left center / 15px 10px; mask: var(--meander) repeat-x left center / 15px 10px; }

/* Sheets: the grab handle becomes a short Greek key */
.sheet-grip { width: 54px; height: 8px; border-radius: 0; background: var(--line-strong); -webkit-mask: var(--meander) repeat-x left center / 12px 8px; mask: var(--meander) repeat-x left center / 12px 8px; }

/* Start screen: mosaic tiles and an inscription wordmark */
.splash-mark i { border-radius: 4px; }
.splash-name .wm { font-family: var(--display); font-weight: 400; font-size: 46px; letter-spacing: .12em; text-transform: uppercase; padding-left: .12em; }
.splash-name .wm span { display: block; margin-top: 6px; font-family: var(--font); font-size: 15px; font-weight: 500; letter-spacing: .02em; text-transform: none; text-align: center; }
.splash-name .meander { width: 126px; height: 10px; margin: 8px 0 6px; -webkit-mask-size: 15px 10px; mask-size: 15px 10px; }

/* Game picker: the chosen game gets a Greek key under its name */
.game-tile { padding-bottom: 16px; }
.game-tile::after { content: ''; position: absolute; left: 50%; bottom: 6px; width: 36px; height: 6px; transform: translateX(-50%) scaleX(0); background: var(--accent); transition: transform .3s var(--ease);
  -webkit-mask: var(--meander) repeat-x left center / 9px 6px; mask: var(--meander) repeat-x left center / 9px 6px; }
.game-tile[aria-checked="true"]::after { transform: translateX(-50%) scaleX(1); }
.game-picker.compact .game-tile::after { display: none; }
.game-picker.compact .game-tile { padding-bottom: 9px; }

/* Boards: Greek key bands top and bottom, like a painted vase */
.ttt-board { padding: 30px 12px; border-radius: 24px; aspect-ratio: 340 / 376; }
.ttt-board::before { inset: 30px 12px; }
.ttt-line { inset: 30px 12px; width: calc(100% - 24px); height: calc(100% - 60px); }
.ttt-board > .vase-band { position: absolute; left: 16px; right: 16px; height: 9px; background: #E5182D; -webkit-mask: var(--meander) repeat-x center / 13.5px 9px; mask: var(--meander) repeat-x center / 13.5px 9px; pointer-events: none; }
.ttt-board > .vase-band.top { top: 11px; }
.ttt-board > .vase-band.bottom { bottom: 11px; }
.ck-frame { padding: 22px 8px; }
.ck-frame { position: relative; }
.ck-frame::before, .ck-frame::after { content: ''; position: absolute; left: 12px; right: 12px; height: 8px; background: #E5182D; -webkit-mask: var(--meander) repeat-x center / 12px 8px; mask: var(--meander) repeat-x center / 12px 8px; }
.ck-frame::before { top: 7px; }
.ck-frame::after { bottom: 7px; }

/* Card backs: black glaze with red Greek key bands, like black-figure pottery */
.pc.back::before { inset: 7%; border: 1.5px solid #E5182D; border-radius: calc(var(--cw) * .06); background: none; }
.pc.back .band { position: absolute; left: 17%; right: 17%; height: calc(var(--cw) * .08); background: #E5182D;
  -webkit-mask: var(--meander) repeat-x center / calc(var(--cw) * .12) calc(var(--cw) * .08); mask: var(--meander) repeat-x center / calc(var(--cw) * .12) calc(var(--cw) * .08); }
.pc.back .band.top { top: 17%; }
.pc.back .band.bottom { bottom: 17%; }
.pc.back b { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-weight: 400; font-size: calc(var(--cw) * .42); line-height: 1; color: #E5182D; }

/* Laurel wreath for winners (result screen, top 3 in rankings) */
.laurel { position: absolute; inset: -14px; width: calc(100% + 28px); height: calc(100% + 28px); pointer-events: none; }
.result-badge { position: relative; border-radius: 50%; }
.result-badge.win { overflow: visible; }
.li .rank { position: relative; }
.li .rank .laurel { inset: -6px; width: calc(100% + 12px); height: calc(100% + 12px); }
.li .rank.top { font-family: var(--display); font-weight: 400; font-size: 16px; }

/* Wallet card: a big Greek key instead of the rings, and a frieze along the bottom */
.wallet-hero .ludo-stripe { display: none; }
.wallet-hero::before { width: 64px; height: 64px; right: 20px; top: 20px; border: 0; border-radius: 0; opacity: .9; background: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath d='M2 28V2H28V24H8V8H22V18H14V14' fill='none' stroke='%23000' stroke-width='3.2'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath d='M2 28V2H28V24H8V8H22V18H14V14' fill='none' stroke='%23000' stroke-width='3.2'/%3E%3C/svg%3E") center / contain no-repeat; }
.wallet-hero::after { width: auto; height: 10px; left: 20px; right: 20px; bottom: 10px; border: 0; border-radius: 0; opacity: .5; background: var(--accent);
  -webkit-mask: var(--meander) repeat-x left center / 15px 10px; mask: var(--meander) repeat-x left center / 15px 10px; }

/* In a game: the same frieze under the prize line */
.game-top { position: relative; padding-bottom: 20px; }
.game-top::after { content: ''; position: absolute; left: 0; right: 0; bottom: 6px; height: 8px; background: var(--accent); opacity: .85;
  -webkit-mask: var(--meander) repeat-x left center / 12px 8px; mask: var(--meander) repeat-x left center / 12px 8px; }

/* ==========================================================================
   Social: chats, people, groups
   People are round; groups are square tiles, like a piece of mosaic.
   ========================================================================== */
.ava.xs { width: 28px; height: 28px; font-size: 15px; }
.ava.xs .lvl { display: none; }
.ava.xs.frame-crown::before { display: none; }
.group-ava { border-radius: 12px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-strong); }
.ava.lg.group-ava { border-radius: 22px; font-size: 36px; }
.ava-dot { position: relative; width: 36px; height: 36px; flex: none; }
.ava-dot .status-dot { position: absolute; right: -2px; bottom: -2px; width: 13px; height: 13px; border: 2.5px solid var(--surface); box-shadow: none; }

.count-pill { display: inline-block; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 700; line-height: 20px; text-align: center; font-variant-numeric: tabular-nums; }
.count-pill.muted { background: var(--surface-3); color: var(--muted); }

/* list rows */
.li.chat-row, .li.member-row { grid-template-columns: 36px minmax(0, 1fr) auto; }
.li.person-row { grid-template-columns: minmax(0, 1fr) auto; }
.li.pick-row { grid-template-columns: 36px minmax(0, 1fr) 24px; }
.chat-mid { min-width: 0; }
.chat-row .nm { display: flex; align-items: center; gap: 6px; color: var(--text); }
.chat-row .nm span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-row .nm .icon { color: var(--faint); }
.li .meta.last { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-row.unread .meta.last { color: var(--text); font-weight: 500; }
.chat-end { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; min-width: 44px; }
.chat-end small { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.chat-row.unread .chat-end small { color: var(--accent-text); font-weight: 600; }
.person-open { display: flex; align-items: center; gap: 12px; min-width: 0; text-align: left; }
.li .meta.online { color: var(--ok); }
.li .meta.playing { color: var(--gold-text); }
.btn.icon-only { width: 36px; padding: 0; }
.star-btn { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: var(--faint); transition: color .2s, transform .2s var(--spring); }
.star-btn:active { transform: scale(.88); }
.star-btn.on { color: var(--coin); }
.star-btn.on .icon { fill: currentColor; }

.req-banner, .allow-banner { width: 100%; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 12px; border-radius: 18px; background: var(--surface); box-shadow: var(--card); text-align: left; }
.req-banner b { display: block; font-weight: 600; }
.req-banner small { display: block; color: var(--muted); font-size: 12.5px; }
.allow-banner { font-size: 13.5px; color: var(--muted); }

.search-field { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px; border-radius: 14px; background: var(--surface); box-shadow: var(--card); color: var(--faint); transition: box-shadow .2s; }
.search-field:focus-within { box-shadow: 0 0 0 1.5px var(--accent), 0 0 0 4.5px var(--accent-tint); }
.search-field input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; outline: none; color: var(--text); }
.search-field input:focus-visible { outline: none; }
.search-field input::-webkit-search-cancel-button { filter: grayscale(1); }
.stats.social-stats { grid-template-columns: repeat(3, 1fr); }
.page-head + .seg { margin-top: 14px; }

.follow-line { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; font-size: 13.5px; color: var(--muted); text-align: left; }
.follow-line b { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
button.follow-line:active { opacity: .7; }
.profile-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.profile-actions .settings-card { margin-top: 0; }
.btn.plain.block-btn { color: var(--danger); }

/* settings rows with a switch */
.set-row.inline { flex-direction: row; align-items: center; justify-content: space-between; gap: 14px; }
.set-label b { display: block; font-weight: 600; }
.set-label small { display: block; margin-top: 2px; color: var(--muted); font-size: 12.5px; font-weight: 400; }
.section > .settings-card { margin-top: 0; }
.notify-card .set-row.inline .set-label:only-child { font-weight: 500; }
.switch { position: relative; width: 50px; height: 30px; border-radius: 15px; flex: none; background: var(--surface-3); transition: background-color .22s var(--ease); }
.switch i { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .26s var(--spring); }
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"] i { transform: translateX(20px); }

/* groups */
.group-head { display: flex; align-items: center; gap: 14px; margin: 6px 0 4px; }
.group-head h2 { word-break: break-word; }
.role-chip { padding: 3px 9px; border-radius: 8px; background: var(--surface-2); color: var(--muted); font-size: 11.5px; font-weight: 600; }
.member-row:first-child .role-chip { background: var(--gold-tint); color: var(--gold-text); }
.icon-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.icon-pick { aspect-ratio: 1; border-radius: 12px; background: var(--surface-2); font-size: 22px; display: grid; place-items: center; transition: transform .2s var(--spring), box-shadow .2s; }
.icon-pick:active { transform: scale(.9); }
.icon-pick[aria-pressed="true"] { box-shadow: inset 0 0 0 2.5px var(--accent); background: var(--accent-tint); }
.pick-row { text-align: left; }
.pick-box { width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--line-strong); display: grid; place-items: center; color: transparent; transition: background-color .15s, border-color .15s; }
.pick-row.on .pick-box { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- one chat ---------- */
.view.chat-view { padding: 0; }
.chat-screen { display: flex; flex-direction: column; height: var(--tg-viewport-stable-height, 100dvh); }
.chat-head { position: relative; flex: none; display: flex; align-items: center; gap: 10px; padding: calc(8px + var(--safe-top)) 12px 20px; background: var(--bg); }
.chat-head::after { content: ''; position: absolute; left: 16px; right: 16px; bottom: 6px; height: 8px; background: var(--accent); opacity: .85;
  -webkit-mask: var(--meander) repeat-x left center / 12px 8px; mask: var(--meander) repeat-x left center / 12px 8px; }
.chat-head .ava-dot .status-dot { border-color: var(--bg); }
.chat-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; text-align: left; padding: 2px; border-radius: 12px; }
.ct-txt { min-width: 0; }
.ct-txt b { display: block; font-family: var(--display); font-weight: 400; font-size: 19px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-txt small { display: block; color: var(--muted); font-size: 12.5px; }
.msgs { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 3px; padding: 6px 12px 10px; }
.day-sep { display: flex; align-items: center; gap: 10px; margin: 14px 0 8px; color: var(--faint); font-size: 12px; font-weight: 500; }
.day-sep::before, .day-sep::after { content: ''; flex: 1; height: 6px; background: var(--line-strong);
  -webkit-mask: var(--meander) repeat-x center / 9px 6px; mask: var(--meander) repeat-x center / 9px 6px; }
.sys-msg { align-self: center; max-width: 86%; margin: 6px 0; text-align: center; font-size: 12.5px; color: var(--muted); }
.dm { display: flex; align-items: flex-end; gap: 8px; max-width: 82%; margin-top: 3px; }
.dm.mine { align-self: flex-end; }
.dm-ava { flex: none; }
.dm-bubble { position: relative; min-width: 0; padding: 7px 12px 5px; border-radius: 18px; background: var(--surface); box-shadow: var(--card); }
.dm.theirs .dm-bubble { border-bottom-left-radius: 6px; }
.dm.mine .dm-bubble { background: var(--accent); color: var(--on-accent); box-shadow: none; border-bottom-right-radius: 6px; }
.dm-text { white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; font-size: 15px; line-height: 1.38; }
.dm-name { font-size: 12.5px; font-weight: 600; color: var(--accent-text); margin-bottom: 1px; }
.dm-time { display: block; margin-top: 1px; text-align: right; font-size: 10.5px; opacity: .62; font-variant-numeric: tabular-nums; }
.dm-in { animation: dm-in .26s var(--ease) both; }
@keyframes dm-in { from { opacity: 0; transform: translateY(8px) scale(.97); } }
.load-more { align-self: center; margin: 4px 0 8px; padding: 6px 12px; border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--accent-text); }
.chat-empty-big { margin: auto; max-width: 250px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; color: var(--muted); font-size: 14px; }

/* a challenge is a small tablet with a key band, like the others in the app */
.dm.card { max-width: 90%; }
.dm.card .dm-bubble { background: var(--surface); color: var(--text); box-shadow: var(--card); padding: 12px 12px 8px; border-radius: 18px; }
.dm.card .dm-bubble::before { content: ''; display: block; height: 6px; margin: 0 2px 10px; background: var(--accent); opacity: .85;
  -webkit-mask: var(--meander) repeat-x left center / 9px 6px; mask: var(--meander) repeat-x left center / 9px 6px; }
.challenge-card { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 10px 12px; align-items: center; width: 250px; max-width: 100%; }
.challenge-card .art { width: 44px; height: 44px; }
.cc-txt b { display: block; font-weight: 650; }
.cc-txt small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.challenge-card .btn { grid-column: 1 / -1; width: 100%; }

.chat-notes { flex: none; padding: 0 12px; }
.chat-note { display: flex; flex-direction: column; gap: 10px; margin: 0 0 8px; padding: 12px 14px; border-radius: 16px; background: var(--surface-2); color: var(--muted); font-size: 13.5px; }
.chat-note .btns { display: flex; gap: 8px; }
.chat-note .btn { flex: 1; }
.composer { flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 12px calc(10px + var(--safe-bottom)); border-top: 1px solid var(--line); background: var(--bg); }
.composer input { flex: 1; min-width: 0; height: 44px; padding: 0 16px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line-strong); outline: none; transition: border-color .2s, box-shadow .2s; }
.composer input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.composer input:disabled { opacity: .5; }
.composer .icon-btn { width: 44px; height: 44px; border-radius: 50%; flex: none; color: var(--accent-text); }
.send-btn { width: 44px; height: 44px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); transition: transform .15s var(--ease), opacity .2s; }
.send-btn:active:not(:disabled) { transform: scale(.9); }
.send-btn:disabled, .composer .icon-btn:disabled { opacity: .38; cursor: not-allowed; }
@media (prefers-reduced-motion: reduce) { .dm-in { animation: none; } .switch i, .switch { transition: none; } }
.profile-actions + .stats { margin-top: 18px; }
.notify-card > .set-row[hidden] + .set-row { margin-top: 0; padding-top: 0; border-top: 0; }

/* ==========================================================================
   Chess: a marble board (white and stone grey) in the white frame with Greek key bands, like the checkers board.
   Gold marks the last move and the chosen piece, red marks a king in check.
   ========================================================================== */
.stage-cs { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.cs-frame { position: relative; width: min(100%, 400px); padding: 22px 8px; border-radius: 20px; background: #FFFFFF; box-shadow: 0 0 0 1px rgba(15, 15, 18, .05), 0 10px 24px rgba(0, 0, 0, .18); }
.cs-frame::before, .cs-frame::after { content: ''; position: absolute; left: 12px; right: 12px; height: 8px; background: #E5182D; -webkit-mask: var(--meander) repeat-x center / 12px 8px; mask: var(--meander) repeat-x center / 12px 8px; }
.cs-frame::before { top: 7px; }
.cs-frame::after { bottom: 7px; }
.cs-board { position: relative; width: 100%; aspect-ratio: 1; display: grid; grid-template: repeat(8, 1fr) / repeat(8, 1fr); border-radius: 10px; overflow: hidden; touch-action: manipulation; }
.cs-sq { position: relative; cursor: pointer; }
.cs-sq.light { background: #F2F2F5; }
.cs-sq.dark { background: #BDBDC7; }
.cs-sq.last.light { background: #F6E3B0; }
.cs-sq.last.dark { background: #E2C27C; }
.cs-sq.sel.light { background: #F7D684; }
.cs-sq.sel.dark { background: #E6B556; }
.cs-sq.check::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle, rgba(255, 51, 71, .95) 0%, rgba(229, 24, 45, .65) 38%, rgba(229, 24, 45, 0) 74%); animation: fade-in .2s ease both; }
.cs-sq.dest::after { content: ''; position: absolute; left: 36%; top: 36%; width: 28%; height: 28%; border-radius: 50%; background: rgba(17, 17, 20, .26); animation: pop-in .2s var(--spring); }
.cs-sq.cap::after { content: ''; position: absolute; inset: 3%; border-radius: 50%; box-shadow: inset 0 0 0 4px rgba(17, 17, 20, .28); animation: pop-in .2s var(--spring); }
.cs-sq .coord { position: absolute; z-index: 2; font-size: 9.5px; font-weight: 700; line-height: 1; pointer-events: none; }
.cs-sq.light .coord { color: #9A9AA6; }
.cs-sq.dark .coord { color: #F2F2F5; }
.coord.rank { left: 3px; top: 3px; }
.coord.file { right: 3px; bottom: 2px; }
.cs-piece { position: absolute; left: 0; top: 0; z-index: 1; width: 12.5%; height: 12.5%; display: grid; place-items: center; pointer-events: none; transition: transform .21s var(--ease); }
.cs-piece svg { width: 92%; height: 92%; filter: drop-shadow(0 1.5px 1.2px rgba(0, 0, 0, .3)); transition: transform .3s var(--ease), opacity .3s; }
.cs-piece.moving { z-index: 3; }
.cs-piece.taken svg { opacity: 0; transform: scale(.5); }
.cs-piece.promoted svg { animation: crown-pop .5s var(--spring); }
.cs-promo { position: absolute; top: 0; z-index: 6; width: 12.5%; height: 50%; display: flex; flex-direction: column; border-radius: 8px; overflow: hidden; background: #FFFFFF; box-shadow: 0 0 0 2px #E5182D, 0 14px 30px rgba(0, 0, 0, .45); animation: pop-in .2s var(--spring); }
.cs-promo button { flex: 1; display: grid; place-items: center; }
.cs-promo button + button { border-top: 1px solid #ECECF0; }
.cs-promo button svg { width: 86%; height: 86%; }
.cs-promo button:active { background: #F6E3B0; }
.cs-under { width: min(100%, 400px); min-height: 48px; display: flex; align-items: center; }
.cs-moves { width: 100%; min-height: 22px; display: flex; gap: 12px; padding: 2px 6px; overflow-x: auto; scrollbar-width: none; white-space: nowrap; font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cs-moves::-webkit-scrollbar { display: none; }
.cs-moves-empty { color: var(--faint); }
.cs-pair { display: inline-flex; gap: 6px; }
.cs-pair i { font-style: normal; color: var(--faint); }
.cs-pair b { font-weight: 600; color: var(--text); }
.cs-pair b.now { color: var(--accent-text); }
.cs-offer { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 6px 6px 12px; border-radius: 14px; background: var(--surface); box-shadow: var(--card); font-size: 14px; font-weight: 600; animation: pop-in .25s var(--spring); }
.cs-offer .btns { display: flex; gap: 6px; flex: none; }
.cs-clock { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 8px; background: var(--surface-2); color: var(--text); font-size: 13.5px; font-variant-numeric: tabular-nums; transition: background-color .2s, color .2s; }
.cs-clock b { font-weight: 700; }
.cs-clock.running { background: var(--text); color: var(--bg); }
.cs-clock.running.low { background: var(--accent); color: #FFFFFF; }
.cs-clock.low:not(.running) { color: var(--accent-text); }
.cs-swatch { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.cs-swatch.w { background: #FFFFFF; box-shadow: inset 0 0 0 1.5px #16161A; }
.cs-swatch.b { background: #1B1B20; box-shadow: 0 0 0 1.5px #9B9BA6; }
.cs-lead { color: var(--ok); font-size: 12px; font-weight: 700; }
.game-chess .right-tools { gap: 2px; }
.tool-btn { min-width: 52px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px; border-radius: 12px; color: var(--muted); font-size: 11.5px; font-weight: 600; transition: background-color .15s; }
.tool-btn:active:not(:disabled) { background: var(--surface-2); }
.tool-btn:disabled { opacity: .38; }
@media (prefers-reduced-motion: reduce) { .cs-piece { transition: none; } }

/* ---------- quiz ---------- */
.stage-quiz { width: 100%; max-width: 520px; margin: 0 auto; }
.quiz { display: flex; flex-direction: column; gap: 12px; padding: 6px 0 2px; }
.quiz-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; font-weight: 600; color: var(--muted); }
.quiz-cat { padding: 3px 10px; border-radius: 999px; background: var(--accent-tint); color: var(--accent-text); }
.quiz-cat:empty { display: none; }
.quiz-bar { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.quiz-bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); transform-origin: left center; will-change: transform; }
.quiz-bar i.low { background: #FF3347; }
.quiz.open .quiz-bar i { background: var(--muted); }
.quiz-img { font-size: 84px; line-height: 1; text-align: center; }
.quiz-q { margin: 2px 0 4px; font-family: var(--display); font-size: clamp(19px, 5.4vw, 24px); font-weight: 400; line-height: 1.3; text-align: center; overflow-wrap: anywhere; }
.quiz-opts { display: grid; gap: 9px; }
.quiz-opts.flags { grid-template-columns: 1fr 1fr; }
.quiz-opt { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 10px 12px; border: 0; border-radius: 16px;
  background: var(--surface); box-shadow: var(--card); color: var(--text); font: inherit; font-size: 16px; font-weight: 600; text-align: left; transition: transform .12s, background-color .2s, box-shadow .2s; }
.quiz-opt:not(:disabled):active { transform: scale(.98); }
.quiz-opt .ltr { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: var(--surface-3); font-size: 13px; font-weight: 700; color: var(--muted); }
.quiz-opt .txt { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.quiz-opts.flags .quiz-opt { flex-direction: column; gap: 4px; padding: 12px 8px; }
.quiz-opts.flags .quiz-opt .txt { font-size: 54px; line-height: 1.1; text-align: center; }
.quiz-opt.picked { box-shadow: 0 0 0 2px var(--accent); background: var(--accent-tint); }
.quiz-opt.picked .ltr { background: var(--accent); color: #fff; }
.quiz-opt.right { box-shadow: 0 0 0 2px var(--ok); background: var(--ok-tint); }
.quiz-opt.right .ltr { background: var(--ok); color: #0E0E11; }
.quiz-opt.wrong { box-shadow: 0 0 0 2px var(--danger); background: var(--danger-tint); }
.quiz-opt.wrong .ltr { background: var(--danger); color: #fff; }
.quiz.open .quiz-opt:not(.right):not(.wrong) { opacity: .62; }
.quiz.locked:not(.open) .quiz-opt:not(.picked) { opacity: .62; }
.quiz-opt .who { display: inline-flex; gap: 3px; flex: none; }
.quiz-opt .who i { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--surface-3); font-style: normal; font-size: 11px; font-weight: 700; color: var(--text); }
.quiz-opt .who i.me { background: var(--accent); color: #fff; }
.quiz-report { align-self: center; padding: 6px 10px; border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px; text-decoration: underline; }
.quiz-report:disabled { text-decoration: none; }
.quiz-score { font-weight: 700; font-variant-numeric: tabular-nums; }
.quiz-done { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--ok); color: #0E0E11; font-size: 10px; font-weight: 800; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-pick { padding: 9px 14px; border: 0; border-radius: 999px; background: var(--surface); box-shadow: var(--card); color: var(--text); font: inherit; font-size: 14px; font-weight: 600; }
.chip-pick.on { background: var(--accent); color: #fff; box-shadow: none; }

/* ---------- league, Daily Labours, city war ---------- */
.lg-card { margin: 0 0 14px; padding: 14px; border-radius: 18px; background: var(--surface); box-shadow: var(--card); }
.lg-card .list { margin-top: 10px; }
.lg-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.lg-head b { font-family: var(--display); font-size: 20px; font-weight: 400; }
.lg-head small { color: var(--muted); font-size: 12.5px; }
.lg-steps { display: flex; gap: 6px; margin-bottom: 10px; }
.lg-steps span { flex: 1; padding: 6px 2px; border-radius: 10px; background: var(--surface-3); color: var(--muted); font-size: 12px; font-weight: 600; text-align: center; }
.lg-steps span.on { background: var(--accent); color: #fff; }
.labour { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--surface-3); }
.labour:first-of-type { border-top: 0; }
.labour-ico { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: var(--surface-3); color: var(--muted); }
.labour.done .labour-ico { background: var(--ok); color: #0E0E11; }
.labour-txt { flex: 1; min-width: 0; font-size: 14.5px; font-weight: 600; }
.labour-bar { height: 5px; margin-top: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.labour-bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.labour.done .labour-bar i { background: var(--ok); }
.labour-n { flex: none; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.labour-coins { flex: none; font-weight: 700; color: var(--ok); }
.li.zone-up { box-shadow: inset 4px 0 0 var(--ok); }
.li.zone-down { box-shadow: inset 4px 0 0 var(--danger); }
.cities { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.city { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 12px 6px; border-radius: 14px; background: var(--surface-3); text-align: center; }
.city.mine { box-shadow: 0 0 0 2px var(--accent); }
.city.lead b { color: var(--ok); }
.city-em { font-size: 30px; line-height: 1.1; font-family: var(--display); }
.city small { color: var(--muted); font-size: 12px; }
.city .btn { margin-top: 6px; }

/* ---------- cups ---------- */
.cup.mine { box-shadow: var(--card), 0 0 0 2px var(--accent); }
.cup-facts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.cup-facts span { padding: 5px 10px; border-radius: 999px; background: var(--surface-3); font-size: 12.5px; font-weight: 600; }
.cup-facts .gold { color: var(--gold-text); }
.cup-act { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.bracket { display: flex; gap: 10px; margin-top: 12px; overflow-x: auto; padding-bottom: 4px; }
.br-round { display: flex; flex-direction: column; justify-content: space-around; gap: 8px; min-width: 118px; }
.br-round small { color: var(--muted); font-size: 11.5px; font-weight: 600; }
.br-match { display: flex; flex-direction: column; border-radius: 10px; background: var(--surface-3); overflow: hidden; font-size: 12.5px; }
.br-match span { padding: 5px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.br-match span + span { border-top: 1px solid var(--surface); }
.br-match .won { font-weight: 700; color: var(--ok); }
.br-match .lost { color: var(--muted); text-decoration: line-through; }
.br-match.live { box-shadow: 0 0 0 2px var(--accent); }

/* ---------- payments ---------- */
.pay-ways { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pay-way { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; border: 0; border-radius: 14px; background: var(--surface-3); color: var(--text); font: inherit; font-size: 12.5px; font-weight: 600; }
.pay-way img, .pay-acc img { border-radius: 12px; }
.pay-way.on, .pay-acc.on { box-shadow: 0 0 0 2px var(--accent); background: var(--accent-tint); }
.pay-accs { display: grid; gap: 8px; }
.pay-acc { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; background: var(--surface-3); cursor: pointer; }
.pay-acc img { width: 34px; height: 34px; }
.pay-acc div { flex: 1; min-width: 0; }
.pay-acc b { display: block; font-size: 17px; letter-spacing: .3px; }
.pay-acc small { display: block; color: var(--muted); font-size: 12.5px; }
.pay .input { width: 100%; margin-top: 8px; }
.pay .input { padding: 12px 14px; border: 0; border-radius: 14px; background: var(--surface-3); color: var(--text); font: inherit; font-size: 15px; box-sizing: border-box; }
.pay textarea.input { resize: vertical; }
.pay .input::placeholder { color: var(--muted); }

/* ---------- the Temple (money area): white marble and gold ---------- */
:root[data-zone="temple"], .temple-preview {
  --bg: #F4EFE6; --surface: #FFFDF8; --surface-2: #F3ECDD; --surface-3: #E8DEC8; --line: #E9DFCB; --line-strong: #D9CBAE;
  --text: #231C0E; --muted: #74694F; --faint: #A89C80;
  --accent: #D4A72C; --accent-press: #B88C1A; --accent-text: #8A6508; --on-accent: #2A1F05;
  --accent-tint: rgba(212, 167, 44, .16); --accent-glow: rgba(184, 137, 27, .5);
  --seg-bg: #EDE4D2; --seg-pill: #FFFDF8; --hero-bg: #2A2112;
  --ok: #0E8F58; --ok-tint: rgba(14, 143, 88, .1); --danger: #B3261E; --danger-tint: rgba(179, 38, 30, .08);
  --gold-text: #8A6508; --gold-tint: rgba(212, 167, 44, .2); --streak: #B45309;
  --tabbar: rgba(250, 246, 238, .92); --backdrop: rgba(35, 28, 14, .45);
  --card: 0 0 0 1px rgba(138, 101, 8, .1), 0 1px 2px rgba(35, 28, 14, .05), 0 6px 16px -8px rgba(35, 28, 14, .12);
  --raise: 0 24px 48px -12px rgba(35, 28, 14, .28);
  --bubble-bg: #231C0E; --bubble-text: #FFFFFF; --toast-bg: #231C0E; --toast-text: #FFFFFF; --input-bg: #F4EFE6;
  color-scheme: light;
}
/* soft veins, like marble */
:root[data-zone="temple"] body {
  background-color: var(--bg);
  background-image:
    linear-gradient(115deg, transparent 0 38%, rgba(138, 101, 8, .05) 38.4% 38.9%, transparent 39.3% 100%),
    linear-gradient(72deg, transparent 0 61%, rgba(120, 110, 90, .06) 61.3% 61.7%, transparent 62% 100%),
    radial-gradient(120% 60% at 20% 0%, rgba(255, 255, 255, .9), transparent 60%),
    radial-gradient(90% 50% at 100% 100%, rgba(212, 167, 44, .08), transparent 70%);
  background-attachment: fixed;
}
:root[data-zone="temple"] .btn.primary { background: linear-gradient(180deg, #E7C04F, #C99A1E); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 10px 24px -12px var(--accent-glow); font-weight: 700; }
:root[data-zone="temple"] .btn.primary:active:not(:disabled) { background: var(--accent-press); }
:root[data-zone="temple"] h1, :root[data-zone="temple"] h2 { font-family: var(--display); letter-spacing: .01em; }
:root[data-zone="temple"] .coin-dot { border-radius: 4px; background: linear-gradient(180deg, #E7C04F, #B88C1A); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .5); }
:root[data-zone="temple"] .coin-token { border-radius: 18px; aspect-ratio: 1 / 1.05; }
:root[data-zone="temple"] .coin-token .fee::after { content: ' Br'; font-size: 11px; font-weight: 700; opacity: .75; }
:root[data-zone="temple"] .wallet-hero { background: linear-gradient(160deg, #2F2513, #1C150A); }
:root[data-zone="temple"] .wallet-hero::after { display: none; }
:root[data-zone="temple"] .wallet-hero .temple-art { position: absolute; right: 14px; bottom: 16px; width: 104px; opacity: .9; z-index: -1; }
:root[data-zone="temple"] .wallet-hero .ludo-stripe i { background: #D4A72C !important; }
.wallet-hero .temple-art { display: none; }
:root[data-zone="temple"] .wallet-hero .temple-art { display: block; }
.wallet-hero .amount .br { font-size: .42em; font-weight: 600; opacity: .75; }

.zone-switch { margin: 4px 0 10px; }
.temple-art .roof { fill: #E7C04F; }
.temple-art .sun { fill: #FFF6D8; }
.temple-art .beam { fill: #D4A72C; }
.temple-art .col { fill: #F1DFA6; transform-box: fill-box; transform-origin: 50% 100%; animation: col-rise .6s var(--ease) both; }
@keyframes col-rise { from { transform: scaleY(0); opacity: 0; } to { transform: scaleY(1); opacity: 1; } }
.temple-front { position: relative; overflow: hidden; display: flex; align-items: center; gap: 12px; padding: 14px; margin: 4px 0 6px; border-radius: 20px; background: linear-gradient(160deg, #2F2513, #1C150A); color: #FFF8E6; box-shadow: var(--raise); animation: fade-in .4s var(--ease); }
.temple-front::after { content: ''; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 30%, rgba(255, 236, 170, .22) 48%, transparent 62%); transform: translateX(-100%); animation: temple-shine 3.6s var(--ease) 0.5s infinite; pointer-events: none; }
@keyframes temple-shine { 0% { transform: translateX(-100%); } 55%, 100% { transform: translateX(100%); } }
.temple-front .temple-art { width: 74px; flex: none; }
.temple-front .tf-txt { flex: 1; min-width: 0; }
.temple-front h2 { margin: 0; font-family: var(--display); font-size: 22px; color: #F3D77A; }
.temple-front p { margin: 2px 0 0; font-size: 13px; color: rgba(255, 248, 230, .78); }
.temple-front .btn { position: relative; z-index: 1; flex: none; }
.temple-teaser { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 14px; margin: 4px 0; border-radius: 18px; background: linear-gradient(160deg, #2F2513, #1C150A); color: #FFF8E6; text-align: left; }
.temple-teaser .temple-art { width: 46px; flex: none; }
.temple-teaser .tt-txt { flex: 1; }
.temple-teaser b { display: block; font-family: var(--display); font-size: 17px; color: #F3D77A; }
.temple-teaser small { display: block; font-size: 12.5px; color: rgba(255, 248, 230, .7); }
.temple-preview { position: relative; margin: -6px -6px 0; padding: 26px 14px 8px; border-radius: 22px; background: var(--bg); color: var(--text); text-align: center; overflow: hidden; }
.temple-preview .temple-art { width: 132px; margin: 6px auto 4px; display: block; filter: drop-shadow(0 10px 14px rgba(138, 101, 8, .3)); }
.temple-preview h2 { font-family: var(--display); font-size: 28px; margin: 4px 0; }
.temple-preview .lead { color: var(--muted); }
.temple-preview .btn.primary { background: linear-gradient(180deg, #E7C04F, #C99A1E); color: var(--on-accent); }
.tp-ribbon { position: absolute; top: 14px; right: -46px; width: 190px; padding: 4px 0; transform: rotate(35deg); background: #231C0E; color: #F3D77A; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.tp-list { list-style: none; padding: 0; margin: 14px 0 16px; display: grid; gap: 8px; text-align: left; }
.tp-list li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--surface); box-shadow: var(--card); font-size: 14px; }
.tp-list .icon { color: var(--accent-text); flex: none; }
@media (prefers-reduced-motion: reduce) { .temple-art .col, .temple-front::after { animation: none; } }
:root[data-zone="temple"] .wallet-hero .amount { font-family: var(--font); }
.badge-pill.laurel-pill { color: var(--ok); background: var(--ok-tint); }
.dm-tick { display: inline-flex; vertical-align: -2px; margin-left: 4px; opacity: .8; }
.dm-tick.read { opacity: 1; color: #fff; }
.dm.theirs .dm-tick.read, .chat-end .dm-tick.read { color: var(--accent-text); }
.chat-end .dm-tick { margin: 0 3px 0 0; }

/* ---------- stories ---------- */
.story-bar { display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 12px; margin: 0 -2px; scrollbar-width: none; }
.story-bar::-webkit-scrollbar { display: none; }
.story-chip { flex: none; width: 70px; display: flex; flex-direction: column; align-items: center; gap: 6px; transition: transform .15s var(--ease); }
.story-chip:active { transform: scale(.94); }
.story-ring { position: relative; width: 66px; height: 66px; border-radius: 50%; padding: 3px; display: grid; place-items: center; }
.story-ring.new { background: conic-gradient(var(--accent), #FF8A95, var(--accent)); animation: ring-in .5s var(--spring); }
.story-ring.seen { background: var(--line-strong); }
.story-ring.none { border: 2px dashed var(--faint); }
.story-ring .ava { width: 100%; height: 100%; font-size: 30px; border: 3px solid var(--bg); }
.story-ring .ava .lvl { display: none; }
.story-plus { position: absolute; right: -2px; bottom: -2px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); border: 2px solid var(--bg); }
.story-name { max-width: 70px; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@keyframes ring-in { from { transform: scale(.7) rotate(-40deg); opacity: 0; } }

.story-view { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; background: #000; color: #fff; padding: calc(8px + var(--safe-top)) 10px calc(12px + var(--safe-bottom)); animation: story-open .28s var(--ease); }
@keyframes story-open { from { opacity: 0; transform: scale(.94); } }
.sv-bars { display: flex; gap: 4px; }
.sv-bars i { flex: 1; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .28); overflow: hidden; }
.sv-bars i b { display: block; height: 100%; width: 0; background: #fff; }
.sv-bars i.done b { width: 100%; }
.sv-bars i.run b { animation: bar-fill linear forwards; }
.story-view.paused .sv-bars i.run b { animation-play-state: paused; }
@keyframes bar-fill { from { width: 0; } to { width: 100%; } }
.sv-head { display: flex; align-items: center; gap: 10px; padding: 10px 2px; }
.sv-head .ava .lvl { display: none; }
.sv-who { flex: 1; min-width: 0; }
.sv-who b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sv-who small { color: rgba(255, 255, 255, .6); font-size: 12px; }
.sv-icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: rgba(255, 255, 255, .1); flex: none; }
.sv-stage { position: relative; flex: 1; min-height: 0; border-radius: 22px; overflow: hidden; }
.sv-tap { position: absolute; top: 0; bottom: 0; width: 34%; }
.sv-tap.left { left: 0; } .sv-tap.right { right: 0; width: 66%; }
.sv-foot { display: flex; align-items: center; gap: 10px; padding-top: 12px; min-height: 60px; }
.sv-reacts { display: flex; gap: 6px; flex: 1; }
.sv-reacts button { width: 44px; height: 44px; border-radius: 50%; font-size: 22px; background: rgba(255, 255, 255, .1); transition: transform .15s var(--ease), background .2s; }
.sv-reacts button.on { background: var(--accent); transform: scale(1.08); }
.sv-reacts button.react-pop { animation: react-pop .45s var(--spring); }
@keyframes react-pop { 40% { transform: scale(1.45) rotate(-8deg); } }
.sv-challenge { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border-radius: 22px; background: #fff; color: #111114; font-weight: 650; }
.sv-views { display: flex; align-items: center; gap: 8px; flex: 1; height: 44px; color: #fff; font-weight: 600; }
.viewer-emoji { font-size: 22px; }

.story-card { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 28px 24px; color: #fff; }
.story-card.text p { margin: 0; font: 600 28px/1.25 var(--font); overflow-wrap: anywhere; text-shadow: 0 2px 14px rgba(0, 0, 0, .25); }
.story-card.mini { position: relative; inset: auto; height: 170px; border-radius: 18px; margin-bottom: 10px; }
.story-card.mini p { font-size: 20px; }
.story-card.photo { padding: 0; background: #000; }
.story-card.photo img { width: 100%; height: 100%; object-fit: contain; }
.sc-caption { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 18px 18px; font-size: 17px; font-weight: 500; background: linear-gradient(transparent, rgba(0, 0, 0, .75)); overflow-wrap: anywhere; }
.story-card.win { justify-content: flex-start; padding-top: 9%; background: radial-gradient(90% 50% at 50% 0%, rgba(255, 51, 71, .38), transparent 70%), radial-gradient(80% 45% at 50% 100%, rgba(255, 51, 71, .22), transparent 70%), #0E0E11; }
.sc-brand { display: flex; align-items: center; gap: 10px; }
.sc-brand b { font: 400 26px var(--display); letter-spacing: .08em; }
.sc-mark { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; width: 34px; height: 34px; }
.sc-mark i { border-radius: 5px; background: #fff; }
.sc-mark i:nth-child(2) { background: #FF3347; }
.sc-meander { width: 126px; height: 12px; margin: 14px 0 0; background: #FF3347; -webkit-mask: var(--meander) repeat-x; mask: var(--meander) repeat-x; }
.sc-ava { margin-top: 7%; padding: 5px; border-radius: 50%; border: 4px solid #FF3347; box-shadow: 0 0 60px rgba(255, 51, 71, .5); animation: ring-in .6s var(--spring) .1s both; }
.sc-ava .ava { width: 128px; height: 128px; font-size: 70px; background: #18181C; }
.sc-victory { margin-top: 6%; font: 400 20px var(--display); letter-spacing: .3em; color: #FF5A6A; }
.sc-amount { font: 800 62px/1.05 var(--font); letter-spacing: -.02em; animation: rise-in .5s var(--ease) .25s both; }
.sc-amount small { margin-left: 8px; font-size: 22px; font-weight: 600; color: #9B9BA6; }
.sc-sub { margin-top: 4px; color: #9B9BA6; font-size: 16px; }
.sc-pill { margin-top: 16px; padding: 7px 16px; border-radius: 999px; background: rgba(255, 51, 71, .2); color: #FF8A95; font-weight: 600; }
@keyframes rise-in { from { opacity: 0; transform: translateY(14px); } }

.story-input { width: 100%; resize: none; }
.story-swatches { display: flex; gap: 10px; margin: 10px 0 4px; }
.story-swatches button { width: 36px; height: 36px; border-radius: 50%; box-shadow: 0 0 0 2px var(--surface); }
.story-swatches button[aria-checked="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4.5px var(--text); }
.story-photo-pick { display: grid; gap: 8px; justify-items: center; margin: 10px 0; }
.story-photo-pick img { max-width: 100%; max-height: 260px; border-radius: 16px; }
.win-share { margin: 12px 0 2px; }
.win-share .btn { flex: 1; }
@media (prefers-reduced-motion: reduce) { .sv-bars i.run b { animation-duration: 0s !important; width: 100%; } }
.story-view { z-index: 28; }
.story-ring .ava, .sc-ava .ava, .sv-head .ava { box-shadow: none; }
.story-ring .ava::before, .sc-ava .ava::before, .sv-head .ava::before { display: none; }
textarea.story-input { font: inherit; }

/* ---------- register ---------- */
.register-sheet { text-align: center; }
.register-sheet .tp-list { text-align: left; }
.register-sheet .tp-list li { background: var(--surface-2); box-shadow: none; }
.register-sheet .tp-list .icon { color: var(--accent-text); }
.reg-mark { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; width: 56px; height: 56px; margin: 6px auto 12px; }
.reg-mark i { border-radius: 9px; background: var(--text); animation: tile-in .5s var(--spring) both; }
.reg-mark i:nth-child(2) { background: var(--accent); box-shadow: 0 6px 16px -4px var(--accent-glow); animation-delay: .08s; }
.reg-mark i:nth-child(3) { animation-delay: .24s; } .reg-mark i:nth-child(4) { animation-delay: .16s; }
@keyframes tile-in { from { transform: scale(0) rotate(-30deg); opacity: 0; } }

/* ---------- the Temple at night: dark stone, gold light ---------- */
:root[data-zone="temple"][data-theme="night"] {
  --bg: #0F0D09; --surface: #1A1711; --surface-2: #242017; --surface-3: #2F2A1E; --line: #2A251A; --line-strong: #3D3627;
  --text: #F6EFDD; --muted: #A99C7E; --faint: #6E6450;
  --accent: #E4B83C; --accent-press: #C99A1E; --accent-text: #F1CB5E; --on-accent: #1E1605;
  --accent-tint: rgba(228, 184, 60, .16); --accent-glow: rgba(228, 184, 60, .45);
  --seg-bg: #1A1711; --seg-pill: #2F2A1E; --hero-bg: #1E1A12;
  --ok: #3DDC97; --ok-tint: rgba(61, 220, 151, .14); --danger: #FF5A6A; --danger-tint: rgba(255, 90, 106, .14);
  --gold-text: #F1CB5E; --gold-tint: rgba(228, 184, 60, .2); --streak: #F5A524;
  --tabbar: rgba(15, 13, 9, .9); --backdrop: rgba(0, 0, 0, .6);
  --card: 0 0 0 1px rgba(228, 184, 60, .1), 0 1px 2px rgba(0, 0, 0, .3), 0 8px 20px -10px rgba(0, 0, 0, .6);
  --raise: 0 24px 48px -12px rgba(0, 0, 0, .7);
  --bubble-bg: #E4B83C; --bubble-text: #1E1605; --toast-bg: #F6EFDD; --toast-text: #1E1605; --input-bg: #0F0D09;
  color-scheme: dark;
}
/* dark marble: faint gold veins and a warm light from above, like torches */
:root[data-zone="temple"][data-theme="night"] body {
  background-image:
    linear-gradient(115deg, transparent 0 38%, rgba(228, 184, 60, .07) 38.4% 38.9%, transparent 39.3% 100%),
    linear-gradient(72deg, transparent 0 61%, rgba(228, 184, 60, .05) 61.3% 61.7%, transparent 62% 100%),
    radial-gradient(120% 55% at 50% 0%, rgba(228, 184, 60, .14), transparent 65%),
    radial-gradient(90% 50% at 100% 100%, rgba(228, 184, 60, .06), transparent 70%);
}
:root[data-zone="temple"][data-theme="night"] .btn.primary { background: linear-gradient(180deg, #F1CB5E, #C99A1E); color: #1E1605; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 10px 26px -10px rgba(228, 184, 60, .6); }
:root[data-zone="temple"][data-theme="night"] .wallet-hero, :root[data-zone="temple"][data-theme="night"] .temple-front { background: linear-gradient(160deg, #2A2214, #141109); box-shadow: inset 0 0 0 1px rgba(228, 184, 60, .22), var(--raise); }
:root[data-zone="temple"][data-theme="night"] .sheet { background: #1A1711; box-shadow: inset 0 1px 0 rgba(228, 184, 60, .18); }
:root[data-zone="temple"][data-theme="night"] .coin-token { color: #1E1605; }
:root[data-zone="temple"][data-theme="night"] .coin-token[aria-pressed="true"] { box-shadow: inset 0 -5px 0 var(--coin-deep), 0 0 0 3px var(--bg), 0 0 0 5.5px var(--accent), 0 0 28px rgba(228, 184, 60, .45); }
:root[data-zone="temple"][data-theme="night"] .game-tile[aria-checked="true"] { box-shadow: inset 0 0 0 2px var(--accent), 0 0 24px -4px rgba(228, 184, 60, .5); }
:root[data-zone="temple"][data-theme="night"] .temple-art .col { fill: #F6E7B8; }
:root[data-zone="temple"][data-theme="night"] .temple-art .roof { fill: #F1CB5E; }
:root[data-zone="temple"][data-theme="night"] .temple-front h2, :root[data-zone="temple"][data-theme="night"] .temple-teaser b { color: #F1CB5E; text-shadow: 0 0 18px rgba(228, 184, 60, .5); }
:root[data-zone="temple"][data-theme="night"] h1 { color: #F6EFDD; }
/* the Greek band in the header glows softly at night */
:root[data-zone="temple"][data-theme="night"] .topbar::after { opacity: 1; filter: drop-shadow(0 0 6px rgba(228, 184, 60, .45)); }
/* columns on both sides of the lobby, day and night, like standing between pillars */
:root[data-zone="temple"] body::before, :root[data-zone="temple"] body::after {
  content: ''; position: fixed; top: 0; bottom: 0; width: 14px; pointer-events: none; z-index: 0; opacity: .5;
  background: linear-gradient(90deg, transparent, var(--accent-tint) 40%, transparent 60%, var(--accent-tint));
}
:root[data-zone="temple"] body::before { left: 0; }
:root[data-zone="temple"] body::after { right: 0; }

/* ---------- the Temple, finer details ---------- */
.temple-art .halo { fill: #FFF3C4; opacity: .35; }
.temple-art .ray { stroke: #F1CB5E; stroke-width: .8; opacity: .22; transform-box: fill-box; transform-origin: 50% 50%; animation: ray-turn 40s linear infinite; }
.temple-art .tympanum { fill: #B88C1A; }
.temple-art .laurel { fill: #FFF6D8; }
.temple-art .frieze { fill: #8A6508; opacity: .6; }
.temple-art .cap { fill: #FFF1C2; transform-box: fill-box; transform-origin: 50% 100%; animation: col-rise .6s var(--ease) both; }
.temple-art .step { opacity: .85; }
@keyframes ray-turn { to { transform: rotate(360deg); } }
:root[data-zone="temple"][data-theme="night"] .temple-art .halo { fill: #E4B83C; opacity: .18; }

/* section titles with gold lines on both sides, like an inscription */
:root[data-zone="temple"] .section > h3 { display: flex; align-items: center; gap: 12px; font-family: var(--display); font-weight: 400; font-size: 15px; letter-spacing: .18em; text-transform: uppercase; color: var(--accent-text); }
:root[data-zone="temple"] .section > h3::before, :root[data-zone="temple"] .section > h3::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--accent), transparent); opacity: .55; }
:root[data-zone="temple"] .section > h3::before { background: linear-gradient(90deg, transparent, var(--accent)); }
:root[data-zone="temple"] .section > h3::after { max-width: 100%; }

/* the Temple card: meander at the top, gold title with a shine */
.temple-front { padding: 18px 16px 16px; border-radius: 22px; box-shadow: inset 0 0 0 1px rgba(241, 203, 94, .3), var(--raise); }
.temple-front::before { content: ''; position: absolute; left: 14px; right: 14px; top: 6px; height: 8px; background: #E4B83C; opacity: .6; -webkit-mask: var(--meander) repeat-x; mask: var(--meander) repeat-x; -webkit-mask-size: 12px 8px; mask-size: 12px 8px; }
.temple-front .temple-art { width: 92px; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .45)); }
.temple-front h2 { font-size: 24px; letter-spacing: .06em; background: linear-gradient(180deg, #FFF1C2, #E4B83C 55%, #B88C1A); -webkit-background-clip: text; background-clip: text; color: transparent; }
.temple-front p { color: rgba(255, 248, 230, .72); font-size: 13px; line-height: 1.35; }
.temple-front .btn.primary { background: linear-gradient(180deg, #F1CB5E, #C99A1E); color: #1E1605; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 8px 20px -8px rgba(228, 184, 60, .7); }

/* game tiles: a thin gold frame with four corner marks */
:root[data-zone="temple"] .game-tile { background: linear-gradient(180deg, var(--surface), var(--surface-2)); box-shadow: inset 0 0 0 1px rgba(228, 184, 60, .18), var(--card); }
:root[data-zone="temple"] .game-tile::before { content: ''; position: absolute; inset: 6px; border-radius: 12px; border: 1px solid rgba(228, 184, 60, .14); pointer-events: none; }
:root[data-zone="temple"] .game-tile[aria-checked="true"] { box-shadow: inset 0 0 0 2px var(--accent), 0 0 0 4px var(--accent-tint), 0 10px 24px -10px var(--accent-glow); }
:root[data-zone="temple"] .game-tile[aria-checked="true"]::before { border-color: rgba(228, 184, 60, .35); }
:root[data-zone="temple"] .game-tile .gname { font-family: var(--display); font-size: 13.5px; letter-spacing: .02em; }

/* the big play button: gold with a slow shine */
:root[data-zone="temple"] .play-bar .btn.primary { position: relative; overflow: hidden; }
:root[data-zone="temple"] .play-bar .btn.primary::after { content: ''; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .35) 50%, transparent 65%); transform: translateX(-100%); animation: temple-shine 4s var(--ease) 1s infinite; pointer-events: none; }

/* entry tokens look like gold coins with a rim */
:root[data-zone="temple"] .coin-token { background: radial-gradient(circle at 50% 35%, #FFF1C2 0 40%, #E4B83C 45% 100%); color: #1E1605; box-shadow: inset 0 -4px 0 #B88C1A, inset 0 0 0 3px rgba(255, 255, 255, .35), 0 6px 14px -6px rgba(0, 0, 0, .5); }
:root[data-zone="temple"] .coin-token .win { color: #5A3A05; opacity: .9; }

/* the chip at the top: a small gold bar instead of a coin */
:root[data-zone="temple"] .coin-dot { background: linear-gradient(180deg, #FFF1C2, #E4B83C 60%, #B88C1A); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .5), 0 0 10px rgba(228, 184, 60, .4); }

/* tab bar: a gold line on top and a glowing active tab */
:root[data-zone="temple"] .tabbar { border-top: 1px solid rgba(228, 184, 60, .25); }
:root[data-zone="temple"] .tabbar button[aria-current="page"] .icon { color: var(--accent-text); filter: drop-shadow(0 0 6px rgba(228, 184, 60, .55)); }

/* the wallet: the number shines in gold */
:root[data-zone="temple"] .wallet-hero .amount { color: #F1CB5E; text-shadow: 0 0 24px rgba(228, 184, 60, .35); }
:root[data-zone="temple"] .wallet-hero .label { font-family: var(--display); letter-spacing: .16em; text-transform: uppercase; font-size: 12px; color: #F1CB5E; }
:root[data-zone="temple"] .wallet-hero::before { content: ''; position: absolute; left: 14px; right: 14px; top: 6px; height: 8px; display: block; background: #E4B83C; opacity: .5; -webkit-mask: var(--meander) repeat-x; mask: var(--meander) repeat-x; -webkit-mask-size: 12px 8px; mask-size: 12px 8px; }
:root[data-zone="temple"] .wallet-hero .temple-art { width: 104px; right: 10px; bottom: 8px; opacity: .55; }

/* pillars of light on both sides of every screen */
:root[data-zone="temple"] body::before, :root[data-zone="temple"] body::after { width: 22px; opacity: .7; background: linear-gradient(90deg, var(--accent-tint), transparent 30%, transparent 70%, var(--accent-tint)); }
@media (prefers-reduced-motion: reduce) { .temple-art .ray, :root[data-zone="temple"] .play-bar .btn.primary::after { animation: none; } }

/* the logo in the Temple: the red tile turns gold, the name is engraved in gold */
:root[data-zone="temple"] .splash-mark i:nth-child(2) { background: linear-gradient(180deg, #F1CB5E, #C99A1E); box-shadow: 0 6px 18px -4px rgba(228, 184, 60, .7); }
:root[data-zone="temple"] .splash-name .wm { color: #E4B83C; }
:root[data-zone="temple"] .splash-name .wm span { color: #A99C7E; }
:root[data-zone="temple"] .splash-mark { filter: drop-shadow(0 0 24px rgba(228, 184, 60, .25)); }
:root[data-zone="temple"][data-theme="day"] .splash-name .wm { color: #7A5A0C; }
:root[data-zone="temple"][data-theme="day"] .splash-name .wm span, :root[data-zone="temple"][data-theme="day"] .splash-name .am, :root[data-zone="temple"][data-theme="day"] .splash-name .tag { color: #74694F; }

/* the Temple logo on the loading screen (birr only): it rises, glows, and a light passes over it */
.splash-temple { display: none; position: relative; width: 200px; height: 200px; border-radius: 44px; overflow: hidden; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .7), 0 0 0 1px rgba(228, 184, 60, .25), 0 0 40px rgba(228, 184, 60, .18); animation: temple-rise .8s var(--spring) both, temple-glow 3s ease-in-out 1s infinite; }
.splash-temple img { display: block; width: 100%; height: 100%; }
.splash-temple i { position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 246, 213, .45) 48%, rgba(255, 246, 213, .15) 52%, transparent 65%); transform: translateX(-120%); animation: temple-sweep 2.4s var(--ease) .7s infinite; }
@keyframes temple-rise { from { opacity: 0; transform: translateY(26px) scale(.85); } to { opacity: 1; transform: none; } }
@keyframes temple-glow { 50% { box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .7), 0 0 0 1px rgba(228, 184, 60, .45), 0 0 70px rgba(228, 184, 60, .4); } }
@keyframes temple-sweep { 0% { transform: translateX(-120%); } 45%, 100% { transform: translateX(120%); } }
:root[data-zone="temple"] .splash-temple { display: block; }
:root[data-zone="temple"] .splash-mark { display: none; }
@media (prefers-reduced-motion: reduce) { .splash-temple, .splash-temple i { animation: none; } }

/* in the Temple, each screen comes in with a soft gold light that fades */
:root[data-zone="temple"] .view::after { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 1; background: radial-gradient(70% 40% at 50% 0%, rgba(228, 184, 60, .22), transparent 70%); opacity: 0; }
:root[data-zone="temple"] .view.enter-up::after, :root[data-zone="temple"] .view.enter-left::after, :root[data-zone="temple"] .view.enter-right::after, :root[data-zone="temple"] .view.enter-fade::after { animation: temple-light .9s var(--ease) both; }
@keyframes temple-light { 0% { opacity: 1; } 100% { opacity: 0; } }
/* cards and tiles rise one after another */
:root[data-zone="temple"] .view.enter-up > *, :root[data-zone="temple"] .view.enter-fade > * { animation: rise-in .5s var(--ease) both; }
:root[data-zone="temple"] .view.enter-up > *:nth-child(2), :root[data-zone="temple"] .view.enter-fade > *:nth-child(2) { animation-delay: .05s; }
:root[data-zone="temple"] .view.enter-up > *:nth-child(3), :root[data-zone="temple"] .view.enter-fade > *:nth-child(3) { animation-delay: .1s; }
:root[data-zone="temple"] .view.enter-up > *:nth-child(n+4), :root[data-zone="temple"] .view.enter-fade > *:nth-child(n+4) { animation-delay: .15s; }
@media (prefers-reduced-motion: reduce) { :root[data-zone="temple"] .view::after, :root[data-zone="temple"] .view > * { animation: none !important; } }
