:root,
[data-theme="light"] {
  --bg: #f6f3ef;
  --bg-elevated: #ffffff;
  --red: #e31e24;
  --red-soft: #d41920;
  --red-glow: rgba(227, 30, 36, 0.2);
  --text: #1c1917;
  --muted: #78716c;
  --line: rgba(28, 25, 23, 0.1);
  --surface: rgba(28, 25, 23, 0.03);
  --surface-strong: rgba(28, 25, 23, 0.05);
  --zalo: #0068ff;
  --zalo-soft: rgba(0, 104, 255, 0.1);
  --shadow: 0 12px 40px rgba(28, 25, 23, 0.08);
  --atm-base: linear-gradient(180deg, #f6f3ef 0%, #faf8f6 50%, #f3efe9 100%);
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Sora", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --theme-btn-bg: #1c1917;
  --theme-btn-fg: #fafaf9;
  --ball: #fff;
  --ball-text: #1c1917;
  --ok: #15803d;
}

[data-theme="dark"] {
  --bg: #0a0a0b;
  --bg-elevated: #141416;
  --red: #e31e24;
  --red-soft: #ff3b40;
  --red-glow: rgba(227, 30, 36, 0.35);
  --text: #f4f1ef;
  --muted: #a8a29e;
  --line: rgba(255, 255, 255, 0.08);
  --surface: rgba(255, 255, 255, 0.03);
  --surface-strong: rgba(255, 255, 255, 0.05);
  --zalo: #0068ff;
  --zalo-soft: rgba(0, 104, 255, 0.12);
  --shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  --atm-base: linear-gradient(180deg, #0a0a0b 0%, #0f0c0c 50%, #0a0a0b 100%);
  --theme-btn-bg: #fafaf9;
  --theme-btn-fg: #1c1917;
  --ball: #1c1917;
  --ball-text: #f4f1ef;
  --ok: #4ade80;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--atm-base);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  transition: background-color .35s var(--ease), color .35s var(--ease);
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }

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

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: .85rem 0; gap: 1rem;
}
.brand { display: flex; align-items: center; gap: .75rem; }
.brand img { height: 36px; width: auto; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-family: var(--font-display); font-size: 1.05rem; }
.brand-text span { font-size: .72rem; color: var(--muted); letter-spacing: .02em; }
.nav-actions { display: flex; gap: .5rem; align-items: center; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg-elevated);
  display: grid; place-items: center;
}
.icon-btn:hover { border-color: var(--red); }

/* Hero */
.hero {
  padding: 3.25rem 0 2rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute; inset: -20% 20% auto -10%; height: 70%;
  background: radial-gradient(ellipse at center, var(--red-glow), transparent 65%);
  pointer-events: none;
}
.hero-grid {
  display: grid; gap: 1.75rem; align-items: end;
  position: relative;
}
@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 1.3fr .7fr; }
}
.eyebrow {
  display: inline-flex; align-items: center; gap: .45rem;
  color: var(--red); font-size: .8rem; font-weight: 500; letter-spacing: .04em;
  text-transform: uppercase; margin-bottom: .85rem;
}
.eyebrow i {
  width: 8px; height: 8px; border-radius: 50%; background: var(--red);
  box-shadow: 0 0 0 4px var(--red-glow); animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px var(--red-glow); }
  50% { box-shadow: 0 0 0 8px transparent; }
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 700; line-height: 1.08; letter-spacing: -.02em;
  margin-bottom: .9rem;
}
.hero h1 em { font-style: normal; color: var(--red); }
.hero p.lead {
  color: var(--muted); font-size: 1.05rem; max-width: 36rem; margin-bottom: 1.4rem;
}
.cta-row { display: flex; flex-wrap: wrap; gap: .75rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .85rem 1.25rem; border-radius: 999px; font-weight: 600;
  transition: transform .25s var(--ease), background .25s var(--ease), color .25s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-soft); }
