/* Studio UI kit skin (shared with Chockies: Frituur Clock): wooden frames, candy buttons, cream cards, outlined lettering.
   Nine-slice margins come from assets/kit/kit.json. */
@font-face { font-family: 'Nunito'; src: url('assets/kit/fonts/Nunito-Black.woff2') format('woff2'); font-weight: 900; font-display: swap; }
@font-face { font-family: 'Nunito'; src: url('assets/kit/fonts/Nunito-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Baloo'; src: url('assets/kit/fonts/BalooBhaijaan2-ExtraBold.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Lilita One'; src: url('assets/kit/fonts/LilitaOne-Regular.woff2') format('woff2'); font-display: swap; }

:root { --ink: #3b1e0c; --outline: #3a1a08; --cream: #fff6e3; --muted: #8b6142; --kit: url('assets/kit/ui/'); }
html, body { font-family: 'Nunito', system-ui, sans-serif; font-weight: 800; }
.btn, .chip, h2, h3, .title, .sign, .tabs button, .seg button, .lbl { font-family: 'Lilita One', 'Nunito', sans-serif; font-weight: 400; }
.outlined, .btn, .sign, .tile-btn span, .chip, .tabs button.on, .big-num {
  color: #fff; -webkit-text-stroke: 4px var(--outline); paint-order: stroke fill; }
#bg { filter: none; transform: none; inset: 0; }
#bg::after { background: linear-gradient(180deg, rgba(30, 14, 4, 0.12) 0%, rgba(30, 14, 4, 0.05) 40%, rgba(30, 14, 4, 0.45) 100%); }
.ic { width: 1.25em; height: 1.25em; object-fit: contain; vertical-align: -0.25em; flex: none; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.3)); }
.ic.lg { width: 2em; height: 2em; }

/* ---------- buttons ---------- */
.btn { --h: 54px; min-height: var(--h); padding: 6px 22px 10px; border: 0; border-radius: 0; background: none; box-shadow: none; font-size: 21px;
  border-style: solid; border-color: transparent; border-width: 0;
  border-image: url('assets/kit/ui/tile_wood.webp') 0 24% fill / 0 calc(var(--h) * 0.48) stretch;
  text-shadow: 0 3px 0 rgba(30, 10, 0, 0.45); filter: drop-shadow(0 5px 4px rgba(0, 0, 0, 0.35)); transition: transform 0.08s, filter 0.08s; }
.btn:active { transform: translateY(3px) scale(0.98); box-shadow: none; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.35)); }
.btn.green, .btn.gold, .btn.red, .btn.blue, .btn.purple, .btn.orange, .btn.grey, .btn.ghost {
  border-image-slice: 45% 20% fill; border-image-width: calc(var(--h) * 0.45) calc(var(--h) * 0.53); }
