/* Quadra Play: one file, by screen.
   1 Tokens   2 Base   3 Shared pieces (logos, prices, rows)
   4 首頁   5 賽事   6 A game's sheet (and the boards)   7 The slip
   8 紀錄 (slips, 戰績)   9 彩券 (tab, a game's sheet, scratch cards, tickets)
   The kit (quadra.css) draws the frames: page heads, hero cards, row cards,
   tags, rails, chips, segmented controls, sheets, the tab bar. */

/* ==== 1 Tokens ==== */
:root {
  color-scheme: light;
  /* Colours are the kit's: <html data-app="odds"> sets --q-accent; win/loss are the kit's meaning tokens. */
  --accent: var(--q-accent);
  --q-accent-ink: #fff;
  --good: var(--q-win, #16a34a);
  --bad: var(--q-loss, #dc2626);
  --gold: #d9a441;
  --wash-good: color-mix(in srgb, var(--good) 14%, transparent);
  --wash-bad: color-mix(in srgb, var(--bad) 14%, transparent);
  --wash-accent: color-mix(in srgb, var(--accent) 14%, transparent);
  font-family: var(--q-font);
}
:root[data-theme='dark'] { color-scheme: dark; }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) { color-scheme: dark; } }

/* ==== 2 Base ==== */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--q-page); color: var(--q-label); line-height: 1.4; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
.num { font-variant-numeric: tabular-nums; }
.back-high { color: var(--good); }
.back-low { color: var(--bad); }
.page { max-width: var(--q-page-max, 720px); margin: 0 auto; padding: 8px var(--q-margin, 16px) calc(48px + var(--q-nav)); }
body:has(#slip-bar:not([hidden])) .page { padding-bottom: calc(120px + var(--q-nav)); }
.q-gl { display: inline-grid; place-items: center; width: 16px; height: 16px; }
.q-gl svg { width: 100%; height: 100%; }
.pl-empty { padding: 24px 8px; color: var(--q-label-2); font: var(--q-t-subhead); text-align: center; }
.pl-count { flex: none; color: var(--q-label-2); font: 600 15px/1 var(--q-font); font-variant-numeric: tabular-nums; }
.q-chips.pl-chips { margin: 0 calc(-1 * var(--q-margin)); padding-inline: var(--q-margin); }
.pl-chips.small .q-chip { min-height: 30px; padding: 0 12px; font-size: 14px; }
.q-chip .chip-count { color: inherit; font-size: 13px; font-variant-numeric: tabular-nums; opacity: 0.6; }
.chip-glyph { font-size: 15px; line-height: 1; }
.pl-chev { flex: none; width: 7px; height: 7px; margin: 0 3px 0 2px; border-top: 2px solid currentColor; border-right: 2px solid currentColor; border-radius: 1px; transform: rotate(45deg); opacity: 0.55; }
.pl-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--q-red); animation: pl-pulse 1.6s ease-in-out infinite; }
@keyframes pl-pulse { 50% { opacity: 0.3; } }
/* A row that folds the rest away: "其他 12 場 ›". */
.pl-fold { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; margin-top: 12px; padding: 8px 14px; border: 0; border-radius: 18px; background: var(--q-surface); color: var(--q-accent); font: 600 16px/1.2 var(--q-font); text-align: left; }
.pl-fold-text { flex: 1; min-width: 0; }
.pl-fold-logos { display: flex; }
.pl-fold-logos > * + * { margin-left: -6px; }
.sl-link { padding: 0; border: 0; background: none; color: var(--q-accent); font: 500 15px/1.3 var(--q-font); }

