:root {
  --bg: #080808;
  --bg-soft: #0b0b10;
  --panel: rgba(255, 255, 255, 0.055);
  --panel-strong: rgba(255, 255, 255, 0.085);
  --gold: #d4af37;
  --red: #8b1e1e;
  --text: #f5f0df;
  --muted: #b8ad96;
  --line: rgba(212, 175, 55, 0.24);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    linear-gradient(rgba(212,175,55,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(212,175,55,.018) 1px, transparent 1px),
    radial-gradient(circle at 18% 0%, rgba(139, 30, 30, 0.22), transparent 26%),
    linear-gradient(180deg, #0b0b10 0%, #080808 54%, #101010 100%);
  background-size: 34px 34px, 34px 34px, auto, auto;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  line-height: 1.6;
  letter-spacing: 0;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
.container { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.skip-link { position: absolute; left: -999px; }
.skip-link:focus { left: 16px; top: 16px; z-index: 99; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(8, 8, 8, 0.82);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}
.header-inner { min-height: 72px; display: flex; align-items: center; gap: 22px; }
.brand { display: inline-flex; align-items: center; gap: 12px; min-width: 224px; }
.brand-logo {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  display: block;
  border-radius: 12px;
  box-shadow: 0 0 34px rgba(212, 175, 55, 0.22);
}
.brand strong { display: block; font-size: 1rem; line-height: 1.1; }
.brand small { display: block; color: var(--muted); font-size: 0.76rem; max-width: 280px; }
.primary-nav { margin-left: auto; }
.primary-nav ul { display: flex; align-items: center; gap: 6px; padding: 0; margin: 0; list-style: none; }
.primary-nav a { display: block; padding: 10px 12px; border-radius: 8px; color: var(--muted); font-weight: 700; font-size: 0.92rem; white-space: nowrap; }
.primary-nav a:hover, .primary-nav .current-menu-item > a { color: var(--gold); background: rgba(212, 175, 55, 0.09); }
.header-cta { padding: 10px 14px; border-radius: 8px; border: 1px solid var(--gold); color: var(--gold); font-weight: 800; white-space: nowrap; }
.menu-toggle { display: none; margin-left: auto; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 8px; background: transparent; }
.menu-toggle span { display: block; width: 18px; height: 2px; margin: 5px auto; background: var(--gold); }

.notice-band { display: none; }
.ttmb-breadcrumb { width: min(1120px, calc(100% - 32px)); margin: 18px auto 0; color: var(--muted); font-size: .9rem; }
.ttmb-breadcrumb a { color: var(--gold); }
.ttmb-breadcrumb span { margin-left: 8px; }

.hero { padding: 38px 0 24px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr); gap: 28px; align-items: start; }
.hero-kicker { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.data-source { color: var(--muted); font-size: .82rem; font-weight: 800; border-left: 1px solid var(--line); padding-left: 10px; }
.hero h1 { margin: 18px 0 16px; font-size: clamp(2.4rem, 6vw, 5.6rem); line-height: .95; letter-spacing: 0; }
.hero-title span { display: block; }
.hero-title span:first-child { color: #fff7e5; text-shadow: 0 14px 42px rgba(212,175,55,.08); }
.hero-title span:last-child {
  margin-left: clamp(12px, 3.2vw, 42px);
  color: #f1d66f;
  text-shadow: 0 14px 48px rgba(139,30,30,.22);
}
.page-hero h1 { margin: 8px 0 12px; font-size: clamp(2.05rem, 4.2vw, 4rem); line-height: 1.02; letter-spacing: 0; }
.hero p, .page-hero p, .section-head p { color: var(--muted); max-width: 660px; }
.hero-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  max-width: 720px;
  margin: 24px 0 0;
  padding: 0;
  overflow: hidden;
}
.hero-summary div { padding: 16px; border-right: 1px solid rgba(255,255,255,.08); }
.hero-summary div:last-child { border-right: 0; }
.hero-summary span { display: block; color: var(--muted); font-size: .8rem; font-weight: 800; }
.hero-summary strong { display: block; margin-top: 7px; color: #fff2cf; font-size: .96rem; line-height: 1.35; }
.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-width: 610px;
  margin-top: 24px;
}
.hero-metrics div {
  min-height: 86px;
  padding: 15px;
  border-radius: 8px;
  border: 1px solid rgba(212,175,55,.18);
  background: rgba(255,255,255,.035);
}
.hero-metrics strong { display: block; color: var(--gold); font-size: 1.3rem; line-height: 1; }
.hero-metrics span { display: block; margin-top: 8px; color: var(--muted); font-size: .82rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 16px; border-radius: 8px; font-weight: 900; border: 1px solid transparent; cursor: pointer; }
.btn-primary { color: #120c02; background: linear-gradient(135deg, #f3d56a, var(--gold)); }
.btn-secondary { color: #fff4d5; background: rgba(139, 30, 30, 0.55); border-color: rgba(255,255,255,.12); }
.btn-ghost { color: var(--gold); border-color: var(--line); background: rgba(255,255,255,.03); }
.panel, .archive-card, .ai-card, .stat-card, .wiki-card {
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(212,175,55,.06), transparent 28%),
    linear-gradient(180deg, var(--panel-strong), var(--panel));
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.panel, .archive-card, .ai-card, .stat-card, .wiki-card { transition: transform .18s ease, border-color .18s ease; }
.panel:hover, .archive-card:hover, .ai-card:hover, .stat-card:hover, .wiki-card:hover { transform: translateY(-2px); border-color: rgba(212,175,55,.42); }
.hero-dashboard { display: grid; gap: 14px; padding-top: 42px; }
.countdown-panel { padding: 24px; }
.countdown-panel h2 { margin: 14px 0 0; font-size: 1.1rem; }
.countdown { margin: 14px 0; color: var(--gold); font-size: clamp(2.2rem, 6vw, 4.2rem); font-weight: 950; font-variant-numeric: tabular-nums; }
.signal-dot { color: #98f5be; font-size: .78rem; font-weight: 900; }
.signal-dot::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 999px; background: #35d978; box-shadow: 0 0 16px #35d978; vertical-align: 1px; }
.micro-bars, .stat-spark { display: flex; align-items: end; gap: 5px; height: 42px; margin: 8px 0 14px; }
.micro-bars i, .stat-spark i { flex: 1; min-width: 8px; border-radius: 5px 5px 0 0; background: linear-gradient(180deg, var(--gold), rgba(139,30,30,.65)); opacity: .86; }
.stat-spark { height: 30px; margin: 10px 0; }
.mini-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.mini-panels .panel { padding: 18px; }
.mini-panels strong { display: block; margin: 12px 0 6px; font-size: 1.3rem; color: var(--gold); }
.province-strip {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(260px, .38fr) minmax(0, 1fr);
  gap: 14px;
  margin-top: 0;
}
.province-today {
  padding: 18px;
}
.province-today h3 {
  margin: 10px 0 10px;
  font-size: 1.08rem;
  line-height: 1.25;
}
.province-today p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: .88rem;
}
.province-today strong {
  display: block;
  width: 100%;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid rgba(212,175,55,.42);
  background: linear-gradient(135deg, rgba(212,175,55,.16), rgba(139,30,30,.2));
  color: var(--gold);
  font-size: 1.55rem;
  line-height: 1.1;
}
.province-week {
  padding: 18px;
}
.province-week .panel-top {
  margin-bottom: 12px;
}
.week-schedule {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}
.week-schedule div {
  min-height: 86px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(212,175,55,.16);
  background: rgba(255,255,255,.035);
}
.week-schedule div.active {
  border-color: rgba(212,175,55,.48);
  background: rgba(212,175,55,.115);
}
.week-schedule span {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 28px;
  border-radius: 7px;
  color: #160f02;
  background: var(--gold);
  font-weight: 950;
  font-size: .78rem;
}
.week-schedule strong {
  display: block;
  margin-top: 9px;
  color: #f7edcf;
  font-size: .86rem;
  line-height: 1.25;
}
.week-schedule div.active strong {
  color: var(--gold);
}
.data-terminal {
  display: grid;
  gap: 0;
  padding: 0;
  overflow: hidden;
}
.data-terminal div {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.data-terminal div:last-child { border-bottom: 0; }
.data-terminal span { color: rgba(212,175,55,.88); font-size: .82rem; font-weight: 900; }
.data-terminal strong { color: #efe3c4; font-size: .9rem; line-height: 1.45; font-weight: 700; }

.badge { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--gold); background: rgba(212,175,55,.08); font-size: .76rem; font-weight: 900; text-transform: uppercase; }
.badge-live { color: #ffd6d6; background: rgba(139,30,30,.45); border-color: rgba(255,120,120,.28); }
.section { padding: 44px 0; }
.hero + .section { padding-top: 24px; }
.compact-section { padding-top: 0; }
.section-head { margin-bottom: 22px; }
.section-head h2 { margin: 10px 0 8px; font-size: clamp(1.55rem, 3vw, 2.4rem); line-height: 1.1; }
.dashboard-grid, .spinner-layout, .community-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, .75fr); gap: 18px; align-items: start; }
.spinner-layout { align-items: stretch; }
.spinner-layout > .panel { height: 100%; }
.panel { padding: 20px; }
.panel-top small { display: block; margin-top: 3px; color: var(--muted); font-size: .82rem; }
.panel-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.status-pill { color: #ffd6d6; background: rgba(139,30,30,.35); border: 1px solid rgba(255,120,120,.22); border-radius: 999px; padding: 4px 10px; font-size: .82rem; }
.skeleton-line { width: 46%; height: 10px; margin: 10px 0 16px; border-radius: 99px; background: linear-gradient(90deg, rgba(255,255,255,.08), rgba(212,175,55,.2), rgba(255,255,255,.08)); }
.result-table { overflow: hidden; border: 1px solid rgba(255,255,255,.08); border-radius: 8px; background: rgba(0,0,0,.18); }
.result-row { display: grid; grid-template-columns: 112px 1fr; gap: 12px; padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,.07); align-items: center; }
.result-row:nth-child(even) { background: rgba(255,255,255,.025); }
.result-row:last-child { border-bottom: 0; }
.result-row span { color: var(--muted); font-weight: 800; }
.result-row strong { display: flex; flex-wrap: wrap; gap: 8px 10px; font-size: 1.05rem; word-break: break-word; }
.result-row strong b {
  display: inline-grid;
  place-items: center;
  min-width: 58px;
  min-height: 34px;
  padding: 4px 8px;
  border: 1px solid rgba(212,175,55,.16);
  border-radius: 7px;
  background: rgba(255,255,255,.035);
  font-weight: 950;
}
.special-number { color: var(--gold); font-size: 1.7rem !important; letter-spacing: 0; }
.special-number b {
  min-width: 98px;
  min-height: 48px;
  border-color: rgba(212,175,55,.42) !important;
  background: linear-gradient(135deg, rgba(212,175,55,.18), rgba(139,30,30,.22)) !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
}
.result-codes {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  background: rgba(212,175,55,.055);
}
.result-codes span { color: var(--muted); font-weight: 900; }
.result-codes strong { color: var(--gold); text-align: right; }
.source-result-shell {
  overflow: auto;
  max-width: 100%;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  background: rgba(0,0,0,.2);
}
.source-result-shell style { display: none !important; }
.source-result-shell table { width: 100% !important; border-collapse: collapse !important; background: transparent !important; color: var(--text) !important; }
.source-result-shell td, .source-result-shell th { border-color: rgba(255,255,255,.08) !important; padding: 10px 12px !important; background: transparent !important; color: var(--text) !important; }
.source-result-shell tr:nth-child(even) td { background: rgba(255,255,255,.025) !important; }
.source-result-shell a { color: var(--gold) !important; }
.source-result-shell .box_kqxs,
.source-result-shell .box-kqxs,
.source-result-shell .bkqtinhmienbac,
.source-result-shell .bkqtinhmiennam,
.source-result-shell .bkqtinhmientrung {
  margin: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: var(--text) !important;
  font-family: inherit !important;
}
.source-result-shell .top,
.source-result-shell .title,
.source-result-shell h1,
.source-result-shell h2,
.source-result-shell h3 {
  color: var(--gold) !important;
  background: rgba(212,175,55,.08) !important;
}
.source-result-shell .giaidb,
.source-result-shell .giaidb div,
.source-result-shell .red,
.source-result-shell .clred {
  color: var(--gold) !important;
  font-size: 1.45rem !important;
  font-weight: 950 !important;
}
.source-result-shell .giaidbl,
.source-result-shell .giai1l,
.source-result-shell .giai2l,
.source-result-shell .giai3l,
.source-result-shell .giai4l,
.source-result-shell .giai5l,
.source-result-shell .giai6l,
.source-result-shell .giai7l {
  color: var(--muted) !important;
  background: rgba(255,255,255,.04) !important;
  font-weight: 900 !important;
  white-space: nowrap;
}
.loto-grid { display: grid; gap: 8px; }
.loto-grid div { display: grid; grid-template-columns: 30px 1fr; gap: 10px; padding: 9px 10px; border-radius: 8px; background: rgba(255,255,255,.04); }
.loto-grid b { color: var(--gold); }
.insight-box { margin-top: 14px; padding: 14px; border-radius: 8px; background: rgba(139,30,30,.24); border: 1px solid rgba(255,255,255,.08); }
.insight-box span { display: block; color: var(--gold); font-size: .76rem; font-weight: 900; text-transform: uppercase; }
.insight-box strong { display: block; margin-top: 6px; font-size: .92rem; line-height: 1.45; }

.ai-grid, .stat-grid, .wiki-grid, .archive-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.ai-card, .stat-card, .wiki-card, .archive-card { padding: 18px; }
.ai-card { position: relative; overflow: hidden; }
.ai-card::after { content: ""; position: absolute; inset: auto 18px 0; height: 2px; background: linear-gradient(90deg, transparent, var(--gold), transparent); opacity: .45; }
.ai-number { display: block; color: var(--gold); font-size: 3rem; line-height: 1; font-weight: 950; }
.meter { height: 8px; margin: 16px 0; border-radius: 99px; background: rgba(255,255,255,.09); overflow: hidden; }
.meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--red), var(--gold)); }
dl { margin: 0; }
dl div { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px solid rgba(255,255,255,.07); }
dt { color: var(--muted); }
dd { margin: 0; font-weight: 800; }
.inline-warning { margin-top: 16px; color: #f4cf8f; font-size: .94rem; }

.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.tabs button { min-height: 38px; padding: 8px 13px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.04); color: var(--muted); font-weight: 800; }
.tabs .active { color: #120c02; background: var(--gold); }
.weekday-nav {
  display: grid;
  grid-template-columns: minmax(150px, 220px) 1fr;
  align-items: center;
  gap: 20px;
  margin-bottom: 18px;
  padding: 26px;
}
.weekday-nav > strong { color: #fff3d4; }
.weekday-nav div {
  display: grid;
  grid-template-columns: repeat(8, minmax(82px, 1fr));
  gap: 10px;
}
.weekday-nav a {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border: 1px solid rgba(212,175,55,.24);
  border-radius: 9px;
  color: #d9c078;
  background: linear-gradient(180deg, rgba(255,255,255,.065), rgba(255,255,255,.025));
  font-weight: 850;
  font-size: .95rem;
  text-align: center;
  white-space: nowrap;
}
.weekday-nav a:hover { color: var(--gold); border-color: rgba(212,175,55,.42); }
.weekday-nav a.active {
  color: #140e02;
  background: var(--gold);
  border-color: var(--gold);
}
.result-day-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 18px;
  padding: 18px;
}
.result-day-summary div {
  min-height: 82px;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.08);
  background: linear-gradient(135deg, rgba(245,197,66,.10), rgba(249,115,22,.05));
}
.result-day-summary span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 750;
}
.result-day-summary strong {
  color: #fff8df;
  font-size: clamp(1.05rem, 2vw, 1.45rem);
  line-height: 1.15;
}
.weekday-results-stack {
  display: grid;
  gap: 18px;
}
.result-panel-wide {
  width: 100%;
}
.province-result-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, .65fr);
  gap: 18px;
  align-items: start;
}
.province-only-result,
.province-update-card {
  height: 100%;
}
.province-update-card {
  position: sticky;
  top: 96px;
}
.province-update-card h2 {
  margin: 14px 0 10px;
  color: #fff8df;
  font-size: clamp(1.35rem, 2.3vw, 2rem);
}
.province-update-card p {
  color: var(--muted);
  line-height: 1.7;
}
.stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 18px; }
.stat-card span { color: var(--muted); font-weight: 800; }
.stat-card strong { display: block; margin: 8px 0; color: var(--gold); font-size: 2.1rem; line-height: 1; }
.stat-card small { color: var(--muted); }
.stats-toolbar {
  flex-wrap: wrap;
}
.range-toggle {
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}
.range-toggle button {
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid rgba(245,197,66,.18);
  border-radius: 999px;
  background: rgba(255,255,255,.035);
  color: var(--tt-muted, var(--muted));
  font-weight: 850;
  cursor: pointer;
}
.range-toggle button.active,
.range-toggle button:hover {
  color: #160f02;
  border-color: rgba(245,197,66,.68);
  background: linear-gradient(135deg, #F5C542, #F97316);
}
.heatmap-panel {
  display: grid;
  gap: 16px;
}
.heatmap-panel .panel-top {
  align-items: flex-start;
}
.heatmap-panel .panel-top small {
  display: block;
  margin-top: 4px;
  color: var(--tt-muted, var(--muted));
  font-size: .86rem;
}
.heatmap-legend {
  display: grid;
  grid-template-columns: auto minmax(42px, 1fr) auto minmax(42px, 1fr) auto;
  gap: 10px;
  align-items: center;
  color: var(--tt-muted, var(--muted));
  font-size: .82rem;
  font-weight: 800;
}
.heatmap-legend i {
  display: block;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(16,185,129,.24), rgba(245,197,66,.58), rgba(249,115,22,.9));
}
.heatmap { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 6px; }
.heat-cell {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  gap: 2px;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 10px;
  color: #fff8e8;
  background:
    radial-gradient(circle at 35% 24%, rgba(255,255,255,.1), transparent 34%),
    color-mix(in srgb, var(--tt-orange, #F97316) calc(var(--heat) * 82%), rgba(16,185,129,.13));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.02);
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.heat-cell strong {
  font-size: .82rem;
  line-height: 1;
  font-weight: 950;
}
.heat-cell span {
  color: rgba(255,255,255,.72);
  font-size: .68rem;
  font-weight: 850;
}
.heat-cell:hover,
.heat-cell.is-selected {
  transform: translateY(-2px);
  border-color: rgba(245,197,66,.72);
  box-shadow: 0 14px 34px rgba(249,115,22,.16), inset 0 0 0 1px rgba(245,197,66,.18);
}
.heat-thap { opacity: .78; }
.heat-vua { opacity: .9; }
.heat-cao { opacity: 1; }
.heatmap-insight,
.heatmap-detail {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.heatmap-detail {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.heatmap-insight article,
.heatmap-detail div {
  padding: 14px;
  border: 1px solid rgba(245,197,66,.15);
  border-radius: 16px;
  background: rgba(16,24,39,.52);
}
.heatmap-insight span,
.heatmap-detail span {
  display: block;
  color: var(--tt-muted, var(--muted));
  font-size: .78rem;
  font-weight: 850;
}
.heatmap-insight strong,
.heatmap-detail strong {
  display: block;
  margin-top: 5px;
  color: var(--tt-gold, var(--gold));
  font-size: 1.35rem;
  line-height: 1.1;
}
.heatmap-insight small {
  display: block;
  margin-top: 5px;
  color: var(--tt-muted, var(--muted));
  font-size: .78rem;
}

.machine-window { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 18px; }
.machine-window span { min-height: 76px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--line); background: #120f0a; color: var(--gold); font-size: clamp(1.7rem, 5vw, 3rem); font-weight: 950; }
.machine-window span.is-spinning { color: #ffeaa5; box-shadow: 0 0 18px rgba(212,175,55,.18); }
.spin-result-table,
.result-table-waiting {
  background:
    radial-gradient(circle at 76% 0, rgba(249,115,22,.12), transparent 24rem),
    linear-gradient(180deg, rgba(16,24,39,.9), rgba(10,14,24,.92));
}
.spin-result-table {
  margin: 2px 0 18px;
  border-color: rgba(245,197,66,.22);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 18px 46px rgba(0,0,0,.16);
}
.spin-result-table .result-row,
.result-table-waiting .result-row {
  grid-template-columns: 96px 1fr;
  min-height: 68px;
}
.spin-result-table .result-row strong,
.result-table-waiting .result-row strong {
  justify-content: flex-end;
}
.spin-result-table .result-row strong b,
.result-table-waiting .result-row strong b {
  min-width: 76px;
  min-height: 40px;
  border-color: rgba(147,51,234,.42);
  background: linear-gradient(180deg, rgba(30,18,61,.86), rgba(22,12,43,.92));
  color: #fff;
  font-size: 1.22rem;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.035);
}
.spin-result-table .special-number b,
.result-table-waiting .special-number b {
  min-width: min(100%, 258px);
  min-height: 72px;
  border-color: rgba(245,158,11,.62) !important;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(44,18,8,.96), rgba(36,15,58,.92)) !important;
  color: #F59E0B;
  font-size: clamp(2.2rem, 7vw, 4.1rem);
  box-shadow: 0 0 34px rgba(249,115,22,.22), inset 0 0 0 1px rgba(245,197,66,.12);
}
.waiting-number {
  color: #C9B8A7 !important;
  letter-spacing: .18em;
  background: rgba(255,255,255,.035) !important;
  border-color: rgba(201,184,167,.18) !important;
  box-shadow: none !important;
}
.spin-result-table b.is-spinning {
  color: #FDE68A;
  border-color: rgba(245,197,66,.58);
  box-shadow: 0 0 18px rgba(245,197,66,.2), inset 0 0 0 1px rgba(255,255,255,.05);
  transform: translateY(-1px);
}
.spin-progress {
  margin: -4px 0 14px;
  padding: 14px;
  border: 1px solid rgba(245,197,66,.22);
  border-radius: 16px;
  background:
    radial-gradient(circle at 12% 0, rgba(245,197,66,.13), transparent 16rem),
    rgba(255,255,255,.035);
}
.spin-progress[hidden] {
  display: none;
}
.spin-progress-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
  color: var(--muted);
  font-weight: 800;
}
.spin-progress-top strong {
  color: var(--gold);
  font-size: 1.05rem;
  letter-spacing: .04em;
}
.spin-progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
}
.spin-progress-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--tt-gold, var(--gold)), var(--tt-orange, #F97316), var(--tt-emerald, #10B981));
  box-shadow: 0 0 18px rgba(245,197,66,.24);
  transition: width .18s linear;
}
.btn:disabled { opacity: .72; cursor: wait; }
.spin-history { margin: 0; padding-left: 22px; color: var(--muted); }
.spin-history li { margin: 8px 0; line-height: 1.45; }
.wiki-card { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.wiki-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: rgba(0,0,0,.28);
  border-bottom: 1px solid rgba(212,175,55,.16);
}
.wiki-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 46%, rgba(0,0,0,.42));
  pointer-events: none;
}
.wiki-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform .28s ease, filter .28s ease;
}
.wiki-card:hover .wiki-thumb img { transform: scale(1.035); filter: saturate(1.08); }
.wiki-card h3, .archive-card h2 { margin: 0; font-size: 1.06rem; }
.wiki-card h3 { padding: 17px 18px 0; }
.wiki-card p { padding: 0 18px; }
.wiki-card > a:not(.wiki-thumb) { display: inline-flex; width: max-content; margin: auto 18px 18px; }
.wiki-card p, .archive-card p, .comment-list p { color: var(--muted); }
.wiki-card a, .archive-card a, .single-meta a, .contact-panel a { color: var(--gold); font-weight: 800; }
.wiki-card[hidden] { display: none; }
.load-more-row { margin-top: 22px; display: flex; justify-content: center; }
.load-more-row .btn { min-width: 180px; }