.btn.green { border-image-source: url('assets/kit/ui/btn_green.webp'); }
.btn.gold { border-image-source: url('assets/kit/ui/btn_yellow.webp'); color: #fff; }
.btn.red { border-image-source: url('assets/kit/ui/btn_red.webp'); }
.btn.blue { border-image-source: url('assets/kit/ui/btn_blue.webp'); }
.btn.purple { border-image-source: url('assets/kit/ui/btn_purple.webp'); }
.btn.orange, .btn.ad { border-image-source: url('assets/kit/ui/btn_orange.webp'); border-image-slice: 45% 20% fill; border-image-width: calc(var(--h) * 0.45) calc(var(--h) * 0.53); }
.btn.grey, .btn.ghost { border-image-source: url('assets/kit/ui/btn_grey.webp'); }
.btn.light { border-image: url('assets/kit/ui/pill_cream.webp') 45% 32% fill / calc(var(--h) * 0.45) calc(var(--h) * 0.6) stretch;
  color: var(--ink); -webkit-text-stroke: 0; text-shadow: none; }
.btn.small { --h: 42px; font-size: 17px; padding: 4px 14px 7px; -webkit-text-stroke-width: 3px; }
.btn.ad::before { content: ''; width: 1.3em; height: 1.3em; background: url('assets/kit/icons/icon_video.webp') center / contain no-repeat; border-radius: 0; padding: 0; }
.btn[disabled] { filter: grayscale(0.7) brightness(0.85); opacity: 0.75; }
.icon-btn { width: 52px; height: 52px; border-radius: 0; background: url('assets/kit/ui/tile_wood_sq.webp') center / 100% 100% no-repeat;
  filter: drop-shadow(0 4px 3px rgba(0, 0, 0, 0.35)); font-size: 26px; color: #fff; }
.icon-btn img { width: 62%; height: 62%; object-fit: contain; }
.icon-btn:active { transform: translateY(2px) scale(0.96); }

/* ---------- panels ---------- */
.board { border: 0; border-image: url('assets/kit/ui/panel_wood.webp') 20% fill / 42px stretch; padding: 30px 20px 26px; filter: drop-shadow(0 8px 8px rgba(0, 0, 0, 0.35)); }
.card { background: none; box-shadow: none; border-radius: 0; border-image: url('assets/kit/ui/panel_cream.webp') 32% fill / 24px stretch; padding: 16px; color: var(--ink);
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.28)); }
.card.gold { border-image: url('assets/kit/ui/panel_card_gold.webp') 30% fill / 28px stretch; }
.card.dark { background: none; color: var(--cream); box-shadow: none; border-image: url('assets/kit/ui/panel_dark.webp') 20% fill / 30px stretch; }
.card.parchment { border-image: url('assets/kit/ui/panel_parchment.webp') 30% fill / 24px stretch; }
.sign { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 6px 44px 10px; font-size: 26px; letter-spacing: 0.5px;
  border-image: url('assets/kit/ui/sign_plank.webp') 42% 20% fill / 24px 48px stretch; text-shadow: 0 3px 0 rgba(30, 10, 0, 0.45);
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.35)); }

