/* Soft royal: satin and velvet instead of foil.
   Loaded last. The base sheet built buttons as hard brass (a white hairline on
   the top edge, a flat 4px "thickness" under the button, a diagonal specular
   band). That reads as stamped metal next to the new painted icons, which are
   warm and glowing. Here the same gold is kept but the hard edges are taken
   out: low-contrast satin gradients, one soft halo, a faint inner light, a
   fine gold hairline. Popups and motion follow the same rule - gentle, short,
   never bouncy. Reduced motion turns every transition below off. */
:root {
  --gold-satin-hi: #f2d58f;
  --gold-satin: #e3b95e;
  --gold-satin-lo: #c99a40;
  --velvet-hi: #4d2520;
  --velvet-lo: #351814;
  --hair: rgba(228, 184, 96, .34);
  --hair-soft: rgba(228, 184, 96, .16);
  --halo: 0 0 18px rgba(255, 196, 96, .16);
  --soft-lift: 0 6px 18px rgba(20, 6, 4, .38);
  --royal-ease: cubic-bezier(.22, .72, .28, 1);
}

/* ───────────────────────────────────────── buttons */
.btn { border-radius: 14px; transition: transform .16s var(--royal-ease), filter .2s ease, box-shadow .2s ease, background-color .2s ease; }
.btn:active { transform: scale(.975); }

.btn-primary {
  color: #3a2208; text-shadow: none;
  background: linear-gradient(180deg, var(--gold-satin-hi) 0%, var(--gold-satin) 55%, var(--gold-satin-lo) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 238, 190, .30),
    inset 0 -8px 14px rgba(150, 100, 24, .14),
    var(--soft-lift), var(--halo);
}
.btn-primary:hover { filter: brightness(1.04) saturate(1.03); }
.btn-primary:active {
  box-shadow: inset 0 0 0 1px rgba(255, 238, 190, .22), inset 0 3px 8px rgba(150, 100, 24, .22), 0 3px 10px rgba(20, 6, 4, .35);
}
.btn-primary:disabled { filter: grayscale(.55) brightness(.7); box-shadow: none; }

.btn-ghost {
  color: var(--ink);
  background: linear-gradient(180deg, var(--velvet-hi), var(--velvet-lo));
  border: 1px solid var(--hair);
  box-shadow: inset 0 0 14px rgba(255, 200, 110, .05), 0 4px 12px rgba(20, 6, 4, .28);
}
.btn-ghost:hover { border-color: rgba(228, 184, 96, .5); }

.icon-btn, .btn-icon, .chat-open {
  background: linear-gradient(180deg, var(--velvet-hi), var(--velvet-lo));
  border: 1px solid var(--hair);
  box-shadow: inset 0 0 12px rgba(255, 200, 110, .05), 0 3px 10px rgba(20, 6, 4, .28);
  transition: transform .16s var(--royal-ease), border-color .2s ease;
}
.icon-btn:active, .btn-icon:active, .chat-open:active { transform: scale(.94); }

.btn-send, .chat-form .btn-send { box-shadow: inset 0 0 0 1px rgba(255, 238, 190, .28), var(--soft-lift); }

.friend-play-btn {
  border: 1px solid var(--hair);
  background: linear-gradient(180deg, var(--velvet-hi), var(--velvet-lo));
  box-shadow: inset 0 0 14px rgba(255, 200, 110, .05), var(--soft-lift);
  transition: transform .16s var(--royal-ease), filter .2s ease;
}
.friend-play-btn.is-invite {
  color: #3a2208; border-color: rgba(255, 238, 190, .45);
  background: linear-gradient(180deg, var(--gold-satin-hi), var(--gold-satin) 60%, var(--gold-satin-lo));
  box-shadow: inset 0 0 0 1px rgba(255, 238, 190, .26), var(--soft-lift), var(--halo);
}
.friend-play-btn:active { transform: scale(.975); }

.btn-throw { box-shadow: inset 0 0 0 1px rgba(255, 238, 190, .30), var(--soft-lift), var(--halo); }

.seg { transition: color .2s ease, background .2s ease, box-shadow .2s ease; }
.seg.is-on {
  color: #3a2208;
  background: linear-gradient(180deg, var(--gold-satin-hi), var(--gold-satin) 65%, var(--gold-satin-lo));
  box-shadow: inset 0 0 0 1px rgba(255, 238, 190, .26), 0 2px 8px rgba(20, 6, 4, .3);
}

.mode-tile, .swatch, .gift-card {
  border-color: var(--hair-soft);
  box-shadow: inset 0 0 18px rgba(255, 200, 110, .04), var(--soft-lift);
  transition: transform .2s var(--royal-ease), border-color .2s ease, box-shadow .2s ease;
}
.mode-tile:hover, .gift-card:hover { transform: translateY(-1px); border-color: var(--hair); }
.mode-tile:active { transform: scale(.98); }
.gift-card.is-on, .swatch.is-on { box-shadow: 0 0 0 1px rgba(228, 184, 96, .5) inset, var(--halo), var(--soft-lift); }

.shop-bar, .hud-corner-box, .chip-league, .home-live-ico, .home-family {
  border-color: var(--hair-soft);
  box-shadow: inset 0 0 14px rgba(255, 200, 110, .05), 0 3px 10px rgba(20, 6, 4, .26);
}

/* Keyboard and switch-access focus: a soft gold ring, never a hard outline. */
:focus-visible { outline: none; box-shadow: 0 0 0 2px rgba(255, 224, 150, .75), 0 0 14px rgba(255, 196, 96, .35) !important; }

/* ───────────────────────────────────────── popups */
.overlay {
  background: radial-gradient(circle at 50% 42%, rgba(60, 26, 20, .62), rgba(24, 8, 6, .84));
  backdrop-filter: blur(6px);
  animation: royal-fade .26s ease both;
}
.pass-card, .result-card {
  border: 1px solid var(--hair);
  border-radius: 22px;
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(255, 200, 110, .08), transparent 60%),
    linear-gradient(180deg, var(--velvet-hi), var(--velvet-lo));
  box-shadow: 0 22px 60px rgba(14, 4, 3, .68), 0 0 40px rgba(255, 190, 90, .07), inset 0 0 0 1px rgba(255, 224, 160, .05);
  animation: royal-pop .3s var(--royal-ease) both;
}
/* A second, finer gold line set just inside the edge, like the border of a
   printed invitation. Pure decoration, so it never takes a tap. */
.pass-card::before, .result-card::before {
  content: ""; position: absolute; inset: 7px; border-radius: 16px; pointer-events: none;
  border: 1px solid var(--hair-soft);
}
.pass-card h2, .result-card h2, .pass-card h3, #pass-title { text-shadow: 0 0 18px rgba(255, 196, 96, .18); }
.chat-close { transition: transform .16s var(--royal-ease); }
.chat-close:active { transform: scale(.9); }

.gift-sheet { border-top: 1px solid var(--hair); box-shadow: 0 -16px 50px rgba(14, 4, 3, .6), 0 0 40px rgba(255, 190, 90, .06); }

/* ───────────────────────────────────────── screens and small motion */
.tab { transition: color .2s ease; }
.toast { border: 1px solid var(--hair); box-shadow: 0 10px 30px rgba(14, 4, 3, .5), var(--halo); }

@keyframes royal-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes royal-pop { from { opacity: 0; transform: translateY(10px) scale(.975); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .overlay, .pass-card, .result-card { animation: none; }
  .btn, .icon-btn, .btn-icon, .friend-play-btn, .mode-tile, .seg { transition: none; }
}

/* ───────────────────────────────────────── shop */
.shop-btn {
  border-radius: 12px;
  background: linear-gradient(180deg, var(--gold-satin-hi), var(--gold-satin) 60%, var(--gold-satin-lo));
  border: 1px solid rgba(255, 238, 190, .35);
  color: #3a2208;
  box-shadow: inset 0 -6px 10px rgba(150, 100, 24, .12), 0 3px 10px rgba(20, 6, 4, .3);
  transition: transform .16s var(--royal-ease), filter .2s ease;
}
.shop-btn:active { transform: scale(.97); }
/* Play Store purchases keep their own colour so they read as "real money",
   but as soft verdigris rather than minty foil. */
.shop-btn.is-cash {
  background: linear-gradient(180deg, #a9d6b6, #6fae86);
  border-color: rgba(190, 235, 205, .4); color: #14301f;
}
.shop-btn.is-quiet { background: transparent; border-color: var(--hair); color: var(--ink); box-shadow: none; }
.shop-btn.is-owned { background: transparent; border-color: var(--hair-soft); color: var(--ink-2); box-shadow: none; }
.chip-help { border-color: var(--hair); background: rgba(228, 184, 96, .08); transition: transform .16s var(--royal-ease); }

/* Every other small gold chip gets the same satin, so no control keeps the old foil. */
.room-join, .shop-tab.is-on, .mode-card.is-on .mode-icon, .war-pill.is-won, .hw-grace b {
  background: linear-gradient(180deg, var(--gold-satin-hi), var(--gold-satin) 60%, var(--gold-satin-lo));
  box-shadow: inset 0 0 0 1px rgba(255, 238, 190, .24);
  color: #3a2208;
}
.room-card { border-color: var(--hair-soft); box-shadow: inset 0 0 18px rgba(255, 200, 110, .04), var(--soft-lift); transition: transform .2s var(--royal-ease), border-color .2s ease; }
.room-card:active { transform: scale(.985); }

/* ───────────────────────────────────────── shop sections: a scrolling tab strip */
#screen-shop .shop-tabs {
  gap: 8px; padding: 2px 16px 6px; scroll-snap-type: x proximity; scroll-padding: 0 16px;
  overscroll-behavior-x: contain;
}
/* a spacer so the last tab can scroll fully clear of the edge instead of being cut by it */
#screen-shop .shop-tabs::after { content: ""; flex: 0 0 8px; }
#screen-shop .shop-tab {
  flex: 0 0 auto; min-width: 84px; min-height: 44px; padding: 8px 18px; border-radius: 999px;
  scroll-snap-align: center; font-size: 14px;
  background: linear-gradient(180deg, var(--velvet-hi), var(--velvet-lo));
  border: 1px solid var(--hair-soft); color: var(--ink-2);
  box-shadow: inset 0 0 12px rgba(255, 200, 110, .04), 0 3px 8px rgba(20, 6, 4, .25);
  transition: transform .16s var(--royal-ease), color .2s ease, background .2s ease;
}
#screen-shop .shop-tab:active { transform: scale(.96); }
#screen-shop .shop-tab.is-on {
  color: #3a2208; border-color: rgba(255, 238, 190, .4);
  background: linear-gradient(180deg, var(--gold-satin-hi), var(--gold-satin) 60%, var(--gold-satin-lo));
  box-shadow: inset 0 0 0 1px rgba(255, 238, 190, .24), 0 3px 10px rgba(20, 6, 4, .3), var(--halo);
}
/* a soft fade on whichever side has more to scroll to */
#screen-shop .shop-tabs.can-right { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 34px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 34px), transparent); }
#screen-shop .shop-tabs.can-left { -webkit-mask-image: linear-gradient(90deg, transparent, #000 34px); mask-image: linear-gradient(90deg, transparent, #000 34px); }
#screen-shop .shop-tabs.can-left.can-right { -webkit-mask-image: linear-gradient(90deg, transparent, #000 34px, #000 calc(100% - 34px), transparent); mask-image: linear-gradient(90deg, transparent, #000 34px, #000 calc(100% - 34px), transparent); }

/* ───────────────────────────────────────── popups, part two: give them the app's character
   They were plain velvet slabs with a bold sans title. Now each question card opens with
   a painted medallion, a serif title and a fine gold divider, the same ingredients as the
   home screen, and destructive answers are no longer dressed as safe ones. */
.overlay .pass-card h2, .overlay .result-card h2 {
  font-family: var(--serif); font-weight: 600; letter-spacing: .01em; font-size: 24px; color: var(--ink);
}
.overlay .pass-card h2::after {
  content: ""; display: block; height: 10px; margin: 12px auto 0; width: 160px; opacity: .8;
  background:
    radial-gradient(circle at 50% 50%, var(--gold-satin) 0 3px, transparent 4px),
    linear-gradient(90deg, transparent, rgba(228, 184, 96, .55) 30%, rgba(228, 184, 96, .55) 44%, transparent 45%, transparent 55%, rgba(228, 184, 96, .55) 56%, rgba(228, 184, 96, .55) 70%, transparent) center / 100% 1px no-repeat;
}
.overlay .pass-card .hint, .overlay .pass-card p { font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }

/* the medallion: a painted icon on a soft gold glow, centred at the top of the card */
.overlay .pass-card::after {
  content: ""; position: absolute; left: 50%; top: 20px; width: 60px; height: 60px; margin-left: -30px;
  background: var(--medal, none) center / contain no-repeat; pointer-events: none;
  filter: drop-shadow(0 0 14px rgba(255, 196, 96, .35)) drop-shadow(0 3px 6px rgba(20, 6, 4, .4));
}
#delete-ask .pass-card { --medal: url(../img/icons/warning.webp); }
#name-ask .pass-card { --medal: url(../img/icons/emoji.webp); }
#code-ask .pass-card { --medal: url(../img/icons/join.webp); }
#lang-ask .pass-card { --medal: url(../img/icons/online.webp); }
#group-make .pass-card { --medal: url(../img/icons/friends.webp); }
#net-lost .pass-card { --medal: url(../img/icons/live.webp); }
#quit-ask .pass-card { --medal: url(../img/icons/back.webp); }
#fam-match .pass-card { --medal: url(../img/icons/family.webp); }
#blocked-overlay .pass-card { --medal: url(../img/icons/lock.webp); }
#bots-ask .pass-card { --medal: url(../img/icons/computer.webp); }
#async-ask .pass-card { --medal: url(../img/icons/turnbased.webp); }
#update-forced .pass-card { --medal: url(../img/icons/help.webp); }
#delete-ask .pass-card, #name-ask .pass-card, #code-ask .pass-card, #lang-ask .pass-card, #group-make .pass-card,
#net-lost .pass-card, #quit-ask .pass-card, #fam-match .pass-card, #blocked-overlay .pass-card,
#bots-ask .pass-card, #async-ask .pass-card, #update-forced .pass-card { padding-top: 92px; }

/* answers that cannot be undone read as such: soft sindoor, still satin */
#btn-delete-confirm, #btn-quit-resign.btn-primary {
  color: #fff3e6;
  background: linear-gradient(180deg, #e58b6c, #cf6446 60%, #b24f35);
  box-shadow: inset 0 0 0 1px rgba(255, 214, 190, .28), 0 6px 18px rgba(20, 6, 4, .38), 0 0 18px rgba(232, 113, 76, .16);
}
#btn-quit-leave, #btn-quit-resign { color: #f1a58b; border-color: rgba(232, 113, 76, .45); }

/* ───────────────────────────────────────── the friend card: a tidy two-column menu */
#friend-card .pass-card { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 22px 18px 18px; }
#friend-card .pass-card::after { display: none; }
#friend-card .pass-card > * { margin: 0; }
#friend-card .pass-card > :not(.btn),
#friend-card #friend-card-invite, #friend-card #friend-card-close { grid-column: 1 / -1; }
#friend-card .btn { padding: 11px 8px; font-size: 14px; }
#friend-card .friend-card-head { margin-bottom: 6px; }
#friend-card .friend-card-head h2::after { display: none; }
#friend-card-remove, #friend-card-report, #friend-card-block { color: #f1a58b; border-color: rgba(232, 113, 76, .4); }

/* medallions for the last few question cards */
#async-friends .pass-card { --medal: url(../img/icons/friends.webp); padding-top: 92px; }
#war-challenge .pass-card { --medal: url(../img/icons/league.webp); padding-top: 92px; }
#war-picker .pass-card { --medal: url(../img/icons/family.webp); padding-top: 92px; }

/* bottom sheets (chat, move history, gifts): the same velvet and fine gold edge as the popups */
.chat-sheet {
  border-radius: 24px 24px 0 0; border-color: var(--hair);
  background: radial-gradient(120% 40% at 50% 0%, rgba(255, 200, 110, .07), transparent 70%), linear-gradient(180deg, var(--velvet-hi), var(--velvet-lo));
  box-shadow: 0 -16px 50px rgba(14, 4, 3, .6), 0 0 36px rgba(255, 190, 90, .06), inset 0 0 0 1px rgba(255, 224, 160, .05);
  animation-duration: .3s; animation-timing-function: var(--royal-ease);
}
.chat-sheet-head { border-bottom: 1px solid var(--hair-soft); padding-bottom: 8px; margin-bottom: 8px; }

/* ───────────────────────────────────────── type: the same two faces on every phone */
:root {
  --serif: "Lora", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia,
    "Noto Serif Devanagari", "Noto Serif Telugu", "Noto Serif Kannada", "Noto Serif Tamil", "Noto Serif Gujarati",
    "Noto Sans Devanagari", "Noto Sans Telugu", "Noto Sans Kannada", "Noto Sans Tamil", "Noto Sans Gujarati", serif;
  --sans: "Nunito", ui-rounded, "SF Pro Rounded", -apple-system, "Segoe UI", Roboto, system-ui,
    "Noto Sans Devanagari", "Noto Sans Telugu", "Noto Sans Kannada", "Noto Sans Tamil", "Noto Sans Gujarati", sans-serif;
  /* one scale, declared once (audit: titles were 20, heads 17, hero 23, one section head 22 sans) */
  --t-display: 26px; --t-title: 21px; --t-head: 17px; --t-body: 15px; --t-cap: 12.5px; --t-micro: 11px;
}

/* ═══════════════════════════════════════ audit pass (three designers, one brief) */

/* ───────────────────────────────────────── tab bar: painted icons on a slim floating shelf
   The band is drawn by ::before so it can start below the icons' tops; the icons
   stand on it rather than sit in it. Whole bar = rise + shelf + safe area, so the
   measured --tabbar-h still clears it. */
:root { --tab-rise: 16px; --tab-shelf: 58px; --tab-ico: 54px; }
.tabbar { overflow: visible; background: none; border-top: 0; box-shadow: none; padding: 0 4px max(var(--sab, env(safe-area-inset-bottom, 0px)), 10px); isolation: isolate; }
.tabbar::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; top: var(--tab-rise); z-index: -1;
  background: linear-gradient(180deg, rgba(74, 36, 30, .96), rgba(43, 18, 15, .99) 65%);
  border-top: 1px solid var(--hair);
  box-shadow: 0 -10px 28px rgba(14, 4, 3, .42), inset 0 1px 0 rgba(255, 224, 160, .06);
}
.tab { min-height: calc(var(--tab-rise) + var(--tab-shelf)); padding: 0 2px 4px; gap: 0; justify-content: flex-start; overflow: visible;
  font-size: 11px; font-weight: 700; letter-spacing: .02em; color: var(--ink-3); }
.tab .tab-ico { position: relative; height: var(--tab-ico); opacity: 1; overflow: visible; }
.tab .tab-ico img.ico { width: var(--tab-ico); height: var(--tab-ico); filter: saturate(.8) brightness(.88) drop-shadow(0 5px 6px rgba(14, 4, 3, .55)); transition: transform .24s var(--royal-ease); }
.tab .tab-label { line-height: 14px; }
.tab.is-on::before { display: none; }
.tab.is-on { color: var(--brass); }
.tab.is-on .tab-ico::before { content: ""; position: absolute; left: 50%; top: 50%; width: 68px; height: 68px; margin: -34px 0 0 -34px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 196, 96, .30), rgba(255, 196, 96, .08) 55%, transparent 72%); }
.tab.is-on .tab-ico img.ico { transform: translateY(-3px) scale(1.08); filter: saturate(1) brightness(1.04) drop-shadow(0 0 8px rgba(255, 200, 90, .7)) drop-shadow(0 6px 8px rgba(14, 4, 3, .5)); }
.tab.is-on .tab-ico { animation: none; }
.tab:active .tab-ico img.ico { transform: scale(.92); }
.tab .badge { top: -2px; left: calc(50% + 14px); }
@media (max-width: 360px) { :root { --tab-rise: 14px; --tab-shelf: 54px; --tab-ico: 48px; } .tab { font-size: 11px; } }
/* content clears the icons that overhang the band */
body.has-tabbar .scroller, body.has-tabbar .menu-wrap, body.has-tabbar #screen-rooms .scroller.rooms-screen, body.has-tabbar #screen-menu .menu-wrap { padding-bottom: calc(var(--tabbar-h, 74px) + 14px); }

/* ───────────────────────────────────────── navigation chrome */
.topbar h2 { font-size: var(--t-title); letter-spacing: .005em; }
.icon-btn img.ico-back { width: 26px; height: 26px; }
#screen-friends .topbar #btn-my-profile { border-radius: 50%; }
#screen-game .topbar .icon-btn img.ico { width: 30px; height: 30px; }

/* ───────────────────────────────────────── settings */
.fold { border-color: var(--hair-soft); background: linear-gradient(180deg, var(--velvet-hi), var(--velvet-lo));
  box-shadow: inset 0 0 14px rgba(255, 200, 110, .04), 0 4px 12px rgba(20, 6, 4, .28); transition: border-color .2s ease; }