.knowledge-hero { padding: 54px 0 24px; border-bottom: 1px solid rgba(212,175,55,.12); background: radial-gradient(circle at 18% 0, rgba(139,30,30,.28), transparent 36%); }
.knowledge-hero-inner { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: end; }
.knowledge-hero h1 { margin: 14px 0 14px; max-width: 820px; font-size: clamp(2.25rem, 4.8vw, 4.4rem); line-height: 1; }
.knowledge-hero p { max-width: 760px; color: var(--muted); font-size: 1.04rem; }
.knowledge-note { display: grid; gap: 10px; padding: 22px; }
.knowledge-note strong { color: #fff3d4; font-size: 1.05rem; }
.knowledge-note span { color: var(--muted); }
.knowledge-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 24px; align-items: start; }
.knowledge-main { display: grid; gap: 22px; }
.compact-head { margin-bottom: 0; }
.compact-head h2 { font-size: clamp(1.7rem, 3vw, 2.65rem); }
.knowledge-topic-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.knowledge-topic {
  min-height: 150px;
  display: grid;
  align-content: space-between;
  gap: 16px;
  padding: 22px;
  border: 1px solid rgba(212,175,55,.2);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(255,255,255,.075), rgba(255,255,255,.025));
}
.knowledge-topic strong { color: #fff8df; font-size: 1.18rem; }
.knowledge-topic span { color: var(--muted); }
.knowledge-topic:hover { border-color: rgba(212,175,55,.5); transform: translateY(-2px); }
.knowledge-post-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.knowledge-card { min-height: 190px; }
.knowledge-empty { padding: 28px; }
.knowledge-empty h2 { margin: 12px 0 10px; font-size: clamp(1.55rem, 2.4vw, 2.25rem); }
.knowledge-empty p { color: var(--muted); max-width: 760px; }
.knowledge-sidebar { position: sticky; top: 104px; }
.knowledge-sidebar .panel { display: grid; gap: 13px; padding: 22px; }
.knowledge-sidebar strong { color: #fff3d4; font-size: 1.1rem; }
.knowledge-sidebar a { color: var(--gold); font-weight: 800; }

.page-hero { padding: 48px 0 16px; }
.page-content-wrap { padding: 22px 0 18px; }
.prose { color: #eadfca; }
.page-prose { max-width: 980px; padding: clamp(22px, 4vw, 38px); }
.prose > *:first-child { margin-top: 0; }
.prose > *:last-child { margin-bottom: 0; }
.prose h2 { margin: 30px 0 12px; color: #fff4d8; font-size: clamp(1.35rem, 2.4vw, 2rem); line-height: 1.12; }
.prose h3 { margin: 22px 0 8px; color: #f4d66d; font-size: 1.08rem; }
.prose p, .prose li { color: #d8c9aa; line-height: 1.78; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin: 7px 0; }
.prose a { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; font-weight: 800; }
.prose .lead { margin-bottom: 22px; color: #f2e7d0; font-size: 1.08rem; line-height: 1.75; }
.prose .info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 24px 0; }
.prose .info-card {
  padding: 18px;
  border: 1px solid rgba(212,175,55,.16);
  border-radius: 8px;
  background: rgba(255,255,255,.035);
}
.prose .info-card strong { display: block; margin-bottom: 8px; color: #fff3d4; }
.prose .notice-box {
  margin: 24px 0;
  padding: 18px;
  border: 1px solid rgba(139,30,30,.42);
  border-radius: 8px;
  background: rgba(139,30,30,.18);
  color: #ffe7c2;
}
.ttmb-wiki-featured-media {
  margin: 24px 0 28px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid rgba(212,175,55,.2);
  border-radius: 8px;
  background: rgba(0,0,0,.28);
  box-shadow: 0 24px 70px rgba(0,0,0,.28);
}
.ttmb-wiki-featured-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.prose .link-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 0; list-style: none; }
.prose .link-list li { margin: 0; }
.prose .link-list a { display: block; padding: 12px 14px; border: 1px solid rgba(212,175,55,.16); border-radius: 8px; background: rgba(255,255,255,.03); text-decoration: none; }
.single-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; padding-top: 42px; }
.single-head { grid-column: 1 / -1; }
.single-head h1 { margin: 12px 0 6px; font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1.04; }
.single-meta { display: grid; align-content: start; gap: 10px; position: sticky; top: 112px; align-self: start; }
.single-meta strong { display: block; margin-bottom: 8px; font-size: 1.05rem; }
.related-list { display: grid; gap: 0; }
.related-list a { display: block; padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,.08); line-height: 1.35; }
.related-list a:last-child { border-bottom: 0; }
.pagination { grid-column: 1 / -1; }

.site-footer { margin-top: 44px; padding: 34px 0 86px; border-top: 1px solid rgba(212,175,55,.14); background: #070707; }
.footer-shell {
  border: 1px solid rgba(212,175,55,.14);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.018));
  overflow: hidden;
}
.footer-top {
  display: grid;
  grid-template-columns: minmax(260px, .85fr) minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  padding: 24px 26px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.footer-top p { margin: 0; color: var(--muted); font-size: .95rem; line-height: 1.65; }
.footer-main {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 18px 26px 22px;
  color: var(--muted);
}
.footer-brand { display: inline-flex; align-items: center; gap: 12px; color: var(--text); font-size: 1.05rem; font-weight: 950; }
.footer-brand strong { display: block; color: #fff3d4; }
.footer-brand small { display: block; margin-top: 2px; color: var(--muted); font-size: .78rem; line-height: 1.35; font-weight: 700; }
.site-footer h3 { margin: 0 0 10px; color: #fff3d4; font-size: .82rem; letter-spacing: .05em; text-transform: uppercase; }
.footer-warning { color: #f4cf8f; }
.site-footer a,
.footer-column span { color: #c7b98f; font-size: .9rem; }
.site-footer a:hover { color: var(--gold); }
.footer-column { display: grid; align-content: start; gap: 7px; padding-right: 14px; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 26px;
  border-top: 1px solid rgba(255,255,255,.08);
  color: var(--muted);
  font-size: .84rem;
  background: rgba(0,0,0,.24);
}
.footer-bottom span:last-child { color: #f4cf8f; text-align: right; }
.bottom-nav { display: none; }

@media (max-width: 920px) {
  .header-cta { display: none; }
  .menu-toggle { display: block; }
  .primary-nav {
    position: fixed; inset: 72px 16px auto 16px; display: none; padding: 12px;
    border: 1px solid var(--line); border-radius: 8px; background: rgba(8,8,8,.97);
  }
  .primary-nav.is-open { display: block; }
  .primary-nav ul { display: grid; gap: 4px; }
  .hero-grid, .dashboard-grid, .spinner-layout, .community-grid, .single-layout, .footer-main, .footer-top, .knowledge-hero-inner, .knowledge-layout, .province-result-layout { grid-template-columns: 1fr; }
  .province-update-card { position: static; }
  .hero-dashboard { padding-top: 0; }
  .weekday-nav { grid-template-columns: 1fr; gap: 14px; }
  .weekday-nav div { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .result-day-summary { grid-template-columns: 1fr; }
  .knowledge-sidebar { position: static; }
  .ai-grid, .stat-grid, .wiki-grid, .archive-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .brand small { display: none; }
}

@media (max-width: 620px) {
  .container { width: min(100% - 24px, 1120px); }
  .hero { padding-top: 44px; }
  .hero-actions .btn { width: 100%; }
  .hero-summary { grid-template-columns: 1fr; }
  .hero-summary div { border-right: 0; border-bottom: 1px solid rgba(255,255,255,.08); }
  .hero-summary div:last-child { border-bottom: 0; }
  .hero-metrics { grid-template-columns: 1fr; }
  .hero-metrics div { min-height: auto; }
  .mini-panels, .ai-grid, .stat-grid, .wiki-grid, .archive-grid, .knowledge-topic-grid, .knowledge-post-grid, .prose .info-grid, .prose .link-list { grid-template-columns: 1fr; }
  .range-toggle {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }
  .heatmap { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .heatmap-legend { grid-template-columns: 1fr; gap: 6px; }
  .heatmap-legend i { height: 8px; }
  .heatmap-insight,
  .heatmap-detail { grid-template-columns: 1fr; }
  .result-row { grid-template-columns: 86px 1fr; padding: 11px 10px; }
  .result-row strong { font-size: .96rem; }
  .heatmap { gap: 4px; }
  .heat-cell strong { font-size: .72rem; }
  .heat-cell span { font-size: .6rem; }
  .machine-window { gap: 5px; }
  .machine-window span { min-height: 58px; }
  .spin-result-table .result-row,
  .result-table-waiting .result-row {
    grid-template-columns: 64px 1fr;
    gap: 8px;
  }
  .spin-result-table .result-row strong,
  .result-table-waiting .result-row strong {
    gap: 6px;
  }
  .spin-result-table .result-row strong b,
  .result-table-waiting .result-row strong b {
    min-width: 48px;
    min-height: 34px;
    padding: 4px 6px;
    font-size: .96rem;
  }
  .spin-result-table .special-number b,
  .result-table-waiting .special-number b {
    min-height: 58px;
    font-size: clamp(2rem, 12vw, 3rem);
  }
  .province-strip { grid-template-columns: 1fr; }
  .week-schedule { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .weekday-nav { padding: 18px; }
  .weekday-nav div { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .weekday-nav a { min-height: 44px; padding-inline: 8px; }
  .result-day-summary { padding: 14px; }
  .data-terminal div { grid-template-columns: 1fr; gap: 4px; }
  .footer-bottom { flex-direction: column; }
  .footer-bottom span:last-child { text-align: left; }
  .bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: grid; grid-template-columns: repeat(5, 1fr);
    border-top: 1px solid var(--line); background: rgba(8,8,8,.95); backdrop-filter: blur(16px);
  }
  .bottom-nav a { min-height: 58px; display: grid; place-items: center; padding: 6px 4px; color: var(--muted); font-size: .76rem; font-weight: 800; text-align: center; }
  .bottom-nav a:hover { color: var(--gold); }
}
/* Thần Tài Miền Nam brand layer */
:root {
  --tt-bg: #070B12;
  --tt-surface: #101827;
  --tt-gold: #F5C542;
  --tt-orange: #F97316;
  --tt-red: #8B1E1E;
  --tt-emerald: #10B981;
  --tt-text: #F8FAFC;
  --tt-muted: #94A3B8;
  --tt-line: rgba(248, 250, 252, 0.12);
  --tt-glass: rgba(16, 24, 39, 0.72);
}

body.ttmn-site,
body.ttmb-site {
  background:
    radial-gradient(circle at 18% 8%, rgba(249, 115, 22, 0.2), transparent 34rem),
    radial-gradient(circle at 84% 18%, rgba(16, 185, 129, 0.14), transparent 30rem),
    linear-gradient(180deg, #070B12 0%, #0B1020 48%, #160D14 100%);
  color: var(--tt-text);
}

.site-header {
  background: rgba(7, 11, 18, 0.82);
  border-bottom: 1px solid var(--tt-line);
  backdrop-filter: blur(18px);
}

.brand,
.footer-brand {
  color: var(--tt-text);
}

.brand span small {
  display: block;
  color: var(--tt-muted);
  font-size: 0.76rem;
  font-weight: 600;
}

.primary-nav a,
.footer-column a,
.bottom-nav a {
  color: var(--tt-muted);
}

.primary-nav a:hover,
.footer-column a:hover,
.bottom-nav a:hover {
  color: var(--tt-gold);
}

.header-cta,
.btn-primary {
  background: linear-gradient(135deg, var(--tt-gold), var(--tt-orange));
  color: #190E05;
  box-shadow: 0 16px 42px rgba(249, 115, 22, 0.22);
}

.btn-secondary {
  background: rgba(16, 185, 129, 0.14);
  color: var(--tt-emerald);
  border: 1px solid rgba(16, 185, 129, 0.32);
}

.btn-ghost {
  color: var(--tt-text);
  border: 1px solid var(--tt-line);
  background: rgba(248, 250, 252, 0.05);
}

.panel,
.archive-card,
.wiki-card,
.stat-card,
.ai-card {
  background: linear-gradient(180deg, rgba(16, 24, 39, 0.86), rgba(16, 24, 39, 0.62));
  border: 1px solid var(--tt-line);
  border-radius: 22px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(16px);
}

.badge {
  background: rgba(245, 197, 66, 0.12);
  color: var(--tt-gold);
  border: 1px solid rgba(245, 197, 66, 0.28);
}

.badge-live {
  background: rgba(249, 115, 22, 0.14);
  color: var(--tt-orange);
  border-color: rgba(249, 115, 22, 0.32);
}

.hero-south {
  padding: clamp(72px, 9vw, 130px) 0 44px;
  position: relative;
  overflow: hidden;
}

.hero-south::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(115deg, rgba(245, 197, 66, 0.09), transparent 42%),
    radial-gradient(circle at 72% 34%, rgba(139, 30, 30, 0.28), transparent 24rem);
  pointer-events: none;
}

.hero-grid-south {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.78fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
}

.hero-title {
  max-width: 780px;
  color: var(--tt-text);
}

.hero-copy p,
.section-head p,
.panel small,
.stat-card small,
.wiki-card p,
.archive-card p {
  color: var(--tt-muted);
}

.hero-metrics div {
  background: rgba(248, 250, 252, 0.06);
  border: 1px solid var(--tt-line);
  border-radius: 18px;
}

.south-schedule-panel h2 {
  margin-top: 10px;
}

.today-province-list,
.schedule-card div,
.province-grid,
.result-tabs,
.schedule-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.today-province-list a,
.schedule-card a,
.province-card,
.result-tabs button,
.schedule-filter button {
  border: 1px solid var(--tt-line);
  background: rgba(248, 250, 252, 0.06);
  color: var(--tt-text);
  border-radius: 999px;
  padding: 10px 14px;
  text-decoration: none;
}

.schedule-filter button.active,
.result-tabs button.active,
.schedule-card.active {
  border-color: rgba(245, 197, 66, 0.58);
  background: linear-gradient(135deg, rgba(245, 197, 66, 0.16), rgba(249, 115, 22, 0.12));
}

.countdown-wrap {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--tt-line);
}

.countdown-wrap span {
  color: var(--tt-muted);
  display: block;
  margin-bottom: 6px;
}

.countdown {
  color: var(--tt-gold);
}

.schedule-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(150px, 1fr));
  gap: 14px;
}

.schedule-card {
  padding: 18px;
}

.schedule-card > span,
.schedule-card-head > span {
  color: var(--tt-orange);
  font-weight: 800;
}

.result-panels .province-result {
  display: none;
}

.result-panels .province-result.active {
  display: block;
}

.status-pill {
  background: rgba(16, 185, 129, 0.12);
  color: var(--tt-emerald);
  border: 1px solid rgba(16, 185, 129, 0.28);
}

.status-cho-quay {
  background: rgba(148, 163, 184, 0.12);
  color: var(--tt-muted);
}

.status-dang-quay {
  background: rgba(249, 115, 22, 0.14);
  color: var(--tt-orange);
}

.result-row {
  border-color: var(--tt-line);
}

.special-number b,
.ai-number,
.stat-card strong {
  color: var(--tt-gold);
}

.province-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 14px 16px;
}

.province-control label,
.spin-province-label {
  color: var(--tt-muted);
  font-weight: 700;
}

.province-control select,
.spinner-machine select {
  width: min(100%, 320px);
  color: var(--tt-text);
  background: #0B1220;
  border: 1px solid var(--tt-line);
  border-radius: 14px;
  padding: 11px 14px;
}

.spinner-machine {
  display: grid;
  gap: 18px;
}

.spin-history li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--tt-line);
}

.spin-history span {
  color: var(--tt-muted);
}

.province-section {
  background: linear-gradient(180deg, transparent, rgba(16, 24, 39, 0.32));
}

.province-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
}

.province-card {
  display: grid;
  gap: 4px;
  border-radius: 20px;
  padding: 18px;
}

.province-card span {
  font-weight: 800;
}

.province-card small {
  color: var(--tt-muted);
}

.site-footer {
  background: #070B12;
  border-top: 1px solid var(--tt-line);
}

.inline-warning {
  background: rgba(139, 30, 30, 0.14);
  border: 1px solid rgba(249, 115, 22, 0.24);
  color: #FDE68A;
}

@media (max-width: 1100px) {
  .hero-grid-south,
  .schedule-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .province-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .hero-grid-south,
  .schedule-grid,
  .province-grid {
    grid-template-columns: 1fr;
  }

  .province-control {
    align-items: stretch;
    flex-direction: column;
  }

  .province-control select,
  .spinner-machine select {
    width: 100%;
  }

  .result-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 6px;
  }

  .result-tabs button {
    white-space: nowrap;
  }
}

/* Southern redesign pass: fuller, warmer, and visually distinct. */
body.ttmn-site,
body.ttmb-site {
  background:
    linear-gradient(115deg, rgba(7, 11, 18, 0.92) 0%, rgba(12, 20, 34, 0.82) 42%, rgba(45, 18, 21, 0.78) 100%),
    radial-gradient(circle at 12% 10%, rgba(249, 115, 22, 0.26), transparent 32rem),
    radial-gradient(circle at 76% 18%, rgba(16, 185, 129, 0.2), transparent 28rem),
    #070B12;
}

.hero-south {
  min-height: calc(100vh - 72px);
  padding: clamp(28px, 4vw, 54px) 0 34px;
  display: grid;
  align-items: start;
  isolation: isolate;
}

.hero-south::before {
  background:
    linear-gradient(90deg, rgba(245, 197, 66, 0.06) 1px, transparent 1px),
    linear-gradient(0deg, rgba(16, 185, 129, 0.045) 1px, transparent 1px),
    radial-gradient(circle at 18% 30%, rgba(249, 115, 22, 0.18), transparent 26rem),
    radial-gradient(circle at 68% 55%, rgba(245, 197, 66, 0.08), transparent 28rem);
  background-size: 72px 72px, 72px 72px, auto, auto;
  mask-image: linear-gradient(180deg, transparent 0%, #000 10%, #000 88%, transparent 100%);
}

.southern-sky {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.southern-sky::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 4%;
  height: 180px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, transparent, rgba(245, 197, 66, 0.18), rgba(249, 115, 22, 0.12), transparent);
  filter: blur(18px);
  opacity: 0.8;
}

.southern-sky span {
  position: absolute;
  width: 34vw;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(245, 197, 66, 0.55), transparent);
  transform: rotate(-11deg);
  opacity: 0.48;
}

.southern-sky span:nth-child(1) { top: 13%; left: 4%; }
.southern-sky span:nth-child(2) { top: 22%; left: 45%; width: 28vw; opacity: 0.34; }
.southern-sky span:nth-child(3) { top: 74%; left: 6%; width: 42vw; opacity: 0.22; }
.southern-sky span:nth-child(4) { top: 64%; right: 2%; width: 30vw; opacity: 0.28; }

.hero-grid-south {
  grid-template-columns: minmax(0, 0.98fr) minmax(340px, 0.78fr);
  gap: clamp(18px, 3.5vw, 52px);
  align-items: start;
}

.hero-copy {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: clamp(8px, 2vw, 18px) 0;
}

.hero-copy::before {
  content: "";
  position: absolute;
  inset: -34px auto -34px -44px;
  width: min(52vw, 620px);
  border-radius: 34px;
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.16), rgba(245, 197, 66, 0.05) 42%, transparent);
  z-index: -1;
}

.southern-ticker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  max-width: 760px;
  max-height: 68px;
  overflow: hidden;
  margin-bottom: 12px;
}