.btn-ghost { border: 1px solid var(--line); background: var(--bg-elevated); }
.hero-meta {
  border: 1px solid var(--line); background: var(--bg-elevated);
  border-radius: 1.25rem; padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow);
}
.hero-meta .k { color: var(--muted); font-size: .78rem; }
.hero-meta .v { font-family: var(--font-display); font-size: 1.35rem; margin-top: .15rem; }
.hero-meta .row { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.hero-meta .full { margin-top: .9rem; padding-top: .9rem; border-top: 1px solid var(--line); }

.section { padding: 1.5rem 0 3rem; }
.section-head {
  display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.1rem;
}
.section-head h2 {
  font-family: var(--font-display); font-size: clamp(1.5rem, 3vw, 2rem); line-height: 1.15;
}
.section-head p { color: var(--muted); font-size: .92rem; max-width: 28rem; }

/* Filter menus */
.filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: .85rem 1rem;
  margin-bottom: 1.35rem;
  padding: 1rem 1.1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 1.15rem;
  box-shadow: var(--shadow);
}
.filter-field {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  min-width: 0;
}
.filter-label {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}
.filter-select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  padding: .75rem 2.5rem .75rem 0.95rem;
  border-radius: .75rem;
  border: 1px solid var(--line);
  background-color: var(--bg);
  background-image:
    linear-gradient(45deg, transparent 50%, var(--red) 50%),
    linear-gradient(135deg, var(--red) 50%, transparent 50%);
  background-position:
    calc(100% - 1.15rem) calc(50% - 0.15rem),
    calc(100% - 0.75rem) calc(50% - 0.15rem);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  color: var(--text);
  font-family: var(--font-body);
  font-size: .95rem;
  font-weight: 500;
  line-height: 1.3;
  cursor: pointer;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.filter-select:hover {
  border-color: color-mix(in srgb, var(--red) 45%, var(--line));
}
.filter-select:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-glow);
}

.filter-input {
  width: 100%;
  padding: .75rem .95rem;
  border-radius: .75rem;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: .95rem;
  font-weight: 500;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.filter-input:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-glow);
}
.filter-btn {
  width: 100%;
  border-radius: .75rem !important;
  padding: .75rem 1rem !important;
}

.personal-bar {
  margin-bottom: 1.35rem;
}
.personal-head {
  margin-bottom: .75rem;
}
.personal-head h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin-bottom: .25rem;
}
.personal-head p {
  color: var(--muted);
  font-size: .9rem;
  max-width: 40rem;
}
.personal-grid {
  margin-bottom: 0;
}
.personal-birth,
.personal-wish { display: none; }
.profile-badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  margin: .35rem 0 .55rem;
  padding: .4rem .75rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--red) 10%, transparent);
  color: var(--red);
  font-size: .84rem;
  font-weight: 600;
}
.profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem .85rem;
  margin: 0 0 .9rem;
  color: var(--muted);
  font-size: .82rem;
}
.profile-meta b { color: var(--text); font-weight: 600; }

.panel-grid {
  display: grid; gap: 1.1rem;
}
@media (min-width: 900px) {
  .panel-grid { grid-template-columns: 1.05fr .95fr; align-items: start; }
  .panel-grid.wide-predict { grid-template-columns: 1.2fr .8fr; }
}

.block {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  padding: 1.2rem 1.25rem 1.35rem;
  box-shadow: var(--shadow);
}
.block h3 {
  font-family: var(--font-display); font-size: 1.25rem; margin-bottom: .35rem;
}
.block .hint { color: var(--muted); font-size: .86rem; margin-bottom: 1rem; }