.fold[open] { border-color: var(--hair); }
.fold > summary { padding: 14px 16px 14px 18px; min-height: 58px; font-size: var(--t-head); }
.fold > summary:active { background: rgba(255, 200, 110, .04); }
.fold > summary::after { content: ""; width: 9px; height: 9px; margin-left: 10px; margin-top: -4px; flex: none;
  border: solid var(--gold-satin); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); transition: transform .22s var(--royal-ease); }
.fold[open] > summary::after { transform: rotate(225deg); margin-top: 4px; }
.fold-value { max-width: 48%; font-size: 13px; color: var(--ink-2); font-weight: 600; letter-spacing: .01em; }
#fold-rules .fold-value { white-space: normal; line-height: 1.25; max-width: 50%; }
.settings-howto { text-align: left; padding: 15px 18px; font-family: var(--serif); font-weight: 600; font-size: 17px; color: var(--ink); margin: 0 0 12px; display: flex; align-items: center; }
.settings-howto::after { content: ""; width: 9px; height: 9px; margin-left: auto; border: solid var(--gold-satin); border-width: 0 1.5px 1.5px 0; transform: rotate(-45deg); }
#screen-settings .scroller > a, #screen-settings .scroller > p > a { display: inline-block; min-height: 44px; padding: 12px 16px; }

/* ───────────────────────────────────────── family */
.crest-picker { grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 14px 0 6px; }
.crest-picker button { padding: 6px; border-radius: 16px; border-color: var(--hair-soft); background: linear-gradient(180deg, rgba(0, 0, 0, .30), rgba(0, 0, 0, .14));
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .4); transition: transform .18s var(--royal-ease), border-color .18s ease, box-shadow .18s ease; }
.crest-picker button .crest-img { filter: saturate(.85) brightness(.9); transition: filter .18s ease, transform .18s var(--royal-ease); }
.crest-picker button.is-on { border-color: var(--gold-satin); background: rgba(228, 184, 96, .10); box-shadow: 0 0 0 1px rgba(255, 238, 190, .35) inset, var(--halo), 0 6px 14px rgba(20, 6, 4, .4); }
.crest-picker button.is-on .crest-img { filter: none; transform: scale(1.06); }
.crest-picker button:active { transform: scale(.94); }
#family-name-input { font-family: var(--sans); font-size: 16px; letter-spacing: 0; text-align: left; padding: 14px 16px; }
#family-none .panel:last-of-type { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
#family-none .panel:last-of-type h3 { grid-column: 1 / -1; margin-bottom: 2px; }
#family-none .panel:last-of-type .code-input { margin: 0; }
#family-none .panel:last-of-type .btn { margin: 0; padding: 13px 22px; min-height: 50px; }
#family-none .panel:last-of-type .hint { grid-column: 1 / -1; margin: 0; }
.panel { padding: 18px 17px 19px; }
.panel > .btn-block:last-child { margin-bottom: 2px; }
.panel h3 { font-size: var(--t-head); }

/* ───────────────────────────────────────── league */
.league-hero { gap: 6px; padding: 6px 0 2px; }
.league-hero b { font-size: var(--t-display); letter-spacing: .01em; }
.league-hero .hint { margin: 0; font-size: 13.5px; }
#league-reset { text-align: center; margin: 8px 0 0; font-size: 12.5px; color: var(--ink-3); letter-spacing: .06em; text-transform: uppercase; }
.league-badge.lg { box-shadow: inset 0 0 0 1px rgba(255, 238, 190, .12), 0 3px 10px rgba(20, 6, 4, .3); }
.league-badge.lg::after { animation: none; }
#screen-league .segmented { margin-bottom: 14px; }
#league-empty { font-size: 14px; line-height: 1.5; color: var(--ink-2); margin-bottom: 14px; }
/* a selected segment is a lit velvet tab, not a second primary button */
.seg.is-on { color: var(--brass-hi); background: linear-gradient(180deg, rgba(255, 200, 110, .18), rgba(255, 200, 110, .08));
  box-shadow: inset 0 0 0 1px var(--hair), 0 0 14px rgba(255, 196, 96, .12); }
/* the end of a short page: a quiet end-mark, not bare stage */
#screen-family .scroller, #screen-league .scroller, #screen-settings .scroller { padding-bottom: 32px; }
#screen-family .scroller::after, #screen-league .scroller::after { content: ""; display: block; height: 10px; margin: 24px auto 0; width: 140px; opacity: .55;
  background: radial-gradient(circle at 50% 50%, var(--gold-satin) 0 2.5px, transparent 3.5px),
    linear-gradient(90deg, transparent, rgba(228, 184, 96, .5) 30%, rgba(228, 184, 96, .5) 45%, transparent 46%, transparent 54%, rgba(228, 184, 96, .5) 55%, rgba(228, 184, 96, .5) 70%, transparent) center / 100% 1px no-repeat; }

/* ───────────────────────────────────────── home: one gold per screen */
#screen-menu .friend-play-btn.is-invite { color: var(--ink); border-color: var(--hair); background: linear-gradient(180deg, var(--velvet-hi), var(--velvet-lo)); box-shadow: inset 0 0 14px rgba(255, 200, 110, .05), var(--soft-lift); }
#screen-menu .home-live { width: 82px; padding: 8px 4px 7px; gap: 3px; border-radius: 13px; border: 1px solid var(--hair-soft); background: linear-gradient(180deg, var(--velvet-hi), var(--velvet-lo)); box-shadow: inset 0 0 14px rgba(255, 200, 110, .05), 0 3px 10px rgba(20, 6, 4, .26); }
#screen-menu .home-live-ico { width: 44px; height: 44px; border: 0; background: none; box-shadow: none; }
#screen-menu .home-live-label { font-size: 11px; font-weight: 700; color: var(--ink); }
#screen-menu .mode-tile.is-big em { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
/* Indic sub-lines run longer: let them take two lines instead of ending in an ellipsis. */
#screen-menu .mode-tile.is-big em:is(:lang(hi), :lang(mr), :lang(ta), :lang(te), :lang(kn), :lang(gu)) { white-space: normal; text-overflow: clip; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#screen-menu .home-top .shop-bar img.ico { width: 26px; height: 26px; }

/* ───────────────────────────────────────── turns: an empty state, not a void */
#screen-turns .scroller { display: flex; flex-direction: column; }
#screen-turns #turns-tabs { flex: none; }
#screen-turns #turns-empty:not([hidden]) { margin: auto 0 0; padding-top: 8px; text-align: center; font-family: var(--serif); font-size: 19px; font-weight: 600; line-height: 1.3; color: var(--ink); }
#screen-turns #turns-empty:not([hidden])::before { content: ""; display: block; width: 96px; height: 96px; margin: 0 auto 14px; background: url(../img/icons/turns.webp) center / contain no-repeat; }
#screen-turns #turns-empty-actions:not([hidden]) { margin: 16px 0 auto; }
#screen-turns #turns-empty-actions .btn { min-height: 50px; }

/* ───────────────────────────────────────── rooms */
#screen-rooms .rooms-top { flex: 0 1 auto; }
#screen-rooms .rooms-fams { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; padding-top: 12px; }
#screen-rooms .rooms-fams .lf-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; margin-top: 10px; gap: 10px; }
#screen-rooms #rooms-list { grid-auto-rows: clamp(84px, 11.5dvh, 100px); gap: 12px; }
#screen-rooms .room-card.is-bot-room { border-style: solid; border-color: var(--hair-soft); }
#screen-rooms .room-board.is-seats-2 .room-seat { font-size: 15px; font-weight: 700; }
#screen-rooms .room-board.is-seats-2 .room-seat.is-free { color: var(--gold-satin); font-size: 14px; }
#screen-rooms .room-foot { min-height: 40px; }
#screen-rooms .room-tag, #screen-rooms .room-join { font-size: 13px; }
#screen-rooms .lf-head h3, .async-games-title { font-family: var(--serif); font-weight: 600; letter-spacing: 0; text-transform: none; }
#screen-rooms .lf-head h3 { font-size: 19px; }
.async-games-title { font-size: 17px; color: var(--ink); }
#screen-rooms .rooms-fams .lf-tag { display: none; }
.lf-row em { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; }
.lf-row { padding: 10px 12px; }
.lf-row .btn, .lf-shuffle, .shop-btn { min-height: 44px; }
.lf-shuffle { padding: 0 14px; }

/* ───────────────────────────────────────── shop */
.shop-btn.is-cash:disabled { opacity: 1; background: transparent; border-color: var(--hair-soft); color: var(--ink-2); box-shadow: none; font-weight: 600; }
.shop-gift { position: relative; }
.shop-free-pill { position: absolute; top: 8px; right: 8px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; color: #3a2208; background: linear-gradient(180deg, var(--gold-satin-hi), var(--gold-satin)); }
.shop-gift p:empty { display: none; }
#screen-shop .topbar { display: grid; grid-template-columns: 1fr auto 1fr; }
#screen-shop .topbar .spacer { display: none; }
#screen-shop .topbar h2 { grid-column: 2; }
#screen-shop .topbar .coin-pill { grid-column: 3; justify-self: end; }
.shop-foot { font-size: 12px; color: var(--ink-3); margin-top: 8px; }
#screen-shop .shop-body { padding-bottom: 20px; }
#screen-shop { position: relative; }
#screen-shop .shop-foot::before { content: ""; position: absolute; left: 0; right: 0; height: 28px; margin-top: -36px; pointer-events: none;
  background: linear-gradient(180deg, transparent, var(--stage-0)); }

/* ───────────────────────────────────────── friends */
#btn-family-open { color: #ffe6a0; border: 1px solid #e6b94f; background: linear-gradient(100deg, rgba(246, 217, 138, .28), rgba(212, 160, 55, .12) 55%, rgba(0, 0, 0, .12));
  box-shadow: inset 0 0 0 1px rgba(246, 217, 138, .12), var(--soft-lift); text-shadow: none; }
.code-pair { align-items: stretch; }
.code-pair .code-half { display: flex; flex-direction: column; }
.code-pair .code-half .lobby-share-row, .code-pair .code-half .btn-block { margin-top: auto; }
.code-pair .code-half .btn-block { margin-bottom: 0; }
#btn-blocked-open { background: none; border-color: transparent; box-shadow: none; color: var(--ink-2); font-weight: 600; font-size: 14px; margin-top: 0; }

/* ───────────────────────────────────────── shared: contrast, radii */
.hint { color: var(--ink-2); font-size: 13px; line-height: 1.4; }
.btn, .hud-corner-box, .home-live-ico, .segmented, .shop-bar, .chip-league, .icon-btn, .shop-btn { border-radius: 12px; }
.panel, .mode-tile.is-big, .home-family, .lf-row, .shop-gift, .shop-card, .room-card, .async-game { border-radius: 16px; }