.southern-ticker a {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(245, 197, 66, 0.18);
  background: rgba(16, 24, 39, 0.48);
  color: #FDE68A;
  font-size: 0.82rem;
  font-weight: 800;
}

.hero-south .hero-title {
  margin: 10px 0 10px;
  max-width: 800px;
  font-size: clamp(3.45rem, 6.35vw, 5.95rem);
  line-height: 0.9;
  color: #FFF7ED;
  text-shadow:
    0 2px 0 rgba(245, 197, 66, 0.18),
    0 24px 70px rgba(249, 115, 22, 0.28);
}

.hero-south .hero-copy p {
  max-width: 680px;
  color: #CBD5E1;
  font-size: 1rem;
  margin-bottom: 0;
}

.lucky-number-strip {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.lucky-number-strip span {
  display: inline-grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  border: 1px solid rgba(245, 197, 66, 0.36);
  background:
    radial-gradient(circle at 35% 25%, rgba(245, 197, 66, 0.26), transparent 38%),
    linear-gradient(150deg, rgba(16, 24, 39, 0.96), rgba(45, 18, 21, 0.82));
  color: var(--tt-gold);
  font-size: 1.28rem;
  font-weight: 950;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
}

.hero-south .hero-actions {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr;
  max-width: 720px;
  gap: 10px;
  margin-top: 14px;
}

.hero-south .btn {
  min-height: 46px;
  border-radius: 14px;
  padding-inline: 14px;
  justify-content: center;
  text-align: center;
  line-height: 1.15;
  white-space: nowrap;
}

.hero-south .hero-metrics {
  max-width: 680px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.hero-south .hero-metrics div {
  min-height: 68px;
  border-radius: 18px;
  padding: 12px 14px;
  background:
    linear-gradient(135deg, rgba(245, 197, 66, 0.13), rgba(16, 24, 39, 0.66)),
    rgba(16, 24, 39, 0.58);
}

.south-schedule-panel {
  height: 100%;
  min-height: 100%;
  align-self: start;
  margin-top: -34px;
  padding: clamp(20px, 2.5vw, 28px);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(16, 24, 39, 0.94), rgba(9, 15, 28, 0.86)),
    radial-gradient(circle at 88% 16%, rgba(16, 185, 129, 0.2), transparent 15rem);
  overflow: hidden;
}

.south-schedule-panel:hover {
  transform: translateY(-2px);
}

.south-schedule-panel::before {
  content: "";
  position: absolute;
  inset: auto -18% -26% 12%;
  height: 230px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(249, 115, 22, 0.2), transparent 68%);
}