/* ==== 3 Shared pieces ==== */
/* Logos: a team's, a league's on a white disc (the same in light and dark), a flag, initials. */
.logo { flex: none; width: 30px; height: 30px; object-fit: contain; }
.logo-xs { width: 18px; height: 18px; }
.logo-sm { width: 24px; height: 24px; }
.logo-md { width: 34px; height: 34px; }
.logo-lg { width: 52px; height: 52px; }
.logo-wrap { display: inline-flex; flex: none; line-height: 0; }
.logo.player-flag, .logo.photo { border-radius: 50%; object-fit: cover; }
.logo-fallback { display: inline-grid; place-items: center; overflow: hidden; border-radius: 50%; background: var(--q-fill-3); color: var(--q-label-2); font-size: 12px; font-weight: 700; line-height: 1; white-space: nowrap; }
.logo-fallback.logo-lg { font-size: 20px; }
.logo-flag { display: grid; place-items: center; font-size: 20px; line-height: 1; }
.logo-flag.logo-sm, .logo-flag.logo-xs { font-size: 16px; }
.logo-flag.logo-lg { font-size: 40px; }
.q-person.logo-sm, .q-team-disc.logo-sm { width: 24px; height: 24px; font-size: 9px; }
.q-person.logo-md, .q-team-disc.logo-md, .q-driver-badge.logo-md { width: 34px; height: 34px; font-size: 12px; }
.league-badge { --s: 30px; flex: none; display: inline-grid; place-items: center; width: var(--s); height: var(--s); overflow: hidden; border-radius: 50%; background: #fff; box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.12); }
.league-badge.logo-xs { --s: 20px; }
.league-badge.logo-sm { --s: 26px; }
.league-badge.logo-lg { --s: 52px; }
.league-badge .logo-wrap { display: grid; place-items: center; width: 78%; height: 78%; }
.league-badge .league-img { display: block; width: 100%; height: 100%; object-fit: contain; }
.league-badge .league-icon { display: grid; place-items: center; font-size: calc(var(--s) * 0.58); line-height: 1; }
.badge { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: color-mix(in srgb, var(--badge) 16%, transparent); color: var(--badge); font-size: 12px; font-weight: 800; }
.badge.badge-text { font-size: 10px; }
.driver-badge { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--team); color: #fff; font-size: 13px; font-weight: 800; }
.flag-badge { flex: none; display: grid; place-items: center; width: 32px; height: 32px; }
.h2h-faces { position: relative; flex: none; width: 46px; height: 38px; }
.h2h-faces > :first-child { position: absolute; left: 0; top: 0; z-index: 1; width: 36px; height: 36px; }
.h2h-faces > :last-child:not(:first-child) { position: absolute; right: 0; bottom: 0; z-index: 2; width: 22px; height: 22px; border-radius: 50%; box-shadow: 0 0 0 2px var(--q-surface); }
.h2h-faces img, .h2h-faces picture { width: 100%; height: 100%; }
.pi { flex: none; display: inline-grid; place-items: center; width: 1em; height: 1em; line-height: 0; }
.pi svg { display: block; }

/* A price: tap to put it on the slip. Big rounded odds; on the slip, filled. */
.pick { position: relative; flex: none; display: grid; align-content: center; justify-items: center; gap: 1px; min-width: 64px; min-height: 40px; padding: 4px 8px; border: 0; border-radius: 12px; background: var(--q-fill-3); color: var(--q-label); text-align: center; font-variant-numeric: tabular-nums; transition: background-color 0.2s, color 0.2s, transform var(--q-dur-snappy) var(--q-spring-snappy); }
button.pick:active { transform: scale(0.95); }
.pick-name { max-width: 100%; overflow: hidden; color: var(--q-label-2); font: 500 12px/1.2 var(--q-font); white-space: nowrap; text-overflow: ellipsis; }
.pick-odds { font: 700 17px/1.15 var(--q-font-rounded); letter-spacing: -0.01em; }
.pick.in-slip { background: var(--accent); color: #fff; }
.pick.in-slip .pick-name { color: rgba(255, 255, 255, 0.85); }
.pick.locked, .pick.stale { opacity: 0.5; cursor: default; }
.pick .lock { width: 15px; height: 15px; margin: 0 auto; color: var(--q-label-2); }
.pick .min-legs { position: absolute; top: -7px; left: 50%; transform: translateX(-50%); padding: 0 5px; border-radius: 999px; background: var(--q-label); color: var(--q-grouped-2, #fff); font-size: 10px; font-weight: 700; line-height: 15px; white-space: nowrap; pointer-events: none; }
.pick.in-slip .min-legs { background: #fff; color: var(--accent); }
.pick-none { width: 64px; flex: none; }

/* A team on a row: logo, name, (score), its price. */
.pl-team { display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 44px; }
.pl-team-name { flex: 1; min-width: 0; overflow: hidden; font: 500 16px/1.25 var(--q-font); white-space: nowrap; text-overflow: ellipsis; }
.pl-draw-mark { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--q-fill-3); color: var(--q-label-2); font-weight: 700; }
.pl-team.draw .pl-team-name { color: var(--q-label-2); }
.pl-score { flex: none; min-width: 1.4em; color: var(--q-label); font: 700 20px/1 var(--q-font-rounded); text-align: right; font-variant-numeric: tabular-nums; }
.pl-score.moved, .gs-score .moved { animation: pl-moved 0.6s ease-out; color: var(--q-red); }
@keyframes pl-moved { 0% { transform: scale(1.2); } }
.pl-when { display: inline-flex; align-items: center; gap: 6px; min-width: 0; color: var(--q-label-2); font: 600 13px/1.2 var(--q-font); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pl-when.live { color: var(--q-red); }
.pl-when.live span { overflow: hidden; text-overflow: ellipsis; }

/* ==== 4 首頁 ==== */
.pl-hero { gap: 6px; padding-bottom: 14px; }
.pl-hero .q-hc-eyebrow { gap: 6px; }
.pl-plus { margin-left: auto; padding: 3px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.2); font-size: 11px; letter-spacing: 0.06em; }
.pl-balance { margin: 2px 0 2px; overflow: hidden; white-space: nowrap; }
.pl-hero-line { display: flex; align-items: center; gap: 8px; width: fit-content; max-width: 100%; min-height: 32px; padding: 0 12px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, 0.16); color: #fff; font: 500 14px/1.2 var(--q-font); text-align: left; }
.pl-hero-line span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-hero-line strong { flex: none; }
.pl-hero-line.plain { background: none; padding: 0; }
.pl-hero-line .pi { width: 16px; height: 16px; }
.pl-hero-search { margin-top: 8px; width: 100%; border: 0; text-align: left; cursor: pointer; }
.pl-hero-search > i svg { width: 18px; height: 18px; }
.pl-starters { margin-top: 14px; }
.pl-starter .league-badge { --s: 20px; }
.pl-starter.live { color: var(--q-red); }
.pl-starter.live .pl-dot { width: 8px; height: 8px; }
/* A match card in a rail. */
.pl-mcards { --q-rail-w: min(80%, 290px); }
.pl-mcard { gap: 2px; padding: 12px 14px 10px; cursor: pointer; }
.pl-mcard-top { display: flex; align-items: center; gap: 6px; min-width: 0; margin-bottom: 2px; }
.pl-mcard-league { flex: 1; min-width: 0; overflow: hidden; color: var(--q-label-2); font: 600 13px/1.2 var(--q-font); white-space: nowrap; text-overflow: ellipsis; }
.pl-mcard-top > :last-child { flex: none; }
.pl-mcard .pl-team { min-height: 42px; gap: 8px; }
.pl-mcard .pl-team-name { font-size: 15px; }
.pl-mcard .pick { min-width: 60px; }
.pl-mcard-pick { display: flex; align-items: center; gap: 8px; margin-top: 4px; padding-top: 8px; border-top: var(--q-hairline) solid var(--q-sep); }
.pl-mcard-pickname { flex: 1; min-width: 0; overflow: hidden; color: var(--q-accent); font: 600 14px/1.25 var(--q-font); white-space: nowrap; text-overflow: ellipsis; }
/* 精選串關: three picks and what they pay together. */
.pl-combos { --q-rail-w: min(84%, 300px); }
.pl-combo { gap: 10px; }
.pl-combo-head { display: flex; align-items: center; gap: 6px; min-width: 0; }
.pl-combo-head strong { flex: 1; min-width: 0; overflow: hidden; font: 700 17px/1.2 var(--q-font); white-space: nowrap; text-overflow: ellipsis; }
.pl-combo-legs { display: grid; gap: 8px; }
.pl-combo-leg { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pl-combo-pick { flex: 1; min-width: 0; overflow: hidden; font: 500 15px/1.25 var(--q-font); white-space: nowrap; text-overflow: ellipsis; }
.pl-combo-leg b { flex: none; font: 700 15px/1 var(--q-font-rounded); }
.pl-combo-foot { display: flex; align-items: center; gap: 10px; padding-top: 10px; border-top: var(--q-hairline) solid var(--q-sep); }
.pl-combo-pay { flex: 1; display: grid; min-width: 0; }
.pl-combo-pay small { overflow: hidden; color: var(--q-label-2); font: var(--q-t-footnote); white-space: nowrap; text-overflow: ellipsis; }
.pl-combo-pay strong { overflow: hidden; color: var(--good); font: 700 22px/1.15 var(--q-font-rounded); white-space: nowrap; }
.pl-combo-go { flex: none; min-height: 38px; padding: 0 14px; font-size: 15px; }
@media (max-width: 340px) { .pl-combo-pay small { font-size: 12px; } .pl-combo-foot { gap: 8px; } .pl-combo-go { padding: 0 8px; font-size: 14px; } }

/* ==== 5 賽事 ==== */
.pl-day { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; margin: 4px 0 12px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--q-fill-3); color: var(--q-label); font: 600 15px/1 var(--q-font); font-variant-numeric: tabular-nums; }
.pl-day:disabled { cursor: default; opacity: 1; }
.pl-day-chev { width: 7px; height: 7px; margin: -3px 0 0 2px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); opacity: 0.6; }
#panel-games > .q-search { margin-bottom: 12px; }
#league-filter { margin-top: 4px; }
body.searching #sport-filter, body.searching #league-filter, body.searching #day-pick { display: none; }
h2.pl-league-h.pl-league-h { display: flex; align-items: center; gap: 8px; min-width: 0; font: 600 17px/22px var(--q-font); }
.pl-league-h > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.pl-live-h { display: flex; align-items: center; gap: 8px; }
.pl-live-h::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--q-red); animation: pl-pulse 1.6s ease-in-out infinite; }
/* A game as a row of its card: time and markets on top, a line a side. */
.pl-games { gap: 0; }
.pl-game { position: relative; display: grid; padding: 10px 12px 6px; cursor: pointer; transition: background-color 0.25s; }
.pl-game:active { background: var(--q-fill-4); transition-duration: 0s; }
.pl-game + .pl-game::before { content: ''; position: absolute; top: 0; left: 12px; right: 0; border-top: var(--q-hairline) solid var(--q-sep); }
.pl-game-top { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 20px; }
.pl-event { flex: 1; min-width: 0; overflow: hidden; color: var(--q-label-2); font: var(--q-t-footnote); white-space: nowrap; text-overflow: ellipsis; }
.pl-more { flex: none; display: inline-flex; align-items: center; gap: 4px; margin-left: auto; color: var(--q-label-2); font: 500 13px/1 var(--q-font); }
.pl-game .pl-team { min-height: 44px; }
.pl-game.live .pl-team-name { font-weight: 600; }
/* 冠軍 and F1: a row a market, its board in the sheet. */
.pl-fut .pl-fut-logo { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--q-fill-3); }
.pl-fut { --q-ritem-sep: 64px; }
.pl-fut small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* ==== 6 A game's sheet ==== */
.game-sheet { padding-bottom: 0; }
.game-sheet-title { display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; }
.game-sheet-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#game-sheet-body { min-height: 40vh; padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
.gs { display: grid; gap: 16px; }
/* The scoreboard: each side's logo and name, the time or the score between. */
.gs-board { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; padding: 6px 0 2px; }
.gs-side { display: grid; justify-items: center; gap: 4px; min-width: 0; text-align: center; }
.gs-name { max-width: 100%; overflow: hidden; font: 600 16px/1.2 var(--q-font); white-space: nowrap; text-overflow: ellipsis; }
.gs-side small { color: var(--q-label-2); font: var(--q-t-caption); }
.gs-mid { display: grid; justify-items: center; gap: 4px; min-width: 76px; }
.gs-time { font: 700 28px/1 var(--q-font-rounded); font-variant-numeric: tabular-nums; }
.gs-day { color: var(--q-label-2); font: 600 13px/1 var(--q-font); }
.gs-score { display: flex; align-items: center; gap: 8px; font: 700 36px/1 var(--q-font-rounded); font-variant-numeric: tabular-nums; }
.gs-score i { color: var(--q-label-3); font-style: normal; font-size: 24px; }
.gs-score b { display: inline-block; }
.gs-state { display: inline-flex; align-items: center; gap: 6px; max-width: 120px; color: var(--q-red); font: 600 13px/1.2 var(--q-font); }
.gs-state span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-win { display: grid; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); gap: 8px; }
.gs-win .pick { min-height: 56px; border-radius: 16px; }
.gs-win .pick-odds { font-size: 20px; }
/* The other markets: a tab a kind, a table a line. */
.game-more { display: grid; gap: 12px; }
.tab-strip { position: sticky; top: 60px; z-index: 1; min-width: 0; margin: 0 calc(-1 * var(--q-margin)); padding: 4px var(--q-margin); background: var(--q-sheet, var(--q-page)); }
.market-tabs.q-chips { flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; padding: 2px 0; }
.market-tabs.more-right { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); }
.market-tabs.more-left { -webkit-mask-image: linear-gradient(to right, transparent, #000 32px); mask-image: linear-gradient(to right, transparent, #000 32px); }
.market-tabs.more-left.more-right { -webkit-mask-image: linear-gradient(to right, transparent, #000 32px, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(to right, transparent, #000 32px, #000 calc(100% - 32px), transparent); }
.market-tabs .has-pick { position: relative; }
.market-tabs .has-pick::after { content: ''; position: absolute; top: 4px; right: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.market-panel, .market-more { display: grid; gap: 12px; }
.line-table, .more-block { display: grid; gap: 8px; padding: 12px; border-radius: 18px; background: var(--q-surface); }
.line-title, .more-title { margin: 0; font: 600 15px/1.25 var(--q-font); }
.line-head, .line-row { display: grid; grid-template-columns: minmax(4em, 0.8fr) 1fr 1fr; gap: 8px; align-items: center; }
.line-head span { overflow: hidden; color: var(--q-label-2); font: 600 12px/1.2 var(--q-font); text-align: center; white-space: nowrap; text-overflow: ellipsis; }
.line-head span:first-child { text-align: left; }
.line-label strong { font: 600 16px/1 var(--q-font-rounded); font-variant-numeric: tabular-nums; }
.line-row .pick { min-width: 0; }
.line-row.main .line-label strong { color: var(--accent); }
.market-head { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--q-label-2); font: 600 13px/1.25 var(--q-font); }
.market-picks { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 8px; }
.market-picks .pick { min-width: 0; min-height: 52px; }
.market-picks.bands { grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 6px; }
.market-picks.bands .pick { padding-inline: 2px; }
.market-picks:has(.min-legs) .pick { padding-top: 10px; }
.market-body > .market-panel > .market-head:first-child { margin-top: 0; }
.more-block .line-table { padding: 0; background: none; }
.pl-empty.sheet-none, .offers-wait { padding: 12px; color: var(--q-label-2); font: var(--q-t-footnote); text-align: center; }
/* Players' markets: a chip a market, a row a player. */
.props { gap: 10px; }
.prop-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.prop-chips::-webkit-scrollbar { display: none; }
.prop-chip { min-height: 30px; padding: 0 12px; font-size: 14px; }
.prop-head, .prop-row { display: grid; grid-template-columns: minmax(0, 1fr) 76px; gap: 8px; align-items: center; }
.prop-head, .prop-row.two { grid-template-columns: minmax(0, 1fr) 70px 70px; }
.prop-head span { color: var(--q-label-2); font: 600 12px/1 var(--q-font); text-align: center; }
.prop-head span:first-child { text-align: left; }
.prop-list { display: grid; gap: 4px; padding: 6px 12px; border-radius: 18px; background: var(--q-surface); }
.prop-row { min-height: 52px; }
.prop-row .pick { min-width: 0; }
.prop-row.two .pick-name { display: none; }
.prop-player { display: flex; align-items: center; gap: 10px; min-width: 0; }
.prop-avatar { flex: none; display: grid; place-items: center; width: 36px; height: 36px; overflow: hidden; border-radius: 50%; background: var(--q-fill-3); color: var(--q-label-2); font-size: 12px; font-weight: 700; }
.prop-photo { object-fit: cover; object-position: top; }
.prop-name { min-width: 0; overflow: hidden; font: 500 15px/1.25 var(--q-font); text-overflow: ellipsis; white-space: nowrap; }
.prop-note { color: var(--q-label-2); font: var(--q-t-caption); }
/* Its markets still on their way: their shape. */
.more-shape { display: grid; gap: 12px; }
.shape-tabs { display: flex; gap: 6px; }
.shape-pill { width: 64px; height: 32px; border-radius: 999px; }
.shape-rows { display: grid; gap: 8px; padding: 12px; border-radius: 18px; background: var(--q-surface); }
.shape-row { display: grid; grid-template-columns: 1fr 72px 72px; gap: 8px; align-items: center; }
.shape-line { width: 60%; height: 14px; border-radius: 7px; }
.shape-odds { height: 40px; border-radius: 12px; }
.more-shape i { display: block; background: var(--q-fill-3); animation: pl-pulse 1.2s ease-in-out infinite; }
/* A board (F1, a championship): its head, its tabs, a row an entry. */
.gs-boardhead { display: flex; align-items: center; gap: 12px; min-width: 0; }
.gs-boardhead > div { min-width: 0; }
.gs-btitle { font: 700 20px/1.25 var(--q-font); }
.gs-bsub, .gs-lead { color: var(--q-label-2); font: var(--q-t-footnote); }
.pl-entries { gap: 0; }
.pl-entry { position: relative; display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 6px 12px; }
.pl-entry + .pl-entry::before { content: ''; position: absolute; top: 0; left: 48px; right: 0; border-top: var(--q-hairline) solid var(--q-sep); }
.pl-entry-rank { flex: none; width: 20px; color: var(--q-label-3); font: 600 13px/1 var(--q-font-rounded); text-align: center; }
.pl-entry-name { flex: 1; display: grid; min-width: 0; }
.pl-entry-name > span { overflow: hidden; font: 500 16px/1.25 var(--q-font); white-space: nowrap; text-overflow: ellipsis; }
.pl-entry-name small { overflow: hidden; color: var(--q-label-2); font: var(--q-t-caption); white-space: nowrap; text-overflow: ellipsis; }
.pl-entry .logo, .pl-entry .q-person, .pl-entry .q-team-disc, .pl-entry .q-driver-badge { width: 36px; height: 36px; }

/* ==== 7 The slip ==== */
.slip-sheet .q-sheet-head h2 { margin: 0; }
#parlay-body { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
.sl { display: grid; gap: 14px; }
.sl-modes { width: 100%; }
.sl-note { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--q-label-2); font: var(--q-t-footnote); }
.sl-legs-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: -6px; padding: 0 4px; color: var(--q-label-2); font: 600 13px/1 var(--q-font); }
.sl-legs { gap: 0; }
.sl-leg { position: relative; display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 8px 8px 12px; }
.sl-leg + .sl-leg::before { content: ''; position: absolute; top: 0; left: 60px; right: 0; border-top: var(--q-hairline) solid var(--q-sep); }
.sl-leg > :first-child { flex: none; }
.sl-leg > .logo, .sl-leg > picture, .sl-leg > .league-badge, .sl-leg > .q-person, .sl-leg > .q-driver-badge { width: 36px; height: 36px; }
.sl-remove { position: relative; flex: none; width: 30px; height: 30px; border: 0; border-radius: 50%; background: var(--q-fill-3); }
.sl-remove::before, .sl-remove::after { content: ''; position: absolute; left: 50%; top: 50%; width: 12px; height: 2px; border-radius: 1px; background: var(--q-label-2); transform: translate(-50%, -50%) rotate(45deg); }
.sl-remove::after { transform: translate(-50%, -50%) rotate(-45deg); }
.leg-main { flex: 1; display: grid; gap: 2px; min-width: 0; }
.leg-pick { display: flex; align-items: center; gap: 6px; min-width: 0; }
.leg-pick strong { min-width: 0; overflow: hidden; font: 600 15px/1.25 var(--q-font); white-space: nowrap; text-overflow: ellipsis; }
.slip-leg-game { overflow: hidden; color: var(--q-label-2); font: var(--q-t-caption); white-space: nowrap; text-overflow: ellipsis; }
.market-tag { flex: none; padding: 1px 6px; border-radius: 6px; background: var(--q-fill-3); color: var(--q-label-2); font: 600 11px/1.5 var(--q-font); }
.market-tag.tag-ml { background: var(--wash-accent); color: var(--accent); }
.market-tag.tag-total, .market-tag.tag-teamtotal { background: var(--wash-good); color: var(--good); }
.market-tag.tag-runline { background: var(--wash-bad); color: var(--bad); }
.market-tag.tag-live { background: var(--q-red); color: #fff; }
.leg-odds { flex: none; display: inline-flex; align-items: baseline; gap: 2px; font: 700 17px/1 var(--q-font-rounded); font-variant-numeric: tabular-nums; white-space: nowrap; }
.leg-odds small { color: var(--q-label-2); font: 600 11px/1 var(--q-font); }
.leg-odds .leg-was { margin-right: 3px; }
.leg-odds.up .leg-was { color: var(--good); }
.leg-odds.down .leg-was { color: var(--bad); }
.sl-label { padding: 0 4px; color: var(--q-label-2); font: 600 13px/1.2 var(--q-font); }
.sl-chips { margin-top: -6px; flex-wrap: wrap; overflow: visible; }
.sl-free-chip .pi { width: 16px; height: 16px; }
.sl-free { display: grid; gap: 12px; }
/* The stake: NT$ and a big number, the usual amounts a tap away. */
.sl-stake { display: grid; gap: 10px; padding: 14px; border-radius: 20px; background: var(--q-surface); }
.sl-stake-field { display: grid; gap: 4px; }
.sl-stake-field .sl-label { padding: 0; }
.sl-stake-box { display: flex; align-items: baseline; gap: 6px; }
.sl-stake-box b { color: var(--q-label-2); font: 600 20px/1 var(--q-font-rounded); }
.sl-stake-box input { flex: 1; min-width: 0; padding: 0; border: 0; background: none; color: var(--q-label); font: 700 34px/1.15 var(--q-font-rounded); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; outline: none; }
.sl-quick { flex-wrap: nowrap; }
.sl-quick .q-chip { flex: 1 1 0; justify-content: center; min-width: 0; padding: 0 6px; font-variant-numeric: tabular-nums; }
.sl-errors { display: grid; gap: 6px; margin: 0; padding: 12px 14px; list-style: none; border-radius: 16px; background: var(--wash-bad); color: var(--bad); font: 500 14px/1.35 var(--q-font); }
/* What it pays: all correct, big, then the lines that make it. */
.sl-pay { display: grid; gap: 12px; padding: 16px; border-radius: 20px; background: var(--q-surface); }
.sl-pay-top { display: grid; justify-items: start; gap: 4px; }
.sl-pay-top small { color: var(--q-label-2); font: 600 13px/1 var(--q-font); }
.pay-big { max-width: 100%; overflow: hidden; color: var(--accent); font: 700 36px/1.1 var(--q-font-rounded); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sl-pay-rows { display: grid; gap: 6px; padding-top: 10px; border-top: var(--q-hairline) solid var(--q-sep); }
.pay-line { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; color: var(--q-label-2); font: 400 14px/1.3 var(--q-font); }
.pay-line span { min-width: 0; }
.pay-line strong { flex: none; color: var(--q-label); font: 600 15px/1.3 var(--q-font-rounded); font-variant-numeric: tabular-nums; }
.pay-line.pay-boost strong { color: var(--good); }
/* The parlay boost as a ladder of sizes. */
.boost { display: grid; gap: 10px; padding: 14px; border-radius: 20px; background: var(--q-surface); }
.boost-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 10px; }
.boost-head strong { font: 600 15px/1.2 var(--q-font); }
.boost.on .boost-head strong { color: var(--good); }
.boost-head small { color: var(--q-label-2); font: var(--q-t-footnote); }
.boost-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; margin: 0; padding: 0; list-style: none; }
.boost-steps li { display: grid; justify-items: center; gap: 2px; padding: 6px 2px; border-radius: 10px; background: var(--q-fill-3); color: var(--q-label-2); font-size: 12px; }
.boost-steps li b { font: 700 13px/1 var(--q-font-rounded); }
.boost-steps li.hit { background: var(--wash-good); color: var(--good); }
.boost-plus { color: var(--gold); font: 600 13px/1.3 var(--q-font); }
.q-plus-hint { justify-self: start; }
/* The one button, the balance under it. */
.place-row { display: grid; gap: 8px; justify-items: center; }
.place-button { width: 100%; min-height: 52px; font-size: 17px; box-shadow: 0 14px 26px -16px var(--accent); }
.place-button.two-line { display: grid; gap: 2px; padding-block: 6px; }
.place-button small { font: 500 12px/1.2 var(--q-font); opacity: 0.85; }
.place-button:disabled { box-shadow: none; opacity: 0.5; }
.place-row > small { color: var(--q-label-2); font: var(--q-t-footnote); font-variant-numeric: tabular-nums; }
.sl-rules { justify-self: center; font-size: 14px; }
/* The slip bar: above the tab bar on every tab, at a game sheet's foot. */
.slip-bar-count { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff; font: 700 17px/1 var(--q-font-rounded); }
.slip-bar-main { flex: 1; display: grid; gap: 1px; min-width: 0; }
.slip-bar-main strong { overflow: hidden; font: 600 15px/1.25 var(--q-font); white-space: nowrap; text-overflow: ellipsis; }
.slip-bar-main small { overflow: hidden; color: var(--q-label-2); font: 400 13px/1.25 var(--q-font); white-space: nowrap; text-overflow: ellipsis; }
.slip-bar-go { flex: none; padding: 10px 16px; border-radius: 999px; background: var(--accent); color: #fff; font: 600 15px/1 var(--q-font); }
.slip-bar.in-sheet { position: sticky; bottom: calc(12px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 12px; width: 100%; margin: 0 0 calc(12px + env(safe-area-inset-bottom)); padding: 8px 8px 8px 10px; border: 0; border-radius: 28px; background: var(--q-glass-strong); -webkit-backdrop-filter: var(--q-glass-blur); backdrop-filter: var(--q-glass-blur); box-shadow: var(--q-glass-rim), var(--q-glass-drop); color: var(--q-label); text-align: left; }
@media (min-width: 721px) { #slip-bar { bottom: calc(var(--q-nav) + 18px); } }

/* ==== 8 紀錄 ==== */
.pl-hist-seg { margin-bottom: 16px; }
.pl-acct .q-stat strong { font-size: 24px; }
.pl-stat-sub { color: var(--q-label-2); font: var(--q-t-caption); }
.q-tags.pl-record { margin: 12px 0 0; }
.pl-placed { width: 100%; margin-top: 16px; border-radius: 18px; background: var(--q-surface); }
.pl-hist-bar { display: flex; align-items: center; gap: 8px; margin-top: 18px; }
.pl-hist-bar .q-chips { flex: 1; min-width: 0; margin-right: 0; }
.pl-check { flex: none; min-height: 34px; padding: 0 12px; border: 0; border-radius: 999px; background: none; color: var(--q-accent); font: 500 15px/1 var(--q-font); }
.pl-group .q-section-head { align-items: center; }
.group-sum { flex: none; display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: 0 6px; max-width: 55%; color: var(--q-label-2); font: 500 13px/1.3 var(--q-font); text-align: right; font-variant-numeric: tabular-nums; }
.group-sum strong { color: var(--q-label); font-weight: 600; }
.group-sum strong.back-high { color: var(--good); }
.group-live .q-section-head h2::before { content: ''; display: inline-block; width: 9px; height: 9px; margin: 0 8px 2px 0; border-radius: 50%; background: var(--q-red); animation: pl-pulse 1.6s ease-in-out infinite; }
.pl-slips { display: grid; gap: 12px; }
/* A slip: what it is and how it stands, its picks, its money, its cash out. */
.pl-slip { display: grid; gap: 10px; padding: 14px; border-radius: 20px; background: var(--q-surface); }
.pl-slip.fresh { animation: pl-fresh 2.4s ease-out; }
@keyframes pl-fresh { 0%, 35% { box-shadow: 0 0 0 2px var(--accent); } }
.pl-slip.dead { opacity: 0.75; }
.pl-slip-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.pl-slip-title { display: grid; gap: 2px; min-width: 0; }
.pl-slip-title strong { overflow: hidden; font: 600 16px/1.25 var(--q-font); white-space: nowrap; text-overflow: ellipsis; }
.pl-slip-title small { overflow: hidden; color: var(--q-label-2); font: var(--q-t-caption); white-space: nowrap; text-overflow: ellipsis; }
.pl-slip-head .q-tag { flex: none; }
.pl-slip-next { margin-top: -4px; color: var(--q-label-2); font: var(--q-t-caption); }
.leg-bar { display: flex; gap: 3px; height: 6px; }
.leg-bar .seg { flex: 1 1 0; border-radius: 3px; background: var(--q-fill-3); }
.seg-won { background: var(--good) !important; }
.seg-lost { background: var(--bad) !important; }
.seg-void, .seg-off, .seg-cashed { background: var(--q-label-3) !important; }
.seg-live { background: var(--accent) !important; animation: pl-pulse 1.4s ease-in-out infinite; }
.seg-live.winning { background: var(--good) !important; }
.seg-live.losing { background: var(--bad) !important; }
.seg-moot { background: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--bad) 70%, transparent) 0 2px, color-mix(in srgb, var(--bad) 22%, transparent) 2px 5px) !important; }
.slip-verdict { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px; background: var(--q-fill-3); color: var(--q-label-2); font: 600 14px/1.3 var(--q-font); }
.slip-verdict .verdict-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.slip-verdict.winning { background: var(--wash-good); color: var(--good); }
.slip-verdict.losing { background: var(--wash-bad); color: var(--bad); }
/* A slip's picks: picture, the pick, its odds; its state on the second line. */
.saved-legs { display: grid; margin: 0 -14px; padding: 0; list-style: none; }
.saved-legs li.leg-row { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; grid-template-rows: auto auto; align-items: center; column-gap: 10px; row-gap: 2px; padding: 8px 14px; }
.saved-legs li.leg-row + li.leg-row::after { content: ''; position: absolute; top: 0; left: 58px; right: 0; border-top: var(--q-hairline) solid var(--q-sep); }
.saved-legs li.leg-row::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 2px 2px 0; }
.saved-legs li.leg-won::before, .saved-legs li.leg-live.winning::before { background: var(--good); }
.saved-legs li.leg-lost::before, .saved-legs li.leg-live.losing::before { background: var(--bad); }
.saved-legs li.leg-live::before { background: var(--accent); }
.saved-legs li.leg-moot { opacity: 0.55; }
.saved-legs li.leg-row > :first-child { grid-row: 1 / 3; }
.saved-legs li.leg-row .leg-body, .saved-legs li.leg-row .leg-side { display: contents; }
.saved-legs li.leg-row .leg-pick { grid-column: 2; grid-row: 1; }
.saved-legs li.leg-row .leg-odds { grid-column: 3; grid-row: 1; justify-self: end; font-size: 16px; }
.saved-legs li.leg-row .leg-sub { grid-column: 2 / 4; grid-row: 2; }
.saved-legs li.leg-row .leg-chip { grid-column: 3; grid-row: 2; justify-self: end; }
.saved-legs li.leg-row:has(.leg-chip) .leg-sub { grid-column: 2; }
.leg-lost .leg-pick strong { text-decoration: line-through; text-decoration-color: var(--bad); }
.leg-sub { display: block; min-width: 0; overflow: hidden; color: var(--q-label-2); font: 400 13px/1.3 var(--q-font); white-space: nowrap; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.leg-sub .leg-min { color: var(--q-red); font-weight: 700; }
.leg-score-line { display: flex; align-items: center; gap: 5px; }
.leg-score-line .leg-team { flex: 0 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.leg-score-line .leg-team-logo, .leg-score-line picture { flex: none; width: 16px; height: 16px; }
.leg-live-score { flex: none; font-weight: 700; font-variant-numeric: tabular-nums; }
.leg-live-score.moved { display: inline-block; animation: pl-moved 0.6s ease-out; }
.leg-row.winning .leg-live-score { color: var(--good); }
.leg-row.losing .leg-live-score { color: var(--bad); }
.leg-chip { padding: 0 7px; border-radius: 999px; background: var(--q-fill-3); color: var(--q-label-2); font: 700 11px/1.6 var(--q-font); white-space: nowrap; }
.leg-chip.winning, .leg-chip.won { background: var(--wash-good); color: var(--good); }
.leg-chip.losing, .leg-chip.lost { background: var(--wash-bad); color: var(--bad); }
/* Its money, in a row of cells. */
.pl-slip-money { display: flex; gap: 10px; padding-top: 10px; border-top: var(--q-hairline) solid var(--q-sep); }
.pay-cell { flex: 1 1 0; display: grid; align-content: start; gap: 2px; min-width: 0; }
.pay-cell small { color: var(--q-label-2); font: 400 12px/1.25 var(--q-font); }
.pay-cell strong { overflow: hidden; font: 700 18px/1.2 var(--q-font-rounded); white-space: nowrap; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.pay-cell strong.tint { color: var(--accent); }
.pay-cell .pay-sub { color: var(--q-label-2); font-size: 11px; }
/* Cash out: one big button, why it's paused and the rules under it. */
.pl-cash { display: grid; gap: 8px; }
.pl-cash-btn { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 0 18px; border: 0; border-radius: 999px; background: var(--wash-accent); color: var(--accent); font: 600 16px/1 var(--q-font); }
.pl-cash-btn strong { font: 700 18px/1 var(--q-font-rounded); }
.pl-cash-btn:disabled { background: var(--q-fill-3); color: var(--q-label-2); cursor: default; }
.pl-cash-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 0 4px; }
.pl-cash-why { flex: 1 1 100%; color: var(--q-label-2); font: var(--q-t-footnote); }
.pl-cash-plus { border: 0; cursor: pointer; }
.pl-cash-foot .sl-link { margin-left: auto; font-size: 13px; }
.pl-slip.recovered .pl-slip-money { border-top: 0; padding-top: 0; }

/* 紀錄 › 戰績 */
#stats-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
#stats-body > .pl-chips { margin-bottom: 14px; }
.st-total { display: grid; gap: 6px; }
.st-label { color: var(--q-label-2); font: 600 13px/1 var(--q-font); }
.st-big { overflow: hidden; font: 700 40px/1.1 var(--q-font-rounded); letter-spacing: -0.02em; white-space: nowrap; }
.wins-rhythm { display: flex; align-items: flex-end; gap: 6px; height: 56px; margin-top: 10px; }
.wr-bar { flex: 1; height: var(--h); min-height: 4px; border-radius: 4px; background: var(--q-fill-2); }
.wr-bar.on { background: color-mix(in srgb, var(--good) 55%, transparent); }
.wr-bar.on.now { background: var(--good); }
.st-stats { margin-top: 12px; }
.st-stats .q-stat strong { font-size: 22px; }
.st-badges { --q-rail-w: 140px; }
.st-badge { position: relative; overflow: hidden; gap: 6px; min-height: 132px; }
.st-badge .q-tile { margin-bottom: 2px; }
.st-badge-name { font: 600 15px/1.25 var(--q-font); }
.st-badge small { display: -webkit-box; overflow: hidden; color: var(--q-label-2); font: var(--q-t-caption); -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.st-badge:not(.done) { color: var(--q-label-2); }
.st-progress { position: relative; display: block; height: 4px; margin-top: 4px; overflow: hidden; border-radius: 2px; background: var(--q-fill-3); }
.st-progress::after { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--p); border-radius: 2px; background: var(--gold); }
.st-badge .st-progress { position: absolute; left: 16px; right: 16px; bottom: 12px; margin: 0; }
.st-moment .q-tile { font: 700 15px/1 var(--q-font-rounded); }
.st-moment .q-ritem-end span { color: var(--good); font-family: var(--q-font-rounded); }
.st-sports { gap: 0; padding: 6px 0; }
.st-sport { display: grid; grid-template-columns: minmax(0, 7em) minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 40px; padding: 0 14px; }
.st-sport-name { overflow: hidden; font: 500 15px/1.2 var(--q-font); white-space: nowrap; text-overflow: ellipsis; }
.st-track { height: 8px; overflow: hidden; border-radius: 4px; background: var(--q-fill-3); }
.st-track i { display: block; width: var(--w); height: 100%; border-radius: 4px; background: var(--accent); }
.st-sport strong { font: 600 15px/1 var(--q-font-rounded); }
.st-vip .q-ritem-text { gap: 3px; }
.st-plus { margin-top: 12px; }

/* ==== 9 彩券 ==== */
/* The tab: the biggest jackpot, the games as tiles, the scratch cards as a rail. */
.lt-hero { width: 100%; cursor: pointer; }
.lt-hero-ball { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: rgba(255, 255, 255, 0.25); font-size: 12px; }
.lt-hero-big { overflow: hidden; white-space: nowrap; }
.lt-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.lt-tile { --lotto: var(--accent); display: grid; align-content: start; gap: 6px; min-width: 0; padding: 14px; border: 0; border-radius: 20px; background: var(--q-surface); color: var(--q-label); text-align: left; }
.lt-name { display: flex; align-items: center; gap: 8px; min-width: 0; font: 600 15px/1.2 var(--q-font); }
.lt-name span { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.lt-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--lotto); }
.lt-big { overflow: hidden; color: var(--lotto); font: 700 24px/1.15 var(--q-font-rounded); letter-spacing: -0.02em; white-space: nowrap; text-overflow: ellipsis; }
.lt-when { color: var(--q-label-2); font: 500 13px/1.2 var(--q-font); }
.lt-open { margin-bottom: 12px; }
.lt-mine { margin-top: 28px; }
.sc-rail { --q-rail-w: 148px; }
.sc-card { justify-items: start; gap: 6px; text-align: left; border: 0; }
.sc-card-icon { margin-bottom: 4px; font-size: 28px; }
.sc-card-name { max-width: 100%; overflow: hidden; font: 600 15px/1.2 var(--q-font); white-space: nowrap; text-overflow: ellipsis; }
.sc-card > strong { color: var(--lotto); }

/* A game's sheet: pick and buy. */
.lotto-sheet { --q-accent: var(--lotto); height: min(94dvh, 940px); padding-bottom: 0; }
.lotto-sheet:has(.lotto-bought) { height: fit-content; padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
.lotto-h { margin: 6px 0 0; color: var(--q-label-2); font: 600 13px/1.3 var(--q-font); }
.ls-hero { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 10px; margin-bottom: 12px; padding: 14px; border-radius: 20px; background: linear-gradient(135deg, color-mix(in srgb, var(--lotto) 18%, var(--q-surface)), var(--q-surface)); }
.ls-hero > div { display: grid; align-content: start; gap: 2px; min-width: 0; }
.ls-hero small { color: var(--q-label-2); font: var(--q-t-caption); }
.ls-hero strong { overflow: hidden; font: 600 15px/1.25 var(--q-font); white-space: nowrap; text-overflow: ellipsis; }
.ls-hero > div:first-child strong { color: var(--lotto); font: 700 22px/1.15 var(--q-font-rounded); }
.ls-hero > div:last-child strong { white-space: normal; }
.ls-slip { display: grid; gap: 10px; margin-bottom: 14px; padding: 12px; border: 1.5px dashed color-mix(in srgb, var(--lotto) 40%, var(--q-sep)); border-radius: 18px; background: var(--q-surface); }
.ls-slip.done { border-style: solid; border-color: var(--lotto); }
.ls-slip-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.ls-slip-head strong { color: var(--lotto); font: 600 15px/1.2 var(--q-font); }
.ls-status { color: var(--q-label-2); font: 600 12px/1.3 var(--q-font); text-align: right; font-variant-numeric: tabular-nums; }
.ls-slots { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; min-height: 32px; }
.ls-slot { display: inline-grid; place-items: center; width: 31px; height: 31px; padding: 0; border: 1.5px dashed color-mix(in srgb, var(--lotto) 45%, var(--q-sep)); border-radius: 50%; background: transparent; color: #fff; font: 700 13px/1 var(--q-font); font-variant-numeric: tabular-nums; }
.ls-slot.on { border: 0; background: var(--lotto); }
.ls-slot.special { border-color: var(--lotto); }
.ls-slot.on.special { background: var(--q-surface); color: var(--lotto); box-shadow: inset 0 0 0 2.5px var(--lotto); }
.ls-slot.digit { width: 40px; height: 44px; border-radius: 12px; font-size: 20px; }
.ls-slot.wide { width: auto; padding: 0 14px; border-radius: 999px; }
.ls-plus { color: var(--q-label-3); font-weight: 700; }
.ls-hint { color: var(--q-label-2); font: var(--q-t-footnote); }
.ls-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ls-add { margin-left: auto; min-height: 34px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--lotto); color: #fff; font: 600 14px/1 var(--q-font); }
.lotto-pick { display: grid; gap: 10px; }
.ls-zone { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 4px 2px 0; color: var(--q-label-2); font: 500 13px/1.3 var(--q-font); }
.ls-zone strong { color: var(--q-label); font-size: 14px; }
.ls-zone.full span { color: var(--lotto); font-weight: 700; }
.num-grid { display: grid; grid-template-columns: repeat(var(--cols, 10), minmax(0, 1fr)); gap: 4px; margin-bottom: 8px; }
.num-cell { position: relative; aspect-ratio: 1; min-width: 0; padding: 0; border: 0; border-radius: 50%; background: var(--q-surface); color: var(--q-label-2); font: 600 12px/1 var(--q-font); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; white-space: nowrap; }
.num-cell.on { background: var(--lotto); color: #fff; }
.num-cell.last::after { content: ''; position: absolute; top: -1px; right: -1px; width: 7px; height: 7px; border-radius: 50%; background: color-mix(in srgb, var(--lotto) 70%, transparent); box-shadow: 0 0 0 1.5px var(--q-sheet, var(--q-page)); }
.num-cell.on.last::after { background: #fff; }
.ls-legend { display: flex; align-items: center; gap: 6px; margin: -4px 2px 4px; color: var(--q-label-2); font: var(--q-t-caption); }
.ls-dot { width: 6px; height: 6px; border-radius: 50%; background: color-mix(in srgb, var(--lotto) 70%, transparent); }
.digit-row { display: flex; justify-content: center; gap: 10px; }
.digit { display: grid; justify-items: center; gap: 4px; }
.digit button { width: 48px; height: 32px; border: 0; border-radius: 10px; background: var(--q-fill-3); color: var(--q-label-2); }
.digit strong { display: grid; place-items: center; width: 48px; height: 56px; border-radius: 14px; background: var(--lotto); color: #fff; font: 700 28px/1 var(--q-font-rounded); }
.lotto-sides { display: flex; flex-wrap: wrap; gap: 8px; }
.lotto-side-group { display: grid; gap: 6px; }
.lotto-side-group .lotto-h { margin: 0; }
.ls-quick { display: flex; align-items: center; gap: 8px; margin: 4px 0 12px; padding: 10px 12px; border-radius: 16px; background: var(--q-surface); }
.ls-quick span { flex: 1; font: 600 14px/1.2 var(--q-font); }
.lotto-lines { display: grid; gap: 6px; margin: 10px 0; }
.ls-lines-head { display: flex; align-items: center; justify-content: space-between; }
.ls-lines-head .lotto-h { margin: 0; }
.ls-clear-all { border: 0; background: none; color: var(--q-accent); font: 500 14px/1 var(--q-font); }
.lotto-line { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 14px; background: var(--q-surface); }
.lotto-line .balls { flex: 1; flex-wrap: wrap; }
.lotto-line .ball { width: 26px; height: 26px; font-size: 11px; }
.line-n { width: 20px; color: var(--q-label-2); font: 700 12px/1 var(--q-font-rounded); text-align: center; }
.icon-x { width: 28px; height: 28px; border: 0; border-radius: 50%; background: var(--q-fill-3); color: var(--q-label-2); }
.lotto-prizes { margin: 10px 0; padding: 12px 14px; border-radius: 16px; background: var(--q-surface); font: 400 14px/1.3 var(--q-font); }
.lotto-prizes summary { color: var(--q-label-2); font-weight: 600; cursor: pointer; }
.lotto-prizes table { width: 100%; margin-top: 6px; border-collapse: collapse; }
.lotto-prizes th { padding: 2px 4px; color: var(--q-label-2); font-size: 12px; text-align: left; }
.lotto-prizes td { padding: 6px 4px; border-top: var(--q-hairline) solid var(--q-sep); white-space: nowrap; }
.lotto-prizes td:nth-child(2) { white-space: normal; }
.lotto-prizes td:nth-child(3), .lotto-prizes th:nth-child(3) { text-align: right; font-variant-numeric: tabular-nums; }
.lotto-prizes > small { display: block; margin-top: 6px; color: var(--q-label-2); font-size: 12px; }
.ls-last { display: grid; gap: 6px; margin: 12px 0 4px; padding: 12px 14px; border-radius: 16px; background: var(--q-surface); }
.ls-last .lotto-h { margin: 0; }
.ls-last .lotto-h small { color: var(--q-label-2); font-weight: 500; }
.ls-last-row { display: grid; grid-template-columns: 4.6em minmax(0, 1fr); align-items: center; gap: 8px; }
.ls-last-row small, .ls-last > small { color: var(--q-label-2); font-size: 12px; }
.lotto-msg { margin: 8px 0 0; color: var(--bad); font: 600 14px/1.3 var(--q-font); text-align: center; }
.lotto-buybar { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px calc(-1 * var(--q-margin)) 0; padding: 12px var(--q-margin) calc(12px + env(safe-area-inset-bottom)); border-top: var(--q-hairline) solid var(--q-sep); background: var(--q-sheet, var(--q-page)); }
.ls-buybar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 10px; }
.ls-buybar.has-opts .ls-opts, .ls-draws { grid-column: 1 / -1; }
.ls-opts { display: flex; flex-wrap: nowrap; justify-content: flex-start; gap: 16px; }
.ls-draws { margin-top: -4px; color: var(--q-label-2); font: var(--q-t-caption); }
.ls-total { display: grid; justify-items: start; }
.ls-total small { color: var(--q-label-2); font: var(--q-t-caption); }
.ls-total strong { font: 700 22px/1.1 var(--q-font-rounded); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ls-buybar .q-btn.primary { min-width: 0; padding-inline: 22px; background: var(--lotto); }
.stepper { display: inline-flex; align-items: center; gap: 4px; }
.stepper button { width: 30px; height: 30px; border: 0; border-radius: 50%; background: var(--q-fill-3); font-size: 17px; }
.stepper button:disabled { opacity: 0.35; cursor: default; }
.ls-mult { display: grid; justify-items: center; min-width: 44px; }
.ls-mult small { color: var(--q-label-2); font-size: 10px; }
.ls-mult strong { font: 600 14px/1.2 var(--q-font-rounded); }
/* Just bought: a tick, what was bought, the two ways on. */
.lotto-bought { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 0 4px; text-align: center; }
.lotto-bought-mark { display: grid; place-items: center; width: 68px; height: 68px; margin-bottom: 8px; border-radius: 50%; background: var(--lotto); box-shadow: 0 12px 30px -12px var(--lotto); animation: lt-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1); }
.lotto-bought-mark svg { width: 34px; height: 34px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; stroke-dashoffset: 24; animation: lt-tick 0.35s 0.2s ease-out forwards; }
@keyframes lt-pop { from { transform: scale(0.6); opacity: 0; } }
@keyframes lt-tick { to { stroke-dashoffset: 0; } }
.lotto-bought-title { font: 700 20px/1.25 var(--q-font); }
.lotto-bought-when { color: var(--q-label-2); font: var(--q-t-subhead); }
.lotto-bought-lines { display: grid; gap: 8px; width: 100%; margin-top: 14px; padding: 12px 14px; border-radius: 18px; background: var(--q-surface); }
.lotto-bought-line { display: flex; align-items: center; gap: 10px; min-width: 0; }
.lotto-bought-line small { flex: none; color: var(--q-label-2); font-size: 12px; }
.lotto-bought-line .balls { flex-wrap: nowrap; overflow: hidden; }
.lotto-bought-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; margin-top: 18px; }
/* Balls: a number in a circle; the second zone and hits in the game's colour. */
.balls { display: flex; flex-wrap: wrap; gap: 5px; }
.ball { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--q-fill-3); color: var(--q-label); font: 700 12px/1 var(--q-font); font-variant-numeric: tabular-nums; }
.ball.special { background: color-mix(in srgb, var(--lotto, var(--accent)) 16%, transparent); color: var(--lotto, var(--accent)); }
.ball.hit { background: var(--lotto, var(--accent)); color: #fff; }
.ball.dim { width: 24px; height: 24px; font-size: 11px; opacity: 0.6; }
.ball.sp { position: relative; background: transparent; box-shadow: inset 0 0 0 2px var(--lotto, var(--accent)); color: var(--lotto, var(--accent)); }
.ball.sp::after { content: attr(data-sp); position: absolute; top: -5px; right: -6px; padding: 0 3px; border-radius: 8px; background: var(--lotto, var(--accent)); color: #fff; font-size: 9px; font-weight: 800; line-height: 1.4; }
.balls.mini { gap: 3px; }
.balls.mini .ball { width: 22px; height: 22px; font-size: 10px; }

/* A scratch card: a band in its colour, the play area under foil. */
.sc-ticket { overflow: hidden; border-radius: 20px; background: var(--q-surface); box-shadow: 0 18px 40px -22px var(--lotto), 0 0 0 2px var(--lotto); }
.sc-band { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: linear-gradient(120deg, var(--lotto), color-mix(in srgb, var(--lotto) 60%, #000)); color: #fff; }
.sc-band-icon { font-size: 30px; line-height: 1; }
.sc-band-text, .sc-band-prize { display: grid; gap: 1px; min-width: 0; }
.sc-band-prize { margin-left: auto; text-align: right; }
.sc-band small { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; opacity: 0.85; white-space: nowrap; }
.sc-band strong { font: 800 18px/1.2 var(--q-font); white-space: nowrap; }
.sc-play { position: relative; margin: 12px; border: 1.5px dashed color-mix(in srgb, var(--lotto) 45%, transparent); border-radius: 14px; background: color-mix(in srgb, var(--lotto) 8%, var(--q-surface)); }
.sc-how { padding: 0 16px 14px; color: var(--q-label-2); font: var(--q-t-caption); }
.scratch-cover { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: inherit; touch-action: none; cursor: grab; }
.scratch-face { display: grid; gap: 8px; min-height: 200px; padding: 12px; }
.scratch-mult { justify-self: start; padding: 4px 10px; border-radius: 999px; background: var(--lotto); color: #fff; font-weight: 800; }
.scratch-spots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.scratch-spots.yours { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
.scratch-face.match3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.spot { display: grid; align-content: center; justify-items: center; gap: 2px; min-width: 0; min-height: 58px; padding: 6px 2px; border-radius: 12px; background: var(--q-surface); box-shadow: inset 0 0 0 1px var(--q-sep); text-align: center; }
.scratch-spots.yours .spot { min-height: 48px; padding: 4px 1px; }
.spot small { max-width: 100%; overflow: hidden; color: var(--q-label-2); font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }
.spot strong { max-width: 100%; overflow: hidden; font-size: 14px; white-space: nowrap; text-overflow: ellipsis; }
.spot strong.big { font-size: 21px; }
.spot-sym { color: var(--lotto); font-size: 26px; font-weight: 900; line-height: 1.1; }
.sc-ticket.revealed :is(.spot.win, .dig.win, .slot-row.win .reel, .dice-row.win) { background: var(--lotto); box-shadow: none; animation: sc-win 0.6s ease-out 2; }
.sc-ticket.revealed :is(.spot.win, .spot.win small, .spot.win .spot-sym, .dice-row.win, .dice-row.win small, .dice-row.win .die-pair.them b) { color: #fff; }
.sc-ticket.revealed .slot-row.win .slot-prize { color: var(--lotto); }
@keyframes sc-win { 50% { transform: scale(1.08); } }
.sc-h { margin: 2px 0 0; color: var(--q-label-2); font: 800 12px/1.3 var(--q-font); letter-spacing: 0.04em; }
.sc-winning { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); justify-items: center; gap: 8px; }
.sc-win-num { display: grid; place-items: center; width: 100%; max-width: 44px; aspect-ratio: 1; border-radius: 50%; background: var(--lotto); color: #fff; font-weight: 900; }
.bingo-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.bcell { display: grid; place-items: center; aspect-ratio: 1; border-radius: 8px; background: var(--q-surface); box-shadow: inset 0 0 0 1px var(--q-sep); font-size: 13px; font-weight: 700; }
.bcell.hit { background: var(--lotto); color: #fff; box-shadow: none; }
.called { display: flex; flex-wrap: wrap; gap: 4px; color: var(--q-label-2); font-size: 12px; }
.called span { padding: 2px 6px; border-radius: 6px; background: var(--q-surface); }
.scratch-face.slots, .scratch-face.dice { gap: 6px; }
.slot-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(64px, auto); align-items: center; gap: 6px; }
.scratch-face.slots.rounds .slot-row { grid-template-columns: auto repeat(3, minmax(0, 1fr)) minmax(56px, auto); }
.slot-round { color: var(--q-label-2); font-size: 11px; font-weight: 700; white-space: nowrap; }
.reel { display: grid; place-items: center; height: 46px; border-radius: 10px; background: var(--q-surface); box-shadow: inset 0 0 0 1px var(--q-sep); font-size: 26px; }
.slot-prize { padding-right: 4px; font-size: 15px; text-align: right; }
.beat-dealer { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 8px; border-radius: 14px; background: color-mix(in srgb, var(--lotto) 14%, transparent); font-weight: 800; }
.beat-dealer strong { display: grid; place-items: center; width: 48px; aspect-ratio: 1; border-radius: 50%; background: var(--lotto); color: #fff; font-size: 22px; }
.treasure-map { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.dig { display: grid; place-items: center; aspect-ratio: 1.15; border-radius: 12px; background: color-mix(in srgb, #a16207 14%, var(--q-surface)); box-shadow: inset 0 0 0 1px var(--q-sep); font-size: 26px; }
.treasure-key { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px 6px; padding: 8px; border-radius: 12px; background: var(--q-surface); font-size: 12px; }
.treasure-key span { display: flex; align-items: center; gap: 3px; min-width: 0; white-space: nowrap; }
.treasure-key b { font-size: 16px; }
.dice-head, .dice-row { display: grid; grid-template-columns: 20px 1fr 1fr minmax(60px, auto); align-items: center; gap: 8px; }
.dice-head { padding: 0 8px; }
.dice-head small { color: var(--q-label-2); font-size: 11px; font-weight: 800; text-align: center; }
.dice-head small:last-child, .dice-row > strong { text-align: right; }
.dice-row { padding: 6px 8px; border-radius: 12px; background: var(--q-surface); box-shadow: inset 0 0 0 1px var(--q-sep); }
.dice-row > small { color: var(--q-label-2); }
.die-pair { display: flex; align-items: center; justify-content: center; gap: 6px; }
.die-pair b { font-size: 29px; font-weight: 400; line-height: 1; letter-spacing: 2px; }
.die-pair small { min-width: 18px; color: var(--q-label-2); font-weight: 800; }
.die-pair.them b { color: var(--q-label-2); }
.scratch-face.wheel { place-items: center; }
.wheel-box { position: relative; width: min(100%, 280px); aspect-ratio: 1; }
.wheel-box::after { content: ''; position: absolute; inset: 40%; border-radius: 50%; background: var(--q-surface); box-shadow: 0 0 0 4px color-mix(in srgb, var(--lotto) 70%, #000); }
.wheel-disc { --wheel-a: var(--lotto); --wheel-b: color-mix(in srgb, var(--lotto) 65%, #fff); --wheel-0: color-mix(in srgb, var(--lotto) 30%, var(--q-surface)); position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 5px color-mix(in srgb, var(--lotto) 70%, #000), 0 8px 20px -8px rgba(0, 0, 0, 0.4); }
.wheel-label { position: absolute; left: 50%; top: 50%; display: flex; align-items: center; justify-content: flex-end; width: 50%; height: 20px; margin-top: -10px; padding-right: 12px; transform-origin: 0 50%; }
.wheel-label b { color: #fff; font-size: 12px; font-weight: 900; white-space: nowrap; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35); }
.wheel-label.flip b { transform: rotate(180deg); }
.wheel-label.zero b { color: var(--lotto); text-shadow: none; }
.sc-ticket.revealed .scratch-face.wheel.won .wheel-label.at b { color: #fde047; font-size: 14px; }
.wheel-pointer { position: absolute; left: 50%; top: -8px; width: 0; height: 0; border: 12px solid transparent; border-top: 22px solid var(--q-label); transform: translateX(-50%); filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.3)); }
/* A card on sale: the pool, then a panel a game (遊戲1…), lit when it pays.
   In the pool: boxed. Mahjong: ivory tiles with the character on them. */
.scratch-face.games { gap: 10px; min-height: 0; padding: 10px; }
.gf-pool, .gf-game { display: grid; gap: 6px; min-width: 0; padding: 10px; border-radius: 12px; background: var(--q-surface); box-shadow: inset 0 0 0 1px var(--q-sep); }
.gf-pool { background: color-mix(in srgb, var(--lotto) 10%, var(--q-surface)); }
.gf-title { margin: 0; color: var(--lotto); font: 800 13px/1.2 var(--q-font); }
.gf-h { margin: 0; color: var(--q-label-2); font: 700 11px/1.3 var(--q-font); letter-spacing: 0.03em; }
.gf-items { display: flex; flex-wrap: wrap; gap: 4px; }
.gf-items.lucky, .gf-items.tens { gap: 6px; }
.gf-n { display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 4px; border-radius: 7px; background: var(--q-fill-3); color: var(--q-label); font: 700 13px/1 var(--q-font); }
.gf-n.free { background: color-mix(in srgb, var(--lotto) 18%, transparent); color: var(--lotto); font-size: 9px; font-weight: 900; }
.gf-n.gf-ball { min-width: 30px; height: 30px; border-radius: 50%; background: var(--lotto); color: #fff; }
.gf-n.gf-sp { background: transparent; box-shadow: inset 0 0 0 2px var(--lotto); color: var(--lotto); }
.gf-n.gf-lucky { background: color-mix(in srgb, var(--lotto) 70%, #000); }
.gf-pyramid.balls .gf-n { border-radius: 50%; background: var(--ball, var(--lotto)); color: #fff; }
.gf-op { align-self: center; color: var(--q-label-2); font-style: normal; font-weight: 800; }
:is(.gf-n, .gf-cell).hit { box-shadow: 0 0 0 2px var(--lotto); }
.gf-n.gf-ball.hit, .gf-pyramid.balls .gf-n.hit { box-shadow: none; outline: 2.5px solid var(--q-label); outline-offset: 1.5px; }
.mj { display: inline-grid; place-items: center; align-content: center; width: 26px; height: 34px; border-radius: 5px; background: linear-gradient(#fffdf5, #f1e7cf); box-shadow: inset 0 -3px 0 #d7c79d, 0 1px 2px rgba(0, 0, 0, 0.25); color: #1f2937; line-height: 1; }
.mj b { font: 800 14px/1 var(--q-font); }
.mj i { font: 700 10px/1 var(--q-font); font-style: normal; }
.mj-man i, .mj-red b { color: #b91c1c; }
.mj-pin i, .mj-blue b { color: #1d4ed8; }
.mj-sou i, .mj-green b { color: #15803d; }
.mj-blue::after { content: ''; width: 14px; height: 20px; border: 2px solid #1d4ed8; border-radius: 3px; }
.mj.hit { box-shadow: inset 0 -3px 0 #d7c79d, 0 0 0 2px var(--lotto); }
.gf-cells { display: grid; grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 5px; }
.gf-cells.one { grid-template-columns: minmax(0, 120px); }
.gf-cell { display: grid; place-items: center; align-content: center; gap: 2px; min-width: 0; min-height: 44px; padding: 4px 2px; border-radius: 10px; background: var(--q-fill-4, var(--q-fill-3)); text-align: center; }
.gf-cell b { max-width: 100%; overflow: hidden; color: var(--lotto); font: 800 15px/1.1 var(--q-font); white-space: nowrap; text-overflow: ellipsis; }
.gf-cell small { max-width: 100%; overflow: hidden; color: var(--q-label-2); font-size: 11px; font-weight: 700; white-space: nowrap; text-overflow: ellipsis; }
.gf-zone { display: grid; gap: 4px; }
.gf-zone-h { color: var(--lotto); font-size: 11px; font-weight: 800; }
.gf-prize { font: 800 14px/1.1 var(--q-font-rounded); white-space: nowrap; }
.gf-box { display: grid; place-items: center; gap: 2px; padding: 6px 10px; border-radius: 10px; background: color-mix(in srgb, var(--lotto) 12%, transparent); }
.gf-box small { color: var(--q-label-2); font-size: 10px; font-weight: 700; }
.gf-table { display: flex; flex-wrap: wrap; gap: 4px; }
.gf-table span { display: inline-flex; align-items: baseline; gap: 4px; padding: 3px 7px; border-radius: 8px; background: var(--q-fill-3); white-space: nowrap; }
.gf-table b { font-size: 11px; font-weight: 700; color: var(--q-label-2); }
.gf-table small { font-size: 12px; font-weight: 800; }
.gf-rows { display: grid; gap: 5px; }
.gf-row { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 5px 8px; border-radius: 10px; background: var(--q-fill-4, var(--q-fill-3)); }
.gf-row-items { display: flex; flex: 1; justify-content: center; gap: 3px; min-width: 0; }
.gf-row-items .gf-n { min-width: 26px; padding: 0 2px; }
.gf-row .gf-prize { min-width: 52px; text-align: right; }
.gf-round { color: var(--q-label-2); font-size: 11px; font-weight: 700; white-space: nowrap; }
.gf-x { padding: 2px 6px; border-radius: 6px; background: var(--lotto); color: #fff; font-size: 11px; font-weight: 800; }
.gf-grid3 { display: grid; grid-template-columns: 22px 1fr 1fr minmax(58px, auto); align-items: center; gap: 6px; padding: 4px 8px; border-radius: 10px; text-align: center; }
.gf-grid3:not(.head) { background: var(--q-fill-4, var(--q-fill-3)); }
.gf-grid3.head small { color: var(--q-label-2); font-size: 10px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gf-grid3 b { font: 800 17px/1.2 var(--q-font-rounded); }
.gf-grid3 b.them { color: var(--q-label-2); }
.gf-grid3 .gf-prize, .gf-grid3.head small:last-child { text-align: right; }
.gf-code { letter-spacing: 0.18em; }
.gf-rounds { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 5px; }
.gf-rounds.dense { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gf-round-box { display: grid; justify-items: center; align-content: start; gap: 4px; min-width: 0; padding: 6px 4px; border-radius: 10px; background: var(--q-fill-4, var(--q-fill-3)); }
.gf-round-box:only-child { justify-items: stretch; }
.gf-pyramid { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; }
.gf-round-box .gf-table { justify-content: center; }
.gf-board-wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.gf-board { display: grid; grid-template-columns: repeat(var(--n), auto); gap: 4px; }
.gf-board .gf-n { min-width: 34px; height: 34px; }
.gf-board .mj { width: 30px; height: 38px; }
.gf-total { display: flex; align-items: baseline; gap: 6px; margin: 0; color: var(--q-label-2); font-size: 12px; font-weight: 700; }
.gf-total strong { color: var(--lotto); font: 800 20px/1 var(--q-font-rounded); }
.gf-cross { display: grid; grid-template-columns: 32px repeat(var(--n), minmax(0, 1fr)); gap: 4px; align-items: center; justify-items: center; }
.gf-cross .gf-cell { width: 100%; min-height: 34px; }
/* Scratched: what pays lights up in gold, the game round it glows. */
.sc-ticket.revealed .gf-game.won { box-shadow: 0 0 0 2px #f5b301, 0 6px 18px -8px #f5b301; }
.sc-ticket.revealed :is(.gf-cell, .gf-row, .gf-grid3, .gf-round-box, .gf-n, .gf-table span, .gf-prize).win { background: #fde68a; color: #713f12; animation: sc-win 0.6s ease-out 2; }
.sc-ticket.revealed :is(.gf-cell, .gf-row, .gf-grid3, .gf-table span).win :is(b, small) { color: #713f12; }
.sc-ticket.revealed .mj.win { box-shadow: 0 0 0 3px #f5b301; }
.sc-prices { margin-bottom: 10px; }
.sc-result { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; margin: 12px 0 0; padding: 8px 14px; border-radius: 16px; color: var(--q-label-2); font-weight: 700; text-align: center; }
.sc-result.won { background: var(--wash-good); color: var(--good); animation: lt-pop 0.4s ease-out; }
.sc-result.lost { background: var(--q-fill-3); }
.sc-result-icon { font-size: 26px; }
.sc-result-amount { font: 800 22px/1 var(--q-font-rounded); }

/* 紀錄 › 彩券: waiting, then drawn by day and by draw. */
.lotto-summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; padding: 14px 16px; border-radius: 18px; background: var(--q-surface); font: 600 15px/1.2 var(--q-font); }
.lotto-tickets, .lotto-done, .lotto-day { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.lotto-done { gap: 18px; margin-top: 8px; }
.lotto-done-head, .lotto-day-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.lotto-day-head { margin-top: 0; padding: 0 4px; }
.lotto-day-head strong { font: 700 17px/1.2 var(--q-font); }
.lotto-filter { display: flex; gap: 6px; }
.lotto-filter .q-chip { min-height: 30px; padding: 0 12px; font-size: 14px; }
.lotto-more { justify-self: center; }
.lotto-ticket, .lt-group { --lotto: var(--accent); display: grid; gap: 8px; min-width: 0; padding: 14px; border: 0; border-radius: 18px; background: var(--q-surface); color: inherit; text-align: left; }
.lotto-ticket { box-shadow: inset 4px 0 0 var(--lotto); }
.lt-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.lt-head strong { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.lt-title { display: grid; gap: 2px; min-width: 0; }
.lt-title small { color: var(--q-label-2); font: var(--q-t-caption); }
.lt-state { color: var(--q-label-2); font: var(--q-t-footnote); }
.lt-state.out-up { color: var(--good); font-weight: 700; }
.lt-net { flex: none; padding: 3px 10px; border-radius: 999px; background: var(--q-fill-3); color: var(--q-label-2); font: 700 14px/1.2 var(--q-font-rounded); }
.lt-net.out-up { background: var(--wash-good); color: var(--good); }
.lt-drawn { display: grid; gap: 4px; padding-bottom: 8px; border-bottom: 1px dashed var(--q-sep); }
.lt-label { color: var(--q-label-2); font-size: 12px; }
.lt-lines { display: grid; gap: 6px; }
.lt-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lt-line .balls { flex: 1; min-width: 0; gap: 4px; }
.lt-line .ball { width: 26px; height: 26px; font-size: 11px; }
.lt-line > .num { flex: none; color: var(--q-label-2); font-size: 13px; }
.lt-win { flex: none; display: grid; justify-items: end; line-height: 1.25; }
.lt-line.won .lt-win .num { color: var(--good); font-size: 13px; font-weight: 700; }
.lt-tier { color: var(--good); font-size: 11px; font-weight: 700; }
.lt-cards { display: flex; flex-wrap: wrap; gap: 6px; }
.lt-card { min-width: 56px; min-height: 36px; padding: 4px 8px; border: 0; border-radius: 10px; background: var(--q-fill-3); color: var(--q-label-2); font: 600 13px/1 var(--q-font-rounded); }
.lt-card.out-up { background: var(--wash-good); color: var(--good); }
.lt-series { color: var(--q-label-2); font: var(--q-t-caption); }

@media (prefers-reduced-motion: reduce) {
  .pl-dot, .pl-live-h::before, .seg-live, .group-live .q-section-head h2::before, .more-shape i { animation: none; }
  .pl-score.moved, .gs-score .moved, .leg-live-score.moved, .pl-slip.fresh, .lotto-bought-mark, .sc-result.won { animation: none; }
  .lotto-bought-mark svg { animation: none; stroke-dashoffset: 0; }
}

/* ---- Round 3 (phase 1): no emoji icons, bigger logos, a full home. ---- */
.q-ask-icon.kit svg, .q-empty-icon.kit svg { width: 30px; height: 30px; }
.q-ask-icon.kit { color: var(--q-accent, var(--accent)); }
.q-empty-icon.kit { display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto; border-radius: 16px; background: var(--q-fill-3); color: var(--q-accent, var(--accent)); }
.q-tile.init { font: 700 17px/1 var(--q-font-rounded, var(--q-font)); color: #fff; }
.q-tile .q-gl { width: 22px; height: 22px; }
.chip-glyph.q-gl { width: 18px; height: 18px; }
.q-chip { min-height: 36px; }
.league-icon .q-gl { width: 70%; height: 70%; }
/* Logos: the hero of their row. */
.pl-game .logo-sm, .pl-game .pl-team .logo, .pl-mcard .logo-sm, .pl-team .logo-sm { width: 32px; height: 32px; }
.pl-team .logo-sm.logo-fallback { font-size: 12px; }
.pl-game-top .league-badge.logo-xs, .pl-mcard-top .league-badge.logo-xs { --s: 26px; }
.q-section-head .league-badge { --s: 28px; }
.pl-game { min-height: 48px; }
/* Pages end above the tab bar. */
#home-body, #lottery-body, #panel-history { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
/* Draw sheet: hero (K6 look), pick card, grid, prizes, buy bar. */
.ls-hero { display: block; padding: 16px; border-radius: 20px; background: linear-gradient(135deg, color-mix(in srgb, var(--lotto) 92%, #000), color-mix(in srgb, var(--lotto) 70%, #fff)); color: #fff; }
.ls-hero small.ls-eyebrow { display: block; color: #fff; opacity: 0.85; font: 600 13px/1.2 var(--q-font); }
.ls-hero strong.ls-big { display: block; margin-top: 6px; color: #fff; font: 800 34px/1.1 var(--q-font-rounded, var(--q-font)); white-space: nowrap; overflow: visible; }
.ls-hero .ls-sub { display: block; margin-top: 4px; font: 500 14px/1.35 var(--q-font); opacity: 0.92; }
.ls-hero .ls-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ls-hero .q-tag { background: rgba(255, 255, 255, 0.2); color: #fff; }
.ls-slip { border: 0; background: var(--q-surface); }
.ls-slip.done { border: 0; box-shadow: inset 0 0 0 1.5px var(--lotto); }
.ls-slip-head strong { color: var(--q-label); }
.ls-slot { width: 28px; height: 28px; border: 1.5px solid var(--q-sep); }
.ls-slot.special { border-color: var(--q-sep); }
.ls-fill, .ls-add { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; }
.ls-fill .q-gl, .ls-add .q-gl { width: 16px; height: 16px; }
.num-grid { --cols: 7; gap: 6px; }
.num-cell { min-height: 40px; font-size: 14px; }
@media (max-width: 340px) { .num-grid { --cols: 6; } }
.lotto-prizes summary { display: flex; align-items: center; justify-content: space-between; min-height: 44px; list-style: none; color: var(--q-label); }
.lotto-prizes summary::-webkit-details-marker { display: none; }
.lotto-prizes summary::after { content: ''; width: 18px; height: 18px; background: var(--q-label-2); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 5 7 7-7 7'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 5 7 7-7 7'/%3E%3C/svg%3E") center / contain no-repeat; transition: transform 0.2s; }
.lotto-prizes[open] summary::after { transform: rotate(90deg); }
.balls.mini .ball, .ball.dim { width: 28px; height: 28px; font-size: 13px; }
.stepper button { width: 44px; height: 44px; font-size: 20px; }
.ls-buybar .q-btn.primary { min-height: 50px; border-radius: 14px; }
.ls-buybar .q-btn.primary:disabled { background: var(--q-fill-3); color: var(--q-label-2); opacity: 1; }
/* 彩券 tiles: a logo, the amount, the countdown. */
.lt-grid { gap: 10px; }
.lt-tile { min-height: 112px; align-content: space-between; }
.lt-logo { width: 32px; height: 32px; border-radius: 10px; font-size: 15px; }
.lt-logo + span { flex: 1; }
.lt-big { color: var(--q-label); font-size: 22px; font-weight: 800; }
.sc-card-icon.q-tile { width: 48px; height: 48px; font-size: 20px; }
.sc-band-icon.q-tile { width: 40px; height: 40px; font-size: 18px; }
.sc-result-icon { width: 28px; height: 28px; }
/* ---- Home: stat cells, quick actions, live strip, wide cards, 彩券 ---- */
.pl-hero { gap: 8px; }
.pl-hero .q-hc-eyebrow .pl-plus { margin-left: auto; padding: 2px 8px; background: rgba(255, 255, 255, 0.2); color: #fff; font-size: 11px; letter-spacing: 0.06em; }
.pl-hc-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.pl-hc-cell { display: grid; gap: 4px; min-width: 0; padding: 10px 12px; border: 0; border-radius: 14px; background: rgba(255, 255, 255, 0.12); color: #fff; text-align: left; }
.pl-hc-cell small { font: 600 12px/1.2 var(--q-font); opacity: 0.8; white-space: nowrap; }
.pl-hc-cell strong { font: 700 17px/1.2 var(--q-font); white-space: nowrap; }
.pl-actions, .q-actions-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 16px; }
.pl-action { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 76px; border: 0; border-radius: 16px; background: var(--q-surface); color: var(--q-label); font: 500 13px/1.2 var(--q-font); }
.pl-action .q-tile { width: 36px; height: 36px; border-radius: 10px; }
.pl-action .q-tile svg { width: 20px; height: 20px; }
.pl-badge { position: absolute; top: 8px; right: 12px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--q-red); color: #fff; font: 600 11px/18px var(--q-font); text-align: center; }
@media (max-width: 340px) { .pl-action { min-height: 68px; font-size: 12px; } .pl-badge { right: 8px; } }
.q-section { margin-top: 24px; }
.pl-livestrip { --q-rail-w: 200px; }
.pl-live-card { display: grid; gap: 8px; align-content: start; min-height: 96px; padding: 10px 12px; border: 0; text-align: left; color: var(--q-label); }
.pl-live-min { display: flex; align-items: center; gap: 6px; color: var(--q-red); font: 600 12px/1 var(--q-font); white-space: nowrap; }
.pl-live-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.pl-live-row .logo { width: 28px; height: 28px; }
.pl-live-row b { overflow: hidden; font: 600 15px/1.2 var(--q-font); white-space: nowrap; }
.pl-live-row .num { font: 700 20px/1 var(--q-font); text-align: right; }
.pl-wide { display: grid; gap: 10px; }
.pl-mcard.wide { padding: 12px 14px; border-radius: 20px; background: var(--q-surface); }
.pl-mcard.wide .pl-team { min-height: 52px; }
.pl-mcard.wide .logo { width: 40px; height: 40px; }
.pl-combos { --q-rail-w: min(84%, 300px); }
.pl-combo .logo { width: 32px; height: 32px; }
.pl-combo-foot { display: grid; grid-template-columns: 1fr auto; }
.pl-combo-go { min-height: 44px; }
.pl-lottery { min-height: 132px; }
.pl-lottery-wrap { display: grid; gap: 10px; }
.pl-lottery-skel { height: 132px; border-radius: 20px; }
.pl-lt-mini { min-height: 104px; }
.pl-empty-row { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 20px 16px; border-radius: 20px; background: var(--q-surface); text-align: center; }
.pl-empty-row .q-tile { width: 48px; height: 48px; }
.pl-empty-row .q-tile svg { width: 26px; height: 26px; }
.q-ritem .logo-md, .q-ritem .q-tile { flex: none; }
.q-ritem .q-ritem-title, .q-ritem-text .q-ritem-title { white-space: normal !important; overflow: visible !important; text-overflow: clip !important; }
.lt-name span { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.2; }
.lt-name { font-size: 14px; }
.sl { min-width: 0; }
.sl .q-sheet-foot { display: block; }
.sl .q-sheet-foot .place-button { width: 100%; min-width: 0; }
.sl-leg { min-width: 0; }
.sl > * { min-width: 0; max-width: 100%; }
.sl-quick { flex-wrap: wrap; overflow: visible; }
.sl-quick .q-chip { flex: 1 1 56px; justify-content: center; }
#parlay-body { min-width: 0; }
.sl-stake-field, .sl-stake-box, .sl-stake-box input { min-width: 0; max-width: 100%; }
.sl-stake-box input { width: 100%; }
.sl-leg > :first-child { flex: none; min-width: 32px; }
.sl-leg > .logo, .sl-leg > picture, .sl-leg > .league-badge { width: 32px; height: 32px; }
.sl-leg picture img, .sl-leg > .logo { width: 32px; height: 32px; }
.slip-leg-game { white-space: normal; overflow: visible; text-overflow: clip; }
.sl-pay:has(.q-sheet-hero) { padding: 0; background: none; }
.sl-pay .q-sheet-hero { margin: 0; }
.sl .q-sheet-foot { display: grid; gap: 6px; }
.sl .q-sheet-foot > * { width: 100%; }
/* Beats calm: a few big rounded panels; the cards inside sit on the panel's own tone. */
.q-section { margin-top: 28px; }
.pl-panel { padding: 16px 12px 12px; border-radius: 28px; background: var(--q-surface); }
.pl-panel .q-section-head { padding: 0 8px 12px; }
.pl-panel .q-match, .pl-panel .q-live-card, .pl-panel .pl-mcard.wide, .pl-panel .q-rowcard { background: var(--q-page, var(--q-fill-3)); }
.pl-panel .q-rowcard { background: none; }
.pl-panel .pl-empty-row { background: none; }
.pl-actions, .q-actions-grid { margin-top: 20px; }

/* The confirm is a solid surface, not glass. */
.q-ask { background: var(--q-surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
/* A slip group's head keeps its title whole; the summary wraps under it. */
.q-section-head h2 { white-space: nowrap; }
.group-sum { min-width: 0; text-align: right; }