/* ───────────────────────────────────────── game screen: board above, hand below */
#screen-game .table { gap: 12px; }
#screen-game .status { margin: auto 16px 12px; padding-top: 6px; font-size: 16.5px; letter-spacing: .005em; }
.seat-row-bottom { margin-top: 2px; }
.turn-timer { margin-top: 10px; margin-bottom: 6px; }
@media (orientation: landscape) and (max-height: 500px) { #screen-game .status { margin: 4px 0; } }
.btn-throw { min-height: 64px; border-radius: 16px; font-size: 18px; letter-spacing: .02em; }
@media (max-width: 400px) { .btn-throw { min-width: 116px; } .throw-area .tray { padding: 10px 12px; gap: 10px; } .shells { gap: 7px; } .turn-timer { padding: 0 10px; } }
.btn-throw.is-ready { box-shadow: inset 0 0 0 1px rgba(255, 238, 190, .34), var(--soft-lift), 0 0 24px rgba(255, 196, 96, .34); }
.btn-throw.is-ready::after { box-shadow: 0 0 14px 3px rgba(255, 210, 120, .45); animation-duration: 2.4s; }
@keyframes readyGlow { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
.throw-area:has(.btn-throw.is-ready) .tray { opacity: .92; }
.turn-timer:not(.is-active):not(.is-paused) { opacity: .16; }
.turn-timer-track { height: 6px; background: rgba(0, 0, 0, .28); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .4), 0 1px 0 rgba(255, 236, 200, .06); }
.turn-timer i { background: linear-gradient(90deg, var(--gold-satin-hi), var(--gold-satin)); }
.chat-open.has-unread { border-color: var(--hair); }
.chat-unread { width: 12px; height: 12px; top: -2px; right: -2px; background: #e8623f; box-shadow: 0 0 0 2px var(--velvet-lo), 0 0 10px rgba(232, 98, 63, .6); }
.turn-pill { font-weight: 600; font-size: 13px; color: var(--ink-2); border-color: var(--hair-soft); box-shadow: inset 0 0 12px rgba(255, 200, 110, .04), 0 3px 10px rgba(20, 6, 4, .26); }
.turn-pill .dot { animation: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--pc) 28%, transparent), 0 0 8px color-mix(in srgb, var(--pc) 55%, transparent); }
.turn-pill.pc-red .dot, .pc-red .turn-pill .dot, .turn-pill .dot.pc-red { box-shadow: 0 0 0 1.5px #d4af37, 0 0 8px color-mix(in srgb, var(--pc) 55%, transparent); }
.pips em { color: var(--ink-2); font-weight: 600; }
.bubble-who { background: color-mix(in srgb, var(--pc) 72%, #1a0f0a); color: #fff6e6; font-size: 11px; border-radius: 5px; }
.chat-bubble { border-color: var(--hair-soft); background: linear-gradient(180deg, var(--velvet-hi), var(--velvet-lo)); animation: royal-rise .22s var(--royal-ease) both; }
.throw-value.is-pop { animation-timing-function: cubic-bezier(.2, 1.18, .4, 1); }
@keyframes stickerPop { from { transform: scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }
.sticker-pop { animation-timing-function: var(--royal-ease); }

/* ───────────────────────────────────────── chat sheet */
.chat-sheet-head { font: 600 17px/1.2 var(--serif); letter-spacing: .01em; text-transform: none; color: var(--ink); }
.chat-quick { gap: 8px; margin-bottom: 12px; }
.quick { min-height: 44px; padding: 9px 15px; font-size: 14px; background: linear-gradient(180deg, var(--velvet-hi), var(--velvet-lo)); border: 1px solid var(--hair-soft);
  box-shadow: inset 0 0 10px rgba(255, 200, 110, .04), 0 2px 6px rgba(20, 6, 4, .25); transition: transform .16s var(--royal-ease), border-color .2s ease; }
.quick:active { transform: scale(.96); border-color: var(--hair); }
.chat-line { background: linear-gradient(180deg, var(--velvet-hi), var(--velvet-lo)); border-color: var(--hair-soft); }
.chat-line.is-me { background: linear-gradient(180deg, var(--gold-satin-hi), var(--gold-satin) 60%, var(--gold-satin-lo)); border-color: rgba(255, 238, 190, .35); color: #3a2208; }
.chat-stickers { padding: 4px 2px 12px; }
.chat-form input { background: linear-gradient(180deg, rgba(0, 0, 0, .3), rgba(0, 0, 0, .14)); border-color: var(--hair-soft); min-height: 46px; }
.chat-sheet { max-height: min(68vh, calc(100dvh - 72px)); }
.chat-log { max-height: 26vh; }
.chat-sheet:has(input:focus) .chat-stickers { display: none; }

/* ───────────────────────────────────────── result: a win and a loss are different cards */
.result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#btn-rematch { grid-column: 1 / -1; min-height: 58px; font-size: 18px; }
.result-actions .btn-share { margin-top: 0; }
.standings:empty { display: none; }
@keyframes royal-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.result-crest { animation: royal-rise .4s var(--royal-ease) both; }
.overlay .result-card h2 { animation: royal-rise .4s var(--royal-ease) .08s both; }
.standings li { animation: royal-rise .36s var(--royal-ease) both; }
.result-card.is-win { background: radial-gradient(120% 70% at 50% 0%, rgba(255, 200, 110, .18), transparent 60%), linear-gradient(180deg, var(--velvet-hi), var(--velvet-lo)); border-color: rgba(228, 184, 96, .55); }
.result-card.is-win .result-crest { width: 76px; height: 76px; }
.result-card.is-win h2 { color: var(--gold-satin-hi); }
.result-card.is-loss .result-crest { width: 52px; height: 52px; opacity: .55; }
.result-card.is-loss h2 { color: var(--ink-2); }
.overlay:has(.is-loss) .confetti { display: none; }

/* ───────────────────────────────────────── popups: rhythm, dismissals, the pass medallion */
.overlay .pass-card::after { top: 24px; width: 64px; height: 64px; margin-left: -32px; }
#delete-ask .pass-card, #name-ask .pass-card, #code-ask .pass-card, #lang-ask .pass-card, #group-make .pass-card,
#net-lost .pass-card, #quit-ask .pass-card, #fam-match .pass-card, #blocked-overlay .pass-card,
#bots-ask .pass-card, #async-ask .pass-card, #update-forced .pass-card,
#async-friends .pass-card, #war-challenge .pass-card, #war-picker .pass-card { padding-top: 104px; padding-bottom: 28px; }
.overlay .pass-card h2::after { margin-top: 14px; }
.overlay .pass-card h2 + .hint, .overlay .pass-card h2 + p { margin-top: 14px; }
#bots-ask .pass-card .hint { margin: 18px 0 8px; }
#bots-ask .pass-card .hint:first-of-type { margin-top: 0; }
#bots-ask .segmented { margin: 0; }
#bots-ask .btn-primary { margin-top: 22px; }
#btn-code-ask-cancel, #bots-ask .btn-ghost, #btn-name-skip, #btn-notify-no, #pf-close, #btn-home { background: transparent; box-shadow: none; border-color: var(--hair-soft); color: var(--ink-2); min-height: 48px; padding: 10px 18px; }
#btn-code-ask-cancel:active, #bots-ask .btn-ghost:active, #pf-close:active { background: rgba(255, 200, 110, .05); }
.pass-dot { animation: none; width: 60px; height: 60px; margin: 0 auto 14px;
  box-shadow: inset 0 -5px 9px rgba(0, 0, 0, .38), inset 0 2px 3px rgba(255, 255, 255, .22), 0 0 0 3px rgba(20, 6, 4, .55), 0 0 0 4px var(--hair), var(--halo), 0 6px 14px rgba(20, 6, 4, .45); }
#pass-title { font-size: 26px; line-height: 1.2; text-wrap: balance; }
.profile-card .friend-card-head { flex-direction: column; align-items: center; text-align: center; gap: 10px; margin-bottom: 10px; }
.profile-card .friend-card-head > div { text-align: center; }
.profile-card .friend-card-head > div { min-width: 0; max-width: 100%; }
.profile-card #pf-name { overflow-wrap: anywhere; word-break: break-word; max-width: 100%; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.profile-card .pf-gifts > .hint { grid-column: 1 / -1; text-align: center; margin: 0; }
.pf-avatar { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; font: 600 30px/1 var(--serif); color: #3a2208;
  background: linear-gradient(180deg, var(--gold-satin-hi), var(--gold-satin) 60%, var(--gold-satin-lo));
  box-shadow: 0 0 0 3px rgba(20, 6, 4, .55), 0 0 0 4px var(--hair), var(--halo), 0 6px 14px rgba(20, 6, 4, .45); overflow: hidden; }
.pf-avatar img { border-radius: 50%; }
.pf-h-btn { min-height: 44px; padding: 8px 0; }
.hw-skip { min-height: 44px; min-width: 44px; padding: 8px 10px; margin: -8px -6px 0 0; color: var(--ink-2); }
.hw-title:empty::after { display: none; }
.hw-nav { display: flex; gap: 10px; align-items: stretch; margin-top: 16px; }
.hw-nav .btn { flex: 1; }
.hw-nav .btn-primary { flex: 1.4; }
@media (prefers-reduced-motion: reduce) { .result-crest, .overlay .result-card h2, .standings li, .chat-bubble { animation: none; } }
/* settings must stay one page: the trailing spacer and extra bottom padding pushed the last row onto a second one */
#screen-settings .scroller { padding-bottom: 6px; }
#screen-settings .scroller > .pad { display: none; }
.fold > summary { min-height: 54px; padding-top: 12px; padding-bottom: 12px; }
#screen-settings .legal-row { min-height: 40px; padding: 8px 16px; margin: 4px 0 0; }
.result-actions .btn-share { font-size: 14px; white-space: nowrap; gap: 6px; padding-left: 10px; padding-right: 10px; }
.result-actions .btn-share img.ico { width: 20px; height: 20px; }
/* on tall phones the slack sits under the board, not between your chip and your hand */
.seat-row-bottom { margin-top: auto; }
#screen-game .status { margin-top: 12px; }
@media (orientation: landscape) and (max-height: 500px) { .seat-row-bottom { margin-top: 2px; } }

/* Feature nudges (js/nudge.js): a gold ring round a button the player has not
   tried yet, and a short label beside it. No scrim; the ring never takes a tap.
   Below the invite banner (95), above the screens. */
.fnudge-ring {
  position: fixed; z-index: 94; pointer-events: none; box-sizing: border-box;
  border: 2px solid var(--gold-satin-hi, #f2d58f);
  box-shadow: 0 0 0 3px rgba(227, 185, 94, .28), 0 0 14px rgba(242, 213, 143, .45);
}
.fnudge-ring::after {
  content: ""; position: absolute; inset: -2px; border-radius: inherit;
  border: 2px solid var(--gold-satin, #e3b95e); opacity: 0;
  animation: fnudge-pulse 1.1s ease-out 2;
}
@keyframes fnudge-pulse {
  0% { transform: scale(1); opacity: .9; }
  100% { transform: scale(1.22); opacity: 0; }
}
.fnudge-tip {
  position: fixed; z-index: 94; max-width: min(240px, calc(100vw - 32px));
  padding: 7px 12px; border-radius: 12px; box-sizing: border-box;
  background: #5a1a1c; border: 1px solid var(--edge, rgba(224,176,85,.3));
  color: var(--brass-hi, #ffeab4); font-size: 14px; font-weight: 700; line-height: 1.25;
  width: max-content; text-wrap: balance; box-shadow: 0 8px 22px rgba(14, 4, 3, .45);
  animation: fnudge-in .2s ease-out both; cursor: pointer;
}
.fnudge-tip::before {
  content: ""; position: absolute; left: var(--arrow-x, 50%); top: -6px;
  width: 10px; height: 10px; margin-left: -5px; transform: rotate(45deg);
  background: #5a1a1c; border-left: 1px solid var(--edge, rgba(224,176,85,.3)); border-top: 1px solid var(--edge, rgba(224,176,85,.3));
}
.fnudge-tip.is-above::before { top: auto; bottom: -6px; transform: rotate(225deg); }
@keyframes fnudge-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .fnudge-ring::after, .fnudge-tip { animation: none; }
}

/* ── Shop: Premium tab (Chaupat Plus hero, Remove ads) ─────────────── */
.shop-plus-hero {
  position: relative; margin: 0 0 14px; padding: 18px 16px 14px; border-radius: 18px;
  background: linear-gradient(160deg, #7a1430 0%, #4e0b20 100%); color: #fbecc8;
  box-shadow: 0 6px 18px rgba(78, 11, 32, .28), inset 0 0 0 1.5px rgba(232, 196, 120, .55);
}
.shop-plus-hero h3 { margin: 0 0 8px; font-family: 'Lora', serif; font-size: 1.35rem; color: #f3d48a; }
.shop-plus-hero ul { margin: 0 0 12px; padding: 0; list-style: none; display: grid; gap: 4px; font-size: .92rem; }
.shop-plus-hero li::before { content: '✓'; color: #f3d48a; margin-right: 8px; font-weight: 700; }
.shop-plus-hero .hint { color: rgba(251, 236, 200, .78); margin: 8px 0 0; font-size: .8rem; }
.shop-plus-crest { position: absolute; top: 12px; right: 16px; font-size: 1.4rem; color: #f3d48a; }
.shop-plus-plans { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.shop-plus-hero .shop-plan {
  display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 64px; padding: 8px 6px;
  position: relative;
}
.shop-plan b { font-size: 1.1rem; }
.shop-plan span { font-size: .75rem; opacity: .85; }
.shop-plan em { font-style: normal; font-size: .6875rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: #f3d48a; color: #4e0b20; }
.shop-plan.is-best { box-shadow: 0 0 0 2px #f3d48a; }
.shop-plus-state { margin: 0; font-weight: 700; color: #f3d48a; }
.shop-remove-ads { margin-bottom: 6px; }
.gift-plus-upsell { margin: 6px 0 0; text-align: center; }

/* ── Shop: Gift Plus to a friend (js/plusGift.js). Diwali look = .is-diwali:
   saffron-gold rangoli drawn in CSS, the painted diya from img/gifts. ───── */
.pg-card {
  position: relative; overflow: hidden; margin: 0 0 14px; padding: 16px 16px 12px; border-radius: 18px;
  display: grid; grid-template-columns: 64px 1fr; gap: 4px 12px; align-items: center;
  background: linear-gradient(160deg, #5a1a2c 0%, #3a0e1a 100%); color: #fbecc8;
  box-shadow: 0 6px 18px rgba(58, 14, 26, .3), inset 0 0 0 1.5px rgba(232, 196, 120, .45);
}
.pg-card.is-diwali {
  background: radial-gradient(90% 70% at 100% 0%, rgba(255, 170, 60, .35), transparent 60%),
    linear-gradient(160deg, #8a2a10 0%, #5a1020 55%, #3a0a18 100%);
  box-shadow: 0 8px 22px rgba(138, 42, 16, .35), inset 0 0 0 2px #f0b94a, inset 0 0 0 4px rgba(255, 210, 120, .2);
}
.pg-rangoli { display: none; position: absolute; right: -36px; bottom: -36px; width: 140px; height: 140px; border-radius: 50%; pointer-events: none; opacity: .35;
  background: repeating-conic-gradient(#ffb43a 0 10deg, transparent 10deg 20deg), radial-gradient(circle, #e8432a 0 22%, #ffd36a 23% 30%, transparent 31%);
  -webkit-mask: radial-gradient(circle, #000 0 64%, transparent 65%); mask: radial-gradient(circle, #000 0 64%, transparent 65%); }
.pg-card.is-diwali .pg-rangoli { display: block; }
.pg-art { width: 64px; height: 64px; grid-row: span 1; }
.pg-card.is-diwali .pg-art { filter: drop-shadow(0 0 10px rgba(255, 190, 80, .7)); }
.pg-copy h3 { margin: 0 0 4px; font-family: 'Lora', serif; font-size: 1.2rem; color: #f3d48a; }
.pg-copy p { margin: 0; font-size: .86rem; color: rgba(251, 236, 200, .86); }
.pg-tag { display: inline-block; margin-bottom: 4px; padding: 1px 10px; border-radius: 999px; font-size: .6875rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #4e0b20; background: linear-gradient(180deg, #ffd98a, #f0a83a); }
.pg-opts { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; position: relative; }
.pg-opt { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 66px; padding: 10px 6px 8px; }
.pg-opt.is-best { box-shadow: 0 0 0 2px #f3d48a; }
.pg-opt b { font-size: 1.1rem; }
.pg-opt s, .pg-period s { opacity: .7; font-size: .8rem; }
.pg-badge { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-style: normal; font-size: .6875rem; font-weight: 800; padding: 1px 8px; border-radius: 999px; color: #fff; background: linear-gradient(180deg, #f2552c, #c22a12); box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
.pg-card .hint { grid-column: 1 / -1; position: relative; margin: 8px 0 0; font-size: .78rem; color: rgba(251, 236, 200, .75); }

/* the sheet (reuses .gift-sheet chrome from css/gifts.css) */
.pg-search { margin: 8px 0 4px; min-height: 40px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--edge-soft); background: var(--well); color: var(--ink); font: inherit; }
.pg-friends { display: flex; flex-wrap: wrap; gap: 8px; max-height: 32vh; overflow-y: auto; padding: 8px 0; }
.pg-empty { width: 100%; text-align: center; padding: 12px 4px; }
.pg-empty p { margin: 0 0 10px; color: var(--ink-2); }
.pg-periods { display: flex; gap: 6px; margin: 6px 0; }
.pg-period em { font-style: normal; font-weight: 800; color: #c22a12; }
.pg-msg { width: 100%; box-sizing: border-box; margin: 4px 0 8px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--edge-soft); background: var(--well); color: var(--ink); font: inherit; resize: none; }

/* sent / received moments: a gift box whose lid lifts in a burst of diya light */
.pg-moment { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgba(12, 4, 3, .62); animation: pg-fade .2s ease-out; }
.pg-moment.is-leaving { opacity: 0; transition: opacity .2s; }
.pg-moment-card { width: min(360px, 100%); text-align: center; padding: 22px 18px 16px; border-radius: 22px; color: #fbecc8;
  background: radial-gradient(120% 70% at 50% 0%, rgba(255, 190, 90, .28), transparent 60%), linear-gradient(160deg, #6a1630, #3a0a18);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .55), inset 0 0 0 2px #f0b94a; animation: pg-pop .35s cubic-bezier(.2, 1.3, .4, 1); }
.pg-moment h2 { margin: 10px 0 6px; font-family: 'Lora', serif; font-size: 1.25rem; color: #f3d48a; }
.pg-moment p { margin: 0 0 10px; font-size: .9rem; }
.pg-moment blockquote { margin: 0 0 10px; font-style: italic; color: #ffe2a8; }
.pg-until { font-weight: 700; color: #f3d48a; }
.pg-moment-art { width: 88px; height: 88px; }
.pg-box { position: relative; width: 96px; height: 96px; margin: 0 auto; }
.pg-body { position: absolute; left: 14px; right: 14px; bottom: 6px; height: 54px; border-radius: 6px;
  background: linear-gradient(90deg, transparent 42%, #f3d48a 42% 58%, transparent 58%), linear-gradient(180deg, #e8432a, #a8201a); }
.pg-lid { position: absolute; left: 8px; right: 8px; top: 30px; height: 18px; border-radius: 5px; z-index: 2;
  background: linear-gradient(90deg, transparent 42%, #f3d48a 42% 58%, transparent 58%), linear-gradient(180deg, #f2552c, #c22a12);
  animation: pg-lid .9s .25s cubic-bezier(.3, 1.4, .5, 1) forwards; }
.pg-glow { position: absolute; left: 50%; top: 40px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; opacity: 0;
  background: radial-gradient(circle, #fff6c8, #ffb43a 50%, transparent 70%); box-shadow: 0 0 30px 18px rgba(255, 190, 80, .55);
  animation: pg-glow 1.1s .55s ease-out forwards; }
@keyframes pg-fade { from { opacity: 0; } }
@keyframes pg-pop { from { transform: scale(.85); opacity: 0; } }
@keyframes pg-lid { to { transform: translateY(-34px) rotate(-14deg); } }
@keyframes pg-glow { 0% { opacity: 0; transform: scale(.4); } 60% { opacity: 1; transform: scale(2.2); } 100% { opacity: .85; transform: scale(1.6); } }
@media (prefers-reduced-motion: reduce) {
  .pg-moment, .pg-moment-card, .pg-lid, .pg-glow { animation: none; }
  .pg-lid { transform: translateY(-34px) rotate(-14deg); }
  .pg-glow { opacity: .85; }
}

/* Pinned Gift Plus banner on the Shop (js/plusGift.js renderBanner): sits
   between the tabs and the scroller, so it never scrolls away. Saffron-gold
   strip; the Diwali look only inside the Diwali window. */
.pg-banner { flex: none; margin: 6px 12px 8px; display: grid; gap: 6px; position: relative; z-index: 2; }
/* The list below always starts under the banner: it takes the remaining height and scrolls inside it. */
#screen-shop .shop-body { min-height: 0; flex: 1 1 0; }
.pg-banner[hidden] { display: none; }
.pg-bn-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 16px; color: #fbecc8;
  background: linear-gradient(100deg, #7a1430, #a8321c 55%, #d9781e); box-shadow: inset 0 0 0 1px rgba(243, 212, 138, .55), 0 3px 10px rgba(0, 0, 0, .25); }
.pg-banner.is-diwali .pg-bn-row:first-child { background: linear-gradient(100deg, #5e0f2a, #b2401a 50%, #f0a83a); box-shadow: inset 0 0 0 1.5px #f3d48a, 0 0 14px rgba(255, 190, 80, .45); }
.pg-bn-row.is-activate { background: linear-gradient(100deg, #1f5a3a, #2f7d4a 60%, #c9a13b); }
.pg-bn-art { width: 40px; height: 40px; }
.pg-bn-bow { font-size: 30px; line-height: 1; }
.pg-bn-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pg-bn-copy > b { font-family: 'Lora', serif; font-size: .95rem; color: #f3d48a; line-height: 1.2; }
.pg-bn-copy > span { font-size: .78rem; color: rgba(251, 236, 200, .9); }
.pg-bn-prices { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.pg-bn-price { padding: 0; border: 0; background: none; color: inherit; font: inherit; font-size: .78rem; cursor: pointer; }
.pg-bn-price b { color: #ffe2a8; }
.pg-bn-price s { opacity: .7; }
.pg-bn-off { font-style: normal; font-weight: 800; font-size: .6875rem; padding: 0 6px; border-radius: 999px; color: #fff; background: linear-gradient(180deg, #f2552c, #c22a12); }
.pg-bn-go { min-height: 36px; padding: 0 16px; }
.pg-banner .pg-tag { align-self: flex-start; margin-bottom: 0; }
.pg-rel { margin-left: 6px; font-size: .6875rem; font-weight: 700; padding: 0 6px; border-radius: 999px; background: rgba(243, 212, 138, .3); }
.pg-later { margin-top: 6px; }

/* The banner's generic span colour was washing the Diwali tag out on its gold pill. */
.pg-bn-copy > span.pg-tag { color: #4e0b20; font-size: .6875rem; line-height: 1.5; }

/* Gift banner v2: selling row. Motion is transform/opacity only (no filters on
   moving things); all of it is switched off under prefers-reduced-motion. */
.pg-banner { animation: pgbIn .5s cubic-bezier(.2, .9, .3, 1.2) both; }
.pg-bn-row.is-gift { position: relative; overflow: hidden; cursor: pointer; grid-template-columns: 50px 1fr auto; gap: 8px; padding: 7px 10px 7px 6px; }
.pg-bn-row.is-gift::after { content: ''; position: absolute; inset: 0 auto 0 0; width: 40%; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 236, 190, .22) 50%, transparent); transform: translateX(-120%) skewX(-18deg); animation: pgbShine 4.8s ease-in-out 1s infinite; }
.pg-bn-stage { position: relative; width: 50px; height: 50px; display: grid; place-items: center; }
.pg-bn-stage::before { content: ''; position: absolute; inset: 2px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 214, 120, .75), rgba(255, 170, 60, .25) 45%, transparent 70%); animation: pgbGlow 2.6s ease-in-out infinite; }
.pg-bn-row.is-gift .pg-bn-art { position: relative; width: 44px; height: 44px; animation: pgbBob 2.6s ease-in-out infinite; }
.pg-sp { position: absolute; width: 7px; height: 7px; opacity: 0; z-index: 1;
  background: radial-gradient(circle, #fff8dc 0 18%, transparent 20%), linear-gradient(#fff3c4, #fff3c4) center / 1.5px 100% no-repeat, linear-gradient(#fff3c4, #fff3c4) center / 100% 1.5px no-repeat;
  animation: pgbTwinkle 2.4s ease-in-out infinite; }
.pg-sp.s1 { top: 2px; left: 4px; }
.pg-sp.s2 { top: 8px; right: 0; animation-delay: .6s; width: 5px; height: 5px; }
.pg-sp.s3 { bottom: 4px; left: 0; animation-delay: 1.2s; width: 5px; height: 5px; }
.pg-sp.s4 { bottom: 0; right: 6px; animation-delay: 1.8s; }
.pg-bn-row.is-gift .pg-bn-copy { gap: 1px; position: relative; z-index: 1; }
.pg-bn-row.is-gift .pg-bn-copy > b { font-size: .92rem; color: #ffe7a6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg-bn-copy > span.pg-bn-sub { font-size: .6875rem; line-height: 1.25; color: rgba(255, 240, 210, .88); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg-banner .pg-bn-row.is-gift .pg-tag { font-size: .6875rem; padding: 0 8px; letter-spacing: .04em; color: #4e0b20; }
.pg-bn-cd { display: inline-block; font-weight: 900; font-variant-numeric: tabular-nums; color: #4e0b20; }
.pg-bn-cd.is-tick { animation: pgbTick .45s ease-out; }
.pg-bn-row.is-gift .pg-bn-prices { gap: 4px; margin-top: 2px; flex-wrap: nowrap; }
.pg-bn-row.is-gift .pg-bn-price { display: inline-flex; align-items: baseline; gap: 3px; padding: 1px 7px; border-radius: 999px; font-size: .7rem; white-space: nowrap;
  color: #fbecc8; background: rgba(40, 4, 14, .42); box-shadow: inset 0 0 0 1px rgba(243, 212, 138, .55); }
.pg-bn-row.is-gift .pg-bn-price i { font-style: normal; opacity: .85; }
.pg-bn-row.is-gift .pg-bn-price b { color: #ffe2a8; font-weight: 800; }
.pg-bn-row.is-gift .pg-bn-price s { font-size: .6875rem; opacity: .65; }
.pg-bn-row.is-gift .pg-bn-price:active { transform: scale(.96); }
.pg-bn-save { position: absolute; top: 0; right: 0; z-index: 2; padding: 1px 8px 2px 10px; border-bottom-left-radius: 10px; font-size: .6875rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase;
  color: #fff; background: linear-gradient(180deg, #f2552c, #b8240f); box-shadow: 0 1px 4px rgba(0, 0, 0, .35); }
.pg-bn-row.is-gift .pg-bn-go { position: relative; z-index: 1; overflow: hidden; min-height: 34px; padding: 0 14px; animation: pgbPulse 2.2s ease-in-out infinite; }
.pg-bn-row.is-gift .pg-bn-go::after { content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 45%; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .6) 50%, transparent); transform: translateX(-140%) skewX(-20deg); animation: pgbSheen 3s ease-in-out .6s infinite; }
.pg-bn-save ~ .pg-bn-go { margin-top: 10px; }
/* A real deal adds struck prices: drop the sub line so the chips get the room (wrap if still tight). */
.pg-bn-row.has-deal .pg-bn-sub { display: none; }
.pg-bn-row.has-deal .pg-bn-prices { flex-wrap: wrap; }
@keyframes pgbIn { from { opacity: 0; transform: translateY(-10px) scale(.96); } }
@keyframes pgbShine { 0%, 60% { transform: translateX(-120%) skewX(-18deg); } 100% { transform: translateX(320%) skewX(-18deg); } }
@keyframes pgbBob { 0%, 100% { transform: translateY(1px) rotate(-2deg); } 50% { transform: translateY(-3px) rotate(2deg); } }
@keyframes pgbGlow { 0%, 100% { opacity: .55; transform: scale(.9); } 50% { opacity: 1; transform: scale(1.08); } }
@keyframes pgbTwinkle { 0%, 100% { opacity: 0; transform: scale(.3) rotate(0); } 45% { opacity: 1; transform: scale(1) rotate(45deg); } 70% { opacity: 0; } }
@keyframes pgbPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes pgbSheen { 0%, 55% { transform: translateX(-140%) skewX(-20deg); } 100% { transform: translateX(320%) skewX(-20deg); } }
@keyframes pgbTick { from { opacity: .2; transform: translateY(-5px); } }
@media (max-width: 360px) {
  .pg-bn-row.is-gift .pg-bn-copy > b { font-size: .84rem; }
  .pg-bn-row.is-gift .pg-bn-go { padding: 0 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .pg-banner, .pg-bn-row.is-gift::after, .pg-bn-stage::before, .pg-bn-row.is-gift .pg-bn-art, .pg-sp,
  .pg-bn-cd.is-tick, .pg-bn-row.is-gift .pg-bn-go, .pg-bn-row.is-gift .pg-bn-go::after { animation: none !important; }
  .pg-bn-row.is-gift::after, .pg-bn-row.is-gift .pg-bn-go::after, .pg-sp { display: none; }
}

/* ---------- Plus perk list (Premium card, gift sheet, offer popups) ---------- */
.plus-feats { margin: 0 0 10px; padding: 0; list-style: none; display: grid; gap: 5px; font-size: .9rem; color: #fbecc8; }
.plus-feats li { display: flex; align-items: center; gap: 8px; line-height: 1.25; }
.shop-plus-hero .plus-feats li::before { content: none; }
.plus-feats li i { flex: 0 0 26px; height: 26px; display: grid; place-items: center; font-style: normal; font-size: 14px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255, 238, 190, .28), rgba(228, 184, 96, .10)); box-shadow: 0 0 0 1px rgba(243, 212, 138, .35) inset; }
.pg-foot .plus-feats { margin: 2px 0 10px; font-size: .84rem; gap: 4px; }
.pg-foot .plus-feats li i { flex-basis: 22px; height: 22px; font-size: 12px; }

/* ---------- Offer popups (js/offerPopup.js) ---------- */
.op-wrap { position: fixed; inset: 0; z-index: 9000; display: grid; place-items: center; padding: 16px; }
.op-wrap[hidden] { display: none; }
.op-scrim { position: absolute; inset: 0; background: rgba(18, 4, 8, .72); opacity: 0; transition: opacity .22s ease; }
.op-wrap.is-open .op-scrim { opacity: 1; }
.op-card { position: relative; width: min(380px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; overflow-x: hidden; padding: 18px 16px 12px; border-radius: 22px;
  color: #fbecc8; background: radial-gradient(120% 70% at 50% 0%, #7a1730 0%, #4e0b20 55%, #2e0613 100%);
  box-shadow: 0 0 0 1.5px rgba(243, 212, 138, .55) inset, 0 18px 50px rgba(0, 0, 0, .55);
  opacity: 0; transform: translateY(18px) scale(.94); transition: opacity .24s ease, transform .32s cubic-bezier(.2, 1.3, .4, 1); }
.op-wrap.is-open .op-card { opacity: 1; transform: none; }
.op-card::after { content: ''; position: absolute; inset: 0 auto 0 0; width: 40%; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 236, 180, .14), transparent); animation: pgbShine 4.2s ease-in-out infinite; }
.op-x { position: absolute; top: 8px; right: 8px; z-index: 2; }
.op-hero { display: flex; align-items: center; gap: 12px; margin: 0 34px 12px 0; }
.op-stage { position: relative; flex: 0 0 64px; height: 64px; display: grid; place-items: center; }
.op-stage img { width: 60px; height: 60px; animation: pgbBob 2.6s ease-in-out infinite; }
.op-head h2 { margin: 2px 0 2px; font-family: 'Lora', serif; font-size: 1.3rem; color: #ffe7a6; line-height: 1.15; }
.op-head p { margin: 0; font-size: .82rem; color: rgba(251, 236, 200, .82); }
.op-tag { display: inline-block; font-size: .6875rem; padding: 1px 8px; color: #4e0b20; }
.op-save { position: absolute; top: 12px; left: -30px; z-index: 2; transform: rotate(-35deg); width: 120px; text-align: center; padding: 2px 0;
  font-size: .6875rem; font-weight: 800; letter-spacing: .04em; color: #4e0b20; background: linear-gradient(180deg, var(--gold-satin-hi), var(--gold-satin)); }
.op-card.is-diwali .op-hero { margin-left: 18px; }
.op-chips { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 4px 0 6px; }
.op-chip { position: relative; display: grid; gap: 1px; justify-items: center; padding: 8px 6px; min-height: 64px; border-radius: 14px; cursor: pointer;
  color: #fbecc8; background: rgba(255, 238, 190, .06); border: 1.5px solid rgba(243, 212, 138, .3); font: inherit; }
.op-chip.is-on { border-color: var(--gold-satin); background: rgba(228, 184, 96, .16); box-shadow: 0 0 0 1px rgba(255, 238, 190, .35) inset; }
.op-chip i { font-style: normal; font-size: .74rem; opacity: .85; }
.op-chip b { font-size: 1.02rem; color: #ffe2a8; }
.op-chip s, .op-chip small { font-size: .6875rem; opacity: .7; }
.op-chip em { font-style: normal; font-size: .6875rem; font-weight: 800; padding: 0 6px; border-radius: 999px; color: #3a2208; background: linear-gradient(180deg, var(--gold-satin-hi), var(--gold-satin)); }
.op-note { margin: 4px 0 10px; font-size: .74rem; text-align: center; color: rgba(251, 236, 200, .72); }
.op-go { position: relative; overflow: hidden; }
.op-go::after { content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 45%; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .45), transparent); animation: pgbShine 2.8s ease-in-out infinite; }
.op-later.btn { margin-top: 4px; background: transparent; border: 0; box-shadow: none; color: rgba(251, 236, 200, .8); min-height: 40px; }
@media (max-height: 640px) { .op-card .plus-feats { gap: 2px; font-size: .82rem; } .op-stage { flex-basis: 48px; height: 48px; } .op-stage img { width: 46px; height: 46px; } }
@media (prefers-reduced-motion: reduce) {
  .op-card, .op-scrim { transition: opacity .15s ease; transform: none !important; }
  .op-card::after, .op-stage img, .op-go::after, .op-stage .pg-sp { animation: none !important; }
  .op-card::after, .op-go::after, .op-stage .pg-sp { display: none; }
}

/* Quick match: a grid tile like its neighbours, gold bolt + QUICK pill. */
#screen-menu #btn-quick-match { position: relative; }
#screen-menu #btn-quick-match .mode-tile-ico { display: grid; place-items: center; }
#screen-menu #btn-quick-match .mode-tile-ico svg { width: 80%; height: 80%; }
#screen-menu #btn-quick-match .quick-tag { position: absolute; top: -7px; right: 6px; padding: 2px 9px; border-radius: 999px; font: 700 11px/1.2 Nunito, system-ui, sans-serif; letter-spacing: .04em; text-transform: uppercase; color: #4a2208; background: linear-gradient(180deg, var(--gold-satin-hi, #f6dc9a), var(--gold-satin-lo, #b9862f)); box-shadow: inset 0 1px 0 rgba(255, 246, 214, .7), 0 1px 2px rgba(0, 0, 0, .3); }
/* Pass & play: a full-width banner, the same shape as Bluetooth. */
#screen-menu #btn-pass-play { grid-column: 1 / -1; display: flex; flex-direction: row; align-items: center; justify-content: flex-start; gap: 12px; min-height: 0; height: 58px; padding: 6px 14px; text-align: left; }
#screen-menu #btn-pass-play .mode-tile-ico { width: 38px; height: 38px; flex: 0 0 auto; margin: 0; }
#screen-menu #btn-pass-play .nearby-copy { min-width: 0; }
#screen-menu #btn-pass-play b { display: block; font-size: 15px; }
#screen-menu #btn-pass-play em { display: block; margin-left: 0; text-align: left; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#screen-menu #btn-pass-play::after { content: ""; margin-left: auto; width: 16px; height: 16px; flex: none; opacity: .75; background: url("../img/icons/back.webp") center / contain no-repeat; transform: scaleX(-1); }
#add-friend-ask .pass-card { --medal: url(../img/icons/invite.webp); padding-top: 92px; max-height: calc(100dvh - 24px); overflow-y: auto; }
#add-friend-ask .lobby-code { margin: 4px 0 8px; }
#add-friend-ask .af-row { display: flex; gap: 8px; margin-bottom: 12px; }
#add-friend-ask .af-row .btn { flex: 1; min-width: 0; padding-left: 6px; padding-right: 6px; }
#add-friend-ask .code-input { text-transform: uppercase; width: 100%; }
#quick-ask .btn + .btn { margin-top: 10px; }
.result-quick { margin: 8px 0 0; text-align: center; font-size: 13px; color: var(--gold-satin-hi, #f6dc9a); opacity: .9; }
.result-goal { margin: 6px 0 0; text-align: center; font-size: 13px; font-weight: 700; color: var(--gold-satin-hi, #f6dc9a); }
.result-goal.is-done { color: #9be59b; }
.btn-result-spin { width: 100%; margin: 8px 0 2px; }
.btn-result-spin[hidden] { display: none; }

/* ---------- Painted icons replacing emoji (img/icons, tools/giftart/icons/sheet4.png) ---------- */
.mode-tile-ico.quick-bolt img { width: 46px; height: 46px; object-fit: contain; display: block; }
.shop-plus-crest { top: 8px; right: 10px; }
.shop-plus-crest img { width: 44px; height: 44px; object-fit: contain; display: block; }
.plus-feats li i { background: none; box-shadow: none; }
.plus-feats li i img { width: 100%; height: 100%; object-fit: contain; display: block; }
.watchers-chip .wc-ico { width: 18px; height: 18px; vertical-align: -4px; }
.spectator-listen::before { content: ""; display: inline-block; width: 18px; height: 18px; margin-right: 4px; vertical-align: -4px;
  background: url(../img/icons/listen.webp) center / contain no-repeat; }
#spectator-talk::before { background-image: url(../img/icons/mic.webp); }
#spectator-talk[data-mode="ask"]::before { background-image: url(../img/icons/invite.webp); }
#spectator-talk[data-mode="asked"]::before { background-image: url(../img/icons/pending.webp); }

/* ---------- Maharaja League (js/maharaja.js, js/maharajaPopup.js) ---------- */
.maharaja-panel { position: relative; overflow: hidden; color: #fbecc8;
  background: radial-gradient(120% 80% at 50% 0%, #7a1730 0%, #4e0b20 60%, #2e0613 100%);
  box-shadow: 0 0 0 1.5px rgba(243, 212, 138, .55) inset, 0 8px 22px rgba(0, 0, 0, .25); }
.maharaja-panel:empty { display: none; }
.mj-head { display: flex; align-items: center; gap: 12px; }
.mj-crest { flex: 0 0 56px; width: 56px; height: 56px; object-fit: contain; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .4)); }
.mj-copy { min-width: 0; display: grid; }
.mj-title { font-family: 'Lora', serif; font-size: 1.15rem; color: #ffe7a6; line-height: 1.2; overflow-wrap: anywhere; }
.mj-days { font-style: normal; font-size: .78rem; color: rgba(251, 236, 200, .8); }
.mj-prize { margin: 10px 0 8px; font-size: .82rem; color: #ffe2a8; }
.mj-me { display: grid; gap: 4px; padding: 8px 10px; border-radius: 12px; background: rgba(255, 238, 190, .07); border: 1px solid rgba(243, 212, 138, .3); font-size: .84rem; }
.mj-qual { font-size: .76rem; opacity: .85; }
.mj-qual.is-ok { color: #ffd77a; opacity: 1; font-weight: 700; }
.mj-bar { height: 6px; border-radius: 999px; background: rgba(255, 238, 190, .15); overflow: hidden; }
.mj-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold-satin, #d9a84e), var(--gold-satin-hi, #f6dc9a)); }
.mj-list { list-style: none; margin: 10px 0 6px; padding: 0; display: grid; gap: 2px; }
.mj-row { display: flex; align-items: center; gap: 10px; padding: 5px 8px; border-radius: 10px; font-size: .88rem; }
.mj-row:nth-child(-n+3) .mj-rank { color: #3a2208; background: linear-gradient(180deg, var(--gold-satin-hi, #f6dc9a), var(--gold-satin, #d9a84e)); }
.mj-row.is-me { background: rgba(228, 184, 96, .18); }
.mj-rank { flex: 0 0 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; font-weight: 800; font-size: .75rem; background: rgba(255, 238, 190, .1); }
.mj-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mj-pts { color: #ffe2a8; font-variant-numeric: tabular-nums; }
.maharaja-panel .hint { color: rgba(251, 236, 200, .75); }
.mj-empty, .mj-last { margin: 8px 0; font-size: .8rem; }
#btn-maharaja-play { margin-top: 8px; }
#btn-home-league { position: relative; }
#btn-home-league.has-dot::after { content: ''; position: absolute; top: 2px; right: 4px; width: 10px; height: 10px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff1c4, #e2a83a); box-shadow: 0 0 0 2px #4e0b20, 0 0 6px rgba(255, 210, 110, .8); }

.mjp-card { text-align: center; padding-top: 22px; }
.mjp-card::after { display: none; }
.mjp-medal { position: relative; width: 132px; height: 132px; margin: 0 auto 4px; display: grid; place-items: center;
  background: radial-gradient(circle, rgba(255, 220, 140, .35) 0%, rgba(255, 220, 140, 0) 68%); }
.mjp-medal > img:first-child { width: 120px; height: 120px; object-fit: contain; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, .45)); animation: pgbBob 2.6s ease-in-out infinite; }
.mjp-av { position: absolute; right: 0; bottom: 2px; width: 46px; height: 46px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2.5px #f3d48a, 0 3px 8px rgba(0, 0, 0, .5); background: #4e0b20; }
.mjp-kicker { margin: 0; font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: rgba(251, 236, 200, .75); }
.mjp-card h2 { margin: 4px 0 2px; font-family: 'Lora', serif; font-size: 1.35rem; color: #ffe7a6; line-height: 1.2; }
.mjp-name { margin: 6px 0 0; font-family: 'Lora', serif; font-weight: 700; font-size: 1.5rem; line-height: 1.25; overflow-wrap: anywhere;
  background: linear-gradient(180deg, #fff3cf, #e6b24f); -webkit-background-clip: text; background-clip: text; color: transparent; }
.mjp-pts { margin: 4px 0 6px; font-weight: 800; color: #ffd77a; }
.mjp-sub { margin: 4px 0 10px; font-size: .84rem; color: rgba(251, 236, 200, .85); }
.mjp-prize { list-style: none; margin: 0 0 12px; padding: 8px 10px; display: grid; gap: 4px; font-size: .8rem; text-align: left; border-radius: 12px;
  background: rgba(255, 238, 190, .07); border: 1px solid rgba(243, 212, 138, .3); }
.mjp-prize li::before { content: '\2726'; margin-right: 6px; color: #f3d48a; }
.mjp-card.is-mine h2 { font-size: 1.45rem; }
.mjp-conf { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.mjp-cf { position: absolute; top: -12px; left: var(--x); width: 7px; height: 12px; border-radius: 2px; opacity: .85; animation: mjpFall 3.4s linear var(--d) infinite; }
.mjp-cf.c0 { background: #f3d48a; } .mjp-cf.c1 { background: #e2a83a; } .mjp-cf.c2 { background: #fff1c4; } .mjp-cf.c3 { background: #c2334f; }
.mjp-cf.c4 { background: #2f8f83; } .mjp-cf.c5 { background: #f3d48a; } .mjp-cf.c6 { background: #ffb2a0; }
@keyframes mjpFall { 0% { transform: translateY(0) rotate(0); } 100% { transform: translateY(560px) rotate(540deg); } }
@media (prefers-reduced-motion: reduce) {
  .mjp-cf { animation: none; top: auto; } .mjp-cf:nth-child(odd) { top: 8%; } .mjp-cf:nth-child(even) { top: 18%; }
  .mjp-medal > img:first-child { animation: none; }
}

/* The division badge is not shown: the league is just the Maharaja League. */
.league-badge[hidden] { display: none; }

/* Maharaja League countdown: four gold-edged boxes ticking to the end of the IST month. */
.mj-timer { margin: 10px 0 4px; padding: 10px 10px 8px; border-radius: 14px; text-align: center;
  background: linear-gradient(180deg, rgba(255, 238, 190, .1), rgba(255, 238, 190, .03));
  border: 1px solid rgba(243, 212, 138, .38); }
.mj-t-lead { display: block; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: #ffe2a8; margin-bottom: 6px; }
.mj-t-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mj-t-box { display: grid; gap: 2px; padding: 7px 0 5px; border-radius: 10px; background: rgba(46, 6, 19, .72);
  box-shadow: inset 0 0 0 1px rgba(243, 212, 138, .45); }
.mj-t-n { font-family: 'Lora', serif; font-variant-numeric: tabular-nums; font-size: 1.45rem; line-height: 1.1; color: #ffe7a6; }
.mj-t-box i { font-style: normal; font-size: .6875rem; letter-spacing: .08em; text-transform: uppercase; color: rgba(251, 236, 200, .75); }
.mj-t-end { display: block; margin-top: 7px; font-style: normal; font-size: .74rem; color: rgba(251, 236, 200, .85); }

/* Small countdown pill under the Home Maharaja League button. */
.chip-league-timer { display: block; margin-top: 1px; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 800;
  letter-spacing: .02em; font-variant-numeric: tabular-nums; color: #4e0b20; line-height: 1.5;
  background: linear-gradient(180deg, #ffd98a, #f0a83a); box-shadow: 0 1px 0 rgba(255, 244, 214, .5) inset; }
.chip-league-timer:empty { display: none; }

/* The Home title: "Chaupat" in bold bright gold serif, in step with the other
   headings (Lora, gold, soft glow) instead of the dim caption it used to be. */
/* Three static/compositor-only layers (no filter, no animated background): the p itself carries the soft shadow
   (text-shadow on transparent text), ::before is the gold gradient text, ::after is a bright glint that only
   fades (opacity). Padding-bottom keeps the descender of "p" inside the painted box. */
#screen-menu .home-mid .brand p.deva {
  position: relative; isolation: isolate;
  font-family: var(--serif, 'Lora', Georgia, serif); font-weight: 700; font-size: clamp(22px, 3.2dvh, 27px); white-space: nowrap;
  letter-spacing: .04em; line-height: 1.2; margin: 6px 0 -2px; padding-bottom: .14em; opacity: 1;
  background: none; color: transparent; -webkit-text-fill-color: transparent;
  text-shadow: 0 2px 2px rgba(20, 6, 4, .55), 0 0 14px rgba(255, 190, 92, .35); filter: none;
}
#screen-menu .home-mid .brand p.deva::before, #screen-menu .home-mid .brand p.deva::after {
  content: "Chaupat Samrat"; white-space: nowrap; position: absolute; inset: 0; pointer-events: none; text-shadow: none; text-align: center;
  color: transparent; -webkit-text-fill-color: transparent; -webkit-background-clip: text; background-clip: text;
}
#screen-menu .home-mid .brand p.deva::before { background-image: linear-gradient(180deg, #fff1c4 0%, #ffd77a 45%, #e5a63a 100%); }
#screen-menu .home-mid .brand p.deva::after { background-image: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .95) 50%, transparent 70%); opacity: 0; }

/* The Maharaja League icon is the same size as the Live icon beside the logo; its
   countdown pill sits underneath, below the label. */
#screen-menu .home-mid button.chip-league img.ico { width: 33px; height: 33px; }
#screen-menu .home-mid button.chip-league { gap: 2px; padding-bottom: 6px; }

/* The middle column must be allowed to shrink (minmax(0, 1fr)): at 1fr its minimum is the logo's own width, which pushed the
   Maharaja League button past the right edge of narrow phones, out of line with the Live button on the left. */
#screen-menu .home-mid { grid-template-columns: 68px minmax(0, 1fr) 68px; }
#screen-menu .home-mid .brand { min-width: 0; }
#screen-menu .home-mid .chip-league-wrap { justify-self: stretch; }
#screen-menu .home-mid .chip-league-wrap .chip-league { width: 100%; }

/* The countdown sits below the Maharaja League button, outside it, so the button stays the size of Live. */
#screen-menu .home-mid .chip-league-wrap { justify-self: end; display: grid; justify-items: center; gap: 5px; }
#screen-menu .home-mid .chip-league-wrap .chip-league { justify-self: center; }
#screen-menu .home-mid .chip-league-wrap .chip-league-timer { margin-top: 0; pointer-events: none; }

/* ---- Offer prices (js/monetization.js priceTagHtml): Play's full price struck, the offer price big, a % pill.
   With no Play offer .px is just the price, so nothing moves. */
.px { --px-strike: #8a5a12; display: inline-flex; align-items: baseline; justify-content: center; gap: .3em; white-space: nowrap; font: inherit; color: inherit; opacity: 1; }
.px-now { display: inline-block; font-weight: 800; font-size: inherit; color: inherit; }
.px.is-deal .px-now { font-size: 1.1em; letter-spacing: .01em; }
.px-was { font-size: .74em; font-weight: 600; opacity: .7; text-decoration: line-through 2px var(--px-strike); }
.px .px-off { align-self: center; font-style: normal; font-size: .6em; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; line-height: 1.5; padding: 0 6px; border-radius: 999px; color: #fff; background: linear-gradient(180deg, #f2552c, #b8240f); box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.px .px-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* On the dark maroon cards the struck line is light gold so it reads; the new price is the bright satin gold. */
.op-chip .px, .pg-bn-price .px, .shop-plus-hero .px { --px-strike: rgba(243, 212, 138, .85); }
.op-chip .px-was, .pg-bn-row.is-gift .pg-bn-price .px-was { font-size: .7em; opacity: .7; }
.op-chip .px .px-now { color: #ffe2a8; }
.op-chip .px { flex-wrap: wrap; row-gap: 0; }
/* Satin green buy buttons: dark-green ink on verdigris, struck line in deep gold-brown. */
.shop-btn .px { --px-strike: #6b4410; }
.shop-btn.is-cash .px.is-deal .px-now { color: #0d2416; }
.shop-plan .px { font-size: 1.1rem; opacity: 1; flex-wrap: wrap; row-gap: 0; }
.shop-plan .px-off { padding: 0 6px; background: linear-gradient(180deg, #f2552c, #b8240f); color: #fff; font-size: .6875rem; }
/* Gift sheet period pills: label on top, price row below, a full 48px target. */
.pg-period { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; min-height: 48px; padding: 4px 10px; line-height: 1.2; }
.pg-period-l { font-size: .72rem; font-weight: 600; opacity: .85; }
.pg-period .px { font-size: .9rem; }
.pg-period .px { --px-strike: rgba(243, 212, 138, .85); }
.pg-period.is-deal .px-now { color: #ffe2a8; }
.pg-period.is-on .px { --px-strike: #8a5a12; }
.pg-period.is-on.is-deal .px-now { color: #4e0b20; }
.px-save-note { margin: 6px 0 0; text-align: center; font-size: .78rem; font-weight: 800; color: #9fe0b2; }
/* One pulse of the offer price as the gift sheet / offer popup arrives. */
.pg-fresh .px.is-deal .px-now, .op-fresh .px.is-deal .px-now { animation: pxPulse .9s cubic-bezier(.3, 1.4, .5, 1) .25s 1 both; }
@keyframes pxPulse { 0% { transform: scale(1); } 45% { transform: scale(1.2); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .pg-fresh .px.is-deal .px-now, .op-fresh .px.is-deal .px-now { animation: none; } }

/* ── Princess Pack: Shop card (ui.js princessCard) and Home popup (offerPopup.js 'princess') ── */
.shop-princess { position: relative; margin: 0 0 14px; padding: 26px 14px 14px; border-radius: 18px; color: #fff1f5;
  background: radial-gradient(120% 80% at 50% 0%, #c2416f 0%, #8e1f4c 55%, #5a0f30 100%);
  box-shadow: 0 6px 18px rgba(90, 15, 48, .3), inset 0 0 0 1.5px rgba(246, 196, 160, .7); }
.pp-ribbon, .op-pp-ribbon { position: absolute; top: 0; left: 50%; transform: translate(-50%, -40%); white-space: nowrap; max-width: 92%; overflow: hidden; text-overflow: ellipsis; padding: 3px 12px; border-radius: 999px;
  font-size: .6875rem; font-weight: 800; letter-spacing: .03em; color: #5a0f30; background: linear-gradient(180deg, #ffe0ea, #f6b7cb); box-shadow: 0 2px 6px rgba(0, 0, 0, .25); }
.pp-head { display: flex; align-items: center; gap: 12px; }
.pp-medal { flex: 0 0 72px; height: 72px; }
.pp-medal img { width: 72px; height: 72px; display: block; }
.pp-head h3 { margin: 0 0 2px; font-family: 'Lora', serif; font-size: 1.3rem; color: #ffe2a8; }
.pp-head p { margin: 0; font-size: .86rem; color: rgba(255, 241, 245, .9); }
.pp-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 12px 0; }   /* wraps to two rows: nothing is clipped at 360px */
.pp-th.pp-more { font: 800 13px/1 var(--font-ui, system-ui, sans-serif); color: #ffe9b0; background: rgba(255, 255, 255, .16); letter-spacing: .2px; }
.pp-strip .shop-thumb { flex: 0 0 48px; width: 48px; height: 48px; }
.pp-th { flex: 0 0 46px; height: 46px; border-radius: 12px; background: rgba(255, 255, 255, .1); display: grid; place-items: center; }
.pp-th img { width: 42px; height: 42px; }
.pp-th.is-av { border-radius: 50%; background: none; }
.pp-th.is-av img { width: 46px; height: 46px; }
.pp-buy { display: flex; align-items: center; justify-content: center; gap: 8px; }
.pp-state { margin: 0; text-align: center; font-weight: 800; color: #ffe2a8; }
.op-card.is-princess { background: radial-gradient(120% 70% at 50% 0%, #c2416f 0%, #8e1f4c 55%, #4a0c28 100%); padding-top: 24px; overflow: visible; }
.op-card.is-princess .op-pp-ribbon { transform: translate(-50%, -50%); }
.op-card.is-princess .op-stage { flex-basis: 76px; height: 76px; }
.op-card.is-princess .op-stage img { width: 76px; height: 76px; animation: none; }
.op-card.is-princess .op-chips { display: block; }
.op-pp-value { margin: 0 0 8px; text-align: center; font-weight: 700; color: #ffe2a8; }
.op-pp-strip { display: flex; justify-content: center; align-items: center; gap: 3px; }
.op-pp-strip img { width: 34px; height: 34px; min-width: 0; }
.op-pp-strip img.is-av { border-radius: 50%; }
.op-pp-pawn { display: inline-block; position: relative; flex: 0 0 32px; width: 32px; height: 32px; border-radius: 50%; }
.op-pp-price { display: block; text-align: center; margin-top: 8px; font-size: 1.1rem; }
.op-card.is-removeads .op-chips { display: block; margin: 0 0 4px; }
.op-card.is-removeads .op-stage img { animation: none; }
.op-card.is-removeads .plus-feats { margin-bottom: 8px; }
.op-card.is-removeads .plus-feats li i img { width: 18px; height: 18px; }
.op-card.is-removeads .op-pp-price { margin-top: 0; }

/* ── Home: light ambient life. transform / opacity / background-position only; runs only while Home is the
   active screen (.screen.is-active) and is off under reduced motion. No JS. ── */
/* ONE layer (the two full-screen ones doubled WebView tile memory) and no will-change: an animated
   transform/opacity is promoted for as long as it runs anyway, will-change only pinned it while idle. */
#screen-menu.is-active::before { content: ""; position: absolute; left: 0; right: 0; bottom: -40px; height: 100%; pointer-events: none; z-index: 0; opacity: 0;
  background-repeat: no-repeat;
  background-image: radial-gradient(circle, rgba(255, 224, 150, .9) 0 1.5px, transparent 2.5px), radial-gradient(circle, rgba(255, 224, 150, .8) 0 1px, transparent 2px),
    radial-gradient(circle, rgba(255, 214, 120, .85) 0 1.5px, transparent 2.5px), radial-gradient(circle, rgba(255, 224, 150, .7) 0 1px, transparent 2px),
    radial-gradient(circle, rgba(255, 224, 150, .8) 0 1px, transparent 2px), radial-gradient(circle, rgba(255, 214, 120, .9) 0 1.5px, transparent 2.5px),
    radial-gradient(circle, rgba(255, 224, 150, .7) 0 1px, transparent 2px), radial-gradient(circle, rgba(255, 214, 120, .85) 0 1.5px, transparent 2.5px);
  background-size: 6px 6px, 4px 4px, 6px 6px, 4px 4px, 4px 4px, 6px 6px, 4px 4px, 6px 6px;
  background-position: 12% 82%, 38% 46%, 71% 70%, 88% 30%, 25% 60%, 55% 90%, 80% 52%, 6% 22%;
  animation: homeDust 16s linear infinite; }
@keyframes homeDust { 0% { transform: translateY(40px); opacity: 0; } 15% { opacity: .75; } 85% { opacity: .75; } 100% { transform: translateY(-90px); opacity: 0; } }
#screen-menu .menu-wrap { position: relative; z-index: 1; }

/* Title: a slow gold glint passing over the letters every ~7s (a second gradient layer on top of the gold). */
#screen-menu.is-active .home-mid .brand p.deva::after { animation: homeShimmer 7s ease-in-out 1.2s infinite; }
@keyframes homeShimmer { 0%, 68%, 100% { opacity: 0; } 84% { opacity: .85; } }

/* Primary button: a breathing halo on a pseudo-element (opacity only), the board art floats, crest and dots pulse. */
#screen-menu.is-active #btn-play-random { position: relative; }
#screen-menu.is-active #btn-play-random::after { content: ""; position: absolute; inset: -2px; border-radius: inherit; pointer-events: none;
  box-shadow: 0 0 18px 3px rgba(255, 200, 100, .55); opacity: 0; animation: homeBreathe 3.6s ease-in-out infinite; }
@keyframes homeBreathe { 0%, 100% { opacity: 0; } 50% { opacity: .85; } }
#screen-menu.is-active .brand-mark .ico-logo { animation: homeFloat 6s ease-in-out infinite !important; }
@keyframes homeFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
#screen-menu.is-active .chip-league img.ico { animation: homePulse 3.2s ease-in-out infinite; }
#screen-menu.is-active .shop-bar-new:not([hidden]), #screen-menu.is-active .shop-gift-dot { animation: homePulse 2.4s ease-in-out infinite; }
@keyframes homePulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }

/* Press feedback */
#screen-menu .mode-tile, #screen-menu .chip-league, #screen-menu .hud-corner, #screen-menu .home-live, #screen-menu .shop-bar, #screen-menu .spin-chip { transition: transform .12s ease-out; }
#screen-menu .mode-tile:active, #screen-menu .chip-league:active, #screen-menu .hud-corner:active, #screen-menu .home-live:active, #screen-menu .shop-bar:active, #screen-menu .spin-chip:active { transform: scale(.97); }

@media (prefers-reduced-motion: reduce) {
  #screen-menu.is-active::before, #screen-menu.is-active #btn-play-random::after { animation: none; opacity: 0; }
  #screen-menu.is-active .home-mid .brand p.deva::after, #screen-menu.is-active .brand-mark .ico-logo, #screen-menu.is-active .chip-league img.ico,
  #screen-menu.is-active .shop-bar-new, #screen-menu.is-active .shop-gift-dot { animation: none !important; }
  #screen-menu .mode-tile:active, #screen-menu .chip-league:active, #screen-menu .hud-corner:active, #screen-menu .home-live:active, #screen-menu .shop-bar:active, #screen-menu .spin-chip:active { transform: none; }
}

/* ═══════════ QA #9 fixes (visual/UX fixer F) — append-only block ═══════════ */

/* 1. The toast is non-blocking and must be readable over every modal, sheet and offer popup (op-wrap is 9000). */
.toast { z-index: 10000; pointer-events: none; }

/* 2. Home mode tiles: the icon is the one thing that gives way when a tile is short, so the caption can never be
   squeezed to a sliver. Caption/title never shrink; Indic captions get a smaller size. */
#screen-menu .mode-tile .hero-badge { top: -7px; right: 6px; padding: 1px 7px; font-size: 11px; letter-spacing: .02em; line-height: 1.3; }
/* On tall phones the Home grid is a flex share of whatever is left (about 75-100px per tile), too short for a
   stacked icon + title + caption, so the caption was squeezed to nothing. There the tile reads sideways: icon left, title over caption right. */
@media (max-width: 599px) and (min-height: 700px) {
  #screen-menu .mode-row.is-grid .mode-tile.is-big { grid-template-columns: 36px minmax(0, 1fr); column-gap: 8px; row-gap: 1px; justify-items: start; text-align: left; align-content: center; padding: 11px 10px 4px; }
  #screen-menu .mode-row.is-grid .mode-tile.is-big .mode-tile-ico { grid-column: 1; grid-row: 1 / span 3; width: clamp(40px, 9dvh, 88px); height: clamp(40px, 9dvh, 88px); align-self: center; }
  #screen-menu .mode-row.is-grid .mode-tile.is-big > b, #screen-menu .mode-row.is-grid .mode-tile.is-big > em, #screen-menu .mode-row.is-grid .mode-tile.is-big > .online-live { grid-column: 2; max-width: 100%; text-align: left; }
  #screen-menu .mode-row.is-grid .mode-tile.is-big > b { font-size: 15px; line-height: 1.2; }
  #screen-menu .mode-row.is-grid .mode-tile.is-big > em { font-size: 11px; line-height: 1.2; padding-bottom: 1px; white-space: normal; text-overflow: clip; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
  #screen-menu .mode-row.is-grid .mode-tile.is-big > em:is(:lang(hi), :lang(mr), :lang(ta), :lang(te), :lang(kn), :lang(gu)) { font-size: 11px; line-height: 1.4; letter-spacing: 0; }
}

/* 3. Daily Spin: the wheel gives way on short phones and the Spin button sticks to the card's bottom edge. */
#daily-spin .spin-stage { width: min(290px, 100%, max(150px, calc(100dvh - 455px))); }
#daily-spin #btn-spin-go { position: sticky; bottom: -22px; z-index: 4; box-shadow: 0 -10px 14px -4px rgba(32, 10, 8, .85), var(--soft-lift, none); }

/* 4. Add Friend: the Copy / Share / WhatsApp row wraps instead of overflowing; the card fits a 360x640 screen. */
#add-friend-ask .af-row { flex-wrap: wrap; }
#add-friend-ask .af-row .btn { flex: 1 1 auto; min-width: max-content; padding-left: 10px; padding-right: 10px; white-space: nowrap; }
@media (max-height: 700px) {
  #add-friend-ask .pass-card { padding-top: 58px; padding-bottom: 12px; }
  #add-friend-ask .pass-card::after { top: 10px; width: 40px; height: 40px; margin-left: -20px; }
  #add-friend-ask .pass-card .btn-block { margin-top: 6px; }
  #add-friend-ask .pass-card .hint { margin: 6px 0; }
  #add-friend-ask .pass-card h2::after { margin-top: 8px; }
  #add-friend-ask .pass-card h2 + .hint, #add-friend-ask .pass-card h2 + p { margin-top: 8px; }
  #add-friend-ask .af-row { margin-bottom: 6px; gap: 6px; }
  #add-friend-ask .af-row .btn { min-height: 44px; padding-top: 6px; padding-bottom: 6px; }
}

/* 5. Tap targets >= 44px. The hit area grows with an invisible ::after / negative-margin padding; the look is unchanged. */
.chat-close:not(.op-x):not(.spin-close) { position: relative; }
.chat-close::after { content: ""; position: absolute; inset: -5px -3px; }
#hero-size-badge::after { content: ""; position: absolute; inset: -16px -2px; }
#btn-shop-coin-pill { position: relative; }
#btn-shop-coin-pill::after { content: ""; position: absolute; inset: -5px 0; }
.pg-bn-row.is-gift .pg-bn-price { position: relative; }
/* the row clips at its edge, 7px below the chips, so the extra reach goes upward */
.pg-bn-row.is-gift .pg-bn-price::after { content: ""; position: absolute; inset: -19px -3px -7px; }
.pg-bn-row.is-gift .pg-bn-go { min-height: 44px; min-width: 56px; }
.name-ask-terms a { display: inline-block; padding: 16px 12px; margin: -16px -12px; }

/* 6. Name prompt on short screens (keyboard open, landscape): small medallion, title and hints; the card scrolls. */
@media (max-height: 520px) {
  #name-ask .pass-card { padding-top: 56px; padding-bottom: 12px; }
  #name-ask .pass-card::after { top: 10px; width: 38px; height: 38px; margin-left: -19px; }
  #name-ask .pass-card h2 { font-size: 18px; }
  #name-ask .pass-card h2::after { margin-top: 6px; }
  #name-ask .pass-card .hint, #name-ask .pass-card h2 + .hint { font-size: 12.5px; line-height: 1.35; margin: 6px 0; }
  #name-ask .name-ask-terms { margin-top: 2px; }
  #name-ask .btn, #name-ask .btn-lg { min-height: 42px; padding-top: 7px; padding-bottom: 7px; margin-top: 6px; }
  #name-ask .code-input { padding-top: 8px; padding-bottom: 8px; min-height: 0; }
}

/* 8. Shop: pause the ~15 infinite banner animations while an offer popup covers them; fewer twinkles; the button
   pulse is an inner glow (opacity) instead of a scale that blurred its text. */
body:has(.op-wrap.is-open) #screen-shop *, body:has(.op-wrap.is-open) #screen-shop *::before, body:has(.op-wrap.is-open) #screen-shop *::after { animation-play-state: paused !important; }
.pg-bn-stage .pg-sp.s3, .pg-bn-stage .pg-sp.s4 { display: none; }
.pg-bn-row.is-gift .pg-bn-go { animation: none; }
.pg-bn-row.is-gift .pg-bn-go::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 0;
  box-shadow: inset 0 0 10px 2px rgba(255, 244, 200, .8); opacity: 0; animation: pgbGoGlow 2.2s ease-in-out infinite; }
@keyframes pgbGoGlow { 0%, 100% { opacity: 0; } 50% { opacity: .9; } }
@media (prefers-reduced-motion: reduce) { .pg-bn-row.is-gift .pg-bn-go::before { animation: none; display: none; } }

/* 10. Shop footer on one line; the Home list clears the tab bar and fades at the bottom edge. */
#screen-shop .shop-foot { margin-top: 4px; font-size: 11px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Home: a soft fade above the tab bar tells the player the list continues (the list already clears the bar). */
body.has-tabbar #screen-menu.is-active::after { content: ""; position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h, 74px) - 4px); height: 30px; pointer-events: none; z-index: 2;
  background: linear-gradient(180deg, rgba(34, 10, 8, 0), rgba(34, 10, 8, .72)); }
@media (min-height: 800px) { body.has-tabbar #screen-menu.is-active::after { display: none; } }

/* ═══════════ Popup audit (docs/popup-audit.md) — append-only block ═══════════ */
/* P1. Close buttons on the crimson popups and the Daily Spin card were 40x36: under the 44px tap target. The glyph
   keeps its size; only the hit box grows (pulled in 4px so the visual position barely moves). */
.op-x, .spin-close { position: absolute; min-width: 44px; min-height: 44px; display: grid; place-items: center; }
.op-x { top: 4px; right: 4px; }
.spin-close { top: 6px; right: 6px; }
/* P2. The forced-update wall outranks every popup. Offer popups sit at 9000, so the wall (was 300) was painted under
   them; it stays under the toast (10000) only. */
.update-forced { z-index: 9500; }

/* Settings: the header never paints over the list, and a section title always scrolls to a spot just under it. */
#screen-settings .topbar { position: relative; z-index: 0; flex: none; }
#screen-settings .scroller { scroll-padding-top: 12px; padding-top: 8px; }
#screen-settings .fold > summary { scroll-margin-top: 12px; }

/* Player and opponent cards on the game screen: size to the content instead of a fixed
   188px, so a short name and city no longer leave a wide empty strip on the right. */
#screen-game #seat-top .chip, #screen-game #seat-bottom .chip { width: auto; min-width: 140px; max-width: 210px; padding: 6px 14px 6px 11px; }
#screen-game #seat-top .chip .chip-body, #screen-game #seat-bottom .chip .chip-body { line-height: 1.25; }
#screen-game #seat-top .chip .chip-badge, #screen-game #seat-bottom .chip .chip-badge { right: 7px; }
#screen-game #seat-top .chip:has(.chip-badge), #screen-game #seat-bottom .chip:has(.chip-badge) { padding-right: 30px; }
@media (max-width: 340px) { #screen-game #seat-bottom .chip { min-width: 128px; max-width: 150px; } }

/* Princess Pack cameo: the computer opponent's princess avatar, beside its name. Tappable (opens the Princess Pack card). */
.chip-av { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; vertical-align: -8px; margin-right: 6px; box-shadow: 0 0 0 1.5px #f3cf72; }
.chip-av[data-princess-bot] { cursor: pointer; }
.sticker-pop[data-princess-bot] { box-shadow: 0 0 0 1.5px #f3cf72; }
.chat-line[data-princess-bot] .chat-sticker { cursor: pointer; }

/* ═══════════ LAYOUT CONTRACT + FLUID TOKENS (layout pass, 2026-10-11) — marked block, append-only ═══════════
   Sources: docs/panel-ui-designer.md. Static CSS only: no filter/backdrop-filter, transform/opacity for anything that moves. */
:root {
  /* viewport helpers: 320..430 wide, 568..932 tall */
  --vw-t: clamp(0, calc((100vw - 320px) / 110), 1);
  --vh-t: clamp(0, calc((100dvh - 568px) / 364), 1);
  --u: clamp(7px, calc(7px + 1px * var(--vw-t) + 1px * var(--vh-t)), 9px);
  --sp-1: calc(var(--u) * .5); --sp-2: var(--u); --sp-3: calc(var(--u) * 1.5);
  --sp-4: calc(var(--u) * 2); --sp-5: calc(var(--u) * 3); --sp-6: calc(var(--u) * 4);
  --gutter: clamp(14px, 4.4vw, 20px);
  /* type scale: min 11px for anything that is read, 12px for secondary body */
  --fs-11: 11px;
  --fs-12: clamp(12px, 3.3vw, 12.5px);
  --fs-14: clamp(13.5px, 3.8vw, 14.5px);
  --fs-16: clamp(15px, 4.3vw, 16.5px);
  --fs-18: clamp(17px, 4.9vw, 19px);
  --fs-22: clamp(20px, 6vw, 24px);
  --fs-30: clamp(26px, 8vw, 34px);
  --fs-hero: clamp(34px, 10.5vw, 46px);
  --lh-tight: 1.15; --lh-body: 1.4;
  /* radius set: chip, card, sheet, pill */
  --r-chip: 12px; --r-card: 16px; --r-sheet: 24px; --r-pill: 999px;
  /* touch targets */
  --tap: 48px; --tap-lg: 56px;
  /* elevation: three static levels (never animated) */
  --e1: 0 2px 6px rgba(14, 4, 3, .35);
  --e2: 0 6px 16px rgba(14, 4, 3, .45), inset 0 1px 0 rgba(255, 226, 170, .08);
  --e3: 0 14px 34px rgba(14, 4, 3, .6), inset 0 1px 0 rgba(255, 226, 170, .10);
  /* one gold hairline (outer edges) + a soft one (inner dividers) + a highlight for selected */
  --hairline: 1px solid var(--hair);
  --hair-hi: rgba(255, 238, 190, .42);
  /* game screen height budget (see "game screen" below) */
  --g-sat: max(var(--sat, 0px), 28px);
  --g-chrome: 322px;
}
@media (min-width: 600px) { :root { --u: 9px; --fs-16: 17px; --fs-hero: 52px; } }

/* ── Game screen: every vertical region is fixed (counted in --g-chrome) except the board, which takes the remainder.
   The AdMob banner is a native strip UNDER the WebView, so 100dvh already shrinks when it shows; html.has-banner (js/ads.js)
   only drops the page's own bottom padding for a 6px clear gutter. Throw never shrinks below 56px and is never scrolled away. */
@media (orientation: portrait) {
  #screen-game .board-wrap .board { width: min(93vw, 470px, max(200px, calc(100dvh - var(--g-chrome)))); }
}
html #screen-game .throw-area { flex: none; min-height: var(--tap-lg); }
html #screen-game .btn-throw { min-height: var(--tap-lg); }
html.has-banner #screen-game { padding-bottom: 6px; }
html.has-banner #screen-game .throw-area { margin-bottom: 4px; }
@media (max-height: 700px) and (orientation: portrait) {
  :root { --g-chrome: 308px; }
  html #screen-game .status { min-height: 0; margin-top: 6px; -webkit-line-clamp: 2; line-clamp: 2; }
  html #screen-game .turn-timer { margin-top: 4px; margin-bottom: 2px; }
}
@media (max-height: 600px) and (orientation: portrait) {
  :root { --g-chrome: 256px; }
  html #screen-game .topbar { padding-top: max(2px, var(--sat, 0px)); padding-bottom: 2px; }
  html #screen-game .status { -webkit-line-clamp: 1; line-clamp: 1; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; min-height: 0; margin-top: 4px; font-size: 14px; }
  html #screen-game #seat-top .chip .chip-where, #screen-game #seat-bottom .chip .chip-where { display: none; }
  html #screen-game .turn-timer { display: none; }
}

/* ===== UX-engineer block (js owner): Home hierarchy + banner/nudge helpers. Append-only; safe to move. ===== */
.result-actions #btn-challenge { flex: 1 1 100%; grid-column: 1 / -1; width: 100%; }
.result-actions #btn-challenge[hidden] { display: none; }
/* ===== end UX-engineer block ===== */

/* ── Sheets: one rhythm. The chat/log sheet is a column: header and the input row never scroll away (the input was
   below the fold at 360x580); the quick replies, stickers and log share what is left and scroll inside it. */
.chat-sheet:not([hidden]) { display: flex; flex-direction: column; overflow: hidden; max-height: min(68dvh, calc(100dvh - var(--g-sat) - 56px)); }
.chat-sheet > * { flex: 0 0 auto; }
.chat-sheet > .chat-log { flex: 1 1 auto; min-height: 56px; max-height: 26dvh; }
.chat-sheet > .chat-quick { flex: 0 1 auto; min-height: 0; overflow-y: auto; }
.chat-sheet > .chat-stickers { flex: 0 0 auto; }
.chat-sheet > .chat-form { padding-top: 6px; border-top: 1px solid var(--hair-soft); margin-top: auto; }
@media (max-height: 700px) {
  .chat-sheet > .chat-quick { flex: 0 0 auto; padding-bottom: 2px; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .chat-sheet > .chat-quick .quick { flex: none; }
}

/* ── Friends: the two code cards stack below 380px (the Send Request label wrapped to two lines in a 159px column), the empty
   line clears the segmented control, and every button is a 48px target. */
@media (max-width: 380px) {
  html .code-pair { grid-template-columns: 1fr; }
}
#btn-add-friend { white-space: nowrap; min-height: var(--tap); }
#screen-friends #friends-empty-hint { margin: 12px 0 8px; text-align: center; }
#btn-friend-code-share, #btn-friend-code-whatsapp, #btn-friends-empty-invite { min-height: var(--tap); }

/* >>> artist batch 1: painted cowrie shells in the throw tray (img/icons/shell-up|down.webp).
   Up = mouth open showing the toothed slit; down = glossy speckled back.
   The art carries its own soft contact shadow, so the old ::before ellipse is off.
   Only transform/opacity animate on .shell (tumble/settle keyframes unchanged). */
.shells .shell { background: center / contain no-repeat; }
.shells .shell.up { background-image: url("../img/icons/shell-up.webp"); }
.shells .shell.down { background-image: url("../img/icons/shell-down.webp"); }
.shells .shell::before { content: none; }
/* <<< artist batch 1 */

/* ── Shop: tab strip, footer, Chaupat Plus price cards, Princess Pack (palette-native, no mint / magenta fills) ── */
#screen-shop .shop-tabs { scroll-snap-type: x proximity; scroll-padding-inline: 16px; }
#screen-shop .shop-tab { scroll-snap-align: start; font-size: clamp(13px, 3.7vw, 14px); }
@media (max-width: 380px) {
  #screen-shop .shop-tabs { gap: 6px; }
  #screen-shop .shop-tab { min-width: 0; padding: 8px 12px; }
}
.shop-tabs-wrap::before, .shop-tabs-wrap::after { width: 48px; }
#screen-shop .shop-foot { white-space: normal; overflow: visible; text-overflow: clip; font-size: var(--fs-12); line-height: 1.3; text-align: center; margin-bottom: calc(var(--tabbar-h, 72px) + 4px); }
.pg-banner { box-shadow: 0 10px 14px -8px rgba(20, 6, 4, .7); border-radius: 16px; }
#screen-shop .shop-body { padding-top: 8px; }

.shop-plus-hero .shop-plan, .shop-plus-hero .shop-plan.is-cash:disabled {
  background: linear-gradient(180deg, #4a1a24, #2f0f17); color: var(--ink);
  border: var(--hairline); border-radius: var(--r-card); box-shadow: var(--e2); opacity: 1; font-weight: 700;
}
.shop-plus-hero .shop-plan .px, .shop-plus-hero .shop-plan .px-now { font-family: var(--serif); color: var(--brass-hi); }
.shop-plus-hero .shop-plan .px.is-deal .px-now { color: var(--brass-hi); }
.shop-plus-hero .shop-plan span { color: var(--ink-2); opacity: 1; font-size: var(--fs-12); }
.shop-plus-hero .shop-plan.is-best {
  background: linear-gradient(180deg, #6a2a2a, #3c1318); border-color: var(--hair-hi);
  box-shadow: var(--e3), inset 0 0 0 1px rgba(255, 238, 190, .18);
}
.shop-plus-hero .shop-plan em { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); white-space: nowrap;
  background: linear-gradient(180deg, var(--gold-satin-hi), var(--gold-satin)); color: #3a2208; box-shadow: var(--e1); font-size: var(--fs-11); }
.shop-plus-hero .shop-plan:active, .shop-plus-hero .shop-plan[aria-checked="true"], .shop-plus-hero .shop-plan.is-selected {
  background: linear-gradient(180deg, var(--gold-satin-hi), var(--gold-satin) 60%, var(--gold-satin-lo)); border-color: var(--hair-hi); }
.shop-plus-hero .shop-plan:active .px-now, .shop-plus-hero .shop-plan:active span,
.shop-plus-hero .shop-plan[aria-checked="true"] .px-now, .shop-plus-hero .shop-plan.is-selected .px-now { color: #3a2208; }
.shop-plus-plans { margin-top: 10px; row-gap: 14px; }

.shop-princess {
  background: linear-gradient(180deg, #4d1a2c, #2f0f1c); color: var(--ink);
  border: 1px solid rgba(255, 170, 200, .5); border-radius: var(--r-card);
  box-shadow: var(--e2), inset 0 0 0 1px rgba(255, 170, 200, .16);
}
.shop-princess .pp-head h3 { color: #ffd1de; }
.pp-ribbon, .op-pp-ribbon { font-size: var(--fs-11); }

/* ── Overlays with a text field: the card sits centred when it fits and starts under the status bar when it does not
   (keyboard open, short phone) instead of being centred half off the top. The overlay scrolls; margin:auto does the centring. */
.overlay { padding: max(24px, calc(var(--sat, 0px) + 12px)) max(24px, var(--sar, 0px)) max(24px, calc(var(--sab, 0px) + 12px)) max(24px, var(--sal, 0px)); }
#name-ask, #code-ask, #delete-ask, #lang-ask, #group-make { place-items: start center; }
#name-ask > *, #code-ask > *, #delete-ask > *, #lang-ask > *, #group-make > * { margin-block: auto; }
.chat-bubble, .sticker-pop { max-width: min(260px, calc(100vw - 16px)); overflow-wrap: anywhere; }

/* ── Indic scripts (Hindi, Marathi, Telugu, Kannada, Tamil, Gujarati): the marks above and below the line need room, negative
   tracking breaks conjuncts, and upper-casing / tracking only belongs to Latin. Real 700 weights, no synthesised bold. */
:root:lang(hi), :root:lang(mr), :root:lang(te), :root:lang(kn), :root:lang(ta), :root:lang(gu) { line-height: 1.5; }
:is(:lang(hi), :lang(mr), :lang(te), :lang(kn), :lang(ta), :lang(gu)) { letter-spacing: 0 !important; text-transform: none !important; font-synthesis: none; }
:is(:lang(hi), :lang(mr), :lang(te), :lang(kn), :lang(ta), :lang(gu)) :is(h1, h2, h3, h4, b, strong, .btn, .tab-label) { line-height: 1.35; }
:is(:lang(hi), :lang(mr), :lang(te), :lang(kn), :lang(ta), :lang(gu)) :is(em, small, p, .hint, .status, .chip-where, .quick) { line-height: 1.45; }
#screen-menu .mode-tile.is-big em:is(:lang(hi), :lang(mr), :lang(ta), :lang(te), :lang(kn), :lang(gu)) { padding-block: .08em; font-size: 11px; line-height: 1.4; }
body { text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; font-kerning: normal; }

/* ── Button state matrix: default / pressed / disabled for every primary. Pressed is transform-only; disabled reads as
   "waiting" (velvet with muted gold type), never as a grey, broken-looking slab. Focus ring is the existing gold one. */
.btn-primary:active, .btn-throw:active { transform: translateY(1px) scale(.985); box-shadow: var(--e1); }
.btn-primary:disabled, .btn-throw:disabled {
  filter: none; opacity: 1; cursor: default; transform: none; text-shadow: none;
  background: linear-gradient(180deg, var(--velvet-hi), var(--velvet-lo)); color: rgba(243, 212, 138, .62);
  border: 1px solid var(--hair-soft); box-shadow: var(--e1);
}
.btn-throw:disabled::after { opacity: 0; animation: none; }
.btn-ghost:active { transform: scale(.985); background-color: rgba(228, 184, 96, .08); }
.btn-ghost:disabled { opacity: .5; }
/* notification dots: one size, one ring */
.spin-chip .spin-chip-dot { width: 10px; height: 10px; top: -3px; right: -3px; background: #e8714c; }
.badge.is-dot { min-width: 10px; width: 10px; height: 10px; background: #e8714c; box-shadow: 0 0 0 2px #3a1612; }

/* ── Home HUD: Spin is the only gold element; the coin chip is dark velvet with gold type. */
#screen-menu .home-top .shop-bar { background: linear-gradient(180deg, var(--velvet-hi), var(--velvet-lo)); color: var(--brass-hi); }

/* ── Art polish (static only; nothing here animates a filter): the pawn's contact shadow is already a soft gradient, so
   its blur filter goes (the pawn moves); the spin wheel gets a glass dome above the rotating disc. */
.pawn::after { filter: none; }
.spin-stage::after { content: ""; position: absolute; inset: 2%; border-radius: 50%; pointer-events: none; z-index: 1;
  background: radial-gradient(circle at 34% 24%, rgba(255, 255, 255, .26), rgba(255, 255, 255, .06) 38%, transparent 55%); }
/* whole-pixel board: a fractional board width resamples the grid and softens the lines */
@supports (width: round(down, 10.5px, 2px)) {
  @media (orientation: portrait) { #screen-game .board-wrap .board { width: round(down, min(93vw, 470px, max(200px, calc(100dvh - var(--g-chrome)))), 2px); } }
}
img { image-rendering: auto; }

/* ── Safe areas: the notch / gesture insets the shell injects (--sal/--sar) apply to every screen, the tab shelf and sheets. */
.screen { padding-left: var(--sal, 0px); padding-right: var(--sar, 0px); box-sizing: border-box; }
.tabbar { padding-left: max(4px, var(--sal, 0px)); padding-right: max(4px, var(--sar, 0px)); }
.chat-sheet, .gift-sheet { padding-left: max(16px, var(--sal, 0px)); padding-right: max(16px, var(--sar, 0px)); }
@media (orientation: landscape) and (max-height: 500px) { #screen-game { padding-left: max(16px, var(--sal, 0px)); padding-right: max(16px, var(--sar, 0px)); } }

/* ── Tablets: lists and sheets are centred cards, not edge-to-edge strips. */
@media (min-width: 700px) {
  .screen .scroller, #screen-shop .shop-body, #screen-settings .scroller { width: min(100%, 640px); margin-inline: auto; }
  .tabbar { padding-left: max(4px, calc((100vw - 560px) / 2)); padding-right: max(4px, calc((100vw - 560px) / 2)); }
  .chat-sheet, .gift-sheet { left: 0; right: 0; margin-inline: auto; width: min(100%, 520px); border-radius: var(--r-sheet); bottom: 12px; border-bottom: 1px solid var(--hair); }
}

/* ── Token migration (hot spots only): one card radius, one chip radius, one touch target, one sheet radius. */
.panel, .mode-tile.is-big, .home-family, .lf-row, .shop-gift, .shop-card, .shop-row, .room-card, .async-game, .shop-plus-hero { border-radius: var(--r-card); }
.btn, .hud-corner-box, .home-live-ico, .segmented, .shop-bar, .chip-league, .icon-btn, .shop-btn { border-radius: var(--r-chip); }
.btn-primary, .btn-lg, .shop-btn { min-height: var(--tap); }
.pass-card, .op-card, .spin-card { border-radius: var(--r-sheet); }
.chat-sheet, .gift-sheet { border-radius: var(--r-sheet) var(--r-sheet) 0 0; }
.shop-card, .shop-gift, .shop-row, .panel { box-shadow: var(--e2); }

/* ── HOME: one screen, no scrolling (owner decision 2026-10-11). The column is a fixed budget: HUD row, board + title,
   Add Friend / Join Table, the Family row, the 2x2 tiles (they take the REMAINING height and are capped to a square, so
   they are square on tall phones and give up height, never the content, on short ones), Pass & Play + Bluetooth side
   by side, then the tab shelf. Board art hides below 600px tall. */
@media all {
  html #screen-menu .menu-wrap { overflow: hidden; --h-gap: clamp(5px, 1dvh, 10px); gap: var(--h-gap);
    padding-top: max(var(--sat, 0px), 28px); padding-bottom: calc(var(--tabbar-h, 74px) + 6px); }
  html #screen-menu .menu-wrap > * { flex-shrink: 0; }
  /* HUD: avatar, coins on the left; Spin then Settings flush right (the gutter and --sar come from the screen padding) */
  html #screen-menu .home-top { display: flex; align-items: center; gap: 10px; }
  html #screen-menu .home-top .hud-corner-box { width: var(--tap); height: var(--tap); }
  /* board + title block shrinks with the screen */
  html #screen-menu .home-mid .brand-mark { width: clamp(56px, 9.5dvh, 112px); height: clamp(56px, 9.5dvh, 112px); }
  html #screen-menu .home-mid .brand p.deva { font-size: clamp(24px, 3.9dvh, 34px); margin-top: 2px; }
  html #screen-menu .home-mid .brand .tagline { display: none; }
  /* friend row, family row */
  html #screen-menu .friend-play-btn { min-height: var(--tap); }
  html #screen-menu .home-family { min-height: 48px; padding: 6px 12px; }
  html #screen-menu .home-family-crest, html #screen-menu .home-family-crest .crest-img { width: 36px; height: 36px; }
  html #screen-menu .home-family-copy em { white-space: nowrap; display: block; overflow: hidden; text-overflow: ellipsis; -webkit-line-clamp: unset; }
  /* tiles: 2 columns x 2 rows of squares, then one compact row of two */
  html #screen-menu .mode-row.is-grid { flex: 1 1 0; min-height: calc(2 * var(--tap) + 52px + 2 * var(--h-gap)); display: grid; grid-template-columns: 1fr 1fr;
    grid-template-rows: minmax(var(--tap), 1fr) minmax(var(--tap), 1fr) 52px; grid-auto-rows: 52px; gap: var(--h-gap); align-content: center; align-items: center; }
  html #screen-menu .mode-row.is-grid .mode-tile.is-big { grid-column: auto; min-height: var(--tap); height: 100%;
    max-height: calc((min(100vw, 600px) - 2 * max(16px, var(--sal, 0px)) - var(--h-gap)) / 2); padding: 6px 6px; justify-content: center; }
  html #screen-menu .mode-tile.is-big .mode-tile-ico { width: clamp(36px, 8dvh, 72px); height: clamp(36px, 8dvh, 72px); }
  html #screen-menu .mode-tile.is-big > b { font-size: clamp(14px, 2.2dvh, 17px); }
  html #screen-menu .mode-tile.is-big em { font-size: 12px; -webkit-line-clamp: 2; }
  html #screen-menu .mode-row.is-grid #btn-pass-play, html #screen-menu .mode-row.is-grid #btn-nearby-menu {
    grid-column: auto; height: 100%; min-height: var(--tap); gap: 8px; padding: 4px 8px; }
  html #screen-menu #btn-pass-play .mode-tile-ico, html #screen-menu #btn-nearby-menu .mode-tile-ico { width: 30px; height: 30px; }
  html #screen-menu #btn-pass-play b, html #screen-menu #btn-nearby-menu b { font-size: 13px; line-height: 1.15; }
  html #screen-menu #btn-pass-play em, html #screen-menu #btn-nearby-menu em { display: none; }
  html #screen-menu #btn-pass-play::after, html #screen-menu #btn-nearby-menu::after { display: none; }
  html #screen-menu .mode-tile.is-big { aspect-ratio: auto; }
}
@media (max-height: 640px) { html #screen-menu .mode-tile.is-big em { display: none; } }
@media (max-height: 600px) { html #screen-menu .home-mid .brand-mark { display: none; } }
/* only the smallest phone may scroll, and only if it truly cannot fit */
@media (max-width: 330px) and (max-height: 600px) { html #screen-menu .menu-wrap { overflow-y: auto; } }
#screen-menu::after { display: none !important; }
/* Home tiles: icon on top, title and caption centred below (also on tall phones, where an older rule set them sideways) */
@media all {
  html #screen-menu .mode-row.is-grid .mode-tile.is-big { grid-template-columns: 1fr; grid-auto-rows: auto; align-content: center; justify-items: center; text-align: center; row-gap: 2px; padding: 6px; }
  html #screen-menu .mode-row.is-grid .mode-tile.is-big .mode-tile-ico { grid-column: 1; grid-row: auto; justify-self: center; }
  html #screen-menu .mode-row.is-grid .mode-tile.is-big > b, html #screen-menu .mode-row.is-grid .mode-tile.is-big > em,
  html #screen-menu .mode-row.is-grid .mode-tile.is-big > .online-live { grid-column: 1; text-align: center; max-width: 100%; }
  html #screen-menu .mode-tile.is-big .mode-tile-ico { width: clamp(40px, 9dvh, 88px); height: clamp(40px, 9dvh, 88px); }
  /* HUD: avatar + Spin left; coins + Settings right (gear is the last item, at the corner) */
  html #screen-menu .home-top { gap: 8px; }
  html #screen-menu .home-top > #btn-home-profile { order: 0; }
  html #screen-menu .home-top > .spin-chip { order: 1; margin-left: 0; }
  html #screen-menu .home-top > .shop-bar { order: 2; margin-left: auto; min-height: var(--tap); }
  html #screen-menu .home-top > [data-goto="settings"] { order: 3; margin-left: 0; }
  html #screen-menu .home-top > .spin-chip:not([hidden]) ~ .shop-bar { margin-left: auto; }
  html #screen-menu .home-top > .shop-bar[hidden] ~ [data-goto="settings"] { margin-left: auto; }
  html #screen-menu .home-top .spin-chip { min-height: var(--tap); }
}
@media (max-width: 340px) { html #screen-menu .home-top #spin-chip-label { display: none; } html #screen-menu .home-top .spin-chip { min-width: var(--tap); padding-inline: 8px; } }
@media (min-width: 700px) { html #screen-menu .home-top, html #screen-menu .home-mid { width: min(100%, 600px); margin-inline: auto; } }

/* >>> Home tiles: icons scale with the tile so the four square tiles feel full, not empty. */
#screen-menu .mode-tile.is-big .mode-tile-ico img, #screen-menu .mode-tile.is-big .mode-tile-ico.quick-bolt img { width: 100%; height: 100%; object-fit: contain; }
#screen-menu .mode-tile.is-big b { font-size: clamp(16px, 2.6dvh, 22px); }
/* <<< Home tiles */

/* >>> Welcome gift spotlight (js/welcomeGift.js): dim Home, ring the Daily Spin chip, one small bubble. */
.welcome-scrim { cursor: pointer; background: transparent; }   /* the hole's own shadow dims everything but the chip */
.welcome-hole { border-radius: 18px; }
.welcome-hole::before { content: ""; position: absolute; inset: -2px; border-radius: 20px; pointer-events: none;
  border: 2px solid rgba(255, 214, 120, .9); animation: welcomeRing 1.8s ease-out infinite; }
@keyframes welcomeRing { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(1.28); opacity: 0; } }
.welcome-bubble { position: fixed; z-index: 61; box-sizing: border-box; display: flex; align-items: center; gap: 8px;
  padding: 11px 8px 11px 14px; border-radius: 14px; border: 1px solid var(--edge);
  background: linear-gradient(180deg, var(--surface), var(--surface-2)); box-shadow: 0 14px 34px rgba(0, 0, 0, .6);
  color: var(--ink); font-size: 14px; line-height: 1.35; font-weight: 700; animation: welcomeIn .3s ease-out both; }
@keyframes welcomeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.welcome-bubble::before { content: ""; position: absolute; top: -7px; left: calc(var(--tail, 40px) - 7px); width: 14px; height: 14px;
  transform: rotate(45deg); background: var(--surface); border-left: 1px solid var(--edge); border-top: 1px solid var(--edge); }
.welcome-text { flex: 1; min-width: 0; font-weight: 700; }
.welcome-text b { display: block; font-size: 14px; }
.welcome-text small { display: block; margin-top: 2px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.welcome-bubble.is-above::before { top: auto; bottom: -7px; transform: rotate(225deg); }
.welcome-x { flex: none; width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: var(--brass);
  font-size: 22px; line-height: 1; cursor: pointer; }
@media (prefers-reduced-motion: reduce) { .welcome-hole::before { animation: none; opacity: .7; } }
/* <<< Welcome gift spotlight */

/* >>> Shop > Sogtī: compact 3-column cards so 6-9 are visible on one screen without scrolling. */
.shop-grid.is-compact { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.shop-grid.is-compact .shop-card { gap: 4px; padding: 7px 6px 8px; border-radius: 14px; }
.shop-grid.is-compact .shop-card p { display: none; }
.shop-grid.is-compact .shop-card h3 { font-size: 12px; line-height: 1.2; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shop-grid.is-compact .shop-card h3::after { display: none; }
.shop-grid.is-compact .shop-card.is-premium::before { content: ""; }
.shop-grid.is-compact .shop-thumb { border-radius: 9px; width: min(100%, 76px); margin-inline: auto; }
.shop-grid.is-compact .shop-btn { min-height: 34px; padding: 4px 4px; font-size: 11px; line-height: 1.15; border-radius: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shop-grid.is-compact .shop-btn .coin-dot { width: 9px; height: 9px; margin-right: 3px; flex: 0 0 auto; }
.shop-grid.is-compact .shop-need { display: none; }
.shop-grid.is-compact .shop-btn.is-short { opacity: .82; }
.shop-grid.is-compact .shop-btn.is-quiet { white-space: normal; text-overflow: clip; }
/* <<< Shop sogtī compact */

/* === mic permission card (js/micPermission.js) === */
.mic-card-wrap { position: fixed; inset: 0; z-index: 9000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, .55); }
.mic-card { width: min(92vw, 340px); display: flex; flex-direction: column; gap: 10px; padding: 18px 16px; border-radius: 18px; background: var(--card, #2a1a10); color: var(--ink, #fff); text-align: center; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.mic-card-text { margin: 0 0 4px; font-size: 1rem; line-height: 1.4; }

/* === lobby pickers: sogtī and board each in one swipeable row (less scrolling) === */
#opt-lobby-pawn, #pawn-sheet-row, #opt-lobby-theme, #board-sheet-row {
  display: flex; flex-wrap: nowrap; gap: 10px; overflow-x: auto; overflow-y: hidden;
  padding: 2px 2px 10px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain; scrollbar-width: thin;
}
#opt-lobby-pawn .pawn-card, #pawn-sheet-row .pawn-card { flex: 0 0 108px; scroll-snap-align: start; }
#opt-lobby-theme .theme-card, #board-sheet-row .theme-card { flex: 0 0 120px; scroll-snap-align: start; }

/* === lobby pickers, premium pass: smooth snap scrolling, soft edge fade, selected card lifts 8% with a light border === */
#opt-lobby-pawn, #pawn-sheet-row, #opt-lobby-theme, #board-sheet-row {
  scroll-behavior: smooth; scroll-snap-type: x mandatory; scroll-padding: 0 14px;
  padding: 16px 14px 18px; margin: 0 -4px; gap: 12px;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 26px), transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 26px), transparent 100%);
}
#opt-lobby-pawn::-webkit-scrollbar, #pawn-sheet-row::-webkit-scrollbar, #opt-lobby-theme::-webkit-scrollbar, #board-sheet-row::-webkit-scrollbar { display: none; }
#opt-lobby-pawn, #pawn-sheet-row, #opt-lobby-theme, #board-sheet-row { scrollbar-width: none; }
#opt-lobby-pawn .pawn-card, #pawn-sheet-row .pawn-card, #opt-lobby-theme .theme-card, #board-sheet-row .theme-card {
  scroll-snap-align: center; position: relative;
  border: 2px solid rgba(255, 230, 180, .07);
  background: linear-gradient(165deg, rgba(255, 235, 200, .07), rgba(0, 0, 0, .22));
  box-shadow: 0 6px 14px rgba(0, 0, 0, .30), inset 0 1px 0 rgba(255, 235, 190, .10);
  transform: scale(1); transform-origin: 50% 55%;
  transition: transform .42s cubic-bezier(.2, .9, .25, 1.15), box-shadow .35s ease, border-color .3s ease, background .3s ease, opacity .3s ease;
  will-change: transform;
}
#opt-lobby-pawn .pawn-card:active, #pawn-sheet-row .pawn-card:active, #opt-lobby-theme .theme-card:active, #board-sheet-row .theme-card:active { transform: scale(.97); }
#opt-lobby-pawn .pawn-card.is-on, #pawn-sheet-row .pawn-card.is-on, #opt-lobby-theme .theme-card.is-on, #board-sheet-row .theme-card.is-on {
  transform: scale(1.08); z-index: 1;
  border-color: rgba(255, 229, 165, .9);
  background: linear-gradient(160deg, rgba(255, 214, 140, .34), rgba(150, 95, 40, .30));
  box-shadow: 0 0 0 1px rgba(255, 229, 165, .35), 0 0 20px rgba(255, 206, 112, .38), 0 12px 24px rgba(0, 0, 0, .42), inset 0 1px 0 rgba(255, 244, 214, .35);
}
#opt-lobby-pawn .pawn-card.is-on:active, #pawn-sheet-row .pawn-card.is-on:active, #opt-lobby-theme .theme-card.is-on:active, #board-sheet-row .theme-card.is-on:active { transform: scale(1.04); }
#opt-lobby-pawn .pawn-card.is-locked, #pawn-sheet-row .pawn-card.is-locked, #opt-lobby-theme .theme-card.is-locked, #board-sheet-row .theme-card.is-locked { opacity: .62; }
@media (prefers-reduced-motion: reduce) {
  #opt-lobby-pawn, #pawn-sheet-row, #opt-lobby-theme, #board-sheet-row { scroll-behavior: auto; }
  #opt-lobby-pawn .pawn-card, #pawn-sheet-row .pawn-card, #opt-lobby-theme .theme-card, #board-sheet-row .theme-card { transition: none; }
}

/* === Room Lobby, one screen: no page scrolling on a normal phone (code card, roster, size, colour, sogtī and board rows all fit above Start) === */
#screen-lobby .lobby-wrap { gap: 8px; padding: 6px 14px calc(10px + var(--sab, env(safe-area-inset-bottom, 0px))); }
#screen-lobby .topbar { min-height: 48px; }
#screen-lobby .lobby-code-card { padding: 10px 14px 12px; border-radius: 16px; }
#screen-lobby .lobby-code-card .hint { font-size: 12px; line-height: 1.3; margin: 0 0 2px; }
#screen-lobby .lobby-code { font-size: clamp(26px, 4.3dvh, 34px); margin-bottom: 8px; letter-spacing: .12em; }
#screen-lobby .lobby-share-row { flex-wrap: nowrap; gap: 8px; }
#screen-lobby .lobby-share-row .btn { flex: 1 1 0; padding: 8px 6px; font-size: 13px; min-height: 0; }
#screen-lobby .lobby-status { font-size: 12.5px; line-height: 1.3; }
/* players side by side */
#screen-lobby #lobby-roster { grid-template-columns: 1fr 1fr; gap: 7px; }
#screen-lobby #lobby-roster li { padding: 7px 10px; gap: 6px; border-radius: 11px; }
#screen-lobby #lobby-roster b { font-size: 13px; }
/* table size on one line with its label */
#screen-lobby .lobby-seats { display: flex; align-items: center; gap: 10px; margin: 0; }
#screen-lobby .lobby-seats .sub-label { margin: 0; white-space: nowrap; }
#screen-lobby .lobby-seats .segmented { flex: 1; }
#screen-lobby .lobby-seats .seg { padding: 7px 0; min-height: 0; }
/* my seat */
#screen-lobby .lobby-mine { margin: 0; display: grid; gap: 2px; }
#screen-lobby .lobby-mine .sub-label { margin: 6px 0 0; font-size: 11.5px; letter-spacing: .08em; }
#screen-lobby #opt-lobby-colour { gap: 8px; }
#screen-lobby #opt-lobby-colour .swatch { padding: 6px 4px; gap: 2px; border-radius: 11px; }
#screen-lobby #opt-lobby-colour .swatch span { transform: scale(.78); transform-origin: center; }
#screen-lobby #opt-lobby-colour .swatch em { font-size: 11px; }
#screen-lobby #opt-lobby-pawn, #screen-lobby #opt-lobby-theme { padding: 10px 12px 12px; gap: 10px; margin: 0 -2px; }
#screen-lobby #opt-lobby-pawn .pawn-card { flex-basis: 92px; padding: 8px 6px; gap: 3px; }
#screen-lobby #opt-lobby-pawn .pawn-preview { width: 40px; height: 40px; }
#screen-lobby #opt-lobby-pawn .pawn-card b { font-size: 11.5px; line-height: 1.15; }
#screen-lobby #opt-lobby-theme .theme-card { flex-basis: 98px; padding: 7px 6px 8px; gap: 4px; }
#screen-lobby #opt-lobby-theme .theme-thumb { width: 62px; }
#screen-lobby #opt-lobby-theme .theme-card b { font-size: 11.5px; line-height: 1.15; }
#screen-lobby #opt-lobby-theme .lock-note { font-size: 10px; }
/* more invites (3-4 players): a short list that scrolls inside itself */
#screen-lobby .lobby-invite { margin: 0; }
#screen-lobby #lobby-friends { max-height: 96px; overflow-y: auto; }
#screen-lobby #btn-fill-bots { padding: 9px 12px; font-size: 13.5px; min-height: 0; }
#screen-lobby #btn-lobby-start { min-height: 50px; font-size: 18px; }

/* lobby, second tightening: the invite rows are one line each, the title and the long instruction give way on shorter screens */
#screen-lobby #lobby-friends li { flex-wrap: nowrap; padding: 6px 10px; gap: 8px; }
#screen-lobby #lobby-friends li b { font-size: 13px; }
#screen-lobby .lobby-invite .sub-label { margin: 0 0 2px; font-size: 11.5px; }
#screen-lobby #opt-lobby-pawn, #screen-lobby #opt-lobby-theme { padding: 8px 12px 10px; }
#screen-lobby #opt-lobby-theme .theme-thumb { width: 56px; }
@media (max-height: 900px) {
  #screen-lobby .lobby-code-card .hint { display: none; }
  #screen-lobby .lobby-code { margin-bottom: 6px; }
  #screen-lobby #opt-lobby-colour .swatch { padding: 4px 4px; }
}

/* lobby: invite more friends as round avatars (face, name, status in brackets) */
#screen-lobby #lobby-friends { display: flex; flex-wrap: nowrap; gap: 14px; overflow-x: auto; overflow-y: hidden; max-height: none; padding: 4px 4px 6px; scrollbar-width: none; }
#screen-lobby #lobby-friends::-webkit-scrollbar { display: none; }
#screen-lobby #lobby-friends li { flex: 0 0 auto; display: block; padding: 0; border: 0; background: none; box-shadow: none; animation: none; min-width: 0; }
#screen-lobby #lobby-friends .invite-chip { display: grid; justify-items: center; gap: 2px; width: 72px; padding: 0; background: none; border: 0; color: inherit; cursor: pointer; }
#screen-lobby #lobby-friends .invite-chip .friend-chip-name { max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 700; }
#screen-lobby #lobby-friends .invite-state { font-style: normal; font-size: 10.5px; color: var(--ink-2); letter-spacing: .02em; }
#screen-lobby #lobby-friends .invite-state.is-asked { color: var(--brass); font-weight: 700; }
#screen-lobby #lobby-friends .invite-chip:disabled { opacity: 1; cursor: default; }
#screen-lobby #lobby-friends .invite-chip:not(:disabled):active .friend-avatar { transform: scale(.94); }
#screen-lobby #lobby-friends .friend-avatar { transition: transform .2s ease; }

/* lobby invite avatars: smaller so Start / the bot button stay on screen */
#screen-lobby #lobby-friends { gap: 12px; padding: 2px 4px 2px; }
#screen-lobby #lobby-friends .friend-avatar { width: 42px; height: 42px; }
#screen-lobby #lobby-friends .friend-avatar-initial { font-size: 18px; }
#screen-lobby #lobby-friends .invite-chip { width: 66px; gap: 1px; }
#screen-lobby #lobby-friends .invite-chip .friend-chip-name { font-size: 11.5px; max-width: 66px; }
#screen-lobby #lobby-friends .invite-state { font-size: 10px; }
#screen-lobby .lobby-invite .sub-label { margin: 0; }
@media (max-height: 1000px) {
  #screen-lobby .lobby-code-card .hint { display: none; }
}

/* Friend chat: the message log fills the screen and the box sits at the bottom (a later .chat-log cap of 26vh had left it mid-screen) */
.dm-wrap > .dm-log { max-height: none; flex: 1 1 auto; min-height: 0; }

/* purchased items read as done and green; owned avatars get a clear Wear button */
.shop-btn.is-owned { opacity: 1; color: #c8f1c6; background: rgba(60, 130, 70, .28); border: 1px solid rgba(140, 214, 140, .55); font-weight: 800; }
.shop-purchased { display: block; margin-top: 4px; font-size: 11.5px; font-weight: 800; color: #9bdc9e; }
.shop-btn.is-wear { background: linear-gradient(180deg, #f3d98f, #cfa24a); color: #2c1a08; font-weight: 800; }
.pp-state { display: inline-block; margin: 0 auto; padding: 8px 18px; border-radius: 999px; background: rgba(60, 130, 70, .32); border: 1px solid rgba(140, 214, 140, .6); color: #c8f1c6; }
.pp-where { margin: 8px 4px 0; text-align: center; font-size: 12px; line-height: 1.4; color: var(--ink-2); }
.shop-btn.is-wear { min-width: 128px; padding: 10px 22px; }

/* Princess Pack: gift it to a friend */
.shop-princess .pp-gift { margin-top: 8px; }
.shop-princess .pp-activate { margin-top: 10px; }
.pk-wrap .pk-what { margin: 0 4px 8px; text-align: center; }

/* Princess Pack: the big card is the gift; a small card under it is for yourself */
.shop-princess .pp-gift { margin-top: 10px; }
.shop-princess-self { display: flex; align-items: center; gap: 12px; margin: 10px 0 0; padding: 10px 12px; border-radius: 16px;
  border: 1px solid rgba(255, 214, 160, .22); background: linear-gradient(165deg, rgba(120, 40, 80, .38), rgba(40, 10, 30, .55)); }
.shop-princess-self .pps-art { flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%; overflow: hidden; border: 2px solid rgba(255, 214, 160, .5); }
.shop-princess-self .pps-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.shop-princess-self .pps-copy { flex: 1 1 auto; min-width: 0; display: grid; gap: 1px; }
.shop-princess-self .pps-copy b { font-size: 14px; color: #ffe2a8; }
.shop-princess-self .pps-copy span { font-size: 12px; color: var(--ink-2); line-height: 1.3; }
.shop-princess-self .pp-where { margin: 3px 0 0; text-align: left; font-size: 11px; line-height: 1.3; color: var(--ink-2); }
.shop-princess-self .pps-buy { flex: 0 0 auto; }
.shop-princess-self .pps-state { flex: 0 0 auto; padding: 6px 12px; font-size: 12.5px; margin: 0; }
.shop-princess-self { margin-bottom: 12px; }

/* === Live Rooms: each room is a card (faces, host, who is at the table, Join) === */
#screen-rooms #rooms-list { display: grid; grid-template-columns: 1fr; grid-auto-rows: auto; gap: 10px; }
#screen-rooms .room-card.rc {
  display: flex; flex-direction: row; align-items: center; gap: 12px; padding: 12px 14px; min-height: 0;
  border-radius: 18px; text-align: left; overflow: hidden; border: 1px solid rgba(255, 214, 160, .24);
  background: linear-gradient(165deg, rgba(135, 62, 48, .52), rgba(42, 14, 16, .72));
  box-shadow: 0 8px 18px rgba(0, 0, 0, .30), inset 0 1px 0 rgba(255, 235, 190, .13);
  transition: transform .2s ease, border-color .2s ease;
}
#screen-rooms .room-card.rc:active { transform: scale(.985); border-color: rgba(255, 226, 160, .55); }
#screen-rooms .room-card.rc.is-bot-room { border-style: solid; }
.rc-faces { display: flex; flex: 0 0 auto; padding-left: 8px; }
.rc-face {
  display: grid; place-items: center; width: 36px; height: 36px; margin-left: -8px; border-radius: 50%;
  font-weight: 800; font-size: 15px; color: var(--ink); background: rgba(255, 255, 255, .13);
  border: 2px solid rgba(40, 14, 16, .9); box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
}
.rc-face.is-host { background: linear-gradient(180deg, #f3d98f, #cfa24a); color: #2c1a08; }
.rc-face.is-bot { background: rgba(120, 150, 210, .35); }
.rc-face.is-free { background: transparent; border: 2px dashed rgba(255, 214, 160, .45); box-shadow: none; color: rgba(255, 214, 160, .8); font-weight: 600; }
.rc-main { flex: 1 1 auto; min-width: 0; display: grid; gap: 4px; }
.rc-title { font-size: 16px; font-weight: 800; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.rc-pill { font-style: normal; font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px; color: #ffe2a8; background: rgba(255, 200, 110, .14); border: 1px solid rgba(255, 214, 160, .28); white-space: nowrap; }
.rc-size { font-style: normal; font-size: 11.5px; color: var(--ink-2); white-space: nowrap; }
#screen-rooms .room-card.rc .rc-join {
  flex: 0 0 auto; display: block; padding: 9px 22px; border-radius: 999px; font-size: 14px; font-weight: 800; color: #2c1a08;
  background: linear-gradient(180deg, #f3d98f, #cfa24a); box-shadow: 0 4px 10px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .45);
}
/* rooms: a touch more compact so about five fit, and a soft fade where the list scrolls away */
#screen-rooms .room-card.rc { padding: 10px 12px; gap: 11px; border-radius: 16px; }
#screen-rooms .room-card.rc .rc-join { padding: 8px 20px; font-size: 13.5px; }
.rc-face { width: 34px; height: 34px; font-size: 14px; }
.rc-title { font-size: 15.5px; }
#screen-rooms .rooms-top { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 26px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 26px), transparent); padding-bottom: 14px; }
/* a bot wears one of the game's own avatars in the room list */
.rc-face.is-pic { padding: 0; overflow: hidden; background: rgba(0, 0, 0, .25); }
.rc-face.is-pic img { display: block; width: 100%; height: 100%; object-fit: cover; }
.rc-face.is-pic.is-host { border-color: #e6c677; }

/* === in-match sogtī switcher: a button beside gifts, and a sheet of what you own === */
.pawn-open { position: relative; display: grid; place-items: center; }
.pawn-open .pawn-body { position: relative; inset: auto; width: 30px; height: 30px; pointer-events: none; }
.pawn-sheet-note { margin: 0 0 4px; font-size: .85rem; opacity: .75; }
#pawn-sheet-row .pawn-card { cursor: pointer; }
.board-open .board-face { display: block; width: 30px; height: 30px; border-radius: 6px; overflow: hidden; pointer-events: none; box-shadow: 0 0 0 1px rgba(255, 229, 165, .55); }
.board-open .board-face svg { display: block; width: 100%; height: 100%; }
#board-sheet-row .theme-card { cursor: pointer; }

/* Home title: the painted Chaupat Samrat wordmark replaces the CSS-gilded text. */
#screen-menu .home-mid .brand p.deva { background: none; text-shadow: none; padding: 0; margin: 2px 0 0; line-height: 0; -webkit-text-fill-color: initial; }
#screen-menu .home-mid .brand p.deva::before, #screen-menu .home-mid .brand p.deva::after { content: none; display: none; }
#screen-menu .home-mid .brand p.deva .home-title-art { display: block; width: min(250px, 66vw); height: auto; margin: 0 auto; pointer-events: none; filter: none; }

/* A friend's avatar fills the round chip; the dot and status ring stay. */
.friend-avatar .friend-avatar-img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }

/* Family board maker */
.fb-card { max-height: 92dvh; overflow-y: auto; }
.fb-preview { width: min(260px, 70vw); aspect-ratio: 1; margin: 6px auto 10px; }
.fb-preview svg { width: 100%; height: 100%; display: block; }
.fb-preview .fb-empty { display: grid; place-items: center; width: 100%; height: 100%; border: 1.5px dashed var(--edge); border-radius: 14px; opacity: .7; }
.fb-name { width: 100%; box-sizing: border-box; margin: 8px 0; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--edge); background: rgba(0, 0, 0, .25); color: inherit; font: inherit; }
.fb-mine { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.fb-mine .fb-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--edge); font-size: .85rem; }
.fb-mine .fb-chip button { border: 0; background: none; color: inherit; font-size: 1rem; line-height: 1; cursor: pointer; opacity: .75; }
.theme-card.is-add .theme-thumb { display: grid; place-items: center; font-size: 34px; opacity: .8; }

/* Seat chips: the avatar is the face of the card, the colour dot a badge on its corner. */
.chip-face { position: relative; flex: 0 0 auto; display: grid; place-items: center; }
.chip-face .chip-av { display: block; width: 44px; height: 44px; margin: 0; vertical-align: 0; }
.chip-face .chip-dot { position: absolute; right: -4px; bottom: -3px; width: 16px; height: 16px; }
.chip-face:not(:has(.chip-av)) .chip-dot { position: static; }
#screen-game #seat-top .chip, #screen-game #seat-bottom .chip { gap: 10px; align-items: center; }
#screen-game #seat-top .chip .chip-body, #screen-game #seat-bottom .chip .chip-body { gap: 1px; justify-items: start; text-align: left; }
.seat-left .chip .chip-face, .seat-right .chip .chip-face { margin: 0 auto; }
.seat-left .chip .chip-face .chip-av, .seat-right .chip .chip-face .chip-av { width: 34px; height: 34px; }
.seat-left .chip .chip-face .chip-dot, .seat-right .chip .chip-face .chip-dot { width: 14px; height: 14px; right: -4px; bottom: -3px; }

/* A coin board armed for purchase from the picker: second tap buys it. */
.theme-card.is-armed { border-color: rgba(255, 229, 165, .9); box-shadow: 0 0 0 1px rgba(255, 229, 165, .35), 0 0 16px rgba(255, 206, 112, .35); opacity: 1; }
.theme-card.is-armed .lock-note { color: #ffe29a; font-weight: 800; }

/* First-run tour: the guide line above the throw, the glowing sogtī, and the welcome spin's 2x button. */
.onboard-bar {
  margin: 6px 14px 2px; padding: 9px 14px; border-radius: 12px; text-align: center;
  font-size: 13.5px; line-height: 1.3; font-weight: 700; color: #3a2204;
  background: linear-gradient(180deg, #ffe7a3, #f0bd55); box-shadow: 0 2px 8px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 250, 225, .7);
}
.onboard-bar[hidden] { display: none; }
.pawn.is-suggest { z-index: 9; }
.pawn.is-suggest::before {
  content: ''; position: absolute; inset: -5px; border-radius: 50%; border: 3px solid #ffe08a; pointer-events: none;
  box-shadow: 0 0 10px 2px rgba(255, 214, 110, .75); animation: tourPulse 1.1s ease-in-out infinite;
}
@keyframes tourPulse { 0%, 100% { transform: scale(.92); opacity: .75; } 50% { transform: scale(1.12); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .pawn.is-suggest::before { animation: none; } }
.spin-reward-double.is-hero { animation: tourGlow 1.4s ease-in-out infinite; font-size: 1.05em; }
@keyframes tourGlow { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 214, 110, .0); transform: scale(1); } 50% { box-shadow: 0 0 18px 4px rgba(255, 214, 110, .7); transform: scale(1.03); } }
#btn-spin-collect.is-quiet { opacity: .8; font-size: .9em; }

/* The cowries you throw wear your colour. */
.shells.pc-red .shell.up { background-image: url("../img/icons/shell-up-red.webp"); }
.shells.pc-red .shell.down { background-image: url("../img/icons/shell-down-red.webp"); }
.shells.pc-green .shell.up { background-image: url("../img/icons/shell-up-green.webp"); }
.shells.pc-green .shell.down { background-image: url("../img/icons/shell-down-green.webp"); }
.shells.pc-yellow .shell.up { background-image: url("../img/icons/shell-up-yellow.webp"); }
.shells.pc-yellow .shell.down { background-image: url("../img/icons/shell-down-yellow.webp"); }
.shells.pc-blue .shell.up { background-image: url("../img/icons/shell-up-blue.webp"); }
.shells.pc-blue .shell.down { background-image: url("../img/icons/shell-down-blue.webp"); }

/* A sogtī another player at the table already wears: shown, but not selectable. */
.pawn-card.is-taken { opacity: .5; }
.pawn-card.is-taken .lock-note { color: #ffd98a; }

/* After the practice match: Home is the obvious next tap. */
/* The post-match challenge card: the friend-invite drop-in with a face (js/botInvite.js, js/ui.js offerBotInvite). */
.bot-invite-who { display: flex; align-items: center; gap: 12px; margin-bottom: 11px; }
.bot-invite-who p { margin: 0; flex: 1; font-size: 14px; line-height: 1.35; }
.bot-invite-av { flex: none; width: 52px; height: 52px; padding: 0; border: 2px solid var(--edge); border-radius: 50%; background: var(--surface-2); overflow: hidden; }
.bot-invite-av img { display: block; width: 100%; height: 100%; object-fit: cover; }
.bot-profile-card { text-align: center; }
.bot-profile-av { width: 92px; height: 92px; border-radius: 50%; border: 2px solid var(--edge); object-fit: cover; margin: 0 auto 8px; display: block; }
.bot-profile-line { margin: 4px 0; font-size: 14px; }
/* Auto Mode: a small pill under the status line. ON is gold and says so; OFF is quiet (js/autoPlay.js). */
.auto-pill { display: block; margin: 0 auto 6px; min-height: 30px; padding: 4px 16px; border: 1px solid var(--edge); border-radius: 999px; background: var(--surface-2); color: var(--ink-soft, inherit); font: inherit; font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.auto-pill[hidden] { display: none; }
.auto-pill[aria-pressed="true"] { background: linear-gradient(180deg, #ffe7a3, #f0bd55); color: #3a2204; border-color: transparent; }
/* A sogtī home, for anyone's: a brief burst of confetti out of the centre of the board (transform and opacity only). */
.board-wrap { position: relative; }
.home-burst { position: absolute; inset: 0; z-index: 6; overflow: hidden; pointer-events: none; }
.home-burst i { position: absolute; left: 50%; top: 50%; width: calc(var(--s, 1) * 8px); height: calc(var(--s, 1) * 12px); border-radius: 2px; background: var(--c); opacity: 0; animation: homeBurst 1.05s cubic-bezier(.15, .7, .3, 1) forwards; }
@keyframes homeBurst {
  0%   { transform: translate(-50%, -50%) rotate(0deg) scale(.4); opacity: 0; }
  12%  { opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(var(--r)) scale(1); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .home-burst { display: none; } }
/* Practice match, before the first throw: the sogtī-style and board buttons are out of sight (one player spent 52 s on them). */
html.tour-first-throw #btn-pawn, html.tour-first-throw #btn-board { visibility: hidden; }
/* After the practice match a newcomer's glowing button is Rematch (js/ui.js paintTourHero). */
#btn-rematch.is-tour-hero { animation: tourGlow 1.4s ease-in-out infinite; }
#btn-home.is-tour-hero { animation: tourGlow 1.4s ease-in-out infinite; background: linear-gradient(180deg, #ffe7a3, #f0bd55); color: #3a2204; border-color: transparent; font-weight: 800; }

/* Play with Friends: one screen, no page scroll. The friends list scrolls on its own when it is long;
   the code cards sit compactly underneath, above the tab shelf. */
#screen-friends .scroller { display: flex; flex-direction: column; gap: 8px; overflow: hidden; padding-bottom: 92px; }
#screen-friends .scroller > .pad { display: none; }
#screen-friends .scroller > .panel { margin: 0; }
#screen-friends .scroller > .panel:not(#panel-friend-requests) { flex: 1 1 0; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
#screen-friends #panel-friend-requests { flex: 0 0 auto; max-height: 28%; overflow-y: auto; }
#screen-friends .code-pair { flex: 0 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; }
#screen-friends .code-half { padding: 10px 12px; margin: 0; }
#screen-friends .code-half h3 { margin: 0 0 4px; font-size: 14px; }
#screen-friends .code-half .hint { display: none; }
#screen-friends .code-half .lobby-code { font-size: 20px; letter-spacing: .18em; margin: 2px 0 6px; }
#screen-friends .code-half .lobby-share-row { gap: 6px; }
#screen-friends .code-half .btn { min-height: 38px; padding: 6px 8px; font-size: 12px; }
#screen-friends .code-half .code-input { min-height: 38px; margin: 2px 0 6px; }
#screen-friends #families-empty { font-size: 12px; margin: 4px 0 8px; }
#screen-friends .family-actions .btn { min-height: 40px; }
#screen-friends #friends-empty-hint, #screen-friends #families-empty { display: none; }
#screen-friends .scroller > .panel { padding: 10px 12px; }
#screen-friends .list-head { margin: 8px 0 6px; }
#screen-friends #friends-block .btn, #screen-friends #families-block .btn { min-height: 40px; }

/* Name card: the boy / girl row sits right under the name field. */
.name-ask-gender-hint { margin: 10px 0 4px; }
#name-ask-gender { margin-bottom: 12px; }

.fb-mine .fb-chip .fb-share { font-size: .78rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--edge); opacity: 1; }

/* Friends screen: the same round faces as Home, in one row that swipes sideways. */
#screen-friends #friends-list { display: flex; flex-wrap: nowrap; gap: 12px; overflow-x: auto; overflow-y: hidden; margin: 6px -4px 4px; padding: 4px 4px 10px; list-style: none; scroll-snap-type: x proximity; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
#screen-friends #friends-list::-webkit-scrollbar { display: none; }
#screen-friends #friends-list li { flex: 0 0 auto; width: 74px; display: block; margin: 0; padding: 0; border: 0; background: none; box-shadow: none; scroll-snap-align: start; }
#screen-friends #friends-list .friend-chip { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; background: none; border: 0; padding: 2px 0; box-shadow: none; border-radius: 0; }
#screen-friends #friends-list .friend-avatar { width: 56px; height: 56px; }
#screen-friends #friends-list .friend-chip-name { max-width: 100%; font-size: 12px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#screen-friends #friends-list .friend-last { font-style: normal; font-size: 10.5px; opacity: .65; line-height: 1; }
#screen-friends #friends-list .friend-last.is-online { color: #8fdd7c; opacity: 1; font-weight: 700; }
#screen-friends #friends-list .friend-unread { display: none; }
#screen-friends #friends-list li.is-renaming { flex: 1 0 100%; width: auto; display: flex; align-items: center; gap: 8px; }
#screen-friends #friends-list li.is-renaming .code-input { flex: 1 1 auto; min-height: 40px; }

/* Turn line under the board: gold lettering on a soft dark pill so it stays readable over the cowrie glow. */
#screen-game .status { align-self: center; width: fit-content; max-width: calc(100% - 32px); margin-left: auto; margin-right: auto; padding: 6px 18px; border-radius: 999px; background: rgba(32, 12, 8, .55); box-shadow: inset 0 0 0 1px rgba(255, 214, 140, .22), 0 3px 10px rgba(0, 0, 0, .3); color: #ffe7b0; font-weight: 700; letter-spacing: .03em; text-shadow: 0 1px 0 rgba(60, 24, 6, .9), 0 2px 8px rgba(0, 0, 0, .55); }
#pkb-thumbs { justify-content: center; margin: 4px 0 14px; }

/* Lobby: when the content runs long the page scrolls; it must not squash the buttons (the bot-fill text sat below its box). */
#screen-lobby .lobby-wrap > * { flex-shrink: 0; }
#screen-lobby #btn-fill-bots { min-height: 44px; line-height: 1.25; display: flex; align-items: center; justify-content: center; text-align: center; }

/* Home: the wordmark and board sit a little higher, closer to the top row, leaving the gap below to the buttons. */
#screen-menu .home-mid .brand { position: relative; top: -8px; }
#screen-menu .home-mid .brand .brand-mark { position: relative; top: 12px; transform: scale(1.22); transform-origin: 50% 0; }

/* Home tiles with a friends row above: the tiles keep their size, so the picture takes every pixel the words leave (was 34px). */
html #screen-menu:has(#friends-strip:not([hidden])) .mode-row.is-grid .mode-tile.is-big { padding: 4px 6px; row-gap: 1px; }
html #screen-menu:has(#friends-strip:not([hidden])) .mode-row.is-grid .mode-tile.is-big .mode-tile-ico { width: 56px; height: 56px; }
html #screen-menu:has(#friends-strip:not([hidden])) .mode-row.is-grid .mode-tile.is-big > b { line-height: 1.1; }
html #screen-menu:has(#friends-strip:not([hidden])) .mode-row.is-grid .mode-tile.is-big > em { line-height: 1.1; }

/* Wordmark shimmer: a soft light sweep crossing the gold letters (masked to the letters), then a pause. */
#screen-menu .home-mid .brand p.deva { position: relative; width: fit-content; margin-inline: auto; }
#screen-menu .home-mid .brand p.deva::after {
  content: ""; display: block; position: absolute; inset: 0; pointer-events: none;
  -webkit-mask: url(../img/icons/title.webp) center / 100% 100% no-repeat; mask: url(../img/icons/title.webp) center / 100% 100% no-repeat;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 246, 214, .75) 50%, transparent 62%) 160% 0 / 250% 100% no-repeat;
  opacity: 1; animation: none;
}
#screen-menu.is-active .home-mid .brand p.deva::after { animation: titleSweep 5.5s ease-in-out 1s infinite; }
@keyframes titleSweep { 0% { background-position: 160% 0; } 38%, 100% { background-position: -60% 0; } }
@media (prefers-reduced-motion: reduce) { #screen-menu.is-active .home-mid .brand p.deva::after { animation: none; opacity: 0; } }

/* === Winning card: shorter and calmer. A slim banner, a smaller crown, the name folded into the headline, tight rows. === */
.overlay .result-card.is-win .win-banner { margin: -22px -24px 6px; padding: 8px 16px 7px; }
.overlay .result-card.is-win .win-banner span { font-size: 18px; }
.overlay .result-card.is-win .result-crest { width: 92px; height: 92px; margin: 8px auto 0; }
.overlay .result-card.is-win .win-crown { width: 84px; }
.overlay .result-card.is-win .win-line { display: none; }
.overlay .result-card.is-win h2 { font-size: 24px; margin: 2px 0 8px; }
.overlay .result-card.is-win .standings { gap: 5px; margin-bottom: 8px; }
.overlay .result-card.is-win .standings li { padding: 6px 10px; font-size: 14px; }
.overlay .result-card.is-win .result-earn { margin: 0 0 6px; gap: 0; }
.overlay .result-card.is-win .result-earn b { font-size: 18px; }
.overlay .result-card.is-win .result-earn span, .result-card.is-win .result-league span { font-size: 11.5px; }
.overlay .result-card.is-win .result-league { margin: 0 0 8px; }
.overlay .result-card.is-win .result-league b { font-size: 14px; }
.overlay .result-card.is-win .result-friends { margin: 0 0 8px; gap: 6px; }
.overlay .result-card.is-win .result-friends .hint { font-size: 12px; }
.overlay .result-card.is-win .result-friends .btn { min-height: 40px; padding: 8px 12px; }
.overlay .result-card.is-win .result-actions { gap: 8px; }
.overlay .result-card.is-win .result-actions .btn { min-height: 44px; padding: 9px 12px; font-size: 15px; }
.overlay .result-card.is-win #btn-rematch { grid-column: 1 / -1; }
.overlay .result-card.is-win #btn-challenge { grid-column: 1 / -1; min-height: 38px; font-size: 13px; opacity: .9; }

/* Sogtī tiles: a dark velvet tile with a soft spotlight, so pale pieces (pearl, donut, macaron) and dark ones (obsidian) both stand out. */
.pawn-preview {
  background: radial-gradient(circle at 50% 36%, #94624c 0%, #62342a 55%, #381912 100%);
  border: 1px solid rgba(255, 222, 150, .38);
  box-shadow: inset 0 0 12px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 236, 190, .16), 0 1px 3px rgba(0, 0, 0, .35);
}

/* The wordmark shrinks to the middle column so it never runs under the Live or Maharaja League buttons on a narrow phone. */
#screen-menu .home-mid .brand p.deva .home-title-art { width: min(250px, 100%); }

/* === Result card: fits the screen. Text kept to the minimum - the standings, what the match earned, and the buttons. === */
.overlay .result-card { max-height: calc(100dvh - 24px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
.overlay .result-card::-webkit-scrollbar { display: none; }
#result-loan-btn { display: none !important; }                       /* no "Try ... free for one match" offer on the result card */
.result-card .result-earn span, .result-card .result-league span { display: none; }   /* the one-line detail under the coins and points */
.overlay .result-card.is-win .win-banner { margin: -18px -20px 2px; padding: 6px 14px 5px; }
.overlay .result-card.is-win .win-banner span { font-size: 16px; }
.overlay .result-card.is-win .result-crest { width: 64px; height: 64px; margin: 4px auto 0; }
.overlay .result-card.is-win .win-crown { width: 58px; }
.overlay .result-card.is-win h2 { font-size: 21px; margin: 0 0 6px; }
.overlay .result-card.is-win .standings { gap: 4px; margin-bottom: 6px; }
.overlay .result-card.is-win .standings li { padding: 4px 9px; font-size: 13px; }
.overlay .result-card .result-earn { margin: 0 0 2px; }
.overlay .result-card.is-win .result-earn b { font-size: 16px; }
.overlay .result-card.is-win .result-league { margin: 0 0 6px; }
.overlay .result-card.is-win .result-league b { font-size: 13px; }
.overlay .result-card .result-friends { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 6px; }
.overlay .result-card .result-friends[hidden] { display: none; }
.overlay .result-card .result-friends .result-social { display: contents; }
.overlay .result-card .result-friends .btn { flex: 1 1 0; min-height: 36px; padding: 6px 10px; font-size: 13px; }
.overlay .result-card.is-win .result-actions { gap: 6px; }
.overlay .result-card.is-win .result-actions .btn { min-height: 40px; padding: 6px 10px; font-size: 14px; }

/* No online head-count on the Play online tile (fake crowd or real). */
#hero-size-badge, #online-live { display: none !important; }
#turn-count-badge.is-yours { background: linear-gradient(180deg, #ffd98a, #f0a83a); color: #4e0b20; }

/* ===== Badges: Plus crown, title medal and the chosen sogtī beside a player (js/badges.js) ===== */
.bdg { display: inline-block; flex: 0 0 auto; line-height: 0; }
.bdg svg { display: block; }
/* On the chip: corners of the avatar. Top-left the title medal, bottom-left the sogtī, bottom-right the presence dot, and the Plus crown rides the name. */
.chip-face .bdg-rank { position: absolute; left: -5px; top: -5px; width: 18px; height: 18px; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .5)); }
.chip-face .bdg-sogti { position: absolute; top: auto; right: auto; left: -6px; bottom: -5px; width: 22px; height: 22px; z-index: 1; }   /* .pawn-body pins top:0, so it is cleared here */
.chip-body b .bdg-plus { width: 15px; height: 15px; margin-left: 4px; vertical-align: -2px; }
.seat-left .chip .chip-face .bdg-rank, .seat-right .chip .chip-face .bdg-rank { left: -3px; top: -4px; width: 14px; height: 14px; }
.seat-left .chip .chip-face .bdg-sogti, .seat-right .chip .chip-face .bdg-sogti { top: auto; left: -4px; bottom: -4px; width: 17px; height: 17px; }
.seat-left .chip .chip-body b .bdg-plus, .seat-right .chip .chip-body b .bdg-plus { display: block; margin: 2px auto 0; width: 13px; height: 13px; }
/* Profile card: medal and crown under the name. */
.pf-badges { display: flex; gap: 6px; align-items: center; min-height: 0; }
.pf-badges:empty { display: none; }
.pf-badges .bdg { width: 22px; height: 22px; }


/* Your own row on the leaderboards: a gold satin band and your name in gold, so it is found without reading the list. */
#league-table li.is-me {
  background: linear-gradient(180deg, rgba(246, 220, 154, .30), rgba(217, 168, 78, .16));
  border-color: var(--brass-hi, #ffeab4);
  box-shadow: inset 0 1px 0 rgba(255, 238, 190, .35), 0 0 0 1px rgba(224, 176, 85, .35);
}
#league-table li.is-me b, #league-table li.is-me .league-rank { color: var(--brass-hi, #ffeab4); }
.mj-row.is-me { background: linear-gradient(180deg, rgba(246, 220, 154, .30), rgba(217, 168, 78, .16)); box-shadow: 0 0 0 1px rgba(224, 176, 85, .35); }
.mj-row.is-me .mj-name { color: var(--brass-hi, #ffeab4); font-weight: 700; }

/* "YOU WON!": the card for the player who is home first while the others finish (js/youWon.js). */
.you-won-card { text-align: center; }
.you-won-crown { display: block; width: 96px; height: auto; margin: -6px auto 0; animation: crown-float 3.2s ease-in-out infinite; }
.you-won-card h2 { margin: 4px 0 6px; font-size: 1.9rem; letter-spacing: .06em; color: var(--brass-hi, #ffeab4); }
.you-won-card .btn { margin-top: 8px; }
.you-won-nudge { margin-top: 12px; padding-top: 10px; border-top: 1px solid rgba(255, 238, 190, .18); }
.you-won-nudge .hint { margin: 0 0 2px; }
@media (prefers-reduced-motion: reduce) { .you-won-crown { animation: none; } }
