.status-block,
.waiting-plaque,
.countdown-hud small,
.history-card {
  display: none !important;
}

.draw-meta {
  justify-content: flex-start;
}

.countdown-hud {
  padding: 11px 20px;
}

.countdown-hud strong {
  margin-top: 0;
}

.countdown-hud.hidden {
  display: none;
}

.stage-shade {
  background: linear-gradient(180deg, #0206098c 0, transparent 22%, transparent 68%, #020609df 100%);
}

.stage-history {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 8px 18px;
  border-top: 1px solid #1c3443;
  background: #07131b;
}

.stage-history > span {
  flex: 0 0 auto;
  color: #91b5c6;
  font-size: 10px;
  letter-spacing: .12em;
}

.stage-history .history-grid {
  display: flex;
  gap: 7px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.stage-history .history-grid::-webkit-scrollbar {
  display: none;
}

.stage-history .history-item {
  flex: 0 0 48px;
  padding: 0;
  border: 0;
  background: transparent;
}

.stage-history .result-ball {
  width: 31px;
  height: 31px;
  font-size: 17px;
}

.stage-history .history-item span {
  margin-top: 3px;
  font-size: 8px;
}

.stage-history .empty {
  margin: 0;
  color: #6e8c9b;
  font-size: 10px;
}

.archive-card {
  margin-top: 14px;
  padding: 18px;
  border: 1px solid #1c3443;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(15, 28, 38, .97), rgba(6, 13, 19, .98));
  box-shadow: 0 18px 45px #0005;
}

.archive-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 13px;
}

.archive-heading small {
  color: #6f96aa;
  font-size: 9px;
  letter-spacing: .16em;
}

.archive-heading h2 {
  margin: 3px 0 0;
  font-size: 16px;
}

.archive-heading > span {
  color: #7897a7;
  font-size: 11px;
  white-space: nowrap;
}

.archive-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.archive-row {
  min-height: 52px;
  display: grid;
  grid-template-columns: minmax(112px, .75fr) 1fr;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid #18313f;
  border-radius: 10px;
  background: #08131a;
}

.archive-row time,
.archive-issue {
  color: #83a2b2;
  font-size: 11px;
}

.archive-balls {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
}

.archive-balls b {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #eaf7fc;
  color: #07111a;
  font-size: 12px;
}

.archive-balls b.special {
  background: #ffbd60;
}

.mouse-history-row {
  grid-template-columns: minmax(130px, 1fr) 104px 118px;
}

.mouse-history-row .result-ball {
  width: 31px;
  height: 31px;
  margin: 0;
  font-size: 16px;
}

.mouse-outcome,
.result-attributes {
  display: flex;
  align-items: center;
  gap: 6px;
}

.result-attributes i {
  display: grid;
  place-items: center;
  min-width: 27px;
  height: 25px;
  padding: 0 6px;
  border: 1px solid #2a4a5b;
  border-radius: 4px;
  background: #10232e;
  color: #a8d9ec;
  font-size: 12px;
  font-style: normal;
}

.archive-more {
  width: 100%;
  margin-top: 12px;
  padding: 10px 14px;
  border: 1px solid #26536a;
  border-radius: 10px;
  background: #0d2230;
  color: #8ddfff;
  cursor: pointer;
}

.archive-more:hover {
  border-color: #55ccff;
  background: #123044;
}

.archive-more:disabled {
  cursor: wait;
  opacity: .65;
}

.archive-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
}

.archive-pagination button {
  min-width: 86px;
  padding: 9px 14px;
  border: 1px solid #26536a;
  border-radius: 5px;
  background: #0d2230;
  color: #8ddfff;
  cursor: pointer;
}

.archive-pagination button:disabled {
  cursor: default;
  opacity: .35;
}

.archive-pagination span {
  min-width: 62px;
  text-align: center;
  color: #8ca7b5;
  font-size: 12px;
}

.official-history {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #1b3442;
}

.api-state a {
  color: #71d6ff;
}

.official-result-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.official-result-actions a {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 7px 11px;
  border: 1px solid #28536a;
  border-radius: 4px;
  background: #0b1d27;
  color: #8edfff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-decoration: none;
}

.official-result-actions .official-video-link {
  border-color: #4dbbe8;
  background: #11394b;
  color: #c2efff;
}

.official-result-actions a:hover {
  border-color: #88dcff;
  background: #17495e;
}

/* Crisp official-results typography. Scoped so live draw layouts stay untouched. */
.external-panel .external-hero small,
.external-panel .section-heading small {
  color: #91b7c9;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: .08em;
}