.south-schedule-panel h2 {
  max-width: 420px;
  margin-top: 18px;
  font-size: clamp(1.45rem, 2.25vw, 2rem);
  line-height: 1.08;
}

.south-schedule-panel > p {
  margin: 14px 0 12px;
}

.today-province-list a {
  border-radius: 16px;
  padding: 10px 14px;
  background: rgba(248, 250, 252, 0.08);
}

.countdown-wrap {
  margin-top: 16px;
}

.countdown {
  display: block;
  margin-top: 8px;
  font-size: clamp(2.8rem, 5vw, 4.15rem);
  line-height: 0.95;
}

.draw-info-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.draw-info-grid div {
  min-height: 58px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 10px;
  border-radius: 16px;
  background: rgba(248, 250, 252, 0.055);
  border: 1px solid var(--tt-line);
}

.draw-info-grid span {
  color: var(--tt-muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.draw-info-grid strong {
  color: #F8FAFC;
  font-size: clamp(.92rem, 1.2vw, 1.05rem);
  line-height: 1.05;
}

.schedule-section {
  margin-top: -12px;
}

.section-head {
  display: grid;
  gap: 6px;
}

.schedule-grid {
  grid-template-columns: repeat(7, minmax(140px, 1fr));
}

.schedule-card,
.stat-card,
.ai-card,
.wiki-card,
.province-card {
  border-radius: 20px;
}

@media (max-width: 1100px) {
  .hero-south {
    min-height: auto;
  }

  .hero-grid-south {
    grid-template-columns: 1fr;
  }

  .south-schedule-panel {
    min-height: auto;
    margin-top: 0;
  }
}

@media (max-width: 720px) {
  .hero-south {
    padding-top: 20px;
  }

  .hero-south .hero-title {
    font-size: clamp(3.25rem, 17vw, 5.1rem);
  }

  .hero-south .hero-actions {
    grid-template-columns: 1fr;
  }

  .hero-south .btn {
    white-space: normal;
  }

  .lucky-number-strip span {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    font-size: 1.35rem;
  }

  .draw-info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.schedule-layout {
  display: grid;
  grid-template-columns: minmax(220px, 270px) minmax(0, 1fr);
  gap: clamp(18px, 3vw, 34px);
  align-items: stretch;
  margin-top: 14px;
}

.schedule-layout .schedule-grid {
  grid-template-columns: 1fr;
  gap: 12px;
}

.schedule-layout .schedule-card {
  min-height: auto;
  padding: 14px;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.schedule-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.schedule-layout .schedule-card h3 {
  margin: 0;
  font-size: 1.02rem;
}

.schedule-layout .schedule-card > div:not(.schedule-card-head) {
  gap: 6px;
}

.schedule-layout .schedule-card a {
  padding: 7px 9px;
  font-size: 0.82rem;
}

.schedule-layout .schedule-card:hover {
  transform: translateY(-2px);
  border-color: rgba(249, 115, 22, 0.5);
}

.schedule-detail-panels {
  min-width: 0;
  position: relative;
}

.schedule-detail {
  display: none;
  position: relative;
  min-height: 100%;
  padding: clamp(22px, 3vw, 34px);
  border-radius: 28px;
  background:
    radial-gradient(circle at 12% 18%, rgba(249, 115, 22, 0.22), transparent 18rem),
    radial-gradient(circle at 88% 16%, rgba(16, 185, 129, 0.16), transparent 16rem),
    linear-gradient(145deg, rgba(16, 24, 39, 0.96), rgba(8, 13, 24, 0.92));
  overflow: hidden;
}

.schedule-detail.active {
  display: grid;
  align-content: start;
  gap: 18px;
}

.schedule-detail::after {
  content: "";
  position: absolute;
  inset: 20px;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(248, 250, 252, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(248, 250, 252, 0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(135deg, black, transparent 78%);
}

.schedule-detail > * {
  position: relative;
  z-index: 1;
}

.schedule-detail-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.schedule-detail-top strong {
  color: var(--tt-gold);
  font-size: 0.95rem;
}

.schedule-detail h3 {
  max-width: 680px;
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 3rem);
  line-height: 1.04;
  color: #FFF7ED;
}

.schedule-detail p {
  max-width: 760px;
  margin: 0;
  color: var(--tt-muted);
}

.schedule-week-map {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.schedule-week-map button,
.schedule-province-showcase a {
  border: 1px solid rgba(245, 197, 66, 0.16);
  border-radius: 20px;
  background: rgba(248, 250, 252, 0.065);
  color: var(--tt-text);
  text-align: left;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.schedule-week-map button {
  display: grid;
  gap: 8px;
  min-height: 92px;
  padding: 15px;
  cursor: pointer;
}

.schedule-week-map button:hover,
.schedule-province-showcase a:hover {
  transform: translateY(-2px);
  border-color: rgba(245, 197, 66, 0.48);
  background: rgba(245, 197, 66, 0.1);
}

.schedule-week-map span {
  color: var(--tt-orange);
  font-weight: 900;
}

.schedule-week-map strong {
  color: #F8FAFC;
  font-size: 0.92rem;
  line-height: 1.45;
}

.schedule-province-showcase {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.schedule-province-showcase a {
  display: grid;
  min-height: 132px;
  padding: 18px;
  text-decoration: none;
}

.schedule-province-showcase span {
  color: #FFF7ED;
  font-size: 1.15rem;
  font-weight: 900;
}

.schedule-province-showcase small {
  color: var(--tt-muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.schedule-province-showcase i {
  justify-self: start;
  align-self: end;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.12);
  color: var(--tt-emerald);
  font-style: normal;
  font-weight: 900;
}

.schedule-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

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

  .schedule-layout .schedule-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .schedule-province-showcase {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .schedule-layout .schedule-grid,
  .schedule-week-map,
  .schedule-province-showcase {
    grid-template-columns: 1fr;
  }

  .schedule-detail-actions .btn {
    width: 100%;
    justify-content: center;
  }
}
