/* 樂透行 v2｜原創樣式：大字級、圓形彩球、三彩種分明主色。不是參考站的版面複製。 */
:root {
  --paper: #fff4ea;
  --paper-2: #ffffff;
  --ink: #161022;
  --ink-soft: #3b3350;
  --rule: #f0c9b0;
  --link: #c0176b;
  --link-hover: #8a0f4e;
  --warn: #8a2c00;
  --warn-bg: #ffe7bf;
  --serif: "Noto Serif CJK TC", "Noto Serif CJK", "Source Han Serif TC", "PMingLiU", serif;
  --sans: "Noto Sans CJK TC", "Noto Sans CJK", "Source Han Sans TC", "Noto Sans", sans-serif;
  --max: 1180px;
  --c539: #00c2c8;
  --c539-deep: #00686e;
  --c539-soft: #d9fbfd;
  --clotto: #ff7a00;
  --clotto-deep: #b34700;
  --clotto-soft: #ffe6cc;
  --cpower: #5b4dff;
  --cpower-deep: #2c1ab8;
  --cpower-soft: #e4e0ff;
  --extra: #ff2d6b;
  --extra-2: #c8f542;
  --game: var(--c539);
  --game-deep: var(--c539-deep);
  --game-soft: var(--c539-soft);
}

.theme-539 { --game: var(--c539); --game-deep: var(--c539-deep); --game-soft: var(--c539-soft); }
.theme-lotto649 { --game: var(--clotto); --game-deep: var(--clotto-deep); --game-soft: var(--clotto-soft); }
.theme-super638 { --game: var(--cpower); --game-deep: var(--cpower-deep); --game-soft: var(--cpower-soft); }

* { box-sizing: border-box; }
html { font-size: 20px; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 12% 0%, #ffe0f0 0, transparent 28%),
    radial-gradient(circle at 90% 8%, #d9f4ff 0, transparent 26%),
    var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem; /* 20px 桌面內文 */
  line-height: 1.7;
  min-height: 100vh;
}
a { color: var(--link); text-decoration-thickness: 2px; text-underline-offset: 0.18em; }
a:hover { color: var(--link-hover); }
.theme-539 a { color: var(--c539-deep); }
.theme-lotto649 a { color: var(--clotto-deep); }
.theme-super638 a { color: var(--cpower-deep); }
.theme-539 a:hover, .theme-lotto649 a:hover, .theme-super638 a:hover { color: var(--ink); }
img { max-width: 100%; }

.wrap { width: min(var(--max), calc(100% - 2rem)); margin: 0 auto; }

.site-header {
  background: linear-gradient(105deg, #ff2d6b 0%, #ff7a00 48%, #5b4dff 100%);
  color: #fff;
  padding: 1.35rem 0 0;
  box-shadow: 0 8px 24px rgba(90, 16, 70, 0.22);
  border-bottom: none;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  text-decoration: none;
  color: #fff;
}
.brand-mark {
  flex: none;
  width: 3.6rem;
  height: 3.6rem;
  border-radius: 1rem;
  border: 3px solid #fff;
  color: #161022;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 2.05rem;
  font-weight: 700;
  letter-spacing: 0;
  background: #ffe24a;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.18);
}
.brand-text h1 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 2.55rem;
  line-height: 1.05;
  margin: 0;
  letter-spacing: 0.14em;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.18);
}
.brand-text p {
  margin: 0.2rem 0 0;
  color: #fff;
  font-size: 1rem;
  letter-spacing: 0.16em;
  font-weight: 700;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}
.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.55rem;
  margin-top: 1.05rem;
  font-size: 1.05rem;
  font-weight: 700;
}
.nav a {
  color: #fff;
  text-decoration: none;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: rgba(22, 16, 34, 0.2);
  border: 2px solid transparent;
}
.nav a:hover { background: rgba(22, 16, 34, 0.38); color: #fff; }
.nav a[aria-current="page"] {
  color: #161022;
  background: #ffe24a;
  border-color: #fff;
}
.color-strip {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  height: 0.55rem;
  margin-top: 1.05rem;
}
.color-strip span:nth-child(1) { background: var(--c539); }
.color-strip span:nth-child(2) { background: var(--clotto); }
.color-strip span:nth-child(3) { background: var(--cpower); }

main { padding: 1.8rem 0 3.2rem; }

.kicker {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--game-deep);
  margin: 0 0 0.4rem;
}
.theme-home .kicker { color: #c0176b; }
h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.25; }
h2 { font-size: 2.2rem; margin: 0 0 0.75rem; letter-spacing: 0.04em; }
h3 { font-size: 1.45rem; margin: 1.5rem 0 0.65rem; }
.lead {
  font-size: 1.12rem;
  color: var(--ink-soft);
  max-width: 44rem;
  margin: 0 0 1.5rem;
}