/* Prediction — bộ số nổi bật */
.predict-hero {
  border: 1px solid color-mix(in srgb, var(--red) 28%, var(--line));
  background:
    radial-gradient(120% 80% at 0% 0%, color-mix(in srgb, var(--red) 14%, transparent), transparent 55%),
    var(--bg-elevated);
}
.predict-kicker {
  font-size: .72rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--red); font-weight: 700; margin: 0 0 .2rem;
}
.predict-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap;
}
.predict-head h3 {
  font-family: var(--font-display); font-size: 1.55rem; margin: 0 0 .2rem; line-height: 1.15;
}
.confidence {
  display: inline-flex; align-items: baseline; gap: .4rem;
  padding: .55rem .9rem; border-radius: 999px;
  background: var(--red); color: #fff; font-weight: 600;
  box-shadow: 0 10px 24px rgba(227, 30, 36, .28);
}
.confidence b { font-family: var(--font-display); font-size: 1.35rem; color: #fff; }

.number-stage {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .85rem;
  margin: 1.25rem 0 .85rem;
  padding: 1.1rem;
  border-radius: 1.15rem;
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--red) 10%, #fff), color-mix(in srgb, var(--bg) 92%, #fff));
  border: 1px solid color-mix(in srgb, var(--red) 20%, var(--line));
}
.number-stage.count-6 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.number-stage.count-4,
.number-stage.count-5 {
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
}
.number-tile {
  position: relative;
  min-height: 108px;
  border-radius: 1rem;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .35rem;
  background: #fff;
  border: 2px solid color-mix(in srgb, var(--red) 45%, #fff);
  box-shadow:
    0 14px 28px rgba(227, 30, 36, .16),
    inset 0 1px 0 rgba(255,255,255,.9);
  animation: pop .5s var(--ease) both;
}
.number-tile .num {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 3.1rem);
  font-weight: 700;
  line-height: 1;
  color: var(--red);
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}
.number-tile .ord {
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.number-tile.special {
  border-color: #0068ff;
  box-shadow: 0 14px 28px rgba(0, 104, 255, .18);
}
.number-tile.special .num { color: #0068ff; }
.number-tile.ghost {
  filter: blur(4px); opacity: .5; user-select: none;
}
.focus-note {
  text-align: center;
  color: var(--muted);
  font-size: .86rem;
  margin: 0 0 1rem;
}
.guarantee-box {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border-radius: .85rem;
  border: 1px dashed color-mix(in srgb, #1a7f37 55%, #ccc);
  background: color-mix(in srgb, #1a7f37 8%, transparent);
}
.guarantee-box strong { display: block; margin-bottom: .35rem; color: #145a28; }
.guarantee-box p { margin: .25rem 0; font-size: .9rem; }
.seal-box {
  margin: 1rem 0 1.15rem;
  padding: 1rem 1.1rem;
  border-radius: .85rem;
  border: 1px solid color-mix(in srgb, var(--text) 14%, transparent);
  background: color-mix(in srgb, var(--text) 3%, transparent);
}
.seal-box.is-valid {
  border-color: color-mix(in srgb, #1a7f37 50%, #ccc);
  background: color-mix(in srgb, #1a7f37 10%, transparent);
}
.seal-box.is-bad {
  border-color: color-mix(in srgb, var(--red) 45%, #ccc);
}
.seal-kicker {
  font-size: .72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .55rem;
  font-weight: 600;
}
.seal-row {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem .85rem;
  align-items: center;
  margin: .3rem 0;
  font-size: .9rem;
}
.seal-row > span:first-child {
  min-width: 5.5rem;
  color: var(--muted);
}
.seal-hash {
  font-size: .8rem;
  word-break: break-all;
}
[data-theme="dark"] .guarantee-box strong { color: #9be2b0; }
[data-theme="dark"] .guarantee-box {
  background: color-mix(in srgb, #1a7f37 14%, #141414);
}
.bag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  justify-content: center;
  margin: .35rem 0 1rem;
}
.bag-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.15rem;
  height: 2.15rem;
  padding: 0 .35rem;
  border-radius: .55rem;
  border: 1px solid color-mix(in srgb, var(--red) 35%, #ccc);
  background: color-mix(in srgb, var(--red) 6%, #fff);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 700;
  font-size: .92rem;
  color: var(--text);
}
.bag-chip.is-hit {
  border-color: #1a7f37;
  background: color-mix(in srgb, #1a7f37 16%, #fff);
  color: #145a28;
}
.board.official {
  margin-bottom: 1rem;
  padding: .85rem 1rem;
  border: 1px solid color-mix(in srgb, var(--text) 12%, transparent);
  border-radius: .85rem;
  background: color-mix(in srgb, var(--text) 3%, transparent);
}
.number-tile.result-tile {
  border-color: color-mix(in srgb, #0068ff 45%, #ccc);
}
.number-tile.result-tile .num { color: #0068ff; }
[data-theme="dark"] .bag-chip {
  background: #1c1c1c;
  border-color: color-mix(in srgb, var(--red) 45%, #444);
}
[data-theme="dark"] .bag-chip.is-hit {
  background: color-mix(in srgb, #1a7f37 22%, #1c1c1c);
  color: #9be2b0;
}
[data-theme="dark"] .number-tile.result-tile .num { color: #7eb6ff; }

[data-theme="dark"] .number-stage {
  background: linear-gradient(160deg, color-mix(in srgb, var(--red) 18%, #1a1212), #141414);
}
[data-theme="dark"] .number-tile {
  background: #1c1c1c;
  border-color: color-mix(in srgb, var(--red) 55%, #333);
}
[data-theme="dark"] .number-tile .num { color: #ff5a5f; }

.number-stage.compact-stage {
  margin: .35rem 0 .85rem;
  padding: .85rem;
}
.number-tile .role-hint {
  display: block;
  font-size: .65rem;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  margin-top: .15rem;
  line-height: 1.2;
  max-width: 7.5rem;
}
.roles-stage .number-tile.role-dau { border-color: #c45c26; }
.roles-stage .number-tile.role-lac { border-color: #1a7f37; }
.roles-stage .number-tile.role-ba_chan { border-color: #0068ff; }
.role-cmp { display: grid; gap: .45rem; margin: .5rem 0 .85rem; }
.role-cmp-row {
  display: grid;
  grid-template-columns: 4.5rem 3.5rem 6rem 1fr;
  gap: .5rem;
  align-items: center;
  padding: .45rem .65rem;
  border-radius: .55rem;
  border: 1px solid color-mix(in srgb, var(--text) 12%, transparent);
  font-size: .88rem;
}
.role-cmp-row.is-hit {
  border-color: #1a7f37;
  background: color-mix(in srgb, #1a7f37 12%, transparent);
}
.role-cmp-row.is-miss { opacity: .85; }
.role-name { font-weight: 700; }
.role-status { font-weight: 600; }
.results-history { padding: 1.25rem 1.35rem 1.5rem; }
.results-head { margin-bottom: 1rem; }
.results-head h2 {
  margin: 0 0 .25rem;
  font-family: Fraunces, serif;
  font-size: 1.35rem;
}
.results-list { display: grid; gap: 1.15rem; }
.result-day {
  border: 1px solid color-mix(in srgb, var(--text) 12%, transparent);
  border-radius: 1rem;
  padding: .95rem 1rem 1.1rem;
  background: color-mix(in srgb, var(--bg-elevated) 88%, transparent);
}
.result-day-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  margin-bottom: .85rem;
  padding-bottom: .65rem;
  border-bottom: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
}
.result-day-date {
  font-family: Fraunces, serif;
  font-size: 1.15rem;
  font-weight: 700;
}
.result-day-wd {
  margin-left: .45rem;
  color: var(--muted);
  font-size: .88rem;
  font-weight: 500;
}
.result-db-chip {
  font-size: .82rem;
  color: var(--muted);
  white-space: nowrap;
}
.result-db-chip b {
  color: var(--red);
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}
.result-boards {
  display: grid;
  gap: .85rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.result-board {
  margin: 0;
  background: var(--bg-elevated);
}
.result-balls {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}
.result-ball {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.55rem;
  height: 2.55rem;
  padding: 0 .35rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.result-ball.special {
  border-color: color-mix(in srgb, var(--red) 50%, var(--line));
  color: var(--red);
  background: color-mix(in srgb, var(--red) 10%, var(--bg-elevated));
}
.jackpot-line { margin: .55rem 0 0; }
.results-table { width: 100%; border-collapse: collapse; }
.results-table th {
  text-align: left;
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  padding: .65rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--text) 12%, transparent);
}
.results-table td {
  padding: .85rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
  vertical-align: middle;
}
.results-table td:first-child { width: 8.5rem; color: var(--text); }
.results-val {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: .02em;
}
@media (max-width: 560px) {
  .results-table td:first-child { width: 6.5rem; font-size: .9rem; }
  .results-val { font-size: .95rem; }
  .result-day { padding: .8rem .75rem .95rem; }
  .result-boards { grid-template-columns: 1fr; }
}
[data-theme="dark"] .prize-num.is-hit { color: #9be2b0; }
@media (max-width: 560px) {
  .role-cmp-row { grid-template-columns: 3.5rem 3rem 1fr; }
  .role-cmp-row .hint { grid-column: 1 / -1; }
}
.number-tile.is-hit .num { color: #145a28; }
.number-tile.is-hit .ord { color: #1a7f37; font-weight: 700; }
.cmp-hit-note { margin: .25rem 0 .5rem; text-align: center; }
[data-theme="dark"] .number-tile.is-hit .num { color: #9be2b0; }
[data-theme="dark"] .number-tile.is-hit {
  border-color: #2f9e57;
  background: color-mix(in srgb, #1a7f37 18%, #1c1c1c);
}

@media (max-width: 560px) {
  .number-stage,
  .number-stage.count-6,
  .number-stage.compact-stage {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .55rem;
    padding: .75rem;
  }
  .number-tile { min-height: 88px; border-radius: .85rem; }
  .number-tile .num { font-size: 1.85rem; }
}

.focus-box {
  margin: 1rem 0 1.15rem;
  padding: .85rem 1rem;
  border: 1px solid color-mix(in srgb, var(--red) 22%, var(--line));
  border-radius: 14px;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--red) 6%, transparent),
    color-mix(in srgb, var(--bg) 80%, #fff));
}
.focus-box.compact { margin: 0 0 1rem; }
.focus-head {
  display: flex; flex-wrap: wrap; gap: .4rem .8rem;
  align-items: baseline; margin-bottom: .65rem;
}
.focus-head strong { font-family: var(--font-display); font-size: 1.05rem; }
.focus-head span { color: var(--muted); font-size: .84rem; }
.focus-nums { display: flex; flex-wrap: wrap; gap: .55rem; justify-content: center; }
.focus-chip {
  min-width: 3.2rem; min-height: 3.2rem;
  padding: .45rem .55rem;
  display: grid; place-items: center;
  text-align: center; font-weight: 800; font-size: 1.25rem;
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  border-radius: 12px;
  background: #fff;
  border: 2px solid color-mix(in srgb, var(--red) 40%, transparent);
  color: var(--red);
  box-shadow: 0 8px 18px rgba(227, 30, 36, .12);
}
.focus-chip.hit {
  background: color-mix(in srgb, #1a7f37 16%, #fff);
  border-color: #1a7f37;
  color: #145a28;
}
[data-theme="dark"] .focus-chip {
  background: #1c1c1c;
  color: #ff5a5f;
}
[data-theme="dark"] .focus-chip.hit {
  background: color-mix(in srgb, #1a7f37 35%, #111);
  color: #9be2b0;
}

.balls {
  display: flex; flex-wrap: wrap; gap: .55rem;
  margin: 1.1rem 0 .5rem;
  min-height: 64px;
}
.ball {
  width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700; font-size: 1.05rem;
  background: radial-gradient(circle at 30% 28%, #fff, var(--ball) 55%);
  color: var(--ball-text);
  border: 2px solid color-mix(in srgb, var(--red) 55%, #fff);
  box-shadow: 0 8px 18px rgba(227, 30, 36, .18);
  animation: pop .45s var(--ease) both;
}
.ball.special {
  border-color: var(--zalo);
  box-shadow: 0 8px 18px rgba(0, 104, 255, .2);
}
.ball.ghost {
  filter: blur(5px); opacity: .55; user-select: none;
}
@keyframes pop {
  from { opacity: 0; transform: scale(.82) translateY(10px); }
  to { opacity: 1; transform: none; }
}

.tagline {
  display: flex; flex-wrap: wrap; gap: .4rem; margin: .75rem 0 1rem;
}
.chip {
  font-size: .78rem; padding: .28rem .55rem; border-radius: 999px;
  background: var(--surface-strong); color: var(--muted);
}
.chip.hot { color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); }
.chip.cold { color: var(--zalo); background: var(--zalo-soft, rgba(0,104,255,.1)); }

.reasons { list-style: none; display: grid; gap: .45rem; }
.reasons li {
  position: relative; padding-left: 1rem; color: var(--muted); font-size: .9rem;
}
.reasons li::before {
  content: ""; position: absolute; left: 0; top: .55em;
  width: 6px; height: 6px; border-radius: 50%; background: var(--red);
}

.lock-box {
  margin-top: 1rem; padding: 1rem;
  border: 1px dashed color-mix(in srgb, var(--red) 45%, var(--line));
  border-radius: 1rem;
  background: color-mix(in srgb, var(--red) 5%, transparent);
  text-align: center;
}
.lock-box p { color: var(--muted); margin: .4rem 0 1rem; font-size: .9rem; }

/* Charts / stats */
.bars { display: grid; gap: .4rem; }
.bar-row {
  display: grid; grid-template-columns: 2.2rem 1fr 2.4rem; gap: .55rem; align-items: center;
  font-size: .82rem;
}
.bar-track {
  height: 8px; border-radius: 999px; background: var(--surface-strong); overflow: hidden;
}
.bar-fill {
  height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, var(--red), #b81419);
  transform-origin: left; animation: grow .7s var(--ease) both;
}
@keyframes grow { from { transform: scaleX(0); } to { transform: none; } }

.table {
  width: 100%; border-collapse: collapse; font-size: .86rem;
}
.table th, .table td {
  text-align: left; padding: .55rem .2rem; border-bottom: 1px solid var(--line);
}
.table th { color: var(--muted); font-weight: 500; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; }
.mono { font-variant-numeric: tabular-nums; font-weight: 600; }

.notice {
  margin-top: 1rem; padding: .85rem 1rem; border-radius: .9rem;
  background: var(--surface); color: var(--muted); font-size: .84rem;
  border: 1px solid var(--line);
}
.notice strong { color: var(--text); }

.boards { display: grid; gap: 1rem; margin: 1rem 0 .25rem; }
.board {
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: .85rem .9rem 1rem;
  background: var(--surface);
}
.board-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin-bottom: .55rem;
  color: var(--red);
}
.prize-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.prize-table th {
  width: 7.5rem; text-align: left; padding: .4rem .35rem .4rem 0;
  color: var(--muted); font-weight: 500; vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.prize-table td {
  padding: .4rem 0; border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.prize-table tr.is-db th { color: var(--red); font-weight: 700; }
.prize-table tr.is-db td { color: var(--red); }
.prize-num {
  display: inline-block;
  min-width: 3.1rem;
  margin: .12rem .28rem .12rem 0;
  padding: .18rem .35rem;
  border-radius: .45rem;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}
.prize-table tr.is-db .prize-num {
  border-color: color-mix(in srgb, var(--red) 45%, var(--line));
  background: color-mix(in srgb, var(--red) 8%, var(--bg-elevated));
}
.prize-num.hit {
  border-color: var(--ok);
  background: color-mix(in srgb, var(--ok) 18%, var(--bg-elevated));
  color: var(--ok);
}

.summary-grid {
  display: grid; gap: .85rem;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-bottom: 1.25rem;
}
.summary-card .k { color: var(--muted); font-size: .78rem; }
.summary-card .v {
  font-family: var(--font-display); font-size: 1.85rem; font-weight: 700; margin-top: .2rem; line-height: 1.15;
}
.summary-card.highlight {
  border-color: color-mix(in srgb, var(--red) 35%, var(--line));
  background: linear-gradient(145deg, color-mix(in srgb, var(--red) 8%, transparent), transparent);
}
.summary-card .hint { margin: .35rem 0 0; font-size: .78rem; }

.compare-list { display: grid; gap: .75rem; }
.compare-item {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  padding: 0;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.compare-item summary {
  list-style: none;
  cursor: pointer;
  display: flex; flex-wrap: wrap; align-items: center; gap: .65rem 1rem;
  padding: .95rem 1.1rem;
  font-weight: 500;
}
.compare-item summary::-webkit-details-marker { display: none; }
.compare-item summary::after {
  content: "+";
  margin-left: auto;
  color: var(--muted);
  font-weight: 600;
}
.compare-item[open] summary::after { content: "−"; }
.cmp-date { font-family: var(--font-display); font-size: 1.05rem; }
.cmp-label { color: var(--muted); font-size: .88rem; flex: 1; }
.cmp-rate {
  font-weight: 700; font-variant-numeric: tabular-nums;
  padding: .25rem .6rem; border-radius: 999px; font-size: .85rem;
}
.cmp-rate.good { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.cmp-rate.mid { background: color-mix(in srgb, var(--zalo) 14%, transparent); color: var(--zalo); }
.cmp-rate.low { background: var(--surface-strong); color: var(--muted); }
.compare-body { padding: 0 1.1rem 1.1rem; display: grid; gap: .85rem; }
.cmp-line { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; }
.cmp-tag {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); min-width: 4.2rem; margin-right: .25rem;
}
.cmp-tag.act { color: var(--red); }

.nav-actions .btn { text-decoration: none; }

.footer {
  border-top: 1px solid var(--line);
  padding: 2rem 0 2.5rem; color: var(--muted); font-size: .85rem;
}
.footer-inner {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; align-items: center;
}
.footer img { height: 28px; opacity: .85; }
.disclaimer {
  max-width: 40rem; line-height: 1.55;
}

.loading { color: var(--muted); font-size: .9rem; padding: 1rem 0; }
.error { color: var(--red); padding: 1rem 0; }

.copy-ok {
  position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #1c1917; color: #fff; padding: .65rem 1rem; border-radius: 999px;
  opacity: 0; pointer-events: none; transition: .3s var(--ease); z-index: 50;
}
.copy-ok.show { opacity: 1; transform: translateX(-50%) translateY(0); }

[data-theme="dark"] .brand img.logo-light { display: block; }
[data-theme="dark"] .brand img.logo-dark { display: none; }
[data-theme="light"] .brand img.logo-light { display: none; }
[data-theme="light"] .brand img.logo-dark { display: block; }
[data-theme="dark"] .footer img.logo-light { display: inline; }
[data-theme="dark"] .footer img.logo-dark { display: none; }
[data-theme="light"] .footer img.logo-light { display: none; }
[data-theme="light"] .footer img.logo-dark { display: inline; }