.external-panel .external-hero p {
  color: #a7c0cc;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}

.external-panel .section-heading h2 {
  font-size: 18px;
  line-height: 1.3;
}

.external-panel .api-state {
  color: #91adbb;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
}

.external-panel .official-result-actions a {
  min-height: 38px;
  padding: 8px 13px;
  font-size: 12px;
  line-height: 1.2;
  letter-spacing: .02em;
}

@media (max-width: 480px) {
  .official-result-actions {
    align-items: stretch;
  }

  .official-result-actions a {
    width: 100%;
  }
}

@media (max-width: 800px) {
  .draw-meta { height: 54px; }
  .stage-history { min-height: 52px; padding: 6px 10px; }
  .stage-history .history-item { flex-basis: 42px; }
  .archive-list { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .stage-history > span { display: none; }
  .stage-history .result-ball { width: 28px; height: 28px; font-size: 15px; }
  .archive-card { padding: 14px 10px; }
  .archive-row { grid-template-columns: 98px minmax(0, 1fr); padding: 7px 8px; }
  .archive-balls { gap: 3px; }
  .archive-balls b { width: 24px; height: 24px; font-size: 11px; }
  .mouse-history-row { grid-template-columns: minmax(118px, 1fr) 92px 108px; }
  .mouse-history-row .result-ball { width: 28px; height: 28px; }
}

/* Compact information layout inspired by the supplied reference page. */
body {
  background: #05090d;
}

.shell {
  width: min(1180px, 94vw);
  padding-top: 8px;
}

.site-header {
  height: 66px;
  border-bottom: 1px solid #1a2b36;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.api-link {
  padding: 6px 10px;
  border: 1px solid #28546a;
  border-radius: 4px;
  color: #81dcff;
  font-size: 11px;
  text-decoration: none;
}

.api-link:hover {
  border-color: #58cdf7;
  background: #102835;
}

.brand-mark {
  width: 36px;
  height: 36px;
  font-size: 18px;
  box-shadow: none;
}

.brand strong {
  font-size: 20px;
}

.brand small {
  font-size: 9px;
}

.game-tabs {
  gap: 0;
  margin: 10px 0 12px;
  border: 1px solid #213746;
  border-radius: 6px;
  overflow: hidden;
}

.game-tab {
  min-height: 48px;
  padding: 9px 16px;
  border: 0;
  border-right: 1px solid #213746;
  border-radius: 0;
  background: #0a141b;
}

.game-tab:last-child {
  border-right: 0;
}

.game-tab:hover,
.game-tab.active {
  border-color: #213746;
  background: #123349;
  box-shadow: inset 0 -3px #58cdf7;
}

.draw-card,
.archive-card,
.external-panel,
.latest-result {
  border-radius: 6px;
  box-shadow: none;
}

.draw-titlebar {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 9px 18px;
  border-bottom: 1px solid #1c3443;
  background: #0b171f;
}

.draw-titlebar > div {
  display: grid;
  gap: 2px;
}

.draw-titlebar small {
  color: #668596;
  font-size: 9px;
  letter-spacing: .14em;
}

.draw-titlebar strong {
  font-size: 16px;
}

.issue-block {
  margin-left: auto;
  text-align: right;
}

.draw-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 284px;
  background: #061017;
}

.stage-column {
  min-width: 0;
}

.stage {
  aspect-ratio: 16 / 9;
}

.stage-shade {
  background: linear-gradient(180deg, #02060935 0, transparent 28%, transparent 75%, #02060980 100%);
  box-shadow: none;
}

.sound-toggle {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 7;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid #6acff866;
  border-radius: 999px;
  background: #061018d9;
  color: #a9c5d2;
  font: 700 9px/1 Inter, "Segoe UI", Arial, sans-serif;
  letter-spacing: .08em;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.sound-toggle:hover,
.sound-toggle.enabled {
  border-color: #68d7ff;
  color: #e7f8ff;
  box-shadow: 0 0 18px #35c7ff3d;
}

.sound-toggle .sound-icon {
  font-size: 13px;
  line-height: 1;
}

.result-overlay.show + .sound-toggle {
  color: #fff;
}

.draw-sidebar {
  min-width: 0;
  border-left: 1px solid #1c3443;
  background: #08131a;
}

.countdown-hud {
  position: relative;
  inset: auto;
  transform: none;
  width: auto;
  min-width: 0;
  min-height: 126px;
  display: grid;
  place-content: center;
  padding: 18px;
  border: 0;
  border-bottom: 1px solid #1c3443;
  border-radius: 0;
  background: #0c1a23;
  box-shadow: none;
  backdrop-filter: none;
}

.countdown-hud strong {
  font-size: 44px;
  letter-spacing: .08em;
  text-shadow: none;
}

.countdown-hud.hidden {
  display: none;
}

.stage-history {
  min-height: 0;
  display: block;
  padding: 14px;
  border: 0;
  background: transparent;
}

.stage-history > span {
  display: block;
  margin-bottom: 10px;
  color: #9ab5c3;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
}

.stage-history .history-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px 5px;
  overflow: visible;
}

.stage-history .history-item {
  min-width: 0;
  width: auto;
  flex: none;
}

.stage-history .result-ball {
  width: 32px;
  height: 32px;
}

.timeline-bar {
  height: 4px;
}

.archive-card {
  margin-top: 12px;
  padding: 16px 18px;
  background: #09131a;
}

.mouse-sync-note {
  margin: 10px 3px 0;
  color: #7897a7;
  font-size: 12px;
}

.mouse-sync-note a {
  color: #7edcff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.mouse-sync-note a:hover {
  color: #b6edff;
}

.archive-list {
  grid-template-columns: 1fr;
}

.archive-row {
  min-height: 45px;
  border-radius: 4px;
  background: #071017;
}

.external-hero {
  min-height: 78px;
  padding: 14px 20px;
  justify-content: center;
  border-bottom: 1px solid #1c3443;
  background: #0b171f;
}

.external-hero h1 {
  margin: 3px 0;
  font-size: 24px;
}

.external-hero p {
  font-size: 12px;
  color: #819dac;
}

.latest-result {
  padding: 18px 20px;
  background: #08131a;
}

.balls {
  min-height: 48px;
}

.balls b,
.ball-placeholder {
  width: 44px;
  height: 44px;
  font-size: 18px;
}

.official-history {
  margin-top: 18px;
  padding-top: 16px;
}

footer {
  padding-top: 18px;
}

/* Mouse draw identity colours: 1 red, 2 blue, 3 green, 4 black. */
.result-ball.red {
  background: #ef3340;
  color: #fff;
}

.result-ball.blue {
  background: #1677e8;
  color: #fff;
}

.result-ball.green {
  background: #18a957;
  color: #fff;
}

.result-ball.black {
  border: 2px solid #dce9ef;
  background: #050608;
  color: #fff;
  box-shadow: inset 0 0 0 1px #000, 0 0 0 1px #516875, 0 5px 15px #0008;
}

.result-overlay[data-result="1"] strong {
  color: #ff4050;
  text-shadow: 0 0 25px #ef3340, 0 0 85px #ef334077;
}

.result-overlay[data-result="2"] strong {
  color: #2d8cff;
  text-shadow: 0 0 25px #1677e8, 0 0 85px #1677e877;
}

.result-overlay[data-result="3"] strong {
  color: #28bd67;
  text-shadow: 0 0 25px #18a957, 0 0 85px #18a95777;
}

.result-overlay[data-result="4"] strong {
  color: #050608;
  -webkit-text-stroke: 3px #f0f7fa;
  text-shadow: 0 0 12px #fff, 0 0 40px #a9bdc7;
}

@media (max-width: 860px) {
  .draw-layout {
    grid-template-columns: 1fr;
  }

  .draw-sidebar {
    order: -1;
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    border-left: 0;
    border-bottom: 1px solid #1c3443;
  }

  .countdown-hud.hidden + .stage-history {
    grid-column: 1 / -1;
  }

  .countdown-hud {
    min-height: 104px;
    border-right: 1px solid #1c3443;
    border-bottom: 0;
  }

  .countdown-hud strong {
    font-size: 34px;
  }

  .stage-history {
    padding: 10px 12px;
  }

  .stage-history > span {
    margin-bottom: 7px;
  }
}

@media (max-width: 560px) {
  .shell {
    width: 100%;
    padding: 0 8px 18px;
  }

  .site-header {
    height: 58px;
  }

  .header-actions {
    gap: 7px;
  }

  .api-link {
    padding: 5px 7px;
    font-size: 9px;
  }

  .connection {
    gap: 5px;
    font-size: 9px;
  }

  .connection span {
    display: block;
    max-width: none;
    white-space: nowrap;
  }

  .game-tabs {
    grid-template-columns: repeat(2, 1fr);
  }

  .game-tab:nth-child(2) {
    border-right: 0;
  }

  .game-tab:nth-child(-n+2) {
    border-bottom: 1px solid #213746;
  }

  .draw-titlebar {
    min-height: 52px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 8px 12px;
  }

  .issue-block {
    min-width: 112px;
    margin-left: 0;
    white-space: nowrap;
  }

  .issue-block small {
    display: none;
  }

  .issue-block strong {
    font-size: 13px;
  }

  .draw-sidebar {
    grid-template-columns: 128px minmax(0, 1fr);
  }

  .countdown-hud {
    min-height: 94px;
    padding: 10px;
  }

  .countdown-hud strong {
    font-size: 27px;
  }

  .sound-toggle {
    right: 8px;
    bottom: 8px;
    min-height: 30px;
    padding: 5px 8px;
  }

  .stage-history {
    padding: 8px;
  }

  .stage-history > span {
    display: block;
    font-size: 9px;
  }

  .stage-history .history-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px 7px;
  }

  .stage-history .result-ball {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }

  .stage-history .history-item span {
    display: none;
  }

  .archive-card,
  .latest-result {
    padding: 13px 10px;
  }

  .mouse-sync-note {
    margin: 9px 10px 0;
    font-size: 10px;
  }

  .mouse-history-row {
    grid-template-columns: minmax(108px, 1fr) 84px 104px;
  }
}

/* Keep the result number, size and parity in fixed columns. */
.mouse-history-row {
  grid-template-columns: minmax(130px, 1fr) 104px 145px;
}

.mouse-outcome {
  width: 145px;
  display: grid;
  grid-template-columns: 31px 108px;
  align-items: center;
  gap: 6px;
  justify-self: end;
}

.mouse-history-row .result-ball {
  width: 31px;
  min-width: 31px;
  max-width: 31px;
  height: 31px;
  min-height: 31px;
  aspect-ratio: 1;
  flex: none;
  border-radius: 50%;
}

.mouse-outcome .result-attributes {
  display: grid;
  grid-template-columns: 54px 48px;
  gap: 6px;
}

.mouse-outcome .result-attributes i {
  width: 100%;
  min-width: 0;
  padding: 0 4px;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .mouse-history-row {
    grid-template-columns: minmax(100px, 1fr) 76px 127px;
    gap: 6px;
  }

  .mouse-outcome {
    width: 127px;
    grid-template-columns: 28px 95px;
    gap: 4px;
  }

  .mouse-history-row .result-ball {
    width: 28px;
    min-width: 28px;
    max-width: 28px;
    height: 28px;
    min-height: 28px;
  }

  .mouse-outcome .result-attributes {
    grid-template-columns: 47px 44px;
    gap: 4px;
  }

  .mouse-outcome .result-attributes i {
    height: 23px;
    padding: 0 3px;
    font-size: 9px;
  }
}
body {
  font-family: "Microsoft JhengHei UI", "Microsoft JhengHei", "Noto Sans TC", sans-serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
}

button,
a,
input,
select,
textarea {
  font-family: inherit;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

.brand strong,
.game-tab span,
.draw-titlebar strong,
.issue-block strong,
.archive-heading h2,
.archive-issue,
.mouse-sync-note,
.connection {
  filter: none;
  text-shadow: none;
}

.brand strong,
.game-tab span,
.draw-titlebar strong,
.issue-block strong,
.archive-heading h2 {
  font-weight: 600;
}

/* Five live draw services share one compact, responsive navigation deck. */
.game-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
}

.game-tab {
  min-width: 0;
  width: 100%;
  border-bottom: 1px solid #213746;
}

.game-tab small {
  white-space: nowrap;
}

.game-tab:nth-child(4n) {
  border-right: 0;
}

.game-tab:nth-child(n+5) {
  border-bottom: 0;
}

/* Twelve services keep the approved four-column desktop deck. */
.game-tab:nth-child(n+5) {
  border-bottom: 1px solid #213746;
}

.game-tab:nth-child(n+9) {
  border-bottom: 0;
}

.partner-panel .partner-hero {
  position: relative;
  min-height: 92px;
  overflow: hidden;
  border-bottom: 1px solid #24485c;
  background: linear-gradient(112deg, #0a1d29, #102c3b 58%, #0a1721);
}

.partner-panel .partner-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(115deg, transparent 0 34px, #73d9ff0a 35px 36px);
}

.partner-panel .partner-hero.australia-five {
  background: linear-gradient(112deg, #082321, #0d403d 58%, #071917);
}

.partner-panel .partner-hero.taiwan-power {
  background: linear-gradient(112deg, #171a2b, #25345b 58%, #101522);
}

.partner-panel .partner-hero.taiwan-five-three-nine {
  background: linear-gradient(112deg, #211323, #472442 58%, #170e18);
}

.partner-heading {
  align-items: flex-start;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(118px, auto);
}

.partner-timing {
  display: grid;
  justify-items: end;
  gap: 5px;
  min-width: 0;
}

.partner-timing time {
  color: #b7d3e0;
  font-size: 13px;
  font-weight: 600;
}

.partner-timing strong {
  min-width: 108px;
  padding: 6px 9px;
  border: 1px solid #2b607a;
  border-radius: 4px;
  background: #07151d;
  color: #83dfff;
  font: 600 13px/1.1 ui-monospace, "Cascadia Mono", monospace;
  text-align: center;
}

.partner-balls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 2px 0 8px;
}

.partner-ball,
.partner-mini-ball {
  --partner-color: #1275a8;
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #ccefff;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #66ccf5, var(--partner-color) 50%, #06253b 100%);
  color: white;
  font-weight: 700;
  font-style: normal;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 2px #001b2b;
  box-shadow: inset 0 0 0 2px #ffffff22, 0 3px 8px #0008;
}

.partner-ball {
  width: 46px;
  height: 46px;
  font-size: 17px;
}

.partner-mini-ball {
  width: 32px;
  height: 32px;
  font-size: 11px;
}

.partner-position-1 { --partner-color: #e7aa00; }
.partner-position-2 { --partner-color: #177abe; }
.partner-position-3 { --partner-color: #343b45; }
.partner-position-4 { --partner-color: #cf641c; }
.partner-position-5 { --partner-color: #13906f; }
.partner-position-6 { --partner-color: #2946b4; }
.partner-position-7 { --partner-color: #8a949e; }
.partner-position-8 { --partner-color: #cf4057; }
.partner-position-9 { --partner-color: #b91828; }
.partner-position-10 { --partner-color: #159a2a; }

.partner-special {
  --partner-color: #e28d16;
  outline: 2px solid #eebc4e;
  outline-offset: 2px;
}

.partner-plus {
  color: #eebc4e;
  font-size: 18px;
  font-style: normal;
  font-weight: 700;
}

.partner-panel .api-state {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.partner-warning {
  color: #efc478;
}

.partner-attributes {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.partner-attributes i {
  padding: 4px 7px;
  border: 1px solid #2b5368;
  border-radius: 4px;
  background: #0a1d27;
  color: #b7e8fb;
  font-style: normal;
}

.partner-attributes small {
  margin-right: 4px;
  color: #6f9eb3;
}

.partner-history-row {
  display: grid;
  grid-template-columns: minmax(230px, .65fr) minmax(0, 1fr);
  align-items: center;
  gap: 16px;
}

.partner-history-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.partner-history-meta time,
.partner-history-meta em {
  color: #7ca6ba;
  font-size: 11px;
  font-style: normal;
  font-variant-numeric: tabular-nums;
}

.partner-history-balls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

/* Australia Lucky 10 is a ten-place finishing order, not a set of ten loose
   numbers. Keep first through tenth in one fixed row on both the current draw
   and every history record, matching the Speed Racing result grammar. */
#game-australian-lucky10 .ranking-balls {
  display: grid;
  grid-template-columns: repeat(10, 46px);
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

#game-australian-lucky10 .ranking-balls::-webkit-scrollbar {
  display: none;
}

#game-australian-lucky10 .partner-history-balls {
  display: grid;
  grid-template-columns: repeat(10, 32px);
  justify-content: end;
  align-items: center;
  gap: 5px;
}

#game-australian-lucky10 .ranking-balls .partner-ranking-ball {
  border-color: #e8f8ff;
  background: var(--partner-color);
  color: #fff;
  font-weight: 800;
  text-shadow: 0 1px 3px #000, 0 0 2px #000;
  box-shadow: inset 0 -6px 10px #0004, inset 0 2px 3px #fff5, 0 3px 8px #0008;
}

.live-game-panel {
  min-width: 0;
  max-width: 100%;
  border: 1px solid #1c3443;
  border-radius: 6px;
  overflow: hidden;
  background: #071017;
}

.live-game-titlebar {
  min-height: 70px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 176px;
  align-items: center;
  gap: 24px;
  padding: 10px 18px;
  border-bottom: 1px solid #1c3443;
  background: #0b171f;
}

.live-game-titlebar small,
.live-result-panel > small {
  display: block;
  color: #7697a8;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .13em;
}

.live-game-titlebar h1 {
  margin: 3px 0 0;
  font-size: 20px;
  font-weight: 600;
}

.live-issue {
  text-align: right;
}

.live-issue strong {
  display: block;
  margin-top: 3px;
  color: #dfeef4;
  font-size: 14px;
  font-weight: 600;
}

.live-countdown {
  min-width: 176px;
  padding: 8px 13px;
  border-left: 1px solid #213c4b;
  text-align: right;
}

.live-countdown strong {
  display: block;
  margin-top: 2px;
  color: #e9f8ff;
  font: 700 29px/1 ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: .06em;
}

.live-countdown.drawing {
  visibility: hidden;
}

.live-game-layout {
  min-width: 0;
  max-width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  background: #061017;
}

.live-media {
  min-width: 0;
  max-width: 100%;
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-right: 1px solid #1c3443;
  background: #020609;
}

.live-media video,
.live-media iframe,
.live-media .live-standby {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #020609;
  object-fit: contain;
  opacity: 0;
}

.live-media video.ready,
.live-media iframe.ready,
.live-media .live-standby.ready {
  opacity: 1;
}

.live-media .live-standby {
  z-index: 1;
  display: block;
  object-fit: cover;
}

.live-media video {
  z-index: 5;
}

.live-media iframe.parameter-player {
  z-index: 7;
  object-fit: contain;
}

#game-canada22.has-parameter-player .live-broadcast-meta,
#game-canada22.has-parameter-player .live-badge,
#game-canada23.has-parameter-player .live-broadcast-meta,
#game-canada23.has-parameter-player .live-badge,
#game-taiwan49.has-parameter-player .live-broadcast-meta,
#game-taiwan49.has-parameter-player .live-badge {
  visibility: hidden;
  opacity: 0;
}

.standby-mask-layer {
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  transition: opacity .16s ease;
}

.standby-result-video {
  position: absolute;
  z-index: 3;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #020609;
  object-fit: contain;
  opacity: 0;
  pointer-events: none;
  transition: opacity .16s ease;
}

.standby-result-video.ready {
  opacity: 1;
}

.standby-result-image {
  position: absolute;
  z-index: 7;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  pointer-events: none;
  transition: opacity .16s ease;
}

.standby-result-image.ready {
  opacity: 1;
}

/*
 * Preserve the exact last decoded live frame across an issue boundary.  The
 * result API and historical MP4 may need a moment to publish/decode, but the
 * viewer must never see the preceding issue during that hand-off.
 */
.held-result-frame {
  position: absolute;
  /* Above the previous-result image during the publication hand-off. */
  z-index: 8;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #020609;
  opacity: 0;
  pointer-events: none;
}

.held-result-frame.ready {
  opacity: 1;
}

/* Taiwan 49 transmits only the native mechanical band during the live draw.
 * The approved Full-HD standby remains underneath, so scene resolution and
 * typography stay unchanged while duplicated static pixels are eliminated. */
#game-taiwan49 .live-media > video[data-role="video"] {
  inset: auto;
  left: 12.865%;
  top: 31.296%;
  width: 76.771%;
  height: 38.333%;
  object-fit: fill;
  background: #020609;
}

.standby-center-screen {
  position: absolute;
  left: 33.3%;
  top: 8.2%;
  width: 33.4%;
  height: 12.5%;
  border: 2px solid #49639a;
  border-radius: 12%;
  background:
    linear-gradient(90deg, transparent, #87c5ff20 48%, transparent 52%),
    #020711;
  box-shadow: inset 0 0 24px #000, 0 0 14px #1f66ff55;
}

.standby-fake-data-mask {
  position: absolute;
  top: 4.8%;
  right: 1.7%;
  width: 22.2%;
  height: 13.5%;
  border-radius: 6px;
  background: #030910;
  box-shadow: inset 0 0 18px #112a44aa;
}

.live-broadcast-meta {
  position: absolute;
  z-index: 8;
  top: 4.8%;
  right: 1.8%;
  width: 22%;
  min-width: 172px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
  padding: clamp(7px, 1vw, 13px) clamp(9px, 1.25vw, 16px);
  border: 1px solid #5f8ebaaa;
  border-radius: 6px;
  background: #030910ee;
  color: #eaf7ff;
  box-shadow: inset 0 0 18px #112a44aa, 0 6px 20px #0008;
  pointer-events: none;
  transition: opacity .16s ease;
}

.live-broadcast-meta span {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.live-broadcast-meta small {
  color: #82bdd8;
  font-size: clamp(7px, .72vw, 10px);
  letter-spacing: .08em;
  white-space: nowrap;
}

.live-broadcast-meta b,
.live-broadcast-meta strong {
  color: #f4fbff;
  font-size: clamp(10px, 1.05vw, 15px);
  font-style: normal;
  font-weight: 700;
  white-space: nowrap;
}

.live-broadcast-meta em {
  font-style: normal;
}

.live-broadcast-meta strong {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: clamp(14px, 1.55vw, 23px);
  letter-spacing: .05em;
}

/*
 * Canada machines already provide a dark information bay in the studio wall.
 * Keep the live values inside that bay instead of drawing a floating web card
 * over the machinery.  Percentages deliberately track the 16:9 artwork so the
 * placement stays locked to the wall on desktop and mobile.
 */
#game-canada23 .live-broadcast-meta,
#game-canada22 .live-broadcast-meta {
  top: 4.45%;
  right: 4.65%;
  width: 18.6%;
  height: 10.9%;
  min-width: 0;
  gap: 0;
  padding: .45% 1.15% .3% 1.35%;
  border: 0;
  border-radius: 0;
  /* Cover the baked sample readout while fading into the curved wall bay. */
  background: linear-gradient(
    96deg,
    #02081200 0%,
    #020812d9 11%,
    #030a14f5 25%,
    #050d18f4 78%,
    #06101bdd 91%,
    #06101b00 100%
  );
  box-shadow: none;
  backdrop-filter: blur(1.4px) brightness(.72);
  -webkit-backdrop-filter: blur(1.4px) brightness(.72);
  transform: perspective(900px) rotateY(-1.5deg) rotateZ(-.35deg);
  transform-origin: right center;
}

#game-canada23 .live-broadcast-meta span,
#game-canada22 .live-broadcast-meta span {
  gap: 4px;
  min-height: 0;
  line-height: 1;
}

#game-canada23 .live-broadcast-meta small,
#game-canada22 .live-broadcast-meta small {
  color: #79d4f6;
  font-size: clamp(8px, .75vw, 11px);
  font-weight: 760;
  letter-spacing: .045em;
  text-shadow: 0 1px 2px #000, 0 0 5px #43c9ff4d;
}

#game-canada23 .live-broadcast-meta b,
#game-canada23 .live-broadcast-meta strong,
#game-canada22 .live-broadcast-meta b,
#game-canada22 .live-broadcast-meta strong {
  font-size: clamp(13px, 1.2vw, 18px);
  font-weight: 800;
  letter-spacing: .02em;
  text-shadow: 0 1px 2px #000, 0 0 6px #d8f5ff33;
}

#game-canada23 .live-broadcast-meta strong,
#game-canada22 .live-broadcast-meta strong {
  font-size: clamp(17px, 1.5vw, 23px);
  letter-spacing: .045em;
}

/* Taiwan has a pale architectural glass wall, so its data is engraved onto
   the wall instead of being placed in the generic dark floating card. */
#game-taiwan49 .live-broadcast-meta {
  top: 5.1%;
  right: 4.6%;
  width: 20.8%;
  min-width: 0;
  gap: 1px;
  padding: .45% .8% .4% 1.15%;
  border: 0;
  border-left: 2px solid #b8644d99;
  border-radius: 0;
  background: linear-gradient(90deg, #eef8f211, #dcebe72a 72%, #dcebe700);
  box-shadow: none;
  color: #102f35;
  backdrop-filter: blur(.7px);
  -webkit-backdrop-filter: blur(.7px);
}

#game-taiwan49 .live-broadcast-meta small {
  color: #315f63;
  font-size: clamp(9px, .82vw, 12px);
  font-weight: 780;
  text-shadow: 0 1px 1px #ffffffd9;
}

#game-taiwan49 .live-broadcast-meta b,
#game-taiwan49 .live-broadcast-meta strong {
  color: #102d32;
  font-size: clamp(13px, 1.2vw, 18px);
  font-weight: 820;
  text-shadow: 0 1px 1px #fff, 0 0 5px #ffffffa8;
}

#game-taiwan49 .live-broadcast-meta strong {
  font-size: clamp(17px, 1.6vw, 24px);
  letter-spacing: .045em;
}

.live-game-panel.has-standby-video .standby-mask-layer {
  visibility: hidden;
  opacity: 0;
}

.live-game-panel.has-live-video .standby-result-video {
  opacity: 0;
}

.live-game-panel.has-live-video .standby-result-image {
  opacity: 0;
}

.live-game-panel.is-drawing:not(.has-live-video):not(.has-standby-video) .standby-mask-layer {
  visibility: visible;
  opacity: 1;
}

.live-media-placeholder {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 7px;
  text-align: center;
  background:
    linear-gradient(135deg, transparent 0 48%, #43cfff12 48% 52%, transparent 52%),
    radial-gradient(circle at 50% 42%, #164866 0, #081924 36%, #03080c 75%);
}

.live-media-placeholder.hidden {
  display: none;
}

.live-media-placeholder span {
  color: #d8f4ff;
  font-size: clamp(24px, 4vw, 54px);
  font-weight: 700;
  letter-spacing: .08em;
}

.live-media-placeholder small {
  color: #6d9bae;
  font-size: 10px;
  letter-spacing: .2em;
}

.live-badge {
  display: none;
}

.live-result-panel {
  min-width: 0;
  padding: 20px 17px;
  background: #08131a;
}

.live-result-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.live-result-heading strong {
  color: #b9d5e2;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.live-result-balls {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 15px;
}

.live-ball {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border: 2px solid #d9f3ff;
  border-radius: 50%;
  background: #123246;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  font-style: normal;
  box-shadow: inset 0 -8px 13px #0005, 0 4px 13px #0006;
}

.live-ball.digit-1 { background: #d92f40; }
.live-ball.digit-2 { background: #176fc8; }
.live-ball.digit-3 { background: #15965a; }

.taiwan-ball,
.racing-ball {
  border-color: color-mix(in srgb, var(--ball-color) 72%, white);
  background: var(--ball-color);
  text-shadow: 0 1px 2px #000;
}

.taiwan-ball.special {
  /* Special is a role, not a larger ball: keep the same outer diameter and
     identify it with a gold rim drawn inside the existing circle. */
  border-color: #ffbf50;
  outline: 0;
  outline-offset: 0;
  box-shadow: inset 0 0 0 1px #fff0b0, inset 0 -8px 13px #0005, 0 4px 13px #0006;
}

/* Taiwan 49 is a single seven-number result: 6 regular balls + 1 special. */
#game-taiwan49 .taiwan-balls {
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
}

#game-taiwan49 .taiwan-balls .taiwan-ball {
  width: 29px;
  height: 29px;
  flex-basis: 29px;
  border-width: 1px;
  font-size: 12px;
  box-shadow: inset 0 -5px 9px #0005, 0 2px 7px #0005;
}

.taiwan-plus {
  flex: 0 0 auto;
  color: #ffca62;
  font: 700 14px/1 ui-monospace, SFMono-Regular, Consolas, monospace;
}

#game-speed-racing .live-game-layout {
  grid-template-columns: minmax(0, 1fr) 368px;
}

#game-speed-racing .live-result-panel {
  padding-right: 12px;
  padding-left: 12px;
  overflow: hidden;
}

#game-speed-racing .racing-balls {
  flex-wrap: nowrap;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

#game-speed-racing .racing-balls::-webkit-scrollbar {
  display: none;
}

#game-speed-racing .racing-ball {
  width: 30px;
  height: 30px;
  flex-basis: 30px;
  border-width: 1px;
  font-size: 11px;
}

.live-result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 13px;
}

.live-result-meta i {
  display: inline-flex;
  min-height: 27px;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border: 1px solid #2a4a5b;
  border-radius: 4px;
  background: #10232e;
  color: #a8d9ec;
  font-size: 11px;
  font-style: normal;
  white-space: nowrap;
}

.live-empty {
  color: #7897a7;
  font-size: 12px;
}

.live-archive {
  margin: 0;
  border-width: 1px 0 0;
  border-radius: 0;
}

.live-history-row {
  grid-template-columns: 152px 132px minmax(0, 1fr);
}

.live-history-outcome {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.live-history-balls {
  min-width: 0;
  display: flex;
  justify-content: flex-end;
  gap: 4px;
}

.live-history-balls .live-ball {
  width: 27px;
  height: 27px;
  flex-basis: 27px;
  border-width: 1px;
  font-size: 11px;
  box-shadow: inset 0 -4px 7px #0004;
}

#game-taiwan49 .live-history-balls .taiwan-ball.special {
  border-color: #ffbf50;
  box-shadow: inset 0 0 0 1px #fff0b0, inset 0 -4px 7px #0004;
}

.live-history-outcome .live-result-meta {
  min-width: 182px;
  margin-top: 0;
  justify-content: flex-end;
}

.live-history-outcome .live-result-meta i {
  min-height: 25px;
  font-size: 10px;
}

@media (max-width: 1080px) {
  .live-game-titlebar {
    grid-template-columns: minmax(0, 1fr) auto 156px;
    gap: 14px;
  }

  .live-countdown {
    min-width: 156px;
  }

  .live-game-layout {
    grid-template-columns: 1fr;
  }

  #game-speed-racing .live-game-layout {
    grid-template-columns: 1fr;
  }

  .live-media {
    border-right: 0;
    border-bottom: 1px solid #1c3443;
  }

  .live-result-panel {
    padding: 14px;
  }

  .live-history-row {
    grid-template-columns: 134px 112px minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  .game-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 8px 0 10px;
  }

  .game-tab,
  .game-tab:nth-child(2),
  .game-tab:nth-child(-n+2) {
    min-width: 0;
    width: 100%;
    border-right: 1px solid #213746;
    border-bottom: 1px solid #213746;
    padding: 8px 10px;
  }

  .game-tab:nth-child(3n) {
    border-right: 0;
  }

  /* Item 9 is the final cell of the third row in the mobile three-column
     deck. Restore its divider after the desktop four-column rule removed it. */
  .game-tab:nth-child(-n+9) {
    border-bottom: 1px solid #213746;
  }

  .game-tab:nth-child(n+10) {
    border-bottom: 0;
  }

  .partner-panel .latest-result {
    padding: 14px 12px;
  }

  .partner-panel .partner-hero {
    min-height: 76px;
    padding: 13px 15px;
  }

  .partner-panel .partner-hero h1 {
    font-size: 20px;
  }

  .partner-heading {
    gap: 10px;
  }

  .partner-heading h2 {
    font-size: 16px;
  }

  .partner-timing strong {
    min-width: 96px;
    font-size: 11px;
  }

  .partner-balls {
    gap: 6px;
  }

  .partner-ball {
    width: 38px;
    height: 38px;
    font-size: 14px;
  }

  .partner-history-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 11px 10px;
  }

  .partner-history-balls {
    justify-content: flex-start;
  }

  .partner-mini-ball {
    width: 28px;
    height: 28px;
    font-size: 10px;
  }

  #game-australian-lucky10 .ranking-balls,
  #game-australian-lucky10 .partner-history-balls {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(10, minmax(20px, 1fr));
    justify-content: stretch;
    gap: 3px;
    overflow: visible;
  }

  #game-australian-lucky10 .ranking-balls .partner-ranking-ball,
  #game-australian-lucky10 .partner-history-balls .partner-ranking-ball {
    width: 100%;
    height: auto;
    min-width: 0;
    aspect-ratio: 1;
    font-size: clamp(9px, 2.7vw, 11px);
  }

  .game-tab span {
    font-size: 12px;
  }

  .live-game-titlebar {
    min-height: 62px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 8px 10px;
  }

  .live-game-titlebar h1 {
    font-size: 16px;
  }

  .live-issue {
    display: none;
  }

  .live-countdown {
    min-width: 112px;
    padding: 6px 8px;
  }

  .live-countdown strong {
    font-size: 23px;
  }

  .live-media {
    aspect-ratio: 16 / 9;
  }

  .live-broadcast-meta {
    top: 4.8%;
    right: 1.8%;
    width: 22%;
    min-width: 0;
    gap: 1px;
    padding: 2px 4px;
    border-radius: 3px;
  }

  #game-canada23 .live-broadcast-meta,
  #game-canada22 .live-broadcast-meta {
    top: 4.4%;
    right: 3.5%;
    width: 20.2%;
    height: 11.5%;
    gap: 0;
    padding: .45% 1.05% .3% 1.3%;
    border: 0;
    border-radius: 0;
    background: linear-gradient(96deg, #02081200, #020812e8 13%, #040b16f5 80%, #06101b00);
    box-shadow: none;
  }

  #game-canada23 .live-broadcast-meta small,
  #game-canada22 .live-broadcast-meta small {
    font-size: clamp(7px, 2.15vw, 9px);
  }

  #game-canada23 .live-broadcast-meta b,
  #game-canada22 .live-broadcast-meta b {
    font-size: clamp(10px, 3vw, 12px);
  }

  #game-canada23 .live-broadcast-meta strong,
  #game-canada22 .live-broadcast-meta strong {
    font-size: clamp(13px, 3.85vw, 16px);
  }

  #game-taiwan49 .live-broadcast-meta {
    top: 4.5%;
    right: 3.4%;
    width: 29.5%;
    gap: 0;
    padding: .4% .6% .35% 1.1%;
  }

  #game-taiwan49 .live-broadcast-meta small {
    font-size: clamp(7px, 2.05vw, 9px);
  }

  #game-taiwan49 .live-broadcast-meta b {
    font-size: clamp(9px, 2.8vw, 12px);
  }

  #game-taiwan49 .live-broadcast-meta strong {
    font-size: clamp(12px, 3.7vw, 16px);
  }

  .live-broadcast-meta span {
    gap: 2px;
  }

  .live-broadcast-meta small {
    font-size: clamp(4px, 1.7vw, 6px);
    letter-spacing: 0;
  }

  .live-broadcast-meta b,
  .live-broadcast-meta strong {
    font-size: clamp(6px, 2.1vw, 8px);
    letter-spacing: 0;
  }

  .live-broadcast-meta strong {
    font-size: clamp(8px, 2.8vw, 11px);
  }

  .live-result-panel {
    padding: 12px 10px;
  }

  .live-ball {
    width: 39px;
    height: 39px;
    flex-basis: 39px;
    font-size: 16px;
  }

  #game-taiwan49 .taiwan-balls {
    gap: 4px;
  }

  #game-taiwan49 .taiwan-balls .taiwan-ball {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
    font-size: 12px;
  }

  .taiwan-plus {
    font-size: 14px;
  }

  .racing-ball {
    width: 31px;
    height: 31px;
    flex-basis: 31px;
    font-size: 12px;
  }

  .live-history-row {
    min-width: 760px;
    grid-template-columns: 132px 112px minmax(0, 1fr);
  }

  .live-history-list {
    overflow-x: auto;
  }
}