.latest-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.05rem;
}
.draw-card, .panel {
  background: var(--paper-2);
  border: 3px solid #efd3c2;
  border-radius: 1.15rem;
  padding: 1.15rem 1.15rem 1.2rem;
  box-shadow: 0 10px 0 rgba(255, 122, 0, 0.08), 0 12px 28px rgba(80, 20, 40, 0.08);
}
.draw-card { min-height: 100%; border-top-width: 12px; }
.draw-card.game-539 { border-color: var(--c539); background: linear-gradient(#fff, var(--c539-soft)); }
.draw-card.game-lotto649 { border-color: var(--clotto); background: linear-gradient(#fff, var(--clotto-soft)); }
.draw-card.game-super638 { border-color: var(--cpower); background: linear-gradient(#fff, var(--cpower-soft)); }
.draw-card .game-name {
  font-family: var(--serif);
  font-size: 1.7rem;
  margin: 0;
  letter-spacing: 0.06em;
}
.draw-card.game-539 .game-name,
.draw-card.game-539 .kicker { color: var(--c539-deep); }
.draw-card.game-lotto649 .game-name,
.draw-card.game-lotto649 .kicker { color: var(--clotto-deep); }
.draw-card.game-super638 .game-name,
.draw-card.game-super638 .kicker { color: var(--cpower-deep); }

.meta {
  color: var(--ink-soft);
  font-size: 1.02rem;
  font-weight: 700;
  margin: 0.25rem 0 0.9rem;
}
.draw-card .meta {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  white-space: normal;
}
.nums {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: flex-end;
}

.ball {
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: 0;
  color: #fff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.28);
  border: 3px solid rgba(255, 255, 255, 0.55);
  box-shadow:
    inset 0 -0.42rem 0.55rem rgba(0, 0, 0, 0.16),
    inset 0 0.35rem 0.45rem rgba(255, 255, 255, 0.28),
    0 0.28rem 0.45rem rgba(0, 0, 0, 0.18);
  background:
    radial-gradient(circle at 30% 26%, rgba(255, 255, 255, 0.72), transparent 40%),
    linear-gradient(165deg, #ff5d8f, #e3135b);
}
/* 依號碼區間上色，同一號碼全站同色 */
.n-01, .n-02, .n-03, .n-04, .n-05 {
  background: radial-gradient(circle at 30% 26%, rgba(255,255,255,.72), transparent 40%),
    linear-gradient(165deg, #ff6b9a, #e3135b);
}
.n-06, .n-07, .n-08, .n-09, .n-10 {
  background: radial-gradient(circle at 30% 26%, rgba(255,255,255,.72), transparent 40%),
    linear-gradient(165deg, #ff9f3c, #e04a00);
}
.n-11, .n-12, .n-13, .n-14, .n-15 {
  background: radial-gradient(circle at 30% 26%, rgba(255,255,255,.78), transparent 40%),
    linear-gradient(165deg, #ffd84a, #e89a00);
  color: #2a1600;
  text-shadow: none;
}
.n-16, .n-17, .n-18, .n-19, .n-20 {
  background: radial-gradient(circle at 30% 26%, rgba(255,255,255,.7), transparent 40%),
    linear-gradient(165deg, #9be34a, #2f9b12);
  color: #102000;
  text-shadow: none;
}
.n-21, .n-22, .n-23, .n-24, .n-25 {
  background: radial-gradient(circle at 30% 26%, rgba(255,255,255,.72), transparent 40%),
    linear-gradient(165deg, #3fe0d0, #0a8f96);
}
.n-26, .n-27, .n-28, .n-29, .n-30 {
  background: radial-gradient(circle at 30% 26%, rgba(255,255,255,.72), transparent 40%),
    linear-gradient(165deg, #4db3ff, #1260d8);
}
.n-31, .n-32, .n-33, .n-34, .n-35 {
  background: radial-gradient(circle at 30% 26%, rgba(255,255,255,.72), transparent 40%),
    linear-gradient(165deg, #8a78ff, #3a27d4);
}
.n-36, .n-37, .n-38, .n-39, .n-40,
.n-41, .n-42, .n-43, .n-44, .n-45,
.n-46, .n-47, .n-48, .n-49 {
  background: radial-gradient(circle at 30% 26%, rgba(255,255,255,.7), transparent 40%),
    linear-gradient(165deg, #d46bff, #8a14c9);
}

.ball.is-extra {
  color: #161022;
  text-shadow: none;
  border-color: #fff;
  background:
    radial-gradient(circle at 30% 26%, rgba(255, 255, 255, 0.8), transparent 42%),
    linear-gradient(165deg, #f6ff7a, #c8f542 40%, #7ad000);
  box-shadow:
    inset 0 -0.42rem 0.55rem rgba(0, 0, 0, 0.12),
    inset 0 0.35rem 0.45rem rgba(255, 255, 255, 0.35),
    0 0 0 3px #ff2d6b,
    0 0.28rem 0.45rem rgba(0, 0, 0, 0.18);
}
.extra-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}
.extra-label span:first-child {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #c0176b;
  background: #ffe24a;
  padding: 0.05rem 0.35rem;
  border-radius: 999px;
  line-height: 1.3;
}

.card-foot {
  margin-top: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.55rem;
  font-size: 1rem;
  font-weight: 700;
}
.card-foot a {
  background: var(--ink);
  color: #fff !important;
  text-decoration: none;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
}
.draw-card.game-539 .card-foot a { background: var(--c539-deep); }
.draw-card.game-lotto649 .card-foot a { background: var(--clotto-deep); }
.draw-card.game-super638 .card-foot a { background: var(--cpower-deep); }

.note-bar {
  margin: 1.6rem 0 0;
  padding: 0.95rem 1.1rem;
  border-left: 8px solid #ff2d6b;
  background: #ffe3ee;
  color: var(--ink);
  font-size: 1.05rem;
  border-radius: 0 0.8rem 0.8rem 0;
}

.subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.55rem;
  margin: 0 0 1.2rem;
  padding-bottom: 0.85rem;
  border-bottom: 3px solid var(--game-soft);
  font-size: 1.05rem;
  font-weight: 700;
}
.subnav a {
  text-decoration: none;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: #fff;
  border: 2px solid var(--game);
  color: var(--game-deep);
}
.subnav a[aria-current="page"] {
  color: #fff;
  background: var(--game-deep);
  border-color: var(--game-deep);
}

table.data {
  width: 100%;
  border-collapse: collapse;
  background: var(--paper-2);
  font-size: 1.02rem;
  font-variant-numeric: tabular-nums;
  border-radius: 0.9rem;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(80, 20, 40, 0.06);
}
table.data th, table.data td {
  border-bottom: 1px solid #f0d5c4;
  padding: 0.7rem 0.65rem;
  text-align: left;
  vertical-align: middle;
}
table.data th {
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.06em;
  color: #fff;
  background: var(--game-deep, #c0176b);
}
.theme-home table.data th { background: #c0176b; }
table.data tbody tr:hover { background: var(--game-soft, #fff0f5); }
table.data .nums { gap: 0.32rem; }
table.data .ball { width: 2.45rem; height: 2.45rem; font-size: 0.98rem; border-width: 2px; }

.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1.3rem;
  align-items: center;
  font-size: 1.05rem;
  font-weight: 700;
}
.pager a, .pager span {
  min-width: 2.4rem;
  text-align: center;
  padding: 0.28rem 0.55rem;
  border: 2px solid var(--game, #ff2d6b);
  background: #fff;
  text-decoration: none;
  color: var(--game-deep, #c0176b);
  font-variant-numeric: tabular-nums;
  border-radius: 0.55rem;
}
.pager a:hover { background: var(--game-soft); }
.pager .is-current {
  background: var(--game-deep, #c0176b);
  color: #fff;
  border-color: var(--game-deep, #c0176b);
}

.period-hero { margin-bottom: 1.5rem; }
.period-hero .meta { font-size: 1.2rem; }
.period-hero .nums { gap: 0.65rem; }
.period-hero .ball { width: 4.7rem; height: 4.7rem; font-size: 1.9rem; border-width: 4px; }
.period-hero h2 { font-size: 2.45rem; }
.period-dl {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 0.45rem 0.9rem;
  margin: 1.3rem 0 0;
  font-size: 1.08rem;
}
.period-dl dt { color: var(--ink-soft); font-weight: 700; }
.period-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.6rem;
  font-size: 1.08rem;
  font-weight: 700;
}

.pending {
  background: var(--warn-bg);
  border: 2px solid #ff9f1c;
  color: var(--warn);
  padding: 0.85rem 1.05rem;
  margin: 1rem 0;
  border-radius: 0.8rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.prose { max-width: 44rem; font-size: 1.08rem; }
.prose p { margin: 0 0 1rem; }
.prose ul { padding-left: 1.3rem; }
.crumbs {
  font-size: 1rem;
  color: var(--ink-soft);
  margin: 0 0 1rem;
  font-weight: 700;
}
.crumbs a { color: var(--game-deep, var(--ink-soft)); }

.site-footer {
  background: #161022;
  color: #ffe9c8;
  padding: 1.5rem 0 2.3rem;
  font-size: 1rem;
}
.site-footer a { color: #ffe24a; }
.site-footer a:hover { color: #fff; }
.site-footer p { margin: 0 0 0.5rem; max-width: 50rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 0.7rem; font-weight: 700; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(5.2rem, 1fr));
  gap: 0.5rem;
  margin: 0.85rem 0 1.4rem;
}
.stat-cell {
  background: #fff;
  border: 2px solid var(--game, #ff7a00);
  border-radius: 0.8rem;
  padding: 0.5rem 0.3rem 0.55rem;
  text-align: center;
}
.stat-cell .n {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-size: 1.25rem;
}
.stat-cell .v { font-size: 0.9rem; color: var(--ink-soft); font-weight: 700; }
.stat-cell.is-hot { background: #ffe0a3; border-color: #ff7a00; }
.stat-cell.is-cold { background: #dceeff; border-color: #1260d8; }
.stat-cell.is-zero { background: #d9fbfd; border-color: #00686e; }

.legend { font-size: 1rem; color: var(--ink-soft); margin: 0 0 0.85rem; }

@media (max-width: 980px) {
  .latest-grid { grid-template-columns: 1fr; }
  .draw-card .ball { width: 3.2rem; height: 3.2rem; font-size: 1.2rem; }
}

@media (max-width: 860px) {
  html { font-size: 18px; } /* 手機內文仍至少 18px */
  .wrap { width: min(var(--max), calc(100% - 1.2rem)); }
  .brand-text h1 { font-size: 2.15rem; letter-spacing: 0.1em; }
  .brand-mark { width: 3.2rem; height: 3.2rem; font-size: 1.8rem; }
  h2 { font-size: 1.85rem; }
  .period-hero h2 { font-size: 2rem; }
  .period-hero .ball { width: 3.9rem; height: 3.9rem; font-size: 1.55rem; }
  .period-dl { grid-template-columns: 1fr; }
  .nav a { padding: 0.42rem 0.85rem; }
  table.data { font-size: 1rem; }
  table.data .ball { width: 2.3rem; height: 2.3rem; font-size: 0.95rem; }
  .meta { white-space: normal; }
}


/* 往年同月同日統計 */
.same-day-section { margin: 2.1rem 0 0; }
.same-day-section > h3 { margin-top: 0; font-size: 1.85rem; }
.same-day-grid { margin-top: 1rem; }
.same-day-panel {
  background: #fff;
  border: 3px solid #efd3c2;
  border-top-width: 12px;
  border-radius: 1.15rem;
  padding: 1.1rem 1.1rem 1.15rem;
  box-shadow: 0 10px 0 rgba(255, 122, 0, 0.08), 0 12px 28px rgba(80, 20, 40, 0.08);
}
.same-day-panel.game-539 { border-color: var(--c539); background: linear-gradient(#fff, var(--c539-soft)); }
.same-day-panel.game-lotto649 { border-color: var(--clotto); background: linear-gradient(#fff, var(--clotto-soft)); }
.same-day-panel.game-super638 { border-color: var(--cpower); background: linear-gradient(#fff, var(--cpower-soft)); }
.same-day-panel h3, .same-day-panel .game-name {
  font-family: var(--serif);
  font-size: 1.45rem;
  margin: 0 0 0.25rem;
}
.same-day-panel.game-539 .game-name, .same-day-panel.game-539 .kicker { color: var(--c539-deep); }
.same-day-panel.game-lotto649 .game-name, .same-day-panel.game-lotto649 .kicker { color: var(--clotto-deep); }
.same-day-panel.game-super638 .game-name, .same-day-panel.game-super638 .kicker { color: var(--cpower-deep); }
.same-day-scope { font-size: 1rem; font-weight: 700; color: var(--ink-soft); margin: 0 0 0.75rem; }
.same-day-rank { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.same-day-rank li {
  display: grid;
  grid-template-columns: 2.1rem 3.2rem 1fr;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255,255,255,0.75);
  border-radius: 999px;
  padding: 0.18rem 0.7rem 0.18rem 0.25rem;
}
.same-day-rank .rank {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-size: 1.15rem;
  text-align: center;
  color: var(--game-deep, #c0176b);
}
.same-day-rank .ball { width: 2.7rem; height: 2.7rem; font-size: 1.05rem; }
.same-day-rank .info { font-weight: 700; font-size: 1rem; line-height: 1.3; }
.same-day-rank .info small { display: block; color: var(--ink-soft); font-size: 0.88rem; font-weight: 700; }
.same-day-few {
  background: #fff3c4;
  border: 2px solid #ffb703;
  color: #6b3a00;
  border-radius: 0.8rem;
  padding: 0.7rem 0.85rem;
  font-weight: 700;
  margin: 0 0 0.7rem;
}
.same-day-note {
  margin: 0.85rem 0 0;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--ink-soft);
}
.same-day-more {
  display: inline-block;
  margin-top: 0.75rem;
  background: var(--game-deep, #161022);
  color: #fff !important;
  text-decoration: none;
  font-weight: 800;
  padding: 0.32rem 0.85rem;
  border-radius: 999px;
}
.same-day-panel.game-539 .same-day-more { background: var(--c539-deep); }
.same-day-panel.game-lotto649 .same-day-more { background: var(--clotto-deep); }
.same-day-panel.game-super638 .same-day-more { background: var(--cpower-deep); }
.same-day-extra { margin-top: 0.9rem; }
.same-day-extra h4 { margin: 0 0 0.45rem; font-size: 1.08rem; }
.same-day-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 0 0 1.1rem;
  font-weight: 800;
}
.cal-month { margin: 0 0 1.4rem; }
.cal-month h3 { font-size: 1.25rem; margin: 0 0 0.5rem; }
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.28rem;
}
.cal-grid .dow, .cal-grid a, .cal-grid .pad {
  text-align: center;
  padding: 0.4rem 0.15rem;
  border-radius: 0.5rem;
  font-weight: 700;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}
.cal-grid .dow { color: var(--ink-soft); font-size: 0.9rem; }
.cal-grid a { background: #fff; border: 2px solid var(--game, #ff7a00); color: var(--game-deep, #c0176b); }
.cal-grid a:hover { background: var(--game-soft); }
.cal-grid a.is-target { background: var(--game-deep); color: #fff; border-color: var(--game-deep); }
.cal-grid a.is-few { border-style: dashed; }
.cal-grid .pad { visibility: hidden; }

@media (max-width: 860px) {
  .same-day-rank li { grid-template-columns: 1.8rem 2.6rem 1fr; }
  .same-day-rank .ball { width: 2.45rem; height: 2.45rem; font-size: 0.95rem; }
}


/* 號碼分布圖 */
.dist-home-section { margin: 2.1rem 0 0; }
.dist-home-section > h3 { margin-top: 0; font-size: 1.85rem; }
.dist-mini {
  background: #fff;
  border: 3px solid #efd3c2;
  border-top-width: 12px;
  border-radius: 1.15rem;
  padding: 1.05rem 1rem 1.1rem;
  box-shadow: 0 10px 0 rgba(255, 122, 0, 0.08), 0 12px 28px rgba(80, 20, 40, 0.08);
}
.dist-mini.game-539 { border-color: var(--c539); background: linear-gradient(#fff, var(--c539-soft)); }
.dist-mini.game-lotto649 { border-color: var(--clotto); background: linear-gradient(#fff, var(--clotto-soft)); }
.dist-mini.game-super638 { border-color: var(--cpower); background: linear-gradient(#fff, var(--cpower-soft)); }
.dist-mini .game-name { font-family: var(--serif); font-size: 1.45rem; margin: 0 0 0.3rem; }
.dist-mini.game-539 .game-name, .dist-mini.game-539 .kicker { color: var(--c539-deep); }
.dist-mini.game-lotto649 .game-name, .dist-mini.game-lotto649 .kicker { color: var(--clotto-deep); }
.dist-mini.game-super638 .game-name, .dist-mini.game-super638 .kicker { color: var(--cpower-deep); }
.chart-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  min-width: 0;
  margin: 0.35rem 0 0.2rem;
  padding-bottom: 0.35rem;
}
.dist-mini, .draw-card, .same-day-panel, .ratio-card {
  min-width: 0;
}
.chart-scroll svg {
  display: block;
  max-width: none !important;
  width: auto;
  /* 不把 SVG 縮成容器寬，以免標籤擠成一團；改由橫向捲動檢視 */
  flex-shrink: 0;
}
.chart-hint { font-size: 0.92rem; font-weight: 700; color: var(--ink-soft); margin: 0 0 0.35rem; }
.chart-caption { font-size: 1rem; font-weight: 700; color: var(--ink-soft); margin: 0.35rem 0 0; }
.chart-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.45rem;
  margin: 0.4rem 0 0.7rem;
}
.chart-tabs > input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.chart-tabs > label {
  cursor: pointer;
  padding: 0.32rem 0.85rem;
  border-radius: 999px;
  border: 2px solid var(--game, #ff2d6b);
  color: var(--game-deep, #c0176b);
  background: #fff;
  font-weight: 800;
  font-size: 1rem;
}
.chart-tabs:has(input[value="all"]:checked) > label[data-k="all"],
.chart-tabs:has(input[value="n100"]:checked) > label[data-k="n100"],
.chart-tabs:has(input[value="n30"]:checked) > label[data-k="n30"] {
  background: var(--game-deep, #c0176b);
  color: #fff;
  border-color: var(--game-deep, #c0176b);
}
.chart-tabs .pane { display: none; flex: 1 0 100%; }
.chart-tabs:has(input[value="all"]:checked) .pane[data-k="all"],
.chart-tabs:has(input[value="n100"]:checked) .pane[data-k="n100"],
.chart-tabs:has(input[value="n30"]:checked) .pane[data-k="n30"] { display: block; }
.ratio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 0.6rem 0 1.2rem;
}
.ratio-card {
  background: #fff;
  border: 3px solid var(--game, #ff7a00);
  border-radius: 1rem;
  padding: 0.85rem 0.95rem 1rem;
}
.ratio-card h4 { margin: 0 0 0.55rem; font-size: 1.12rem; }
.ratio-card svg { width: 100%; height: auto; max-width: 100%; display: block; }
.legend-row { display: flex; flex-wrap: wrap; gap: 0.5rem 0.9rem; margin: 0.45rem 0 0; font-weight: 700; font-size: 0.95rem; }
.legend-dot {
  display: inline-block;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 0.2rem;
  margin-right: 0.3rem;
  vertical-align: -0.1rem;
}
.matrix-legend { font-weight: 700; color: var(--ink-soft); margin: 0.4rem 0 0.5rem; font-size: 1rem; }
.streak-swatch {
  display: inline-block;
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 0.2rem;
  margin: 0 0.2rem;
  vertical-align: -0.15rem;
  background: #ffe24a;
  box-shadow: inset 0 0 0 2px #ff2d6b;
}
@media (max-width: 860px) {
  .ratio-grid { grid-template-columns: 1fr; }
}

/* v5 tools, countdown, articles */
.countdown-banner {
  background: #fff;
  border: 3px solid var(--game, #ff2d6b);
  border-radius: 1.1rem;
  padding: 1rem 1.1rem 0.85rem;
  margin: 1rem 0 1.2rem;
  box-shadow: 0 8px 0 rgba(0,0,0,0.06);
}
.countdown-banner h3 { margin: 0 0 0.25rem; font-size: 1.25rem; }
.countdown-when { margin: 0; font-weight: 800; font-size: 1.2rem; }
.countdown-clock {
  margin: 0.35rem 0;
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--game-deep, #c0176b);
  letter-spacing: 0.04em;
}
.jackpot-line { margin: 0.35rem 0; font-weight: 700; }
.next-mini { margin: 0.45rem 0 0; font-weight: 700; font-size: 0.95rem; line-height: 1.45; }
.next-mini .countdown-clock { font-size: 1.02rem; margin: 0.15rem 0; }
.tool-app { margin: 1rem 0 1.4rem; }
.tool-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 1rem;
  align-items: end;
  margin-bottom: 0.7rem;
}
.tool-toolbar label { display: grid; gap: 0.2rem; font-weight: 700; }
.tool-toolbar select, .tool-toolbar input {
  font: inherit;
  font-weight: 700;
  padding: 0.35rem 0.6rem;
  border: 2px solid #161022;
  border-radius: 0.6rem;
  min-width: 10rem;
}
.btn-go, .btn-lite {
  font: inherit;
  font-weight: 800;
  border-radius: 999px;
  padding: 0.45rem 1.1rem;
  border: 3px solid var(--game-deep, #161022);
  cursor: pointer;
}
.btn-go { background: var(--game-deep, #c0176b); color: #fff; }
.btn-lite { background: #fff; color: var(--game-deep, #161022); }
.hidden { display: none !important; }
.keypad {
  display: grid;
  grid-template-columns: repeat(10, minmax(2.4rem, 1fr));
  gap: 0.35rem;
  margin: 0.6rem 0;
}
@media (max-width: 700px) {
  .keypad { grid-template-columns: repeat(5, minmax(2.6rem, 1fr)); }
}
.key {
  font: inherit;
  font-weight: 800;
  min-height: 2.6rem;
  border-radius: 0.7rem;
  border: 2px solid #161022;
  background: #fff;
  cursor: pointer;
}
.key.is-on, .key-extra.is-on {
  background: var(--game, #ff2d6b);
  color: #fff;
  border-color: #161022;
}
.keypad.extra-keypad {
  margin-top: 0.4rem;
  grid-template-columns: repeat(8, minmax(2.4rem, 1fr));
}
.pick-tray { min-height: 3.2rem; display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.pick-tray .ball { width: 2.6rem; height: 2.6rem; font-size: 1.05rem; }
.pick-tray .ball.is-hit { outline: 3px solid #ffe24a; box-shadow: 0 0 0 3px #ff2d6b; }
.muted { color: var(--ink-soft); font-weight: 700; }
.extra-tag {
  display: inline-block;
  background: #7ad000;
  color: #161022;
  font-size: 0.75rem;
  font-weight: 800;
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
}
.result-card {
  background: #fff;
  border: 3px solid #161022;
  border-radius: 1rem;
  padding: 1rem 1.1rem;
  margin: 0.8rem 0;
}
.result-card.is-win { border-color: #7ad000; background: #f3ffd6; }
.result-card.is-miss { border-color: #c9b8c0; }
.result-card h3 { margin: 0 0 0.4rem; font-size: 1.6rem; }
.plain-table { width: 100%; border-collapse: collapse; font-weight: 700; }
.plain-table th, .plain-table td {
  text-align: left;
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid #ead7c8;
  vertical-align: top;
}
.table-wrap { overflow-x: auto; max-width: 100%; }
.spark-table td:last-child { min-width: 10rem; }
.hbar-list { display: grid; gap: 0.45rem; }
.hbar { display: grid; grid-template-columns: 6.5rem 1fr auto; gap: 0.5rem; align-items: center; font-weight: 700; }
.hbar-track { background: #f4efe8; border-radius: 999px; height: 1.05rem; overflow: hidden; }
.hbar-fill { display: block; height: 100%; background: linear-gradient(90deg, #ff2d6b, #ff7a00, #5b4dff); border-radius: 999px; }
.guide-grid, .guide-card { }
.guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin: 1rem 0;
}
@media (max-width: 800px) { .guide-grid { grid-template-columns: 1fr; } }
.guide-card {
  display: grid;
  gap: 0.35rem;
  background: #fff;
  border: 3px solid var(--game, #ff7a00);
  border-radius: 1rem;
  padding: 0.9rem 1rem;
  text-decoration: none;
  color: inherit;
}
.guide-card strong { font-size: 1.15rem; color: var(--game-deep, #c0176b); }
.article-body { font-size: 1.05rem; }
.article-body h3 { margin-top: 1.4rem; }
.source-list { padding-left: 1.2rem; }
.faq-item, .tuopai-group {
  background: #fff;
  border: 2px solid #ead7c8;
  border-radius: 0.8rem;
  padding: 0.55rem 0.8rem;
  margin: 0.45rem 0;
}
.faq-item summary, .tuopai-group summary {
  font-weight: 800;
  cursor: pointer;
}
.big-tails { font-size: 2rem; font-weight: 800; color: var(--game-deep, #c0176b); margin: 0.2rem 0 0.8rem; letter-spacing: 0.06em; }
.ref-nums { font-size: 1.85rem; font-weight: 800; line-height: 1.7; letter-spacing: 0.04em; }
.plain-table tr.is-selected td { background: #ffe8a3; }
.tuopai-hero { margin: 1rem 0; }
.method-list { font-weight: 700; }
.home-tools { margin: 1.2rem 0; }

.plain-table .nums { display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; }
.plain-table .ball { width: 2.15rem; height: 2.15rem; font-size: 0.9rem; }


/* v6：四個新彩種主色、導覽換行、選號／包牌／號碼頁、圖卡 */
:root {
  --cstar3: #ff2d55;
  --cstar3-deep: #b00032;
  --cstar3-soft: #ffd6e0;
  --cstar4: #ffbf00;
  --cstar4-deep: #8a6500;
  --cstar4-soft: #fff3c2;
  --cloto39: #00d5a4;
  --cloto39-deep: #007a5c;
  --cloto39-soft: #c8fff0;
  --cloto49: #2f6bff;
  --cloto49-deep: #1239b8;
  --cloto49-soft: #d6e4ff;
}
.theme-star3 { --game: var(--cstar3); --game-deep: var(--cstar3-deep); --game-soft: var(--cstar3-soft); }
.theme-star4 { --game: var(--cstar4); --game-deep: var(--cstar4-deep); --game-soft: var(--cstar4-soft); }
.theme-loto39 { --game: var(--cloto39); --game-deep: var(--cloto39-deep); --game-soft: var(--cloto39-soft); }
.theme-loto49 { --game: var(--cloto49); --game-deep: var(--cloto49-deep); --game-soft: var(--cloto49-soft); }
.theme-star3 a { color: var(--cstar3-deep); }
.theme-star4 a { color: var(--cstar4-deep); }
.theme-loto39 a { color: var(--cloto39-deep); }
.theme-loto49 a { color: var(--cloto49-deep); }
.theme-star3 a:hover, .theme-star4 a:hover, .theme-loto39 a:hover, .theme-loto49 a:hover { color: var(--ink); }

.nav { display: flex; flex-wrap: wrap; gap: 0.35rem 0.85rem; align-items: center; }
.color-strip { display: grid; grid-template-columns: repeat(7, 1fr); }
.color-strip span:nth-child(1) { background: var(--c539); }
.color-strip span:nth-child(2) { background: var(--clotto); }
.color-strip span:nth-child(3) { background: var(--cpower); }
.color-strip span:nth-child(4) { background: var(--cstar3); }
.color-strip span:nth-child(5) { background: var(--cstar4); }
.color-strip span:nth-child(6) { background: var(--cloto39); }
.color-strip span:nth-child(7) { background: var(--cloto49); }

.latest-grid.four-up { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 1rem; }
@media (max-width: 1100px) {
  .latest-grid.four-up { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .latest-grid.four-up { grid-template-columns: 1fr; }
}

.draw-card.game-star3, .same-day-panel.game-star3, .dist-mini.game-star3 { border-color: var(--cstar3); background: linear-gradient(#fff, var(--cstar3-soft)); }
.draw-card.game-star4, .same-day-panel.game-star4, .dist-mini.game-star4 { border-color: var(--cstar4); background: linear-gradient(#fff, var(--cstar4-soft)); }
.draw-card.game-loto39, .same-day-panel.game-loto39, .dist-mini.game-loto39 { border-color: var(--cloto39); background: linear-gradient(#fff, var(--cloto39-soft)); }
.draw-card.game-loto49, .same-day-panel.game-loto49, .dist-mini.game-loto49 { border-color: var(--cloto49); background: linear-gradient(#fff, var(--cloto49-soft)); }
.draw-card.game-star3 .game-name, .draw-card.game-star3 .kicker,
.same-day-panel.game-star3 .game-name, .same-day-panel.game-star3 .kicker,
.dist-mini.game-star3 .game-name, .dist-mini.game-star3 .kicker { color: var(--cstar3-deep); }
.draw-card.game-star4 .game-name, .draw-card.game-star4 .kicker,
.same-day-panel.game-star4 .game-name, .same-day-panel.game-star4 .kicker,
.dist-mini.game-star4 .game-name, .dist-mini.game-star4 .kicker { color: var(--cstar4-deep); }
.draw-card.game-loto39 .game-name, .draw-card.game-loto39 .kicker,
.same-day-panel.game-loto39 .game-name, .same-day-panel.game-loto39 .kicker,
.dist-mini.game-loto39 .game-name, .dist-mini.game-loto39 .kicker { color: var(--cloto39-deep); }
.draw-card.game-loto49 .game-name, .draw-card.game-loto49 .kicker,
.same-day-panel.game-loto49 .game-name, .same-day-panel.game-loto49 .kicker,
.dist-mini.game-loto49 .game-name, .dist-mini.game-loto49 .kicker { color: var(--cloto49-deep); }
.draw-card.game-star3 .card-foot a, .same-day-panel.game-star3 .same-day-more { background: var(--cstar3-deep); }
.draw-card.game-star4 .card-foot a, .same-day-panel.game-star4 .same-day-more { background: var(--cstar4-deep); }
.draw-card.game-loto39 .card-foot a, .same-day-panel.game-loto39 .same-day-more { background: var(--cloto39-deep); }
.draw-card.game-loto49 .card-foot a, .same-day-panel.game-loto49 .same-day-more { background: var(--cloto49-deep); }

.nums.is-digits { align-items: center; gap: 0.55rem; }
.digit-code {
  font-weight: 800;
  font-size: 2.4rem;
  letter-spacing: 0.08em;
  color: var(--game-deep, var(--ink));
  line-height: 1;
}
.nums.is-small .digit-code { font-size: 1.35rem; }
.ball.n-d0 { background: linear-gradient(#8a8a96, #3a3a44); color: #fff; }
.ball.n-d1 { background: linear-gradient(#ff6b8a, #ff2d55); color: #fff; }
.ball.n-d2 { background: linear-gradient(#ffb066, #ff7a00); color: #161022; }
.ball.n-d3 { background: linear-gradient(#ffe066, #ffbf00); color: #161022; }
.ball.n-d4 { background: linear-gradient(#9aee7a, #50c83c); color: #161022; }
.ball.n-d5 { background: linear-gradient(#7af0f4, #00c2c8); color: #161022; }
.ball.n-d6 { background: linear-gradient(#7aa6ff, #2f6bff); color: #fff; }
.ball.n-d7 { background: linear-gradient(#9b92ff, #5b4dff); color: #fff; }
.ball.n-d8 { background: linear-gradient(#e48ce4, #c846c8); color: #fff; }
.ball.n-d9 { background: linear-gradient(#3a3a48, #14141e); color: #fff; }

.num-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
  gap: 0.7rem;
  margin: 1rem 0 1.6rem;
}
.num-grid.is-digits { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.num-cell {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  align-items: center;
  padding: 0.7rem 0.4rem;
  border: 2px solid var(--game, #ff2d6b);
  border-radius: 0.9rem;
  background: #fff;
  text-decoration: none;
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 700;
}
.num-cell:hover { background: var(--game-soft); color: var(--ink); }

.tool-form {
  display: grid;
  gap: 0.8rem;
  margin: 1rem 0;
  padding: 1rem;
  border: 3px solid var(--game, #ff7a00);
  border-radius: 1rem;
  background: #fff;
}
.tool-form label { display: block; font-weight: 800; color: var(--game-deep, var(--ink)); }
.tool-form input, .tool-form select {
  font: inherit;
  width: 100%;
  margin-top: 0.2rem;
  padding: 0.35rem 0.5rem;
  border: 2px solid var(--rule);
  border-radius: 0.5rem;
}
.cond-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 0.7rem; }
.ticket-list { display: grid; gap: 0.8rem; margin-top: 1rem; }
.ticket-card {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  padding: 0.8rem 1rem;
  border-radius: 1rem;
  border: 3px solid var(--game);
  background: linear-gradient(#fff, var(--game-soft));
}
.share-card-block { margin: 1.5rem 0; }
.share-preview {
  width: min(100%, 720px);
  height: auto;
  border-radius: 1rem;
  border: 4px solid var(--game, #ff2d6b);
  display: block;
  margin: 0.6rem 0 0.8rem;
}
.share-downloads { display: flex; flex-wrap: wrap; gap: 0.7rem; }
.pos-keypad { margin: 0.6rem 0 1rem; }
.pos-keypad h4 { margin: 0.3rem 0; }
.key.is-ex { background: #161022; color: #fff; text-decoration: line-through; }
.key.is-must { box-shadow: 0 0 0 3px #ffbf00 inset; }
.subnav { flex-wrap: wrap; }
