/* Public results page: compact white and blue layout. */
:root {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; cursor: pointer; }
button:disabled { cursor: wait; opacity: .6; }
a { text-underline-offset: .18em; }
.skip-link { position: absolute; z-index: 10; top: -5rem; left: 12px; padding: 8px 12px; border-radius: 5px; color: #fff; background: #172438; }
.skip-link:focus { top: 8px; }
.site-header { display: flex; align-items: center; }
.brand { display: inline-flex; align-items: center; flex: 0 0 auto; font-weight: 760; text-decoration: none; white-space: nowrap; }
.icon-button svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.game-tab { cursor: pointer; }
.status-message { line-height: 1.5; }
.section-topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.state-badge { display: inline-flex; align-items: center; flex: 0 0 auto; font-weight: 650; white-space: nowrap; }
.state-badge.is-stale { color: #966329; background: #fff3e2; }
.state-badge.is-error { color: #b03d49; background: #fff0f2; }
.period-countdown .next-panel { flex-direction: column; }
.skeleton { border-radius: 5px; background: linear-gradient(90deg, #e9eff5, #f6f9fb, #e9eff5); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
.skeleton-balls { width: min(100%, 480px); height: 90px; }
@keyframes shimmer { to { background-position-x: -200%; } }
.details-heading { display: flex; justify-content: space-between; gap: 12px; }
.details-heading h2 { margin: 0; }
.details-heading p { color: #708094; }
.detail-tab { cursor: pointer; }
.detail-tab:hover { border-color: #92caeb; color: #207bb6; }
.more-button { display: block; padding: 0 16px; background: #fff; font-weight: 650; }
.empty-result p, .empty-detail { color: #708094; line-height: 1.5; }
.empty-detail strong { display: block; color: #172438; }
.insight-intro h3 { margin: 0; }
.insight-intro p { margin: 5px 0 0; color: #708094; line-height: 1.5; }
.insight-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.insight-item strong, .insight-item span, .stat-summary strong, .stat-summary span { display: block; }
.stat-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.frequency-list { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.frequency-cell { padding: 7px 4px; text-align: center; font-variant-numeric: tabular-nums; }
.frequency-cell strong, .frequency-cell span { display: block; }
.frequency-cell strong { font-size: 13px; }
.frequency-cell span { margin-top: 2px; color: #708094; font-size: 10px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .skeleton { animation: none; }
}

/* Compact results layout, following the supplied pc28.ai reference. */
:root {
  color: #172438;
  background: #f7f9fc;
  --ink: #172438;
  --muted: #708094;
  --line: #e2e8ef;
  --paper: #fff;
  --accent: #2d98d2;
  --accent-light: #eaf6fc;
  --radius: 12px;
}
body { min-width: 320px; }
a { color: #237db4; }
::selection { background: #2d98d2; }
:focus-visible { outline-color: #2d98d2; }
[hidden] { display: none !important; }
.app-shell { width: min(100%, 1540px); max-width: none; padding: 0 18px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.result-layout, .result-layout.is-single { display: block; }
.site-header { min-height: 66px; gap: 22px; padding: 0 4px; border-bottom: 1px solid var(--line); background: #fff; }
.brand { gap: 8px; font-size: 18px; color: var(--ink); }
.game-tabs { display: flex; align-items: stretch; gap: 2px; min-height: 66px; margin: 0; padding: 0; border-radius: 0; background: transparent; }
.game-tab { position: relative; min-width: 92px; min-height: 0; padding: 0 13px; border: 0; border-radius: 0; color: #647388; background: transparent; font-size: 14px; font-weight: 650; box-shadow: none; }
.game-tab.is-active { color: #207bb6; background: transparent; box-shadow: none; }
.game-tab.is-active::after { content: ""; position: absolute; right: 12px; bottom: 0; left: 12px; height: 3px; border-radius: 3px 3px 0 0; background: var(--accent); }
.icon-button { display: inline-grid; place-items: center; flex: 0 0 auto; width: 36px; height: 36px; margin-left: auto; padding: 0; border: 1px solid var(--line); border-radius: 7px; color: #53667b; background: #fff; }
.icon-button:hover { color: #207bb6; background: #eef8fe; }
.icon-button svg { width: 19px; height: 19px; }
.header-status { margin-left: auto; padding: 0; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.header-status + .icon-button { margin-left: 0; }
.status-message { margin: 14px 0; padding: 10px 12px; border: 1px solid #f2dab2; border-radius: 5px; font-size: 13px; }
.status-message.is-error { border-color: #f4c7cc; }
.latest-panel { min-width: 0; min-height: 0; margin-top: 16px; padding: 18px 14px 20px; border: 1px solid var(--line); border-radius: 17px; background: #fff; }
.section-topline { min-height: 36px; }
.section-topline h1, .section-topline h2 { margin: 0; font-size: 24px; line-height: 1.3; font-weight: 760; letter-spacing: -.02em; }
.state-badge { padding: 4px 8px; border-radius: 4px; font-size: 11px; }
.state-badge.is-ok { color: #268457; background: #eaf7ef; }
.period-countdown { display: flex; align-items: center; justify-content: center; flex-direction: column; width: min(100%, 390px); min-height: 94px; margin: 8px auto 16px; padding: 12px 14px; border: 1px solid #a4d9f7; border-radius: 19px; background: #eff9ff; text-align: center; font-variant-numeric: tabular-nums; }
.period, #latest-period { margin: 0; color: #66758a; font-size: 18px; line-height: 1.35; font-weight: 700; overflow-wrap: anywhere; }
.period-countdown .next-panel { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 3px 8px; min-height: 0; margin-top: 3px; padding: 0; border: 0; background: none; }
.period-countdown .next-label { width: 100%; color: #8390a1; font-size: 13px; font-weight: 600; }
.period-countdown .next-panel h2 { color: #8390a1; font-size: 13px; font-weight: 600; }
.period-countdown .next-value { margin: 0; color: var(--ink); font-size: 20px; line-height: 1.3; font-weight: 750; letter-spacing: .02em; }
.period-countdown .next-note { width: 100%; margin: 1px 0 0; color: var(--muted); font-size: 11px; line-height: 1.3; }
.latest-content { min-width: 0; padding: 0; }
.draw-line { display: flex; align-items: center; justify-content: center; flex-wrap: nowrap; gap: clamp(3px, .8vw, 12px); min-width: 0; min-height: 126px; margin: 0; padding: 17px 8px; border: 1px solid #edf1f5; border-radius: 17px; background: #f7f9fc; font-variant-numeric: tabular-nums; }
.draw-ball { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 54px; height: 54px; border: 0; border-radius: 13px; color: var(--ink); background: #eef1f7; box-shadow: 0 7px 18px #1c3a6010; font-size: 28px; font-weight: 720; }
.draw-ball.special { color: #fff; background: #eb4855; }
.draw-operator { flex: 0 0 auto; color: var(--ink); font-size: 24px; font-weight: 690; }
.draw-sum { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; min-width: 56px; min-height: 56px; height: 56px; padding: 0 8px; border-radius: 13px; color: #fff; background: #2ca9e5; box-shadow: 0 6px 16px #2d9bd926; font-size: 26px; font-weight: 760; }
.draw-classification { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 13px 0 0; color: #237db4; font-size: 15px; font-weight: 700; }
.result-chips { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; gap: 8px; margin-left: clamp(8px, 1.8vw, 28px); }
.result-chip { display: inline-flex; align-items: center; justify-content: center; min-width: 41px; min-height: 38px; padding: 4px 7px; border-radius: 9px; color: #fff; background: #2d9cf0; font-size: 19px; font-weight: 730; line-height: 1; }
.result-chip.is-big, .result-chip.is-even { background: #f24560; }
.result-chip.is-small, .result-chip.is-odd { background: #329bf0; }
.draw-time { margin: 11px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
.empty-result { padding: 20px 8px; text-align: center; }
.empty-result strong { font-size: 16px; }
.empty-result p { font-size: 13px; }
.skeleton-period { margin: 0 auto 12px; }
.skeleton-balls { margin: 0 auto; }
.skeleton-time { margin: 12px auto 0; }
.omission-preview { margin-top: 2px; padding: 0 0 4px; }
.omission-title { display: flex; align-items: center; min-height: 36px; margin: 0 0 9px; padding: 0 10px; border-radius: 6px; color: #3d566a; background: #eaf5fc; font-size: 15px; font-weight: 690; }
.omission-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0; }
.omission-item { display: flex; align-items: center; gap: 12px; min-width: 0; min-height: 74px; padding: 10px; border: 1px solid #dfe6ec; border-radius: 10px; background: #fff; }
.omission-number { display: inline-grid; place-items: center; flex: 0 0 auto; width: 48px; height: 48px; border-radius: 50%; color: #fff; background: #3699d0; font-size: 20px; font-weight: 740; font-variant-numeric: tabular-nums; }
.omission-metric { display: grid; gap: 2px; min-width: 0; color: #66717f; font-size: 12px; line-height: 1.35; }
.omission-metric strong { color: #ed554b; font-size: 13px; font-variant-numeric: tabular-nums; }
.details-section { margin-top: 10px; padding: 0; border: 0; }
.details-heading { align-items: center; margin: 0 0 10px; }
.details-heading h2 { font-size: 18px; }
.details-heading p { margin-top: 2px; font-size: 12px; }
#game-panel[data-game="canada"] .details-heading { display: none; }
.sample-count { font-size: 11px; }
.detail-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; margin: 0 0 12px; border: 0; overflow: visible; }
.detail-tab { min-width: 0; min-height: 42px; padding: 7px 4px; border: 2px solid #d9e0e6; border-radius: 8px; color: #727b86; background: #fff; font-size: 15px; font-weight: 680; white-space: nowrap; }
.detail-tab.is-active { border-color: var(--accent); color: #fff; background: #349bd4; box-shadow: 0 4px 9px #349bd42a; }
.detail-content { min-height: 120px; }
.table-scroll { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.results-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-variant-numeric: tabular-nums; }
.results-table th { height: 40px; padding: 7px 5px; border-right: 1px solid #e1e6ec; color: #495b6a; background: #edf2f7; font-size: 13px; font-weight: 690; text-align: center; }
.results-table th:last-child { border-right: 0; }
.results-table td { height: 41px; padding: 5px 4px; border-top: 1px solid #e9edf1; color: #314358; font-size: 13px; text-align: center; vertical-align: middle; }
.results-table tbody tr:nth-child(even) { background: #f6f8fa; }
.results-table tbody tr:hover { background: #edf7fd; }
.results-table th:nth-child(1), .results-table td:nth-child(1) { width: 16%; }
.results-table th:nth-child(2), .results-table td:nth-child(2) { width: 15%; }
.results-table th:nth-child(3), .results-table td:nth-child(3) { width: 38%; }
.results-table th:nth-child(4), .results-table td:nth-child(4) { width: 19%; }
.results-table th:nth-child(5), .results-table td:nth-child(5) { width: 12%; }
.results-table.is-marksix th:nth-child(1), .results-table.is-marksix td:nth-child(1) { width: 20%; }
.results-table.is-marksix th:nth-child(2), .results-table.is-marksix td:nth-child(2) { width: 22%; }
.results-table.is-marksix th:nth-child(3), .results-table.is-marksix td:nth-child(3) { width: 44%; }
.results-table.is-marksix th:nth-child(4), .results-table.is-marksix td:nth-child(4) { width: 14%; }
.mini-draw { display: inline-flex; align-items: center; justify-content: center; flex-wrap: nowrap; gap: 3px; max-width: 100%; white-space: nowrap; }
.mini-ball { display: inline-grid; place-items: center; flex: 0 0 auto; min-width: 23px; height: 23px; padding: 0 3px; border: 1px solid #a8d7ec; border-radius: 50%; color: #233b4b; background: #e9f8ff; box-shadow: 0 1px 3px #43658033; font-size: 12px; font-weight: 700; }
.mini-ball.special { border-color: #f7b3b8; color: #b53443; background: #fff0f2; }
.mini-operator { flex: 0 0 auto; color: #445666; font-size: 12px; font-weight: 650; }
.results-table .result-chip { min-width: 27px; min-height: 25px; margin: 1px; padding: 3px 5px; border-radius: 5px; font-size: 12px; }
.position-tag { display: inline-block; min-width: 31px; padding: 3px 4px; border-radius: 5px; color: #745b43; background: #f5e8d9; font-size: 12px; font-weight: 660; }
.position-tag.is-edge { color: #fff; background: #dd8b2b; }
.row-period { font-weight: 660; }
.row-time { color: #6e7e8b; font-size: 12px; }
.row-result { font-size: 12px; }
.more-button { min-height: 38px; margin-top: 12px; border-color: #a8d2eb; border-radius: 6px; color: #237db4; }
.more-button:hover { background: #eef8fe; }
.empty-detail { padding: 28px 6px; font-size: 13px; text-align: center; }
.insight-intro { padding: 12px 2px 4px; }
.insight-intro h3 { font-size: 16px; }
.insight-intro p { font-size: 12px; }
.insight-list { gap: 8px; margin-top: 10px; }
.insight-item, .stat-summary div { padding: 12px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.insight-item strong, .stat-summary strong { color: #237db4; font-size: 18px; }
.insight-item span, .stat-summary span { font-size: 11px; }
.stat-summary { gap: 8px; margin: 13px 0; }
.frequency-list { gap: 6px; }
.frequency-cell { min-height: 50px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.site-footer { margin-top: 20px; padding: 13px 4px 18px; font-size: 11px; }

@media (max-width: 720px) {
  .app-shell { padding: 0 10px; }
  .site-header { min-height: 56px; gap: 8px; padding: 0 2px; }
  .brand { gap: 5px; font-size: 14px; }
  .game-tabs { width: auto; min-height: 56px; }
  .game-tab { flex: 0 0 auto; min-width: 68px; padding: 0 5px; font-size: 12px; }
  .game-tab.is-active::after { right: 5px; left: 5px; }
  .header-status { display: none; }
  .icon-button { width: 30px; height: 30px; }
  .icon-button svg { width: 16px; height: 16px; }
  .latest-panel { min-height: 0; margin-top: 10px; padding: 12px 8px 14px; border-radius: 11px; }
  .section-topline h1, .section-topline h2 { font-size: 19px; }
  .period-countdown { min-height: 76px; margin: 7px auto 10px; padding: 7px; border-radius: 12px; }
  .period, #latest-period { font-size: 15px; }
  .period-countdown .next-panel { display: flex; min-height: 0; padding: 0; }
  .period-countdown .next-value { font-size: 17px; }
  .draw-line { min-height: 79px; gap: 4px; padding: 10px 4px; border-radius: 9px; }
  .draw-ball { width: 34px; height: 34px; border-radius: 8px; font-size: 19px; }
  .draw-operator { font-size: 16px; }
  .draw-sum { min-width: 38px; min-height: 37px; height: 37px; border-radius: 8px; font-size: 18px; }
  .draw-classification { gap: 5px; margin-top: 8px; }
  .result-chips { gap: 4px; margin-left: 4px; }
  .result-chip { min-width: 30px; min-height: 28px; border-radius: 6px; font-size: 15px; }
  .omission-title { min-height: 31px; font-size: 13px; }
  .omission-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .omission-item { min-height: 59px; gap: 7px; padding: 6px; }
  .omission-number { width: 34px; height: 34px; font-size: 14px; }
  .omission-metric { font-size: 10px; }
  .omission-metric strong { font-size: 11px; }
  .detail-tabs { grid-template-columns: 1fr; gap: 5px; margin-bottom: 8px; }
  .detail-tab { min-height: 35px; padding: 5px 8px; border-width: 1px; border-radius: 5px; font-size: 13px; }
  .results-table th { height: 31px; padding: 4px 1px; font-size: 11px; }
  .results-table td { height: 33px; padding: 4px 1px; font-size: 11px; }
  .row-time { font-size: 10px; }
  .mini-draw { gap: 1px; }
  .mini-ball { min-width: 16px; height: 16px; padding: 0 1px; font-size: 10px; }
  .mini-operator { font-size: 9px; }
  .results-table .result-chip { min-width: 19px; min-height: 19px; margin: 0 1px; padding: 2px; border-radius: 3px; font-size: 10px; }
  .position-tag { min-width: 21px; padding: 2px; font-size: 10px; }
  .insight-list { gap: 5px; }
  .insight-item, .stat-summary div { padding: 8px 5px; }
  .insight-item strong, .stat-summary strong { font-size: 15px; }
  .frequency-list { gap: 3px; }
  .frequency-cell { min-height: 42px; padding: 4px 1px; }
  .frequency-cell strong { font-size: 11px; }
  .frequency-cell span { font-size: 9px; }
}

@media (max-width: 370px) {
  .game-tab { min-width: 61px; font-size: 11px; }
  .draw-line { gap: 2px; }
  .draw-ball { width: 31px; height: 31px; font-size: 17px; }
  .draw-sum { min-width: 35px; min-height: 34px; height: 34px; font-size: 17px; }
  .results-table th:nth-child(1), .results-table td:nth-child(1) { width: 18%; }
  .results-table th:nth-child(2), .results-table td:nth-child(2) { width: 14%; }
  .results-table th:nth-child(3), .results-table td:nth-child(3) { width: 39%; }
  .results-table th:nth-child(4), .results-table td:nth-child(4) { width: 18%; }
  .results-table th:nth-child(5), .results-table td:nth-child(5) { width: 11%; }
}

/* A clearer results-first visual system; the information and navigation stay compact. */
:root {
  color: #172b3b;
  background: #f3f5f6;
  --ink: #172b3b;
  --muted: #586b7c;
  --line: #dce4e8;
  --paper: #fff;
  --accent: #1779b5;
  --accent-light: #e7f2f8;
  --radius: 14px;
}
body { background: #f3f5f6; }
::selection { color: #fff; background: #166d9f; }
:focus-visible { outline: 3px solid #0f8fcd; outline-offset: 3px; }
a { color: #12699f; }
.app-shell { width: min(100%, 1180px); margin: 0 auto; padding: 0 20px 48px; }
.site-header { min-height: 72px; margin-bottom: 20px; padding: 0 2px; border-bottom-color: #d6e0e5; background: transparent; }
.brand { gap: 9px; color: #102b3f; font-size: 20px; letter-spacing: -.025em; }
.game-tabs { min-height: 72px; gap: 12px; }
.game-tab { min-width: 104px; padding: 0 8px; color: #566b7c; font-size: 15px; }
.game-tab:hover { color: #116a9f; }
.game-tab.is-active { color: #104f76; }
.game-tab.is-active::after { right: 8px; left: 8px; height: 3px; background: #167db9; }
.icon-button { width: 40px; height: 40px; border-color: #d2dde4; border-radius: 9px; color: #375669; }
.icon-button:hover { color: #0e679c; background: #e8f3fa; }
.icon-button:focus-visible, .game-tab:focus-visible, .detail-tab:focus-visible, .more-button:focus-visible { outline: 3px solid #0f8fcd; outline-offset: 2px; }

.latest-panel { margin-top: 0; padding: 24px 28px 20px; border: 0; border-radius: 16px; color: #f5fbff; background: #142c40; box-shadow: 0 14px 30px rgba(15, 39, 58, .15); }
.section-topline { min-height: 36px; }
.section-topline h1, .section-topline h2 { color: #fff; font-size: 24px; letter-spacing: -.025em; }
.state-badge { padding: 6px 10px; border-radius: 6px; font-size: 12px; }
.state-badge.is-ok { color: #c6f2df; background: #285445; }
.state-badge.is-stale { color: #ffe5b9; background: #584936; }
.state-badge.is-error { color: #ffd3d6; background: #653645; }
.period-countdown { display: flex; align-items: flex-end; justify-content: space-between; flex-direction: row; gap: 18px; width: 100%; max-width: none; min-height: 0; margin: 20px 0 0; padding: 0; border: 0; border-radius: 0; background: transparent; text-align: left; }
.period, #latest-period { color: #e8f3f9; font-size: 23px; font-weight: 750; letter-spacing: -.02em; }
.period-countdown .next-panel { align-items: flex-end; justify-content: flex-end; gap: 1px; margin: 0; text-align: right; }
.period-countdown .next-label { color: #b9d1e0; font-size: 12px; font-weight: 550; }
.period-countdown .next-value { color: #fff; font-size: 27px; font-weight: 750; }
.period-countdown .next-note { color: #b9d1e0; font-size: 11px; }
.latest-content { margin-top: 17px; }
.draw-line { justify-content: center; min-height: 104px; gap: clamp(5px, 1.1vw, 15px); margin: 0; padding: 20px 4px 5px; border: 0; border-top: 1px solid #3b566a; border-radius: 0; background: transparent; }
.draw-ball { width: 58px; height: 58px; border-radius: 11px; color: #182d3e; background: #fff; box-shadow: none; font-size: 28px; }
.draw-ball.special { color: #fff; background: #c53e54; }
.draw-operator { color: #b9d1df; font-size: 25px; }
.draw-sum { min-width: 62px; min-height: 62px; height: 62px; border-radius: 11px; background: #1784c2; box-shadow: none; font-size: 29px; }
.result-chips { gap: 7px; margin-left: 13px; }
.result-chip { min-width: 43px; min-height: 43px; border-radius: 9px; font-size: 19px; }
.result-chip.is-small, .result-chip.is-odd { background: #167bb7; }
.result-chip.is-big, .result-chip.is-even { background: #c33d52; }
.draw-time { color: #c3d8e4; }
.empty-result p { color: #c3d8e4; }
.empty-result strong { color: #fff; }
.skeleton { background: linear-gradient(90deg, #345267, #4a6a7e, #345267); background-size: 200% 100%; }

.omission-preview { margin-top: 0; padding: 0; }
.omission-title { min-height: 0; margin: 0 0 10px; padding: 0; border: 0; border-radius: 0; color: #193448; background: transparent; font-size: 18px; font-weight: 740; }
.omission-grid { gap: 0; overflow: hidden; border: 1px solid #dce4e8; border-radius: 12px; background: #fff; }
.omission-item { min-height: 76px; gap: 11px; padding: 12px 15px; border: 0; border-radius: 0; background: transparent; }
.omission-item:not(:first-child) { border-left: 1px solid #e8edef; }
.omission-number { width: 40px; height: 40px; border-radius: 9px; color: #12699f; background: #e7f2f8; font-size: 17px; }
.omission-metric { color: #4a6070; font-size: 12px; }
.omission-metric strong { color: #b64a45; }

.details-section { margin-top: 17px; }
.details-heading { margin-bottom: 10px; }
.detail-tabs { gap: 4px; margin: 0 0 12px; padding: 4px; border-radius: 11px; background: #e7edf1; }
.detail-tab { min-height: 42px; padding: 7px 9px; border: 0; border-radius: 8px; color: #435b6c; background: transparent; font-size: 14px; font-weight: 680; }
.detail-tab:hover { border: 0; color: #0c648f; background: #f5fafc; }
.detail-tab.is-active { border: 0; color: #103c59; background: #fff; box-shadow: 0 2px 6px rgba(24, 54, 76, .12); }
.table-scroll { border-color: #d7e0e5; border-radius: 12px; }
.results-table th { height: 43px; border-right-color: #dce4e8; color: #2d4658; background: #eaf0f3; font-size: 13px; }
.results-table td { height: 45px; border-top-color: #e7ecef; color: #213b4e; }
.results-table tbody tr:nth-child(even) { background: #f8fafb; }
.results-table tbody tr:hover { background: #eaf4f8; }
.results-table tbody tr:first-child { background: #edf6fa; }
.row-period { color: #183e56; font-weight: 730; }
.row-time { color: #536a78; }
.mini-ball { border-color: #8ac1db; color: #174667; background: #f2faff; box-shadow: none; }
.mini-ball.sum { border-color: #177fb9; color: #fff; background: #177fb9; }
.mini-ball.special { border-color: #d38d9b; color: #ae3049; background: #fff1f4; }
.results-table .result-chip { min-width: 27px; min-height: 25px; border-radius: 5px; font-weight: 750; }
.results-table .result-chip.is-small, .results-table .result-chip.is-odd { color: #095d92; background: #e3f2fb; }
.results-table .result-chip.is-big, .results-table .result-chip.is-even { color: #ac3046; background: #fde9ec; }
.position-tag { color: #536877; background: #e9eef0; }
.position-tag.is-edge { color: #925632; background: #f9ebd9; }
.more-button { min-height: 42px; border: 1px solid #b8d2e0; border-radius: 8px; color: #0b659b; }
.more-button:hover { background: #e9f5fa; }
.mobile-row-time, .mobile-position { display: none; }

.insight-intro { padding: 12px 2px 9px; }
.insight-intro h3 { color: #18394f; }
.insight-intro p { color: #546a78; }
.insight-item, .stat-summary div, .frequency-cell { border-color: #dce4e8; border-radius: 9px; }
.insight-item strong, .stat-summary strong { color: #12699f; }
.omission-cell { display: grid; gap: 3px; min-width: 0; min-height: 66px; padding: 11px 7px; border-right: 1px solid #e8edef; border-bottom: 1px solid #e8edef; text-align: center; }
.omission-cell strong { color: #1b4e6c; font-size: 17px; font-variant-numeric: tabular-nums; }
.omission-cell span { color: #566b79; font-size: 11px; line-height: 1.35; }
.omission-cell.is-unseen { background: #fff8ef; }
.omission-cell.is-unseen strong { color: #9d5b26; }
.detail-content > .omission-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); margin-top: 11px; }

@media (max-width: 720px) {
  .app-shell { padding: 0 12px 32px; }
  .site-header { min-height: 58px; gap: 7px; margin-bottom: 12px; }
  .brand { gap: 6px; font-size: 16px; }
  .game-tabs { min-height: 58px; gap: 1px; }
  .game-tab { min-width: 70px; padding: 0 4px; font-size: 12px; }
  .game-tab.is-active::after { right: 4px; left: 4px; }
  .icon-button { width: 44px; height: 44px; }
  .latest-panel { padding: 16px 14px 12px; border-radius: 12px; }
  .section-topline h1, .section-topline h2 { font-size: 20px; }
  .period-countdown { gap: 9px; margin-top: 13px; }
  .period, #latest-period { font-size: 16px; }
  .period-countdown .next-label { font-size: 10px; }
  .period-countdown .next-value { font-size: 20px; }
  .period-countdown .next-note { font-size: 9px; }
  .latest-content { margin-top: 10px; }
  .draw-line { min-height: 80px; gap: 5px; padding: 15px 0 4px; }
  .draw-ball { width: 35px; height: 35px; border-radius: 7px; font-size: 20px; }
  .draw-operator { font-size: 16px; }
  .draw-sum { min-width: 40px; min-height: 40px; height: 40px; border-radius: 8px; font-size: 20px; }
  .result-chips { gap: 4px; margin-left: 5px; }
  .result-chip { min-width: 30px; min-height: 30px; border-radius: 6px; font-size: 14px; }
  .omission-title { margin-bottom: 8px; font-size: 16px; }
  .omission-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .omission-item { min-height: 62px; padding: 8px 10px; }
  .omission-item:nth-child(odd) { border-left: 0; }
  .omission-item:nth-child(n+3) { border-top: 1px solid #e8edef; }
  .omission-number { width: 35px; height: 35px; font-size: 14px; }
  .omission-metric { font-size: 11px; }
  .details-section { margin-top: 14px; }
  .detail-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px; padding: 4px; }
  .detail-tab { min-height: 44px; padding: 6px 4px; font-size: 12px; }
  .results-table th { height: 34px; font-size: 11px; }
  .results-table td { height: 52px; font-size: 12px; }
  .results-table.is-canada th:nth-child(2), .results-table.is-canada td:nth-child(2),
  .results-table.is-canada th:nth-child(5), .results-table.is-canada td:nth-child(5),
  .results-table.is-marksix th:nth-child(2), .results-table.is-marksix td:nth-child(2) { display: none; }
  .results-table.is-canada th:nth-child(1), .results-table.is-canada td:nth-child(1) { width: 27%; }
  .results-table.is-canada th:nth-child(3), .results-table.is-canada td:nth-child(3) { width: 47%; }
  .results-table.is-canada th:nth-child(4), .results-table.is-canada td:nth-child(4) { width: 26%; }
  .results-table.is-marksix th:nth-child(1), .results-table.is-marksix td:nth-child(1) { width: 29%; }
  .results-table.is-marksix th:nth-child(3), .results-table.is-marksix td:nth-child(3) { width: 54%; }
  .results-table.is-marksix th:nth-child(4), .results-table.is-marksix td:nth-child(4) { width: 17%; }
  .period-id, .mobile-row-time, .mobile-position { display: block; }
  .mobile-row-time { margin-top: 2px; color: #687d89; font-size: 10px; font-weight: 450; }
  .mobile-position { margin-top: 3px; color: #6c7d86; font-size: 10px; font-weight: 500; }
  .mini-draw { gap: 2px; }
  .mini-ball { min-width: 20px; height: 20px; padding: 0 2px; font-size: 11px; }
  .mini-operator { font-size: 10px; }
  .results-table .result-chip { min-width: 22px; min-height: 21px; margin: 0 1px; padding: 2px; font-size: 11px; }
  .detail-content > .omission-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .omission-cell { min-height: 62px; padding: 8px 3px; }
  .omission-cell strong { font-size: 15px; }
  .omission-cell span { font-size: 10px; }
  .stat-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .frequency-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stat-summary div { padding: 11px; }
  .stat-summary span, .frequency-cell span { color: #526979; font-size: 11px; line-height: 1.35; }
  .frequency-cell { min-height: 49px; }
}

@media (max-width: 370px) {
  .app-shell { padding-inline: 9px; }
  .latest-panel { padding-inline: 10px; }
  .draw-line { gap: 3px; }
  .draw-ball { width: 31px; height: 31px; font-size: 18px; }
  .draw-sum { min-width: 36px; min-height: 36px; height: 36px; font-size: 18px; }
  .result-chip { min-width: 27px; min-height: 27px; font-size: 13px; }
  .mini-ball { min-width: 18px; height: 18px; font-size: 10px; }
}

/* Hong Kong Mark Six number classifications. */
.marksix-display-button:focus-visible { outline: 3px solid #0f8fcd; outline-offset: 2px; }
.marksix-display { display: flex; width: fit-content; max-width: 100%; gap: 3px; margin: 16px auto 0; padding: 3px; border: 1px solid #466477; border-radius: 9px; background: #203e53; }
.marksix-display-button { min-width: 64px; min-height: 31px; padding: 5px 13px; border: 0; border-radius: 6px; color: #c7dce8; background: transparent; font-size: 13px; font-weight: 650; cursor: pointer; }
.marksix-display-button.is-active { color: #173b53; background: #fff; }
.mark-six-ball, .mini-mark-six-ball { display: inline-flex; align-items: center; justify-content: flex-start; flex-direction: column; flex: 0 0 auto; }
.mark-six-ball { gap: 5px; }
.mini-mark-six-ball { gap: 2px; }
.draw-ball-caption { min-height: 16px; color: #d2e4ee; font-size: 12px; font-weight: 650; line-height: 1.2; }
.mini-ball-caption { min-height: 12px; color: #4c6370; font-size: 10px; font-weight: 650; line-height: 1; }
.draw-ball.is-red, .mini-ball.is-red { border-color: #bb4154; color: #fff; background: #c64a5a; }
.draw-ball.is-blue, .mini-ball.is-blue { border-color: #196da5; color: #fff; background: #247eb6; }
.draw-ball.is-green, .mini-ball.is-green { border-color: #247a63; color: #fff; background: #30886d; }
.draw-ball.special { outline: 2px solid #fff; outline-offset: 2px; }
.mini-ball.special { outline: 1px solid #17394c; outline-offset: 1px; }
.results-table.is-marksix td { height: 55px; }
.results-table.is-marksix .mini-draw { gap: 4px; }
.results-table.is-marksix .mini-ball { min-width: 25px; width: 25px; height: 25px; padding: 0; border-radius: 50%; }
.results-table.is-marksix .row-special .mini-mark-six-ball { margin: 0 auto; }

@media (max-width: 720px) {
  .marksix-display { margin-top: 11px; }
  .marksix-display-button { min-width: 58px; min-height: 30px; padding-inline: 10px; font-size: 12px; }
  #game-panel[data-game="marksix"] .draw-line, #game-panel[data-game="macau"] .draw-line { min-height: 86px; gap: 3px; }
  #game-panel[data-game="marksix"] .draw-ball, #game-panel[data-game="macau"] .draw-ball { width: clamp(28px, 8vw, 45px); height: clamp(28px, 8vw, 45px); font-size: clamp(16px, 4.8vw, 23px); }
  #game-panel[data-game="marksix"] .draw-operator, #game-panel[data-game="macau"] .draw-operator { font-size: 14px; }
  .draw-ball-caption { font-size: 10px; }
  .results-table.is-marksix td { height: 61px; }
  .results-table.is-marksix .mini-draw { gap: 2px; }
  .results-table.is-marksix .mini-ball { min-width: 20px; width: 20px; height: 20px; font-size: 10px; }
  .mini-ball-caption { font-size: 9px; }
}

@media (max-width: 520px) {
  .site-header { display: grid; grid-template-columns: 1fr auto; column-gap: 8px; row-gap: 0; }
  .game-tabs { grid-column: 1 / -1; grid-row: 2; width: 100%; min-height: 42px; }
  .game-tab { flex: 1 1 0; min-width: 0; min-height: 42px; }
  .icon-button { grid-column: 2; grid-row: 1; margin-left: 0; }
}

/* Draw information borrowed from the supplied Hong Kong/Macau reference. */
.game-tab { display: inline-flex; align-items: center; justify-content: center; flex-direction: column; gap: 2px; line-height: 1.2; }
.game-tab-date { min-height: 0; color: #718494; font-size: 11px; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.game-tab-date:empty { display: none; }
.game-tab.is-active .game-tab-date { color: #317dac; }
.period-summary { min-width: 0; }
.latest-date { display: block; margin-top: 5px; color: #b9d1e0; font-size: 12px; line-height: 1.4; font-variant-numeric: tabular-nums; }
.latest-date:empty { display: none; }
.history-shortcut { display: flex; align-items: center; justify-content: flex-end; gap: 6px; width: fit-content; min-height: 44px; margin: 0 0 0 auto; color: #c5e6fb; font-size: 13px; font-weight: 650; text-decoration: underline; text-decoration-color: #80b4d0; text-underline-offset: 4px; }
.history-shortcut:hover { color: #fff; }
.history-shortcut:focus-visible { outline: 3px solid #7ecfff; outline-offset: 2px; }
.history-shortcut span { font-size: 17px; line-height: 1; }
#game-panel[data-game="marksix"] .latest-content, #game-panel[data-game="macau"] .latest-content { margin-top: 8px; }
#game-panel[data-game="marksix"] .draw-line, #game-panel[data-game="macau"] .draw-line { justify-content: center; gap: clamp(6px, 1.4vw, 18px); }
#game-panel[data-game="marksix"] .draw-ball, #game-panel[data-game="macau"] .draw-ball {
  width: 66px; height: 66px; border: 5px solid; border-radius: 50%; color: #283e4d; background: #fff;
  box-shadow: 0 5px 12px rgba(3, 22, 37, .2); font-size: 28px;
}
#game-panel[data-game="marksix"] .draw-ball.is-red, #game-panel[data-game="macau"] .draw-ball.is-red { border-color: #ef4d59; }
#game-panel[data-game="marksix"] .draw-ball.is-blue, #game-panel[data-game="macau"] .draw-ball.is-blue { border-color: #3a9be4; }
#game-panel[data-game="marksix"] .draw-ball.is-green, #game-panel[data-game="macau"] .draw-ball.is-green { border-color: #35b87a; }
#game-panel[data-game="marksix"] .draw-ball.special, #game-panel[data-game="macau"] .draw-ball.special { outline: 0; }
#game-panel[data-game="marksix"] .draw-operator, #game-panel[data-game="macau"] .draw-operator { align-self: flex-start; margin-top: 13px; }
#game-panel[data-game="marksix"] .draw-ball-caption, #game-panel[data-game="macau"] .draw-ball-caption { color: #d8e9f1; font-size: 12px; white-space: nowrap; }

@media (max-width: 720px) {
  .game-tab-date { font-size: 10px; }
  .latest-date { font-size: 10px; }
  #game-panel[data-game="marksix"] .draw-line, #game-panel[data-game="macau"] .draw-line { gap: 3px; }
  #game-panel[data-game="marksix"] .draw-ball, #game-panel[data-game="macau"] .draw-ball {
    width: clamp(28px, 8vw, 46px); height: clamp(28px, 8vw, 46px);
    border-width: 3px; font-size: clamp(15px, 4.5vw, 21px);
  }
  #game-panel[data-game="marksix"] .draw-operator, #game-panel[data-game="macau"] .draw-operator { margin-top: 6px; }
  #game-panel[data-game="marksix"] .draw-ball-caption, #game-panel[data-game="macau"] .draw-ball-caption { font-size: 10px; }
}

@media (max-width: 520px) {
  .site-header { padding-bottom: 3px; }
  .game-tabs { min-height: 53px; }
  .game-tab { min-height: 53px; }
  .period-countdown { align-items: flex-start; }
  .period-summary { flex: 1 1 auto; }
  .period-countdown .next-panel { flex: 0 0 auto; max-width: 43%; }
  .history-shortcut { margin-top: 2px; }
  #game-panel[data-game="marksix"] .draw-ball, #game-panel[data-game="macau"] .draw-ball {
    width: clamp(30px, 9.8vw, 39px); height: clamp(30px, 9.8vw, 39px); font-size: clamp(16px, 5vw, 22px);
  }
}