/* Mobile draw history: keep every result visible without a horizontal table. */
@media (max-width: 560px) {
  .live-history-list {
    min-width: 0;
    overflow: visible;
  }

  .live-history-row {
    width: 100%;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "draw-date draw-issue"
      "draw-outcome draw-outcome";
    gap: 8px 10px;
    padding: 10px;
    overflow: hidden;
  }

  .live-history-row > time {
    grid-area: draw-date;
    min-width: 0;
  }

  .live-history-row > .archive-issue {
    grid-area: draw-issue;
    justify-self: end;
    white-space: nowrap;
  }

  .live-history-outcome {
    grid-area: draw-outcome;
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-items: start;
    gap: 8px;
  }

  .live-history-balls {
    width: 100%;
    min-width: 0;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 4px;
  }

  .live-history-outcome .live-result-meta {
    width: 100%;
    min-width: 0;
    justify-content: flex-start;
    gap: 5px;
  }

  #game-taiwan49 .live-history-balls {
    flex-wrap: nowrap;
    align-items: center;
  }

  #game-speed-racing .racing-balls,
  #game-speed-racing .live-history-balls {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(10, minmax(20px, 1fr));
    align-items: center;
    gap: 3px;
    overflow: visible;
  }

  #game-speed-racing .racing-balls .racing-ball,
  #game-speed-racing .live-history-balls .racing-ball {
    width: 100%;
    height: auto;
    min-width: 0;
    aspect-ratio: 1;
    flex-basis: auto;
    font-size: clamp(9px, 2.7vw, 11px);
  }
}
