/* Ludo Paws — game UI styles.
 * Skins (panels, ribbons, buttons, tiles, tabs, nav bar) are 9-slice PNGs from assets/images/ui, exposed by
 * assets.js as CSS variables: --ui-btn_green, --ui-panel, --ui-tile_blue, ... ; every image is a variable (--icon-coin).
 */
@font-face { font-family: 'Lilita One'; src: url(../assets/fonts/lilita-one-latin-400-normal.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: Fredoka; src: url(../assets/fonts/fredoka-latin-500-normal.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: Fredoka; src: url(../assets/fonts/fredoka-latin-600-normal.woff2) format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: Fredoka; src: url(../assets/fonts/fredoka-latin-700-normal.woff2) format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --ink: #5a3416; --ink2: #8a5a36; --paper: #fff6e3;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --display: 'Lilita One', 'Arial Rounded MT Bold', sans-serif;
  --body: Fredoka, 'Arial Rounded MT Bold', sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body { font-family: var(--body); font-weight: 600; color: var(--ink); background: #9fdcff; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
img { -webkit-user-drag: none; pointer-events: none; }
input { font: inherit; }

.st { color: #fff; font-family: var(--display); font-weight: 400; letter-spacing: 0.3px; -webkit-text-stroke: var(--sw, 5px) var(--sc, #5a3416); paint-order: stroke fill; text-shadow: 0 2px 0 var(--sc, #5a3416); }

#backdrop { position: fixed; inset: -40px; background: #9fdcff center/cover; filter: blur(20px) saturate(1.1); opacity: 0.9; }
#app { position: fixed; top: 0; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 500px; overflow: hidden; background: #bfe6ff; box-shadow: 0 0 50px rgba(40, 70, 110, 0.35); }
.screen { position: absolute; inset: 0; display: none; flex-direction: column; overflow: hidden; }
.screen.on { display: flex; }
.screen.enter { animation: scrIn 0.35s ease-out both; }
@keyframes scrIn { from { opacity: 0; transform: scale(1.04); } }
.bg { position: absolute; inset: 0; background-size: cover; background-position: center; z-index: 0; }
.screen > *:not(.bg) { position: relative; z-index: 1; }
.spacer { flex: 1; }

/* ---------------------------------------------------------------- skins */
.rnd { background: var(--ui-round_orange) center / 100% 100% no-repeat; }
.rnd.green { background-image: var(--ui-round_green); } .rnd.blue { background-image: var(--ui-round_blue); } .rnd.pink { background-image: var(--ui-round_pink); }
.rnd.gold { background-image: var(--ui-round_gold); } .rnd.gray { background-image: var(--ui-round_gray); } .rnd.purple { background-image: var(--ui-round_purple); } .rnd.red { background-image: var(--ui-round_red); }

.btn { position: relative; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 96px; height: 58px; padding: 0 24px 7px;
  border: 0 solid transparent; border-image: var(--ui-btn_green) 46 fill / 23px stretch; font-family: var(--display); font-size: 23px; line-height: 1; white-space: nowrap; transition: transform 0.08s, filter 0.08s; --sc: #12501f; }
.btn > * { pointer-events: none; }
.btn:active { transform: translateY(2px) scale(0.97); filter: brightness(0.96); }
.btn.orange { border-image-source: var(--ui-btn_orange); --sc: #6b3207; }
.btn.blue { border-image-source: var(--ui-btn_blue); --sc: #0d386b; }
.btn.purple { border-image-source: var(--ui-btn_purple); --sc: #33166b; }
.btn.pink { border-image-source: var(--ui-btn_pink); --sc: #660d24; }
.btn.gold { border-image-source: var(--ui-btn_gold); --sc: #6b4206; }
.btn.gray { border-image-source: var(--ui-btn_gray); --sc: #4a3b32; }
.btn.small { height: 48px; font-size: 19px; padding: 0 16px 6px; min-width: 70px; }
.btn.tiny { height: 40px; font-size: 16px; padding: 0 12px 5px; min-width: 56px; border-image-width: 20px; }
.btn.big { height: 72px; padding: 0 40px 9px; border-image-width: 28px; font-size: 32px; }
.btn .row { display: flex; align-items: center; justify-content: center; gap: 5px; }
.btn img.ico { width: 30px; height: 30px; margin: -6px 0; }
.btn.small img.ico { width: 26px; height: 26px; }
.btn.tiny img.ico { width: 22px; height: 22px; }
.btn[disabled], .btn.off { filter: grayscale(0.85) brightness(1.05); opacity: 0.75; pointer-events: none; }
.btn .st { --sc: inherit; }
.btn .sub { font-size: 12px; margin-top: 2px; --sw: 3px; }
.shine { overflow: hidden; }
.shine::after { content: ''; position: absolute; top: 6px; bottom: 14px; left: -40%; width: 30%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.55), transparent); transform: skewX(-18deg); animation: shine 3.2s ease-in-out infinite; pointer-events: none; }
@keyframes shine { 0%, 55% { left: -40%; } 85%, 100% { left: 120%; } }

.rbtn { width: 50px; height: 53px; display: flex; align-items: center; justify-content: center; padding-bottom: 5px; flex: none; transition: transform 0.08s; }
.rbtn img { width: 32px; height: 32px; }
.rbtn.sm { width: 44px; height: 47px; } .rbtn.sm img { width: 28px; height: 28px; }
.rbtn:active { transform: translateY(2px) scale(0.95); }

.coinbar { position: relative; display: flex; align-items: center; height: 34px; min-width: 76px; padding: 0 12px 3px 26px; margin-left: 16px; border: 0 solid transparent; border-image: var(--ui-plaque) 34 fill / 17px stretch; font-size: 18px; --sc: #5a3416; flex: none; }
.coinbar .ci { position: absolute; left: -16px; top: 50%; width: 40px; height: 40px; margin-top: -21px; }
.coinbar .val { flex: 1; text-align: center; font-size: 17px; --sw: 4px; }
.coinbar .plus { width: 24px; height: 25px; margin: 0 -9px 0 4px; background: var(--ui-round_green) center / 100% 100% no-repeat; flex: none; }
.coinbar .plus::before { content: '+'; display: block; margin-top: -1px; font: 20px/22px var(--display); color: #fff; -webkit-text-stroke: 4px #12501f; paint-order: stroke fill; text-align: center; }
.coinbar.bump { animation: bump 0.35s; }
@keyframes bump { 40% { transform: scale(1.14); } }

.ribbon { position: relative; display: inline-flex; align-items: center; justify-content: center; height: 60px; min-width: 190px; padding: 0 62px 11px; border: 0 solid transparent;
  border-image: var(--ui-ribbon_pink) 0 124 fill / 0 58px stretch; font-size: 25px; white-space: nowrap; }
.ribbon .st { --sc: #660d24; }
.ribbon.green { border-image-source: var(--ui-ribbon_green); } .ribbon.green .st { --sc: #12501f; }
.ribbon.blue { border-image-source: var(--ui-ribbon_blue); } .ribbon.blue .st { --sc: #0d386b; }
.ribbon.purple { border-image-source: var(--ui-ribbon_purple); } .ribbon.purple .st { --sc: #33166b; }
.ribbon.orange { border-image-source: var(--ui-ribbon_orange); } .ribbon.orange .st { --sc: #6b3207; }

.badge { position: absolute; top: -5px; right: -5px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px; background: linear-gradient(#ff6f86, #e8304f); color: #fff; font: 13px/17px var(--display); text-align: center; border: 2.5px solid #fff; box-shadow: 0 2px 0 rgba(90, 20, 30, 0.5); display: none; font-style: normal; z-index: 2; }
.badge.on { display: block; animation: pop 1.4s ease-in-out infinite; }
@keyframes pop { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.15); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-9deg); } 75% { transform: rotate(9deg); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes popIn { from { transform: scale(0); } }
.shake { animation: shake 0.4s; }
@keyframes shake { 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(2px); } }

.card { border: 0 solid transparent; border-image: var(--ui-card) 30 fill / 15px stretch; }

/* ---------------------------------------------------------------- loading */
#screen-loading { align-items: center; justify-content: center; background: url(../assets/images/bg/home.jpg) center / cover, #9fdcff; }
.load-wrap { width: 84%; max-width: 380px; text-align: center; margin-top: -10%; }
.load-logo { width: 100%; animation: bob 2.4s ease-in-out infinite; filter: drop-shadow(0 8px 10px rgba(60, 40, 20, 0.2)); }
.load-bar { position: relative; margin: 26px auto 10px; height: 28px; border-radius: 16px; background: #6b4424; border: 4px solid #4a2a12; box-shadow: inset 0 3px 4px rgba(0, 0, 0, 0.35), 0 3px 0 rgba(74, 42, 18, 0.35); overflow: hidden; }
.load-bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 12px; background: repeating-linear-gradient(-45deg, #ffd24a 0 12px, #ffb52e 12px 24px); box-shadow: inset 0 4px 0 rgba(255, 255, 255, 0.45); transition: width 0.2s; }
.load-pct { font-size: 24px; }
.load-msg { margin-top: 6px; font-size: 17px; min-height: 22px; --sw: 4px; }

/* ---------------------------------------------------------------- top bars */
.topbar { display: flex; align-items: center; gap: 6px; padding: calc(8px + var(--safe-t)) 10px 4px 10px; flex: none; }
.scr-title { font-size: 26px; margin-left: 4px; white-space: nowrap; }
.me { position: relative; display: flex; align-items: center; height: 46px; padding-left: 0; flex: none; }
.me .av { width: 46px; height: 46px; border-radius: 14px; overflow: hidden; border: 3px solid #fff; box-shadow: 0 0 0 2.5px var(--ink), 0 3px 0 2.5px rgba(90, 52, 22, 0.35); background: #ffe3b8; }
.me .av img { width: 100%; height: 100%; display: block; }
.me .lv { position: absolute; left: 30px; bottom: -6px; min-width: 24px; height: 24px; padding: 0 4px; border-radius: 12px; background: linear-gradient(#8ef06a, #3cb84a); border: 2.5px solid #fff; font-size: 14px; line-height: 17px; text-align: center; --sw: 3.5px; --sc: #12501f; }
.me .xpbar { position: absolute; left: 50px; bottom: 2px; width: 44px; height: 9px; border-radius: 5px; background: #6b4424; border: 2px solid #fff; overflow: hidden; display: none; }
.me .xpbar i { display: block; height: 100%; background: linear-gradient(#bff27a, #3cb84a); }
@media (min-width: 400px) { .me .xpbar { display: block; } .me { padding-right: 46px; } }

/* ---------------------------------------------------------------- home */
.home-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; display: flex; flex-direction: column; align-items: stretch; gap: clamp(6px, 1.4vh, 14px); padding: 0 12px 10px; }
.home-logo { text-align: center; flex: none; }
.home-logo img { display: block; width: min(76%, 330px); margin: -4px auto -6px; animation: bob 3s ease-in-out infinite; filter: drop-shadow(0 6px 8px rgba(70, 40, 20, 0.22)); }
.feats { display: flex; justify-content: space-around; flex: none; }
.feat { display: flex; flex-direction: column; align-items: center; width: 78px; }
.feat .ic { position: relative; width: 56px; height: 60px; display: flex; align-items: center; justify-content: center; padding-bottom: 6px; transition: transform 0.1s; }
.feat .ic img { width: 38px; height: 38px; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.18)); }
.feat:active .ic { transform: scale(0.92); }
.feat .lbl { margin-top: 0; font-size: 13px; line-height: 1.05; text-align: center; --sw: 4px; white-space: nowrap; }
.feat.ready .ic { animation: wiggle 1.2s ease-in-out infinite; }
.tile { border: 0 solid transparent; border-image: var(--ui-tile_blue) 64 fill / 30px stretch; }
.tile.purple { border-image-source: var(--ui-tile_purple); } .tile.green { border-image-source: var(--ui-tile_green); } .tile.orange { border-image-source: var(--ui-tile_orange); }
.tile.pink { border-image-source: var(--ui-tile_pink); } .tile.gold { border-image-source: var(--ui-tile_gold); }
.mode { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; transition: transform 0.1s; flex: none; }
.mode:active { transform: scale(0.97); }
.mode.big { flex: 1 1 auto; height: auto; min-height: clamp(118px, 18vh, 150px); max-height: 230px; flex-direction: row; align-items: center; justify-content: flex-start; padding: 0 14px 12px 4px; }
.mode.big .art { width: 44%; max-width: 190px; height: auto; margin: -16px 0 -8px -4px; filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.18)); }
.mode.big .txt { flex: 1; display: flex; flex-direction: column; align-items: flex-start; text-align: left; gap: 4px; min-width: 0; }
.mode.big .t1 { font-size: clamp(26px, 7.4vw, 34px); --sc: #0d386b; line-height: 1; }
.mode.big .t2 { font-size: 13.5px; --sw: 4px; --sc: #0d386b; line-height: 1.15; }
.mode.big .go { margin-top: 6px; }
.modes3 { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: 100%; gap: 8px; flex: 1 1 auto; min-height: clamp(106px, 16vh, 134px); max-height: 210px; }
.modes3 .mode { height: auto; padding: 0 4px 16px; }
.modes3 .art { position: absolute; left: 50%; top: calc(50% - 16px); width: 98%; max-width: 140px; transform: translate(-50%, -50%); filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.18)); }
.modes3 .t1 { position: relative; font-size: clamp(14px, 4.3vw, 18px); line-height: 1; white-space: nowrap; }
#m-tourney .t1 { --sc: #33166b; } #m-computer .t1 { --sc: #12501f; } #m-local .t1 { --sc: #6b3207; }
.lockt { position: absolute; top: 8px; right: 6px; font-size: 12px; --sw: 3.5px; display: none; align-items: center; gap: 2px; padding: 2px 6px 3px; border-radius: 10px; background: rgba(40, 20, 60, 0.55); }
.mode.locked .art { filter: grayscale(0.7) brightness(0.9); }
.mode.locked .lockt { display: flex; }
.chests { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 6px 6px 8px; border: 0 solid transparent; border-image: var(--ui-shelf) 60 fill / 26px stretch; flex: none; }
.chest { position: relative; height: 66px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; border-radius: 16px; background: rgba(90, 45, 15, 0.25); box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25); }
.chest img { position: absolute; top: -8px; left: 50%; width: 62px; height: 62px; margin-left: -31px; filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.25)); }
.chest .cl { position: relative; margin-bottom: 3px; font-size: 12px; --sw: 3.5px; white-space: nowrap; }
.chest.empty .cl { color: rgba(255, 240, 220, 0.8); -webkit-text-stroke: 0; text-shadow: none; font-family: var(--body); font-size: 11px; }
.chest.ready img { animation: wiggle 1s ease-in-out infinite; }
.chest.ready::after { content: ''; position: absolute; inset: -3px; border-radius: 18px; box-shadow: 0 0 0 3px #ffe066, 0 0 14px rgba(255, 220, 80, 0.9); pointer-events: none; animation: pulse 1.2s infinite; }
.chest.unlocking .cl { --sc: #0d386b; }
.navbar { position: relative; display: flex; align-items: flex-end; justify-content: space-around; height: calc(70px + var(--safe-b)); padding: 0 4px var(--safe-b); border: 0 solid transparent; border-image: var(--ui-nav) 48 fill / 24px stretch; flex: none; z-index: 5; }
.navbar button { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 70px; padding-bottom: 8px; transition: transform 0.1s; }
.navbar button img { width: 36px; height: 36px; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.2)); transition: transform 0.2s; }
.navbar button .st { font-size: 13px; --sw: 3.5px; --sc: #2a1050; margin-top: 1px; }
.navbar button.on img { width: 54px; height: 54px; transform: translateY(-10px); }
.navbar button.on .st { font-size: 15px; }
.navbar button:active { transform: scale(0.94); }
.navbar .badge { top: 4px; right: 18%; }

/* ---------------------------------------------------------------- tabs, segmented */
.tabs { display: flex; gap: 4px; padding: 4px 10px 0; flex: none; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { position: relative; flex: 1; min-width: 70px; height: 44px; display: flex; align-items: center; justify-content: center; gap: 3px; padding: 0 6px 6px; border: 0 solid transparent; border-image: var(--ui-tab_off) 34 fill / 17px stretch; font-size: 15px; white-space: nowrap; }
.tabs button img { width: 24px; height: 24px; }
.tabs button .st { --sc: #33166b; --sw: 4px; }
.tabs button.on { border-image-source: var(--ui-tab_on); transform: translateY(-2px); }
.tabs button.on .st { --sc: #6b3a06; }
.tabs .badge { top: -4px; right: -2px; }
.seg { display: flex; justify-content: center; gap: 0; margin: 8px auto 0; padding: 4px; border-radius: 22px; background: rgba(40, 60, 110, 0.25); flex: none; }
.seg button { height: 34px; padding: 0 16px 3px; border-radius: 18px; font-size: 15px; }
.seg button .st { --sw: 4px; --sc: #0d386b; }
.seg button.on { background: linear-gradient(#ffe07a, #ffb31f); box-shadow: inset 0 -3px 0 rgba(160, 90, 10, 0.4), 0 2px 0 rgba(0, 0, 0, 0.2); }
.seg button.on .st { --sc: #6b3a06; }

/* ---------------------------------------------------------------- world tour */
#screen-tour .bg, #screen-tourney .bg, #screen-shop .bg { filter: saturate(1.05); }
.tables { flex: 1; min-height: 0; display: flex; gap: 14px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; padding: 14px 9% 8px; scrollbar-width: none; -webkit-overflow-scrolling: touch; align-items: center; }
.tables::-webkit-scrollbar { display: none; }
.table { position: relative; flex: 0 0 82%; max-width: 380px; scroll-snap-align: center; display: flex; flex-direction: column; align-items: center; padding: 12px 12px 22px; max-height: 100%; }
.table .pic { position: relative; width: 100%; aspect-ratio: 2 / 1; border-radius: 18px; overflow: hidden; border: 4px solid rgba(255, 255, 255, 0.9); box-shadow: 0 0 0 3px rgba(40, 20, 10, 0.55), 0 4px 0 3px rgba(40, 20, 10, 0.25); flex: none; }
.table .pic img { width: 100%; height: 100%; display: block; }
.table .name { margin-top: -26px; z-index: 2; height: 52px; min-width: 160px; font-size: 22px; padding: 0 50px 10px; border-image-width: 0 48px; flex: none; }
.table .info { display: flex; gap: 10px; width: 100%; margin-top: 6px; flex: none; }
.table .info > div { flex: 1; padding: 5px 6px 8px; text-align: center; font-size: 12px; color: var(--ink2); }
.table .info b { display: flex; align-items: center; justify-content: center; gap: 4px; font: 22px/1.1 var(--display); color: var(--ink); }
.table .info img { width: 26px; height: 26px; }
.table .pz b { color: #1f8a3c; }
.table .go { margin-top: 10px; min-width: 60%; flex: none; }
.table .lockveil { position: absolute; inset: 6px 6px 14px; border-radius: 24px; background: rgba(40, 25, 60, 0.55); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; z-index: 3; }
.table .lockveil img { width: 64px; height: 64px; }
.table .lockveil .st { font-size: 20px; }
.dots { display: flex; justify-content: center; gap: 6px; padding: 2px 0 4px; flex: none; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(40, 60, 110, 0.3); transition: all 0.2s; }
.dots i.on { width: 22px; border-radius: 5px; background: #fff; box-shadow: 0 0 0 2px rgba(40, 60, 110, 0.4); }
.mode-tip { margin: 0 14px calc(12px + var(--safe-b)); padding: 8px 12px 9px; border-radius: 16px; background: rgba(255, 250, 238, 0.94); border: 2.5px solid var(--ink); font-size: 13.5px; line-height: 1.3; text-align: center; display: flex; align-items: center; gap: 8px; flex: none; }
.mode-tip img { width: 30px; height: 30px; flex: none; }

/* ---------------------------------------------------------------- tournament */
.k-body { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; align-items: center; justify-content: safe center; padding: 6px 12px calc(14px + var(--safe-b)); gap: clamp(8px, 1.6vh, 16px); }
.k-hero { position: relative; width: 100%; display: flex; align-items: center; gap: 8px; padding: 10px 14px 18px; }
.k-hero img.tr { width: 96px; height: 96px; flex: none; animation: bob 2s infinite; }
.k-hero .tx { flex: 1; text-align: left; }
.k-hero h3 { margin: 0; font: 24px/1.1 var(--display); color: #fff; -webkit-text-stroke: 5px #33166b; paint-order: stroke fill; text-shadow: 0 2px 0 #33166b; }
.k-hero p { margin: 4px 0 0; font-size: 13px; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); }
.k-prizes { display: flex; gap: 8px; width: 100%; }
.k-prizes > div { flex: 1; padding: 6px 4px 8px; text-align: center; font-size: 11.5px; color: var(--ink2); }
.k-prizes b { display: flex; justify-content: center; align-items: center; gap: 3px; font: 18px var(--display); color: var(--ink); }
.k-prizes img { width: 22px; height: 22px; }
.bracket { position: relative; width: 100%; display: grid; grid-template-columns: 1fr 1fr 1fr 1fr 1fr; align-items: stretch; gap: 0; padding: 14px 6px 16px; min-height: clamp(260px, 40vh, 380px); }
.blines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.blines path { fill: none; stroke: rgba(138, 90, 54, 0.4); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.blines path.w { stroke: #f5a316; stroke-width: 4; }
.bcol { position: relative; z-index: 1; }
.bcol { display: flex; flex-direction: column; justify-content: space-around; height: 100%; gap: 6px; }
.bslot { position: relative; display: flex; flex-direction: column; align-items: center; font-size: 10px; color: var(--ink2); }
.bslot .a { width: clamp(40px, 6vh, 50px); height: clamp(40px, 6vh, 50px); border-radius: 12px; overflow: hidden; border: 2.5px solid #fff; box-shadow: 0 0 0 2px var(--ink); background: #e8dccb; }
.bslot .a img { width: 100%; height: 100%; display: block; }
.bslot.me .a { box-shadow: 0 0 0 2.5px #ff5b8a, 0 0 10px rgba(255, 90, 140, 0.8); }
.bslot.out .a { filter: grayscale(1); opacity: 0.55; }
.bslot .n { max-width: 58px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.bslot.empty .a { background: rgba(255, 255, 255, 0.5); border-style: dashed; }
.bcol.final { justify-content: center; }
.bcol.final .bslot .a { width: clamp(50px, 7.5vh, 62px); height: clamp(50px, 7.5vh, 62px); }
.bslot.empty .a { background: rgba(255, 255, 255, 0.7); }
.bcol .cup { width: 60px; height: 60px; margin: 0 auto; }
.k-round { font: 20px var(--display); color: #fff; -webkit-text-stroke: 5px #33166b; paint-order: stroke fill; text-shadow: 0 2px 0 #33166b; }

/* ---------------------------------------------------------------- shop */
.shop-list { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 10px 12px calc(16px + var(--safe-b)); align-content: start; }
.item { position: relative; display: flex; flex-direction: column; align-items: center; padding: 8px 6px 10px; text-align: center; }
.item .prev { position: relative; width: 100%; height: 108px; display: flex; align-items: center; justify-content: center; }
.item .prev img { max-width: 100%; max-height: 100%; }
.item .prev .pets { display: grid; grid-template-columns: 1fr 1fr; gap: 0; width: 104px; }
.item .prev .pets img { width: 52px; height: 52px; }
.item .prev img.bd { width: 104px; height: 104px; border-radius: 10px; box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25); }
.item .prev .dicepair { display: flex; gap: 6px; }
.item .prev .dicepair img { width: 50px; height: 50px; border-radius: 10px; box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35), 0 3px 4px rgba(0, 0, 0, 0.25); }
.item .prev .dicepair img:nth-child(2) { transform: rotate(10deg) translateY(10px); }
.item .nm { font: 16px/1.1 var(--display); margin: 6px 0 6px; color: var(--ink); }
.item .btn { width: 100%; }
.item.eq::before { content: ''; position: absolute; inset: 0; border-radius: 18px; box-shadow: 0 0 0 3px #3cb84a, 0 0 12px rgba(60, 184, 74, 0.55); pointer-events: none; }
.item .tag { position: absolute; top: 4px; left: 4px; padding: 1px 7px 2px; border-radius: 9px; background: #ff4f6d; color: #fff; font-size: 11px; border: 2px solid #fff; z-index: 2; }
.item .tag.g { background: #3cb84a; }
.item.wide { grid-column: span 2; flex-direction: row; gap: 10px; text-align: left; padding: 8px 10px 10px; }
.item.wide .prev { width: 84px; height: 72px; flex: none; }
.item.wide .mid { flex: 1; min-width: 0; }
.item.wide .nm { margin: 0 0 2px; }
.item.wide p { margin: 0; font-size: 12.5px; color: var(--ink2); line-height: 1.25; font-weight: 500; }
.item.wide .btn { width: auto; min-width: 104px; flex: none; }
.shop-note { grid-column: span 2; text-align: center; font-size: 12px; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); }

/* ---------------------------------------------------------------- match */
#screen-match { justify-content: space-between; }
#g-top { display: flex; align-items: center; gap: 8px; padding: calc(6px + var(--safe-t)) 10px 0; flex: none; }
.g-center { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
.g-prize { position: relative; display: flex; align-items: center; height: 34px; min-width: 110px; padding: 0 14px 3px 30px; border: 0 solid transparent; border-image: var(--ui-plaque_dark) 34 fill / 17px stretch; }
.g-prize .ci { position: absolute; left: -12px; top: 50%; width: 40px; height: 40px; margin-top: -21px; }
.g-prize .val { flex: 1; text-align: center; font-size: 18px; --sw: 4px; --sc: #3a1c08; }
.g-prize.noicon { padding-left: 14px; } .g-prize.noicon .ci { display: none; }
.g-mode { font-size: 13px; --sw: 3.5px; --sc: #3a1c08; }
.g-mid { flex: 1; display: flex; flex-direction: column; justify-content: center; min-height: 0; }
.g-row { display: flex; justify-content: space-between; align-items: center; padding: 0 8px; flex: none; }
.corner { position: relative; width: 48%; display: flex; }
.corner[data-c="2"], .corner[data-c="3"] { justify-content: flex-end; }
#g-boardwrap { position: relative; margin: 0 auto; flex: none; }
#g-board { display: block; touch-action: none; filter: drop-shadow(0 6px 10px rgba(30, 20, 10, 0.3)); }
#g-banner { position: absolute; left: 50%; top: 50%; z-index: 4; transform: translate(-50%, -50%) scale(0.6); padding: 10px 22px 13px; border-radius: 22px; background: rgba(58, 32, 14, 0.9); border: 3px solid #ffe2a8; color: #fff; font: 22px var(--display); white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.25s cubic-bezier(0.2, 1.5, 0.4, 1); text-align: center; }
#g-banner.on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
#g-banner small { display: block; font: 600 13px var(--body); opacity: 0.9; margin-top: 2px; }

/* player panel */
.pp { position: relative; display: flex; align-items: center; gap: 6px; }
.corner[data-c="2"] .pp, .corner[data-c="3"] .pp { flex-direction: row-reverse; }
.pp .av { position: relative; width: var(--av, 58px); height: var(--av, 58px); flex: none; transition: transform 0.2s; }
.pp .av .face { position: absolute; inset: 5px; width: calc(100% - 10px); height: calc(100% - 10px); border-radius: 50%; object-fit: cover; background: #fff; }
.pp .av .frame { position: absolute; inset: 0; width: 100%; height: 100%; }
.pp .av svg { position: absolute; inset: -5px; width: calc(100% + 10px); height: calc(100% + 10px); transform: rotate(-90deg); pointer-events: none; }
.pp .av svg circle { fill: none; stroke-width: 6; stroke-linecap: round; }
.pp .av svg .tr { stroke: rgba(0, 0, 0, 0.18); }
.pp .av svg .tm { stroke: #5fe06a; transition: stroke 0.3s; }
.pp .av svg.warn .tm { stroke: #ff4f5e; }
.pp .av svg.mid .tm { stroke: #ffc93a; }
.pp .nmt { position: absolute; left: 50%; bottom: -12px; transform: translateX(-50%); max-width: 92px; padding: 1px 8px 3px; border-radius: 10px; background: var(--pc, #ff6d80); border: 2.5px solid #fff; box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25); font-size: 11.5px; line-height: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; --sw: 3px; --sc: var(--pd, #7c1b34); z-index: 2; }
.pp .lvb { position: absolute; top: -4px; left: -4px; min-width: 22px; height: 22px; padding: 0 3px; border-radius: 11px; background: linear-gradient(#8ef06a, #3cb84a); border: 2px solid #fff; font-size: 12px; line-height: 17px; text-align: center; --sw: 3px; --sc: #12501f; z-index: 2; }
.corner[data-c="2"] .pp .lvb, .corner[data-c="3"] .pp .lvb { left: auto; right: -4px; }
.pp.turn .av { transform: scale(1.08); }
.pp.turn .av::before { content: ''; position: absolute; inset: -9px; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 245, 170, 0.85), rgba(255, 220, 80, 0)); animation: pulse 1s infinite; }
.pp.done .av .face { filter: saturate(1.1); }
.pp.gone .av { filter: grayscale(1); opacity: 0.6; }
.pp .rk { position: absolute; top: -10px; right: -10px; width: 34px; height: 34px; z-index: 3; display: none; }
.corner[data-c="2"] .pp .rk, .corner[data-c="3"] .pp .rk { right: auto; left: -10px; }
.pp.done .rk { display: block; animation: popIn 0.5s cubic-bezier(0.2, 1.6, 0.4, 1); }
.pp .rk span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 15px; --sw: 3.5px; padding-bottom: 2px; }
.dslot { position: relative; width: var(--ds, 58px); height: var(--ds, 58px); flex: none; border-radius: 16px; display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, 0.28); box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.18); opacity: 0; transition: opacity 0.2s, background 0.2s; }
.pp.turn .dslot { opacity: 1; background: rgba(255, 250, 230, 0.95); box-shadow: 0 0 0 3px var(--pc), 0 3px 0 3px rgba(0, 0, 0, 0.18); }
.pp.turn.human.can .dslot { cursor: pointer; animation: pulse 0.9s infinite; box-shadow: 0 0 0 3px var(--pc), 0 0 16px 4px rgba(255, 230, 90, 0.95); }
.dslot .tap { position: absolute; top: -22px; left: 50%; transform: translateX(-50%); font-size: 15px; --sw: 4px; --sc: #6b3a06; white-space: nowrap; display: none; animation: bob 0.8s infinite; pointer-events: none; }
.pp.turn.human.can .dslot .tap { display: block; }
.pp .bub { position: absolute; bottom: calc(100% + 6px); left: 0; z-index: 8; padding: 6px 10px 7px; border-radius: 16px; background: #fff; border: 3px solid var(--ink); box-shadow: 0 3px 0 rgba(90, 52, 22, 0.3); font-size: 14px; white-space: nowrap; opacity: 0; transform: scale(0.5); transform-origin: 20% 100%; transition: opacity 0.2s, transform 0.3s cubic-bezier(0.2, 1.6, 0.4, 1); pointer-events: none; }
.pp .bub img { display: block; width: 64px; height: 64px; margin: -6px -4px; }
.pp .bub.on { opacity: 1; transform: scale(1); }
.corner[data-c="2"] .pp .bub, .corner[data-c="3"] .pp .bub { left: auto; right: 0; transform-origin: 80% 100%; }
#g-row-top .pp .bub { bottom: auto; top: calc(100% + 16px); transform-origin: 20% 0; }
#g-row-top .corner[data-c="2"] .pp .bub { transform-origin: 80% 0; }
.pp .hitgift { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; z-index: 6; pointer-events: none; animation: giftStick 1.6s ease-out forwards; }
@keyframes giftStick { 0% { transform: scale(1.4); } 15% { transform: scale(0.9); } 70% { opacity: 1; } 100% { opacity: 0; transform: scale(0.9) translateY(10px); } }
.pp.hit .av { animation: shake 0.45s; }

/* dice: a flat, front-facing die (js/dice.js) — one clear face, chunky edge, number badge after landing */
.dice { position: relative; width: var(--dsz, 46px); height: var(--dsz, 46px); }
.dice .dshadow { position: absolute; left: 8%; right: 8%; bottom: -7px; height: 11px; border-radius: 50%; background: radial-gradient(rgba(40, 25, 15, 0.38), rgba(40, 25, 15, 0) 70%); }
.dice .dbody { position: absolute; inset: 0; display: block; border-radius: 22%; transform-origin: 50% 60%; }
.dice .dface { display: block; width: 100%; height: 100%; border-radius: 22%; box-shadow: 0 0 0 2.5px rgba(45, 30, 40, 0.55), 0 4px 0 2px var(--dedge, #aab2c8), 0 4px 0 4.5px rgba(45, 30, 40, 0.55); }
.dice .dnum { position: absolute; right: -9px; bottom: -9px; min-width: 24px; height: 24px; padding: 0 4px; border-radius: 12px; background: #fff; border: 2.5px solid var(--ink); color: var(--ink); font: 16px/19px var(--display); text-align: center; opacity: 0; transform: scale(0.3); transition: opacity 0.15s, transform 0.25s cubic-bezier(0.2, 1.8, 0.4, 1); pointer-events: none; z-index: 2; }
.dice.hasnum .dnum { opacity: 1; transform: none; }
.dice.six .dnum { background: linear-gradient(#fff39a, #ffc93a); }
.dice.ready .dbody { animation: dready 1.1s ease-in-out infinite; }
@keyframes dready { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg) translateY(-3px); } }
.dice.landed .dbody { animation: dland 0.3s; }
@keyframes dland { 40% { transform: scale(1.1); } }
.dice.six::after { content: ''; position: absolute; inset: -12px; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 240, 150, 0.9), rgba(255, 220, 80, 0)); animation: pulse 0.6s 2; pointer-events: none; z-index: -1; }

/* boosters */
#g-boosters { display: flex; justify-content: center; gap: 12px; padding: 4px 10px calc(8px + var(--safe-b)); flex: none; }
#g-boosters.hide { visibility: hidden; }
.booster { position: relative; width: 74px; height: 66px; display: flex; align-items: center; justify-content: center; border: 0 solid transparent; border-image: var(--ui-tile_purple) 64 fill / 22px stretch; padding-bottom: 8px; transition: transform 0.1s, filter 0.2s; }
.booster img.bi { width: 50px; height: 50px; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.2)); }
.booster .cnt { position: absolute; top: -7px; right: -6px; min-width: 24px; height: 24px; padding: 0 5px; border-radius: 12px; background: linear-gradient(#ff6f86, #e8304f); color: #fff; font: 14px/19px var(--display); text-align: center; border: 2.5px solid #fff; box-shadow: 0 2px 0 rgba(90, 20, 30, 0.45); font-style: normal; }
.booster .cnt.plus { background: linear-gradient(#8ef06a, #3cb84a); font-size: 18px; line-height: 18px; }
.booster .lbl { position: absolute; bottom: -8px; font-size: 13px; --sw: 3.5px; --sc: #33166b; white-space: nowrap; }
.booster:active { transform: translateY(2px) scale(0.95); }
.booster.dim { filter: grayscale(0.8) brightness(1.05); opacity: 0.7; }
.booster.on { transform: translateY(-4px); filter: drop-shadow(0 0 10px rgba(255, 230, 90, 0.95)); }
.booster.use { animation: boostUse 0.5s; }
@keyframes boostUse { 30% { transform: scale(1.18) rotate(-8deg); } 60% { transform: scale(0.95) rotate(4deg); } }

/* tip bubble in the match */
#g-tip { position: absolute; left: 12px; right: 12px; z-index: 6; display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 8px; border-radius: 20px; background: #fffdf6; border: 3px solid var(--ink); box-shadow: 0 4px 0 rgba(90, 52, 22, 0.35), 0 8px 18px rgba(0, 0, 0, 0.15); font-size: 14.5px; line-height: 1.3; opacity: 0; transform: translateY(8px) scale(0.96); transition: opacity 0.2s, transform 0.25s; pointer-events: none; }
#g-tip.on { opacity: 1; transform: none; }
#g-tip .av { flex: none; width: 46px; height: 46px; border-radius: 14px; overflow: hidden; border: 2.5px solid var(--ink); }
#g-tip .av img { width: 100%; height: 100%; display: block; }
#g-tip .txt b { color: #e0487a; }

/* sticker sheet */
#g-sheet { position: absolute; left: 8px; right: 8px; bottom: calc(8px + var(--safe-b)); z-index: 20; padding: 12px 12px 14px; border: 0 solid transparent; border-image: var(--ui-panel) 92 fill / 40px stretch; transform: translateY(120%); transition: transform 0.28s cubic-bezier(0.2, 1.2, 0.4, 1); }
#g-sheet.on { transform: none; }
#g-sheet .emg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
#g-sheet .emg button { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 16px; transition: transform 0.1s; }
#g-sheet .emg button:active { transform: scale(0.9); background: rgba(255, 200, 120, 0.3); }
#g-sheet .emg img { width: 86%; }
#g-sheet .phr { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; }
#g-sheet .phr button { height: 38px; border-radius: 14px; background: #fff; border: 2.5px solid #e6cfae; font-size: 13.5px; color: var(--ink); box-shadow: 0 2px 0 #e6cfae; }
#g-sheet .phr button:active { transform: translateY(2px); box-shadow: none; }
#g-sheet .shx { position: absolute; top: -10px; right: -4px; width: 42px; height: 45px; display: flex; align-items: center; justify-content: center; padding-bottom: 5px; }
#g-sheet .shx img { width: 24px; height: 24px; }

/* magic dice picker */
.pick6 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 6px 4px; }
.pick6 button { aspect-ratio: 1; border-radius: 18%; overflow: hidden; box-shadow: 0 0 0 3px var(--ink), 0 4px 0 3px rgba(90, 52, 22, 0.35); transition: transform 0.1s; }
.pick6 button img { width: 100%; height: 100%; display: block; }
.pick6 button:active { transform: scale(0.92); }
.pick6 button[disabled] { filter: grayscale(1); opacity: 0.45; }

/* ---------------------------------------------------------------- result */
.r-body { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; align-items: center; justify-content: safe center; padding: calc(24px + var(--safe-t)) 14px calc(14px + var(--safe-b)); gap: 8px; }
.r-top { position: relative; width: 100%; height: 170px; display: flex; align-items: flex-end; justify-content: center; flex: none; }
.r-top .rays { position: absolute; left: 50%; top: 50%; width: 360px; height: 360px; margin: -190px 0 0 -180px; background: var(--ui-rays) center / contain no-repeat; animation: spin 14s linear infinite; }
.r-top .hero { position: relative; width: 132px; height: 132px; animation: bob 1.6s infinite; }
.r-top .hero .face { width: 100%; height: 100%; border-radius: 30px; border: 5px solid #fff; box-shadow: 0 0 0 4px var(--ink), 0 6px 0 4px rgba(90, 52, 22, 0.35); }
.r-top .hero .crown { position: absolute; top: -46px; left: 50%; width: 76px; height: 76px; margin-left: -38px; transform: rotate(-8deg); }
.r-top .pet { position: absolute; bottom: 0; width: 70px; height: 70px; animation: bob 1s infinite; }
.r-top .pet.l { left: 8%; } .r-top .pet.r { right: 8%; animation-delay: 0.4s; }
.r-title { margin-top: -18px; z-index: 2; flex: none; }
.r-rank { width: 100%; display: flex; flex-direction: column; gap: 6px; flex: none; }
.rrow { display: flex; align-items: center; gap: 8px; padding: 5px 12px 8px 8px; font-size: 15px; }
.rrow .md { width: 34px; height: 34px; flex: none; display: flex; align-items: center; justify-content: center; font: 18px var(--display); color: #fff; border-radius: 50%; background: #c9b8a6; border: 2.5px solid #fff; box-shadow: 0 0 0 2px var(--ink); -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; }
.rrow .md.m1 { background: linear-gradient(#fff08a, #f5a316); } .rrow .md.m2 { background: linear-gradient(#f4f7ff, #aab6cc); } .rrow .md.m3 { background: linear-gradient(#ffc79a, #d9803e); }
.rrow .a { width: 40px; height: 40px; border-radius: 12px; overflow: hidden; flex: none; box-shadow: 0 0 0 2.5px var(--pc, #ccc); }
.rrow .a img { width: 100%; height: 100%; display: block; }
.rrow .nm { flex: 1; min-width: 0; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rrow .nm small { display: block; font-size: 11.5px; color: var(--ink2); font-weight: 500; }
.rrow .pz { display: flex; align-items: center; gap: 3px; font: 17px var(--display); color: #1f8a3c; }
.rrow .pz img { width: 24px; height: 24px; }
.rrow.me { box-shadow: 0 0 0 3px #ff5b8a; border-radius: 16px; }
.r-rew { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 14px; margin-top: 6px; flex: none; }
.r-xp { width: 100%; max-width: 320px; display: flex; align-items: center; gap: 8px; flex: none; }
.r-xp .lvn { font: 18px var(--display); color: #fff; -webkit-text-stroke: 4px #12501f; paint-order: stroke fill; }
.r-xp .bar { flex: 1; height: 18px; border-radius: 10px; background: #6b4424; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--ink); overflow: hidden; }
.r-xp .bar i { display: block; height: 100%; width: 0; background: linear-gradient(#bff27a, #3cb84a); transition: width 1s ease-out; }
.r-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; width: 100%; margin-top: 8px; flex: none; }
.r-btns .btn { flex: 1 1 40%; }
.r-btns .btn.full { flex-basis: 100%; }

/* ---------------------------------------------------------------- fx / toast / cover */
#fx { position: absolute; inset: 0; z-index: 55; pointer-events: none; }
#toast { position: absolute; left: 50%; top: 42%; z-index: 60; transform: translate(-50%, -50%) scale(0.8); max-width: 86%; padding: 10px 20px 12px; border-radius: 20px; background: rgba(58, 32, 14, 0.92); border: 3px solid #ffe2a8; color: #fff; font-size: 16px; text-align: center; opacity: 0; transition: opacity 0.2s, transform 0.2s; pointer-events: none; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25); }
#toast.on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
#cover { position: absolute; inset: 0; z-index: 70; background: #fff6e3; opacity: 0; pointer-events: none; transition: opacity 0.22s; }
#cover.on { opacity: 1; pointer-events: auto; }
#rotate { display: none; }
@media (orientation: landscape) and (max-height: 500px) and (pointer: coarse) {
  #rotate { display: flex; position: fixed; inset: 0; z-index: 999; align-items: center; justify-content: center; text-align: center; background: #fff6e3; font-size: 20px; }
  #rotate img { width: 120px; }
}
.flyer { position: absolute; z-index: 58; pointer-events: none; }

/* ---------------------------------------------------------------- matchmaking */
.mm { position: absolute; inset: 0; z-index: 45; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: rgba(30, 20, 60, 0.72); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: fadeIn 0.2s both; }
.mm h2 { margin: 0; font: 28px var(--display); color: #fff; -webkit-text-stroke: 5px #33166b; paint-order: stroke fill; text-shadow: 0 3px 0 #33166b; }
.mm .sub { color: #fff; font-size: 14px; opacity: 0.9; margin-top: -8px; }
.mm .slots { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; width: 94%; max-width: 420px; }
.mm .slots.four { grid-template-columns: 1fr 1fr; gap: 16px 24px; width: 80%; }
.mm .ps { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.mm .ps .a { width: 88px; height: 88px; border-radius: 26px; overflow: hidden; border: 4px solid #fff; box-shadow: 0 0 0 3px var(--pc, #ff6d80), 0 6px 0 3px rgba(0, 0, 0, 0.3); background: #fff; }
.mm .ps .a img { width: 100%; height: 100%; display: block; }
.mm .ps .a.spin img { animation: slot 0.12s linear infinite; }
@keyframes slot { 0% { transform: translateY(-30%); opacity: 0.6; } 100% { transform: translateY(30%); opacity: 0.6; } }
.mm .ps .n { font: 17px var(--display); color: #fff; -webkit-text-stroke: 4px #2a1050; paint-order: stroke fill; max-width: 130px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mm .ps .l { font-size: 12px; color: #fff; opacity: 0.9; display: flex; align-items: center; gap: 4px; }
.mm .ps .l img { width: 18px; height: 18px; }
.mm .vs { font: 46px var(--display); color: #ffe066; -webkit-text-stroke: 7px #7a2a06; paint-order: stroke fill; animation: pulse 0.8s infinite; }
.mm .pot { display: flex; align-items: center; gap: 6px; padding: 6px 18px 8px 10px; border-radius: 22px; background: rgba(0, 0, 0, 0.35); font: 22px var(--display); color: #fff; -webkit-text-stroke: 4px #3a1c08; paint-order: stroke fill; }
.mm .pot img { width: 36px; height: 36px; }
.mm .cancel { margin-top: 10px; }

/* ---------------------------------------------------------------- dialogs */
#modal { position: absolute; inset: 0; z-index: 50; display: none; align-items: center; justify-content: center; padding: 30px 14px 14px; background: rgba(40, 22, 10, 0.55); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
#modal.on { display: flex; animation: fadeIn 0.2s both; }
@keyframes fadeIn { from { opacity: 0; } }
.dlg { position: relative; width: 100%; max-width: 370px; max-height: calc(100% - 16px); display: flex; flex-direction: column; padding: 44px 24px 26px; text-align: center; border: 0 solid transparent; border-image: var(--ui-panel) 92 fill / 46px stretch; filter: drop-shadow(0 10px 18px rgba(30, 15, 5, 0.35)); animation: dlgIn 0.4s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
.dlg.out { animation: dlgOut 0.18s ease-in both; pointer-events: none; }
@keyframes dlgIn { from { transform: scale(0.6) translateY(30px); opacity: 0; } }
@keyframes dlgOut { to { transform: scale(0.85); opacity: 0; } }
.dlg > .ribbon { position: absolute; top: -30px; left: 50%; transform: translateX(-50%); max-width: 104%; z-index: 2; }
.dlg > .x { position: absolute; top: -14px; right: -8px; width: 46px; height: 49px; z-index: 3; display: flex; align-items: center; justify-content: center; padding-bottom: 5px; }
.dlg > .x img { width: 26px; height: 26px; }
.dlg > .x:active { transform: scale(0.92); }
.dlg .body { overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; min-height: 0; padding: 6px 2px 4px; margin: 0 -2px; }
.dlg .btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 14px; flex: none; }
.dlg .btns .btn { flex: 1 1 40%; min-width: 0; }
.dlg .btns .btn.full { flex-basis: 100%; }
.dlg p { margin: 8px 0; font-size: 15.5px; line-height: 1.35; }
.dlg .muted { color: var(--ink2); font-size: 13.5px; font-weight: 500; }
.dlg h3 { margin: 6px 0 4px; font: 22px var(--display); }
.dlg.wide { max-width: 420px; }

.glowbox { position: relative; width: 170px; height: 150px; margin: -4px auto 0; }
.glowbox::before { content: ''; position: absolute; left: 50%; top: 50%; width: 260px; height: 260px; margin: -130px 0 0 -130px; background: var(--ui-rays) center / contain no-repeat; animation: spin 12s linear infinite; opacity: 0.85; }
.glowbox img { position: relative; width: 150px; height: 150px; animation: popIn 0.6s cubic-bezier(0.2, 1.6, 0.4, 1) both; }
.glowbox.sm { height: 120px; } .glowbox.sm img { width: 120px; height: 120px; }
.prizes { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px 16px; margin-top: 10px; }
.prize { position: relative; display: inline-flex; align-items: center; height: 44px; padding: 0 14px 4px 42px; border: 0 solid transparent; border-image: var(--ui-plaque) 34 fill / 17px stretch; font-size: 21px; animation: popIn 0.5s both; }
.prize img { position: absolute; left: -8px; top: 50%; width: 48px; height: 48px; margin-top: -26px; }
.prize.neg .st { --sc: #8a1c1c; }

/* setup dialogs (vs computer / pass & play) */
.opt { margin: 4px 0 10px; text-align: left; }
.opt h4 { margin: 0 0 5px 4px; font: 16px var(--display); color: var(--ink); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips button { flex: 1; min-width: 60px; height: 42px; padding: 0 8px 4px; border-radius: 14px; background: #fff; border: 2.5px solid #e6cfae; box-shadow: 0 3px 0 #e6cfae; font-size: 14.5px; color: var(--ink2); display: flex; align-items: center; justify-content: center; gap: 4px; }
.chips button img { width: 24px; height: 24px; }
.chips button.on { background: linear-gradient(#ffe07a, #ffb31f); border-color: #b86b12; box-shadow: 0 3px 0 #b86b12; color: var(--ink); }
.chips.colors button { height: 46px; }
.chips.colors button i { width: 26px; height: 26px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.3); }
.chips.colors button.on i { box-shadow: 0 0 0 2px var(--ink), 0 0 8px rgba(255, 255, 255, 0.9); }
.opt .hint { font-size: 12.5px; color: var(--ink2); margin: 5px 4px 0; font-weight: 500; line-height: 1.3; }

/* settings */
.set-list { display: flex; flex-direction: column; gap: 8px; text-align: left; }
.set-row { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 4px 12px 7px 8px; }
.set-row img { width: 36px; height: 36px; flex: none; }
.set-row .nm { flex: 1; font-size: 16.5px; }
.set-row .nm small { display: block; font-size: 12px; color: var(--ink2); font-weight: 500; }
.set-row.link { cursor: pointer; }
.set-row.link .go { font: 26px/1 var(--display); color: var(--ink2); }
.switch { position: relative; width: 60px; height: 34px; border-radius: 17px; background: #cdbdb0; border: 3px solid var(--ink); box-shadow: inset 0 3px 3px rgba(0, 0, 0, 0.2); transition: background 0.2s; flex: none; }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%; background: linear-gradient(#fff, #efe4da); border: 2.5px solid var(--ink); transition: transform 0.2s; }
.switch.on { background: linear-gradient(#8ef06a, #3cb84a); }
.switch.on::after { transform: translateX(26px); }
.ver { margin-top: 12px; font-size: 12px; color: var(--ink2); }

/* rules */
.rules { display: flex; flex-direction: column; gap: 8px; text-align: left; }
.rule { display: flex; align-items: center; gap: 10px; padding: 7px 10px 9px 7px; }
.rule img { width: 44px; height: 44px; flex: none; }
.rule h4 { margin: 0 0 1px; font: 17px/1.1 var(--display); color: var(--ink); }
.rule p { margin: 0; font-size: 13px; line-height: 1.3; color: var(--ink2); font-weight: 500; }

/* daily */
.cal { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.day { position: relative; padding: 4px 2px 6px; font-size: 12px; }
.day .it { display: flex; justify-content: center; align-items: flex-start; gap: 2px; min-height: 52px; }
.day .it .di { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.day .it img { width: 34px; height: 34px; }
.day .it b { font: 12.5px/1 var(--display); color: var(--ink); white-space: nowrap; margin-top: 1px; }
.day .dn { font-size: 11px; color: var(--ink2); }
.day.today { border-image-source: none; border-radius: 16px; background: linear-gradient(#eaffd9, #c6f5a8); box-shadow: 0 0 0 3px #3cb84a, 0 0 14px rgba(80, 200, 80, 0.6); animation: pulse 1.4s infinite; }
.day.got { opacity: 0.55; }
.day.got::after { content: ''; position: absolute; right: 0; top: 0; width: 24px; height: 24px; background: var(--icon-check) center / contain no-repeat; }
.day.big { grid-column: span 2; }

/* wheel */
.wheel-wrap { position: relative; width: 272px; height: 272px; margin: 8px auto 0; }
.wheel-wrap .wheel { position: absolute; inset: 0; transition: transform 4.2s cubic-bezier(0.12, 0.72, 0.1, 1); }
.wheel-wrap .wheel > img { width: 100%; height: 100%; display: block; }
.wheel-wrap .seg { position: absolute; left: 50%; top: 50%; width: 60px; height: 50%; margin-left: -30px; transform-origin: 50% 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: 26px; }
.wheel-wrap .seg > div { transform: rotate(180deg); display: flex; flex-direction: column; align-items: center; }
.wheel-wrap .seg img { width: 38px; height: 38px; filter: drop-shadow(0 2px 1px rgba(0, 0, 0, 0.25)); }
.wheel-wrap .seg .st { font-size: 14px; --sw: 3.5px; margin-top: -4px; }
.wheel-wrap .ptr { position: absolute; top: -18px; left: 50%; width: 44px; margin-left: -22px; z-index: 2; filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.3)); }
.wheel-left { margin-top: 8px; font-size: 13px; color: var(--ink2); }

/* chests dialog */
.chest-time { display: inline-flex; align-items: center; gap: 6px; padding: 4px 14px 6px; border-radius: 16px; background: #fff; border: 2.5px solid #e6cfae; font: 19px var(--display); }
.chest-time img { width: 26px; height: 26px; }
.chest-note { font-size: 13px; color: var(--ink2); margin-top: 8px; }

/* missions */
.mis { display: flex; flex-direction: column; gap: 8px; text-align: left; }
.mrow { display: flex; align-items: center; gap: 10px; padding: 7px 10px 9px 8px; }
.mrow .ic { width: 44px; height: 44px; flex: none; }
.mrow .mid { flex: 1; min-width: 0; }
.mrow .t { font-size: 14.5px; line-height: 1.2; }
.mrow .pb { position: relative; height: 16px; margin-top: 4px; border-radius: 9px; background: #e6d6c0; overflow: hidden; box-shadow: inset 0 2px 2px rgba(0, 0, 0, 0.15); }
.mrow .pb i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 9px; background: linear-gradient(#bff27a, #3cb84a); }
.mrow .pb span { position: absolute; inset: 0; font-size: 11px; line-height: 16px; text-align: center; color: var(--ink); }
.mrow .rw { display: flex; flex-direction: column; align-items: center; gap: 2px; flex: none; min-width: 70px; }
.mrow .rw .q { display: flex; align-items: center; gap: 2px; font: 15px var(--display); }
.mrow .rw .q img { width: 22px; height: 22px; }
.mrow.done { opacity: 0.6; }
.mbonus { display: flex; align-items: center; gap: 10px; padding: 8px 10px 10px; border-radius: 16px; background: linear-gradient(#fff4c8, #ffe08a); border: 2.5px solid #d9941e; margin-top: 4px; }
.mbonus img { width: 50px; height: 50px; }
.mbonus .mid { flex: 1; text-align: left; font-size: 13.5px; }
.mreset { font-size: 12px; color: var(--ink2); margin-top: 8px; }

/* league + leaderboard */
.lg-top { display: flex; align-items: center; gap: 12px; text-align: left; }
.lg-top img { width: 96px; height: 96px; flex: none; }
.lg-top h3 { margin: 0; }
.lg-top .tp { display: flex; align-items: center; gap: 4px; font: 20px var(--display); }
.lg-top .tp img { width: 26px; height: 26px; }
.lg-bar { position: relative; height: 18px; margin-top: 6px; border-radius: 10px; background: #e6d6c0; overflow: hidden; box-shadow: inset 0 2px 2px rgba(0, 0, 0, 0.15); }
.lg-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(#d4b3ff, #8a5cf0); border-radius: 10px; }
.lg-bar span { position: absolute; inset: 0; font-size: 11.5px; line-height: 18px; text-align: center; }
.lg-list { display: flex; flex-direction: column; gap: 5px; margin-top: 10px; }
.lg-row { display: flex; align-items: center; gap: 8px; padding: 3px 10px 5px 6px; font-size: 13.5px; text-align: left; }
.lg-row img { width: 38px; height: 38px; }
.lg-row .nm { flex: 1; }
.lg-row .rw { display: flex; align-items: center; gap: 3px; font-size: 12px; color: var(--ink2); }
.lg-row .rw img { width: 20px; height: 20px; }
.lg-row.cur { box-shadow: 0 0 0 3px #8a5cf0; border-radius: 14px; }
.lg-row.lock { opacity: 0.6; }
.lb { display: flex; flex-direction: column; gap: 4px; }
.lbr { display: flex; align-items: center; gap: 8px; padding: 3px 10px 5px 6px; font-size: 14px; text-align: left; }
.lbr .k { width: 30px; font: 16px var(--display); text-align: center; flex: none; }
.lbr .a { width: 34px; height: 34px; border-radius: 10px; overflow: hidden; flex: none; }
.lbr .a img { width: 100%; height: 100%; display: block; }
.lbr .nm { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lbr .tr { display: flex; align-items: center; gap: 3px; font: 15px var(--display); }
.lbr .tr img { width: 20px; height: 20px; }
.lbr.me { box-shadow: 0 0 0 3px #ff5b8a; border-radius: 12px; background: #fff0f5; }
.dlg .tabs { padding: 0 0 8px; }

/* profile */
.pf-top { display: flex; align-items: center; gap: 12px; text-align: left; }
.pf-top .a { position: relative; width: 86px; height: 86px; border-radius: 24px; overflow: visible; flex: none; }
.pf-top .a img.face { width: 100%; height: 100%; border-radius: 24px; border: 4px solid #fff; box-shadow: 0 0 0 3px var(--ink); display: block; }
.pf-top .a .ed { position: absolute; right: -8px; bottom: -8px; width: 34px; height: 36px; display: flex; align-items: center; justify-content: center; padding-bottom: 3px; }
.pf-top .a .ed img { width: 20px; height: 20px; }
.pf-top .nmr { display: flex; align-items: center; gap: 6px; }
.pf-top .nmr b { font: 22px var(--display); max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-top .nmr button { width: 30px; height: 32px; display: flex; align-items: center; justify-content: center; padding-bottom: 3px; }
.pf-top .nmr button img { width: 18px; height: 18px; }
.pf-lv { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 13px; color: var(--ink2); }
.pf-lv .bar { flex: 1; height: 12px; border-radius: 7px; background: #e6d6c0; overflow: hidden; }
.pf-lv .bar i { display: block; height: 100%; background: linear-gradient(#bff27a, #3cb84a); }
.pf-lg { display: flex; align-items: center; gap: 4px; margin-top: 4px; font-size: 13px; }
.pf-lg img { width: 26px; height: 26px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 12px; }
.stat { padding: 5px 4px 8px; font-size: 11.5px; color: var(--ink2); font-weight: 500; }
.stat b { display: block; font: 21px/1.1 var(--display); color: var(--ink); }
.avgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.avgrid button { position: relative; aspect-ratio: 1; border-radius: 18px; overflow: hidden; box-shadow: 0 0 0 2.5px rgba(90, 52, 22, 0.35); }
.avgrid button img { width: 100%; height: 100%; display: block; }
.avgrid button.on { box-shadow: 0 0 0 3.5px #3cb84a, 0 0 10px rgba(60, 184, 74, 0.7); }
.avgrid button.lock img { filter: grayscale(0.9) brightness(0.8); }
.avgrid button .lk { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 12px; background: rgba(40, 25, 60, 0.35); }
.avgrid button .lk img { width: 28px; height: 28px; }
.nameinput { width: 100%; height: 48px; padding: 0 14px; border-radius: 16px; border: 3px solid var(--ink); background: #fff; font-size: 20px; font-weight: 700; color: var(--ink); text-align: center; outline: none; }

/* player card */
.pc-top { display: flex; align-items: center; gap: 12px; text-align: left; }
.pc-top img.a { width: 76px; height: 76px; border-radius: 22px; border: 4px solid #fff; box-shadow: 0 0 0 3px var(--pc, #ccc); flex: none; }
.pc-top b { font: 22px var(--display); display: block; }
.pc-top .ln { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--ink2); margin-top: 2px; }
.pc-top .ln img { width: 22px; height: 22px; }
.gifts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 12px; }
.gifts button { display: flex; flex-direction: column; align-items: center; padding: 4px 2px 6px; border-radius: 14px; background: #fff; border: 2.5px solid #e6cfae; box-shadow: 0 3px 0 #e6cfae; }
.gifts button img { width: 44px; height: 44px; }
.gifts button span { display: flex; align-items: center; gap: 1px; font: 12.5px var(--display); }
.gifts button span img { width: 16px; height: 16px; }
.gifts button:active { transform: translateY(2px); box-shadow: none; }

/* ad placeholder */
.ad-screen { position: absolute; inset: 0; z-index: 80; display: flex; flex-direction: column; align-items: center; justify-content: center; background: linear-gradient(160deg, #6a5ae0, #b06ab3); color: #fff; text-align: center; padding: 30px; }
.ad-screen .tag { position: absolute; top: calc(14px + var(--safe-t)); left: 14px; padding: 3px 10px; border-radius: 10px; background: rgba(0, 0, 0, 0.25); font-size: 13px; }
.ad-screen .cd { position: absolute; top: calc(12px + var(--safe-t)); right: 12px; min-width: 40px; height: 40px; padding: 0 14px; border-radius: 20px; background: rgba(0, 0, 0, 0.3); display: flex; align-items: center; justify-content: center; font-size: 15px; }
.ad-screen img { width: 260px; max-width: 80%; animation: bob 1.2s infinite; }
.ad-screen h2 { margin: 14px 0 6px; font: 28px var(--display); }
.ad-screen p { margin: 0; opacity: 0.9; font-size: 14px; max-width: 300px; }
.ad-screen .bar { width: 70%; height: 10px; margin-top: 20px; border-radius: 5px; background: rgba(255, 255, 255, 0.25); overflow: hidden; }
.ad-screen .bar i { display: block; height: 100%; width: 0; background: #fff; }

/* ---------------------------------------------------------------- compact phones */
@media (max-height: 700px) {
  .home-logo img { width: min(60%, 270px); }
  .feat .ic { width: 50px; height: 53px; } .feat .ic img { width: 34px; height: 34px; }
  .feat .lbl { font-size: 12px; }
  .mode.big .go { display: none; }
  .chest { height: 58px; } .chest img { width: 54px; height: 54px; margin-left: -27px; }
  .navbar { height: calc(62px + var(--safe-b)); } .navbar button { height: 62px; padding-bottom: 6px; }
  .navbar button img { width: 32px; height: 32px; } .navbar button.on img { width: 46px; height: 46px; }
  .dlg { padding: 40px 20px 22px; }
  .table .info b { font-size: 19px; }
}
@media (max-height: 600px) {
  .home-logo img { width: min(50%, 220px); }
  .feat .lbl { display: none; }
  .modes3 { min-height: 100px; }
  .mode.big { min-height: 110px; }
}
@media (max-width: 350px) {
  .coinbar { min-width: 64px; padding-right: 8px; margin-left: 14px; } .coinbar .val { font-size: 15px; }
  .feat { width: 68px; }
  .scr-title { font-size: 22px; }
}

/* ---------------------------------------------------------------- match: tall phones use the spare height
   (set by Match.layout) — bigger HUD, panels, dice and boosters instead of empty bands */
#screen-match { --dsz: 44px; }
#g-row-top { margin-bottom: 12px; }
#g-row-bot { margin-top: 2px; }
#g-boosters { padding-bottom: calc(14px + var(--safe-b)); }
#screen-match.roomy { --dsz: 54px; }
.roomy #g-top { padding-top: calc(12px + var(--safe-t)); }
.roomy .rbtn.sm { width: 52px; height: 55px; } .roomy .rbtn.sm img { width: 32px; height: 32px; }
.roomy .g-prize { height: 44px; min-width: 160px; padding-left: 36px; } .roomy .g-prize .val { font-size: 23px; }
.roomy .g-prize .ci { width: 52px; height: 52px; margin-top: -27px; left: -16px; }
.roomy .g-mode { font-size: 15px; margin-top: 2px; }
.roomy .pp { --av: 78px; --ds: 72px; gap: 8px; }
.roomy .pp .nmt { font-size: 13px; line-height: 15px; max-width: 112px; bottom: -13px; }
.roomy .pp .lvb { min-width: 26px; height: 26px; font-size: 14px; line-height: 21px; }
.roomy #g-row-top { margin-bottom: 18px; }
.roomy #g-row-bot { margin-top: 6px; }
.roomy #g-boosters { gap: 18px; padding-bottom: calc(18px + var(--safe-b)); }
.roomy .booster { width: 90px; height: 80px; } .roomy .booster img.bi { width: 62px; height: 62px; }
.roomy .booster .lbl { font-size: 14.5px; bottom: -9px; }
.roomy .booster .cnt { min-width: 28px; height: 28px; font-size: 16px; line-height: 23px; }

@media (max-width: 420px) {
  .tabs button { min-width: 0; padding: 0 3px 6px; font-size: 13.5px; }
  #s-tabs button img { display: none; }
  #t-modes button img { width: 20px; height: 20px; }
}
/* World Tour: seats preview on each table */
.table .seats { display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 8px; font-size: 13px; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); flex: none; }
.table .seats img { width: 34px; height: 34px; filter: drop-shadow(0 2px 1px rgba(0, 0, 0, 0.25)); animation: bob 1.6s ease-in-out infinite; }
.table .seats img:nth-child(2n) { animation-delay: 0.3s; }
.table .seats .st { font-size: 14px; --sw: 4px; margin-left: 4px; }
.table .pic { aspect-ratio: 640 / 420; }
.tables { align-items: stretch; }
.table { max-height: 620px; }
.table .name { margin-top: -16px; }
.table .seats { flex: 1 1 auto; min-height: 60px; flex-direction: column; justify-content: center; gap: 6px; }
.table .seats img { animation: none; filter: none; }
.table .seats .row { display: flex; align-items: center; justify-content: center; gap: 6px; }
.table .seat { position: relative; width: clamp(54px, 9vh, 76px); height: clamp(54px, 9vh, 76px); display: block; animation: bob 1.8s ease-in-out infinite; }
.table .seat:nth-child(2n) { animation-delay: 0.4s; }
.table .seats .row.four .seat { width: clamp(46px, 7vh, 60px); height: clamp(46px, 7vh, 60px); }
.table .seat .fr { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; }
.table .seat .fa { position: absolute; inset: 12%; width: 76%; height: 76%; border-radius: 50%; background: rgba(255, 255, 255, 0.85); object-fit: cover; }
.table .seats .vs { font-size: 26px; --sw: 6px; --sc: #7a2a06; color: #ffe066; margin: 0 4px; }
.table .seats .cap { font-size: 14px; --sw: 4px; text-align: center; }
.table .pic { aspect-ratio: auto; height: clamp(84px, 27vh, 236px); flex: none; }
.table .pic img { object-fit: cover; object-position: 50% 100%; }
.table .seats { min-height: 0; }
@media (max-height: 620px) {
  .table { padding-bottom: 16px; }
  .table .info { margin-top: 2px; } .table .info > div { padding: 2px 4px 4px; }
  .table .seats .cap { display: none; }
  .table .seat { width: 44px; height: 44px; } .table .seats .row.four .seat { width: 40px; height: 40px; }
  .table .go { margin-top: 4px; height: 50px; }
  .mode-tip { font-size: 12px; padding: 5px 10px 6px; margin-bottom: calc(8px + var(--safe-b)); }
  .seg { margin-top: 4px; }
}
@media (max-width: 340px) {
  .topbar { gap: 4px; padding-left: 6px; padding-right: 6px; }
  .rbtn.sm { width: 40px; height: 43px; } .rbtn.sm img { width: 24px; height: 24px; }
  .coinbar { min-width: 58px; margin-left: 12px; padding: 0 8px 3px 20px; } .coinbar .ci { width: 34px; height: 34px; margin-top: -18px; left: -13px; }
  .coinbar .plus { width: 20px; height: 21px; } .coinbar .plus::before { font-size: 17px; line-height: 19px; }
  .me .av { width: 40px; height: 40px; }
}
.table .pic { height: clamp(64px, calc(100vh - 480px), 236px); height: clamp(64px, calc(100dvh - 480px), 236px); }
.table .seats { flex: 1 0 auto; }
/* the picture takes whatever height is left (64–236 px); seats sit in the middle of any spare room */
.table { height: auto; }
.table .pic { flex: 1 1 236px; height: auto; min-height: 64px; max-height: 236px; }
.table .seats { flex: none; margin: auto 0; padding: 6px 0; }
.table .go { flex: none; }
/* glow rays stay inside the glowbox margins so dialog bodies never scroll because of them */
.glowbox { margin: 18px auto 12px; }
.glowbox::before { width: 280px; height: calc(100% + 36px); margin: 0; left: 50%; top: -18px; transform: translateX(-50%); background-size: contain; background-position: center; animation: none; }
.glowbox::after { content: ''; }
.glowbox.sm { margin-top: 14px; }
@keyframes spinR { to { rotate: 360deg; } }
.glowbox::before { animation: spinR 14s linear infinite; }

/* mode chips in the setup dialogs: 2 × 2 so every name fits */
.chips.modes { display: grid; grid-template-columns: 1fr 1fr; }
.chips.modes button { justify-content: flex-start; padding-left: 12px; }
.ad-screen.done .cd { background: #3cb84a; box-shadow: 0 0 0 3px #fff; animation: pulse 0.9s infinite; cursor: pointer; }