/* ---------- top bar ---------- */
.topbar { gap: 8px; margin-bottom: 18px; align-items: center; }
.topbar h2 { flex: 1; display: flex; justify-content: center; font-family: 'Lilita One', sans-serif; text-shadow: none; }
.topbar h2 .sign { font-size: 24px; max-width: 100%; white-space: nowrap; overflow: hidden; }
.wallet { flex-direction: column; gap: 4px; align-items: flex-end; }
.wallet .chip, .pill { display: inline-flex; align-items: center; gap: 5px; min-width: 96px; justify-content: space-between; height: 34px; padding: 0 4px 0 4px;
  border-image: url('assets/kit/ui/pill_dark.webp') 45% 20% fill / 15px 26px stretch; background: none; font-family: 'Baloo', 'Lilita One', sans-serif; font-size: 19px;
  color: #fff; -webkit-text-stroke: 0; }
.wallet .chip img.ic, .pill img.ic { width: 30px; height: 30px; margin-left: -6px; }
.wallet .chip .plus { width: 24px; height: 24px; border-radius: 50%; background: url('assets/kit/ui/circ_green.webp') center / contain no-repeat; display: inline-flex;
  align-items: center; justify-content: center; }
.wallet .chip .plus img { width: 15px; height: 15px; }

/* ---------- chips / segmented / toggles / bars ---------- */
.chip { background: none; border-image: url('assets/kit/ui/pill_dark.webp') 45% 20% fill / 13px 22px stretch; padding: 2px 14px 4px; font-size: 15px; -webkit-text-stroke: 0; color: #fff; }
.chip.gold { border-image-source: url('assets/kit/ui/btn_yellow.webp'); color: #fff; -webkit-text-stroke: 3px var(--outline); }
.chip.green { border-image-source: url('assets/kit/ui/btn_green.webp'); color: #fff; -webkit-text-stroke: 3px var(--outline); }
.seg { gap: 6px; }
.seg button { border-radius: 0; background: none; color: var(--ink); min-height: 44px; padding: 6px 14px; font-size: 17px;
  border-image: url('assets/kit/ui/panel_cell.webp') 36% fill / 16px stretch; }
.seg button.on { border-image-source: url('assets/kit/ui/panel_cell_gold.webp'); color: #fff; -webkit-text-stroke: 3px var(--outline); paint-order: stroke fill; box-shadow: none; }
.toggle input[type=checkbox] { width: 64px; height: 34px; border-radius: 0; background: url('assets/kit/ui/toggle_off.webp') center / contain no-repeat; }
.toggle input[type=checkbox]::after { display: none; }
.toggle input[type=checkbox]:checked { background: url('assets/kit/ui/toggle_on.webp') center / contain no-repeat; }
.levelbar, .progress { background: none; border-image: url('assets/kit/ui/bar_bg.webp') 45% 8% fill / 6px 10px stretch; border-radius: 0; height: 14px; overflow: visible; padding: 2px; }
.levelbar i, .progress i { border-image: url('assets/kit/ui/bar_fill_gold.webp') 45% 7% fill / 5px 8px stretch; background: none; height: 10px; min-width: 10px; }
.field > label { color: var(--muted); font-family: 'Lilita One'; font-size: 15px; }

/* ---------- tabs ---------- */
.tabs { gap: 2px; margin-bottom: -6px; position: relative; z-index: 1; padding: 0 6px; }
.tabs button { border-radius: 0; background: none; padding: 10px 16px 8px; min-height: 46px; font-size: 16px; color: #ffe7c2; -webkit-text-stroke: 3px var(--outline); paint-order: stroke fill;
  border-image: url('assets/kit/ui/tab_wood.webp') 0 20% fill / 0 26px stretch; }
.tabs button.on { border-image-source: url('assets/kit/ui/tab_wood_active.webp'); color: #fff; }

/* ---------- home ---------- */
.home { gap: 10px; }
.home-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.home-top .me { display: flex; align-items: center; gap: 8px; padding: 4px 14px 6px 4px; border-image: url('assets/kit/ui/pill_dark.webp') 45% 20% fill / 26px 30px stretch;
  color: #fff; border: 0; background: none; }
.home-top .me .lvl { font-family: 'Baloo', sans-serif; font-size: 15px; line-height: 1; }
.home-top .me .nm { font-family: 'Lilita One'; font-size: 15px; max-width: 110px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-logo { display: block; width: min(86%, 380px); margin: -6px auto -10px; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.4)); position: relative; z-index: 2; }
.home-hero { position: relative; height: 170px; margin: -6px -16px 0; }
.home-hero .mr, .home-hero .mme { position: absolute; bottom: 0; width: 44%; max-width: 210px; filter: drop-shadow(0 10px 10px rgba(0, 0, 0, 0.4)); }
.home-hero .mr { left: -2%; transform: rotate(-4deg); }
.home-hero .mme { right: -2%; transform: rotate(4deg); }
.home-hero canvas { position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); width: 46%; max-width: 230px; aspect-ratio: 230 / 150; }
.gift-ribbon { display: flex; align-items: center; gap: 8px; padding: 10px 14px; }
.gift-ribbon .grow b { font-family: 'Lilita One'; font-size: 18px; color: var(--ink); }
.play-big { --h: 84px; width: 86%; margin: 4px auto -26px; position: relative; z-index: 3; font-size: 40px; flex-direction: column; gap: 0; line-height: 1; padding-top: 4px; }
.play-big small { font-size: 17px; -webkit-text-stroke-width: 3px; }
.play-big::before { content: ''; position: absolute; left: 9%; top: 50%; width: 38px; height: 38px; transform: translateY(-55%);
  background: url('assets/kit/icons/icon_play.webp') center / contain no-repeat; }
.tile-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding-top: 30px; }
.tile-btn { position: relative; border: 0; background: none; padding: 6px 4px 8px; min-height: 104px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 0;
  border-image: url('assets/kit/ui/btn_wood.webp') 30% fill / 26px stretch; filter: drop-shadow(0 4px 3px rgba(0, 0, 0, 0.3)); }
.tile-btn:active { transform: translateY(2px) scale(0.97); }
.tile-btn img { width: 68px; height: 62px; object-fit: contain; margin-bottom: -4px; filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.35)); }
.tile-btn span { font-family: 'Lilita One'; font-size: 17px; line-height: 1.05; text-align: center; }
.tile-btn .badge { position: absolute; top: -6px; right: -4px; }
.badge-dot { width: 26px; height: 26px; background: url('assets/kit/ui/badge_red.webp') center / contain no-repeat; display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-family: 'Baloo'; font-size: 14px; }
.family-row img { width: 17%; }

/* ---------- lists, rows, items ---------- */
.list { gap: 12px; }
.table-row { background: none; box-shadow: none; border-radius: 0; border-image: url('assets/kit/ui/panel_card.webp') 32% fill / 22px stretch; padding: 10px 12px;
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.25)); }
.table-row .who b { font-family: 'Lilita One'; font-weight: 400; font-size: 19px; color: var(--ink); }
.table-row .who small { font-family: 'Nunito'; font-weight: 700; }
.club { border: 0; border-radius: 22px; box-shadow: 0 0 0 4px #f2c24b, 0 0 0 7px var(--outline), 0 10px 18px rgba(0, 0, 0, 0.4); margin: 4px 4px 8px; }
.club h3 { font-family: 'Lilita One'; font-size: 24px; color: #fff; -webkit-text-stroke: 4px var(--outline); paint-order: stroke fill; }
.club p { font-family: 'Nunito'; font-weight: 800; font-size: 13px; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8); }
.item { background: none; box-shadow: none; border-radius: 0; border-image: url('assets/kit/ui/panel_card.webp') 32% fill / 22px stretch; padding: 12px 10px;
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.25)); }
.item b { font-family: 'Lilita One'; font-weight: 400; color: var(--ink); font-size: 17px; }
.item canvas, .item .preview { border-radius: 12px; background: #e9d6b3; box-shadow: inset 0 0 0 2px rgba(120, 70, 20, 0.25); }
.offer { background: none; box-shadow: none; border-radius: 0; border-image: url('assets/kit/ui/panel_card_gold.webp') 30% fill / 28px stretch; padding: 14px 16px;
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.28)); }
.offer b { font-family: 'Lilita One'; font-weight: 400; font-size: 19px; color: var(--ink); }
.offer .emoji img { width: 60px; height: 60px; object-fit: contain; }
.fair { font-family: 'Nunito'; font-weight: 800; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7); }
.pass-cell { background: none; box-shadow: none; border-radius: 0; border-image: url('assets/kit/ui/panel_cell.webp') 36% fill / 16px stretch; font-family: 'Lilita One'; color: var(--ink); }
.pass-cell.premium { background: none; border-image-source: url('assets/kit/ui/panel_cell_gold.webp'); }
.tier-n { font-family: 'Baloo'; -webkit-text-stroke: 4px var(--outline); paint-order: stroke fill; }
.seat-slot { background: none; border-image: url('assets/kit/ui/panel_cell.webp') 36% fill / 16px stretch; border-radius: 0; }
.big-code { font-family: 'Baloo', 'Lilita One'; color: #fff; -webkit-text-stroke: 6px var(--outline); paint-order: stroke fill; letter-spacing: 10px; font-size: 50px; }
.text-input { border: 0; border-radius: 0; border-image: url('assets/kit/ui/panel_cell.webp') 36% fill / 16px stretch; background: none; font-family: 'Baloo', 'Nunito'; color: var(--ink); }
.bubble { border: 3px solid var(--outline); font-family: 'Nunito'; font-weight: 800; font-size: 16px; border-radius: 18px; }
.bubble::after { left: -11px; border-right-color: var(--outline); }
.host-line .avatar.lg { width: 96px; height: 96px; }
.avatar { border: 3px solid #f2c24b; box-shadow: 0 0 0 3px var(--outline), 0 3px 4px rgba(0, 0, 0, 0.35); background: radial-gradient(circle at 50% 35%, #bfe8ff, #6fb6e8); }

/* ---------- modal ---------- */
#modal-root .backdrop { background: rgba(20, 8, 2, 0.62); }
.modal { background: none; box-shadow: none; border-radius: 0; border-image: url('assets/kit/ui/panel_cream.webp') 32% fill / 30px stretch; padding: 30px 20px 22px;
  filter: drop-shadow(0 12px 14px rgba(0, 0, 0, 0.45)); overflow: visible; margin-top: 30px; }
.modal h2 { align-self: center; margin: -58px 0 4px; min-height: 58px; padding: 6px 46px 10px; font-family: 'Lilita One'; font-size: 30px; color: #fff;
  -webkit-text-stroke: 5px var(--outline); paint-order: stroke fill; text-shadow: 0 3px 0 rgba(30, 10, 0, 0.45);
  border-image: url('assets/kit/ui/sign_plank.webp') 42% 20% fill / 26px 50px stretch; display: inline-flex; align-items: center; white-space: nowrap; }
.modal p { font-family: 'Nunito'; font-weight: 800; color: var(--ink); }
.modal .buttons { gap: 12px; margin-top: 6px; }
.round-panel td { font-family: 'Nunito'; font-weight: 800; border-bottom: 2px dashed #e4cfa6; }
.reward-line { font-family: 'Baloo'; font-size: 30px; color: #fff; -webkit-text-stroke: 5px var(--outline); paint-order: stroke fill; gap: 18px; align-items: center; }
.reward-line img { width: 42px; height: 42px; }
.stars-row { display: flex; justify-content: center; gap: 4px; margin: -6px 0 4px; }
.stars-row img { width: 64px; height: 64px; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.35)); }
.stars-row img:nth-child(2) { width: 82px; height: 82px; margin-top: -14px; }
.stars-row img.off { filter: grayscale(1) brightness(0.55) opacity(0.6); }
#toast { font-family: 'Lilita One'; font-size: 17px; border: 3px solid #f2c24b; background: rgba(40, 18, 6, 0.94); }

/* ---------- game HUD ---------- */
.seat-chip { background: none; box-shadow: none; border-radius: 0; border-image: url('assets/kit/ui/panel_card.webp') 32% fill / 20px stretch; color: var(--ink); padding: 6px 10px 6px 6px; }
.seat-chip.turn { border-image-source: url('assets/kit/ui/panel_card_gold.webp'); box-shadow: none; filter: drop-shadow(0 0 10px rgba(255, 200, 40, 0.75)); }
.seat-chip.partner { background: none; }
.seat-chip.partner .nm { color: #1d7a45; }
.seat-chip .nm { font-family: 'Lilita One'; font-size: 16px; }
.seat-chip .sub { font-family: 'Nunito'; font-weight: 800; color: var(--muted); }
.seat-chip .score { font-family: 'Baloo'; font-size: 26px; color: #fff; -webkit-text-stroke: 5px var(--outline); paint-order: stroke fill; }
.seat-chip .avatar.sm { width: 50px; height: 50px; }
.backs i { width: 8px; height: 14px; border-radius: 2px; background: linear-gradient(180deg, #a86b3c, #5a3218); box-shadow: inset 0 0 0 1px rgba(255, 220, 170, 0.45), 0 1px 0 rgba(0, 0, 0, 0.3); }
.obj-banner { background: none; box-shadow: none; border-radius: 0; border-image: url('assets/kit/ui/panel_order_gold.webp') 24% fill / 18px stretch; padding: 8px 14px; color: var(--ink);
  font-family: 'Nunito'; font-weight: 800; font-size: 13px; }
.obj-banner b { font-family: 'Lilita One'; font-weight: 400; color: #c0392b; font-size: 15px; }
.obj-banner.claimed { background: none; border-image-source: url('assets/kit/ui/panel_order.webp'); color: #1d7a45; }
.info-row .chip { font-size: 14px; }
.me-chip { background: none; border-image: url('assets/kit/ui/pill_dark.webp') 45% 20% fill / 26px 30px stretch; border-radius: 0; padding: 4px 16px 4px 4px; font-family: 'Lilita One'; }
.me-chip .score { font-family: 'Baloo'; font-size: 22px; }
.turn-label { font-family: 'Lilita One'; font-size: 18px; color: #fff; -webkit-text-stroke: 4px var(--outline); paint-order: stroke fill; text-shadow: none; }
.timer-ring { font-family: 'Baloo'; border-radius: 10px; }
.round-sign { align-self: center; font-size: 17px; min-height: 40px; padding: 4px 34px 7px; border-image-width: 18px 36px; }

/* screen content sits on the bolted wooden board, like Frituur Clock's shop */
.topbar ~ .list, .tabs + div { border-image: url('assets/kit/ui/panel_wood.webp') 20% fill / 42px stretch; padding: 28px 16px 24px; max-width: 720px; margin: 0 auto;
  filter: drop-shadow(0 8px 8px rgba(0, 0, 0, 0.35)); }
.topbar ~ .list > h3, .pass-tier b { font-family: 'Lilita One'; color: #fff; -webkit-text-stroke: 4px var(--outline); paint-order: stroke fill; }
.title-screen { justify-content: center; gap: 10px; }
.title-screen .home-logo { width: min(92%, 420px); }
.title-screen .home-hero { height: 190px; }
.pass-cell { flex-direction: row; gap: 6px; }
.pass-cell .ic.lg { width: 34px; height: 34px; }
.btn.gold, .btn.green, .btn.red, .btn.ghost, .btn.light, .btn.blue, .btn.grey, .btn.orange, .btn.purple, .btn.small, .btn.ad { background: none; box-shadow: none; }
.btn.ghost:not(.light) { color: #fff; }
.btn.ghost.light { color: var(--ink); -webkit-text-stroke: 0; }
.home-hero canvas { width: 54%; max-width: 270px; }
.tile-btn { min-height: 118px; }
.tile-btn img { width: 84px; height: 74px; }
.tile-btn span { font-size: 18px; }
.home-hero { height: 190px; }

/* opponents as portrait cards (Frituur Clock customer-card look) */
#hud-top .hud-row { position: relative; justify-content: center; gap: 8px; padding-right: 58px; padding-left: 58px; min-height: 112px; }
#hud-top .hud-row > [data-act=menu] { position: absolute; right: 0; top: 0; }
#hud-top .hud-row > [data-act=menu] img { width: 58%; height: 58%; }
.seat-chip { flex: 0 1 140px; min-width: 0; flex-direction: column; align-items: center; gap: 2px; padding: 8px 8px 10px; text-align: center; }
.seat-chip .info { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 100%; }
.seat-chip .avatar.sm { width: 62px; height: 62px; }
.seat-chip .nm { max-width: 100%; }
.seat-chip .sub { justify-content: center; flex-wrap: wrap; }
.seat-chip .score { position: absolute; top: -8px; right: -8px; min-width: 40px; height: 34px; display: flex; align-items: center; justify-content: center; padding: 0 10px 2px;
  border-image: url('assets/kit/ui/pill_dark.webp') 45% 20% fill / 15px 18px stretch; font-size: 21px; -webkit-text-stroke: 0; }
.seat-chip .last { top: auto; bottom: -12px; right: 50%; transform: translateX(50%); white-space: nowrap; }
.seat-chip .speech { top: calc(100% + 10px); left: 50%; transform: translateX(-50%); }
.seat-chip .speech::after { left: calc(50% - 8px); }
.puzzle-hud .seat-chip, .hud-row .seat-chip:only-child { flex-basis: 220px; }
#hud-top .hud-row.puzzle-row { min-height: 0; padding-left: 0; }
.puzzle-goal { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 14px; text-align: center; }
.puzzle-goal b { font-family: 'Lilita One'; font-weight: 400; font-size: 19px; color: var(--ink); }

/* ---------- full frame: the game is laid out at 375 logical px and scaled whole (js/frame.js) ----------
   Every screen fills the frame: top bar, then one wooden board down to the bottom edge. Controls are sized for a
   thumb: segment buttons 52 px, main actions 60+ px. */
#screen { display: flex; flex-direction: column; padding: calc(10px + var(--safe-top)) 12px calc(12px + var(--safe-bottom)); }
#screen > .topbar { flex: none; width: 100%; max-width: none; margin: 0 0 12px; }
#screen > .topbar ~ .list, #screen > .tabs + div { flex: 1 0 auto; width: 100%; max-width: none; margin: 0; }
#screen > .tabs { flex: none; }
.topbar .icon-btn { width: 56px; height: 56px; }
.topbar h2 .sign { font-size: 25px; padding: 6px 30px 10px; }
.wallet .chip, .pill { height: 36px; font-size: 20px; min-width: 104px; }
.wallet .chip img.ic, .pill img.ic { width: 32px; height: 32px; }

.seg { gap: 8px; flex-wrap: nowrap; }
.seg button { flex: 1 1 0; min-width: 0; min-height: 52px; font-size: 19px; padding: 6px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.field { gap: 8px; }
.field > label { font-size: 17px; }
.hint-line { font-family: 'Nunito'; font-weight: 800; font-size: 14px; line-height: 1.25; color: var(--muted); min-height: 2.5em; }
.toggle > span { font-family: 'Lilita One'; font-size: 18px; color: var(--ink); }
.card { padding: 18px; }

/* game setup */
.list.setup { display: flex; flex-direction: column; gap: 16px; }
.setup-card { flex: 1 1 auto; justify-content: space-evenly; gap: 14px; padding: 22px 18px; }
.setup-actions { display: flex; gap: 10px; align-items: center; padding: 0 2px; }
.setup-actions .start-btn { --h: 68px; flex: 1; font-size: 32px; }
.setup-actions .icon-btn { width: 64px; height: 64px; flex: none; }

/* home: everything on one screen */
#screen > .home { flex: 1 1 auto; min-height: 0; max-width: none; width: 100%; }
.home { height: 100%; gap: 4px; margin: 0; }
.home-top .me { padding: 5px 16px 7px 5px; }
.home-top .me .nm { font-size: 17px; max-width: 130px; }
.home-top .me .lvl { font-size: 16px; }
.home-top .avatar.sm { width: 46px; height: 46px; }
.home-stage { position: relative; flex: 1 1 auto; min-height: 120px; margin: 0 -12px; }
.home-stage .home-logo { position: absolute; left: 50%; top: 0; transform: translateX(-50%); width: auto; height: 96%; max-width: 68%; object-fit: contain; margin: 0; z-index: 1; }
.home-stage .mr, .home-stage .mme { position: absolute; bottom: -26px; height: 78%; max-height: 240px; width: auto; z-index: 2; pointer-events: none;
  filter: drop-shadow(0 10px 10px rgba(0, 0, 0, 0.4)); }
.home-stage .mr { left: -4%; transform: rotate(-4deg); }
.home-stage .mme { right: -4%; transform: rotate(4deg); }
.gift-btn { position: absolute; left: 14px; top: 2px; z-index: 4; width: 70px; height: 70px; border: 0; padding: 4px 0 6px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0; background: url('assets/kit/ui/tile_wood_sq.webp') center / 100% 100% no-repeat; filter: drop-shadow(0 4px 3px rgba(0, 0, 0, 0.35)); animation: pulse 1.6s ease-in-out infinite; }
.gift-btn img { width: 40px; height: 40px; }
.gift-btn span { font-family: 'Lilita One'; font-size: 12px; line-height: 1; color: #fff; -webkit-text-stroke: 3px var(--outline); paint-order: stroke fill; }
.gift-btn .badge-dot { position: absolute; top: -8px; right: -8px; font-style: normal; }
.home .play-big { --h: 80px; width: 84%; margin: 0 auto -24px; flex: none; }
.home-board { flex: none; padding: 34px 14px 16px; }
.home-board .tile-grid { padding-top: 0; gap: 10px; }
.home-board .tile-btn { min-height: 98px; }
.gift-prize { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.ic.xl { width: 96px; height: 96px; }
.home-board .tile-btn { min-height: 90px; }
.home-board .tile-btn img { width: 78px; height: 66px; }
.home-board { padding: 30px 14px 14px; }
.seg button.on { background: none; }
.seg button { flex: 1 1 auto; min-height: 48px; }
.list.setup { padding: 24px 12px 14px; gap: 12px; }
.setup-card { padding: 16px 16px; gap: 10px; }
.setup-card .field { gap: 6px; }
.setup-card .field > label { font-size: 16px; line-height: 1.1; }
.setup-card .hint-line { min-height: 0; }
.setup-card .toggle { padding: 2px 0; }
.setup-actions { position: sticky; bottom: 0; z-index: 2; }
#screen, .modal { scrollbar-width: none; }
#screen::-webkit-scrollbar, .modal::-webkit-scrollbar { display: none; }

/* top bar: the back button and the wallet never give way to a long title; the title shrinks to fit its sign instead
   (fitSigns in js/screens.js) - owner 2026-11-23: the home button was squashed into a thin sliver */
.topbar > .icon-btn, .topbar > .wallet { flex: none; }
.topbar h2 { min-width: 0; }
.topbar h2 .sign { text-overflow: ellipsis; }

/* daily gift week (owner 2026-11-23): 7 days, each a little better; claimed days ticked, today's gift lit */
.gift-btn { animation: none; }
.gift-btn.ready { animation: pulse 1.6s ease-in-out infinite; }
.gift-week { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.gift-day { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 2px; min-height: 104px; padding: 8px 4px;
  border-image: url('assets/kit/ui/panel_cell.webp') 36% fill / 16px stretch; font-family: 'Lilita One'; color: var(--ink); text-align: center; }
.gift-day b { font-weight: 400; font-size: 15px; line-height: 1; }
.gift-day .ic.lg { width: 44px; height: 44px; }
.gift-day .amt { display: flex; align-items: center; justify-content: center; gap: 2px; font-size: 15px; line-height: 1; white-space: nowrap; }
.gift-day .amt .ic { width: 18px; height: 18px; }
.gift-day.big { grid-column: span 2; }
.gift-day.big .ic.lg { width: 60px; height: 60px; }
.gift-day.big .amt { font-size: 18px; gap: 3px; }
.gift-day.big .amt .ic { width: 22px; height: 22px; }
.gift-day.today { border-image-source: url('assets/kit/ui/panel_cell_gold.webp'); color: #fff; animation: pulse 1.6s ease-in-out infinite; }
.gift-day.today b, .gift-day.today .amt { -webkit-text-stroke: 3px var(--outline); paint-order: stroke fill; }
.gift-day.done { border-image-source: url('assets/kit/ui/panel_cell_dark.webp'); color: var(--cream); }
.gift-day.done > :not(.tick):not(.nine) { opacity: 0.5; }
.gift-day .tick { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-style: normal; }
.gift-day .tick .ic { width: 46px; height: 46px; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.45)); }
.gift-note { margin: 2px 0 0; text-align: center; font-family: 'Nunito'; font-weight: 800; font-size: 14px; line-height: 1.3; color: var(--muted); }
.topbar h2 .sign.two { white-space: normal; line-height: 1.02; text-align: center; padding-left: 22px; padding-right: 22px; }

/* match length: rounds row + points row, scores table with rounds and points */
.len-field .seg + .seg { margin-top: -2px; }
.round-panel th { font-family: 'Lilita One'; font-weight: 400; font-size: 14px; color: var(--muted); padding: 2px 4px; text-align: right; }
.score-table td:nth-child(2) { text-align: right; font-size: 17px; }
/* the setup fits a 16:9 frame with both match length rows (owner 2026-11-23: nothing hidden, nothing cramped) */
.list.setup { padding: 18px 10px 10px; gap: 10px; }
.setup-card { padding: 12px 14px; gap: 8px; }
.setup-card .field { gap: 5px; }
.setup-card .field > label { font-size: 15px; }
.setup-card .seg button { min-height: 44px; font-size: 18px; }
.len-field .seg + .seg { margin-top: 0; }
#screen > .topbar:has(~ .list.setup) { margin-bottom: 8px; }
.list.setup { padding-top: 14px; gap: 6px; }
.setup-card { padding: 10px 14px; gap: 6px; }
.setup-card .field > label { font-size: 14px; }

/* friends (Chockies accounts): your code, add by code, list with who is online, invite / join */
.card-title { font-family: 'Lilita One'; font-weight: 400; font-size: 20px; }
.friends-card { gap: 10px; }
.code-row { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border-image: url('assets/kit/ui/panel_cell.webp') 36% fill / 16px stretch; }
.code-row small { font-family: 'Nunito'; font-weight: 800; font-size: 13px; color: var(--muted); line-height: 1.1; max-width: 70px; }
.friend-code { flex: 1; font-family: 'Lilita One'; font-weight: 400; font-size: 26px; letter-spacing: 2px; text-align: center; color: var(--ink); }
.icon-btn.sm { width: 46px; height: 46px; flex: none; }
.add-row .text-input { min-width: 0; text-transform: uppercase; letter-spacing: 1px; }
.friends-list { display: flex; flex-direction: column; gap: 6px; }
.friend-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; min-height: 58px; border-image: url('assets/kit/ui/panel_cell.webp') 36% fill / 16px stretch; }
.friend-row .grow { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.friend-row b { font-family: 'Lilita One'; font-weight: 400; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.friend-row small { font-family: 'Nunito'; font-weight: 800; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.friend-row .dot { width: 9px; height: 9px; border-radius: 50%; background: #9b8a7a; flex: none; }
.friend-row.on .dot { background: #2bb673; box-shadow: 0 0 0 2px rgba(43, 182, 115, 0.25); }
.friend-row.off { opacity: 0.72; }
.friend-row.req { border-image-source: url('assets/kit/ui/panel_cell_gold.webp'); }
.friend-row .btn.small { flex: none; }
.avatar.blank { display: inline-flex; align-items: center; justify-content: center; background: #e7d6b6; }
.avatar.blank img.ic { width: 60%; height: 60%; }
.invite-card { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; font-family: 'Nunito'; font-weight: 800; }
.friend-code { font-size: 22px; letter-spacing: 1px; white-space: nowrap; }
.modal > h2 { white-space: nowrap; max-width: none; }
