:root {
  --brand: #bb2e28;
  --sub-brand: #365294;
  --content: #212529;
  --secondary: #747474;
  --border: #d6d6d6;
  --button: #73a81f;
  --highlight: #ff3110;
  --link: #1e68b3;
  --line: #e9e9e9;
  --lotto-bg: #f2f2f2;
  --gradient: linear-gradient(109deg, var(--brand), var(--sub-brand));
  --page-gradient: linear-gradient(to bottom, #f5f7fd, #dce2fa);
  --shadow: 0 2px 4px rgba(0, 0, 0, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--content);
  background: var(--page-gradient) fixed;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}
a { color: var(--link); text-decoration: underline; }
a:hover { color: #0b4c8d; }
img { max-width: 100%; height: auto; }
.xsmb-icon { width: 16px; height: 16px; flex: 0 0 16px; display: inline-block; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.15em; }
.xsmb-icon__fill { fill: currentColor; stroke: none; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 12px; top: 12px; z-index: 2000; background: #fff; padding: 8px; }

.site-header { position: relative; z-index: 20; background: #fff; border-bottom: 1px solid #dee2e6; }
.site-header__inner {
  width: min(1116px, calc(100% - 24px));
  height: 77px;
  margin: auto;
  display: grid;
  grid-template-columns: 178px 1px 1fr auto;
  align-items: center;
  gap: 24px;
}
.brand { display: flex; align-items: center; text-decoration: none; }
.brand img { width: 160px; max-height: 52px; object-fit: contain; object-position: left center; }
.brand-divider { width: 1px; height: 42px; background: #e2e2e2; }
.header-copy { min-width: 0; display: grid; gap: 3px; font-size: 14px; }
.header-copy .header-title { margin: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 14px; line-height: 1.5; font-weight: 500; }
.header-copy span { color: #343a40; }
.nav-toggle { display: none; border: 0; background: transparent; color: #555; padding: 8px; }
.nav-toggle .xsmb-icon { width: 24px; height: 24px; }
.site-nav { height: 40px; background: #fff; border-top: 1px solid #dee2e6; }
.site-nav__inner { width: min(1116px, calc(100% - 24px)); height: 100%; margin: auto; display: flex; align-items: stretch; }
.site-nav a { color: #202020; text-decoration: none; font-weight: 500; white-space: nowrap; }
.site-nav__inner > .nav-link,
.nav-item > .nav-link { min-height: 40px; display: flex; align-items: center; padding: 0 10px; }
.site-nav__inner > .nav-link:first-child { padding-left: 10px; }
.site-nav a:hover { color: var(--brand); }
.site-nav__inner > .nav-link:hover,
.nav-item:hover > .nav-link,
.nav-item:focus-within > .nav-link { background: #f3f3f3; }
.nav-item { position: relative; display: flex; align-items: stretch; }
.nav-dropdown-toggle { min-width: 18px; margin-left: -9px; padding: 0 5px 0 0; border: 0; background: transparent; color: #202020; cursor: pointer; }
.site-nav .nav-caret { width: 11px; height: 11px; flex-basis: 11px; margin-left: 5px; stroke-width: 2; }
.nav-dropdown { position: absolute; top: 100%; left: 0; z-index: 50; min-width: 205px; display: none; padding: 5px 0; border: 1px solid var(--border); border-radius: 0 0 6px 6px; background: #fff; box-shadow: 0 5px 12px rgba(0, 0, 0, .16); }
.nav-dropdown a { min-height: 39px; display: flex; align-items: center; padding: 7px 14px; border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 400; }
.nav-dropdown a:last-child { border-bottom: 0; }
.nav-dropdown a:hover { background: #f5f5f5; }
.nav-item:hover > .nav-dropdown,
.nav-item:focus-within > .nav-dropdown,
.nav-item.is-open > .nav-dropdown { display: block; }
.nav-item.is-open .nav-dropdown-toggle .xsmb-icon { transform: rotate(180deg); }
.site-notice { position: relative; z-index: 2; width: min(1116px, calc(100% - 24px)); margin: 15px auto 0; }
.site-notice > div { padding: 10px 20px; border-radius: 10px; background: #fff2ca; box-shadow: var(--shadow); }

.site-main { position: relative; z-index: 1; width: min(1140px, calc(100% - 16px)); margin: 15px auto 42px; }
.content-layout { display: grid; grid-template-columns: 1fr 2fr 1fr; align-items: start; }
.content-layout > * { min-width: 0; margin: 0 8px; }
.content-layout--wide { grid-template-columns: minmax(0, 3fr) minmax(250px, 1fr); }
.primary-content { min-width: 0; }

.schedule-card,
.xsmb-card,
.result-card,
.side-card,
.post-card,
.feature-card,
.xsmb-editor-content,
.page-heading {
  background: #fff;
  border-radius: 10px;
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 15px;
}
.schedule-card { min-height: 44px; display: flex; align-items: center; gap: 9px; padding: 10px 20px; font-weight: 500; }
.schedule-card .xsmb-icon { width: 17px; height: 17px; flex-basis: 17px; }
.site-sidebar--left .schedule-card { margin-bottom: 0; }
.side-card h2,
.xsmb-card__title,
.region-title,
.page-heading {
  margin: 0;
  padding: 8px 16px;
  color: #fff;
  background: var(--gradient);
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
}
.side-card h2 { display: flex; align-items: center; gap: 7px; }
.side-card h2 .xsmb-icon { width: 16px; height: 16px; flex-basis: 16px; }
.side-card nav { display: grid; }
.side-card nav a { min-height: 39px; padding: 8px 16px; border-top: 1px solid var(--line); color: #666; text-decoration: none; background: #fff; }
.side-card nav a:hover { color: var(--brand); background: #f7f7f7; }
.side-news nav a { font-size: 14px; }
.page-heading h1 { margin: 0; font-size: 16px; line-height: 24px; font-weight: 600; }
.page-heading p { margin: 8px 0 0; font-weight: 400; font-size: 14px; color: #fff; }
.region-group { margin-bottom: 15px; }
.region-title { border-radius: 10px 10px 0 0; }

.result-card { border: 3px solid var(--brand); border-bottom-width: 1px; background: #fff; }
.result-card__head { padding: 10px 8px 8px; text-align: center; background: #fff; border-bottom: 1px solid var(--border); }
.result-card__head h2 { margin: 0 0 3px; font-size: 20px; line-height: 1.35; }
.result-card__head h2 a { color: var(--brand); text-decoration: none; font-weight: 700; }
.result-card__head span { color: #444; font-size: 15px; }
.result-card__head span a { color: var(--link); }
.result-special-code { padding: 6px 10px; border-bottom: 1px solid var(--border); text-align: center; font-weight: 500; }
.result-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.result-table tr:nth-child(even) { background: var(--lotto-bg); }
.result-table th,
.result-table td { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); text-align: center; }
.result-table th { width: 59px; padding: 7px 4px; font-size: 15px; font-weight: 600; }
.result-table td { display: grid; align-items: stretch; min-height: 39px; padding: 0; }
.result-table td span { min-width: 0; display: grid; place-items: center; padding: 4px 2px; border-right: 1px solid var(--border); font-size: 23px; line-height: 1.25; font-weight: 700; letter-spacing: .2px; }
.result-table td span:last-child { border-right: 0; }
.result-table .prize-db th { color: var(--highlight); }
.result-table .prize-db td span { color: var(--highlight); font-size: 27px; }
.result-table .prize-g1 td span { font-size: 24px; }
.result-table .prize-g2 td { grid-template-columns: repeat(2, 1fr); }
.result-table .prize-g3 td,
.result-table .prize-g5 td,
.result-table .prize-g6 td { grid-template-columns: repeat(3, 1fr); }
.result-table .prize-g4 td,
.result-table .prize-g7 td { grid-template-columns: repeat(4, 1fr); }
.result-table .prize-g8 td { grid-template-columns: 1fr; }
.result-table .is-waiting { color: var(--sub-brand) !important; }
.multi-result-table,
.multi-loto-table { width: 100%; min-width: 510px; border-collapse: collapse; table-layout: fixed; background: #fff; }
.multi-result-table th,
.multi-result-table td,
.multi-loto-table th,
.multi-loto-table td { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); text-align: center; }
.multi-result-table thead th,
.multi-loto-table thead th { padding: 7px 4px; background: #fff; color: #333; font-weight: 600; }
.multi-result-table thead th:first-child,
.multi-loto-table thead th:first-child,
.multi-result-table tbody th,
.multi-loto-table tbody th { width: 58px; }
.multi-result-table thead a { color: var(--link); text-decoration: none; }
.multi-result-table tbody tr:nth-child(even),
.multi-loto-table tbody tr:nth-child(odd) { background: var(--lotto-bg); }
.multi-result-table tbody th,
.multi-loto-table tbody th { padding: 6px 3px; font-weight: 600; }
.multi-result-table td { padding: 0; vertical-align: middle; }
.multi-result-table td span { display: block; padding: 3px 2px; font-size: 21px; line-height: 1.25; font-weight: 700; }
.multi-result-table .prize-db th,
.multi-result-table .prize-db td span { color: var(--highlight); }
.multi-result-table .prize-db td span { font-size: 23px; }
.multi-loto-table td { padding: 6px 8px; line-height: 1.45; }
.result-filter { margin: 0 -3px -1px; padding: 8px 10px; border: 1px solid #f5c17b; border-top: 0; background: #fff7eb; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.result-filter__modes { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; font-weight: 600; }
.result-filter input { accent-color: var(--brand); }
.result-filter__digits { display: flex; flex-wrap: wrap; gap: 3px; }
.result-filter__digits button { width: 24px; height: 24px; padding: 0; border: 1px solid #fff; border-radius: 50%; background: #f89d3c; color: #fff; font-size: 12px; font-weight: 700; }
.result-filter__digits button:hover,
.result-filter__digits button.active { background: #ff5722; }
.result-filter .number-match { color: #fff !important; background: radial-gradient(circle at 1px 1px, #41e241, #000); border-radius: 50%; }

.loto-card { background: #fff; }
.loto-card .xsmb-card__title { color: #333; background: #fff; font-weight: 400; text-align: left; font-size: 15px; }
.loto-card .xsmb-card__title a { color: var(--link); }
.loto-grid__head,
.loto-cell { display: grid; grid-template-columns: 42px minmax(0, 1fr) 42px minmax(0, 1fr); }
.loto-grid__head { text-align: center; font-weight: 600; }
.loto-grid__head > *,
.loto-cell > * { min-height: 36px; display: flex; align-items: center; border-right: 1px solid var(--border); border-top: 1px solid var(--border); padding: 5px 8px; }
.loto-grid__head > * { justify-content: center; }
.loto-cell:nth-child(odd) { background: var(--lotto-bg); }
.loto-cell b { justify-content: center; }
.loto-cell span span { display: inline; min-height: 0; border: 0; padding: 0; }
.loto-cell .is-special { color: var(--highlight); }

.filter-nav,
.quick-links { display: flex; gap: 0; overflow-x: auto; margin: 0 0 15px; padding: 0; border-radius: 8px; background: #f2f2f2; box-shadow: var(--shadow); }
.filter-nav a,
.quick-links a { flex: 0 0 auto; padding: 8px 11px; color: #333; text-decoration: none; border-right: 1px solid var(--border); font-size: 14px; }
.filter-nav a:hover,
.filter-nav a.active,
.quick-links a:hover { color: #fff; background: var(--brand); }

.live-box { padding-bottom: 12px; }
.live-box > p,
.live-box > .live-results,
.live-box > .button-link { margin-left: 14px; margin-right: 14px; }
.live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--highlight); animation: pulse 1.4s infinite; }
.live-row { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--line); }
.live-box.is-active-live { margin-bottom: 0; padding: 3px; border: 0; overflow: hidden; background: var(--brand); }
.live-box.is-active-live > .xsmb-card__title,
.live-box.is-active-live > .live-status,
.live-box.is-active-live > .button-link { display: none; }
.live-box.is-active-live > .live-results { margin: 0; overflow: hidden; border-radius: 8px; background: #fff; }
.live-box.is-countdown { padding: 0; overflow: visible; background: transparent; box-shadow: none; }
.live-box.is-countdown > .xsmb-card__title,
.live-box.is-countdown > .live-results,
.live-box.is-countdown > .button-link { display: none; }
.live-box.is-countdown > .live-status { margin: 0 0 15px; padding: 7px 10px; text-align: center; }
.live-result-heading { padding: 6px 12px 7px; border-bottom: 1px solid var(--border); text-align: center; }
.live-result-heading h2 { margin: 0; font-size: 20px; line-height: 30px; font-weight: 700; }
.live-result-heading h2 a { color: var(--brand); text-decoration: none; }
.live-result-heading h3 { margin: 0; font-size: 16px; line-height: 24px; font-weight: 400; }
.live-result-heading h3 a { color: var(--link); }
.live-result-table { width: 100%; border-collapse: collapse; table-layout: fixed; background: #fff; }
.live-result-table th,
.live-result-table td { padding: 6px 4px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); text-align: center; }
.live-result-table thead th { color: var(--link); background: #f8f9fa; font-weight: 500; }
.live-result-table thead a { color: var(--link); text-decoration: underline; }
.live-result-table thead th:first-child,
.live-result-table tbody th { width: 58px; color: var(--content); }
.live-result-table tbody tr { background: var(--lotto-bg); }
.live-result-table td { height: 40px; vertical-align: middle; }
.live-result-table td b { display: block; padding: 0 2px; font-size: 21px; line-height: 21px; font-weight: 700; }
.live-result-table tr.is-special th,
.live-result-table tr.is-special td b { color: var(--highlight); }
.live-result-table tr.is-special td b { font-size: 22px; }
.live-temp-number { display: inline-block !important; color: inherit; font-variant-numeric: tabular-nums; white-space: nowrap; }
.live-output-digit {
  display: inline-block;
  padding: 0 5px;
  border-radius: 100%;
  background: linear-gradient(rgb(218, 117, 6), rgb(183, 29, 29));
  color: #fff;
  font-size: 24px;
  line-height: 1.35;
}
.live-cell-spinner { display: inline-block; width: auto; height: auto; border: 0; color: #777; font-size: 16px; line-height: 1; vertical-align: middle; animation-duration: 2s; }
.live-result-table--bac .live-prize-column { width: 58px; }
.live-result-table--bac tbody tr.is-shaded { background: var(--lotto-bg); }
.live-result-table--bac tbody tr:not(.is-shaded) { background: #fff; }
.live-result-table--bac td { height: 42px; }
.live-result-table--province tbody th { width: 70px; }
.live-result-table--province td { padding: 4px; }
.live-province-values { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); align-items: center; min-height: 34px; }
.live-province-values > b,
.live-province-values > .live-cell-spinner { margin: 4px auto; }
.live-box.is-test-live { border: 2px solid #d97706; }
.live-box.is-test-live > .xsmb-card__title { background: linear-gradient(90deg, #92400e, #d97706); }
.live-test-banner { display: flex; justify-content: space-between; gap: 12px; margin: 10px 0; padding: 9px 12px; border: 1px solid #f59e0b; border-radius: 6px; background: #fffbeb; color: #92400e; }
.live-test-card { margin-top: 12px; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.live-test-card > header { display: flex; justify-content: space-between; gap: 10px; padding: 9px 12px; background: var(--lotto-bg); }
.live-test-card table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.live-test-card th { width: 58px; color: var(--text); }
.live-test-card th,
.live-test-card td { padding: 6px; border-top: 1px solid var(--border); text-align: center; }
.live-test-card td { display: grid; grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); align-items: center; min-height: 39px; }
.live-test-card td b { font-size: 21px; }
.live-test-card tr:nth-child(even) { background: var(--lotto-bg); }
.live-test-card tr.is-special th,
.live-test-card tr.is-special td { color: var(--highlight); }
.live-test-card tr.is-waiting td { color: var(--muted); }
.live-test-spinner { display: inline-block; width: 20px; height: 20px; margin: auto; border: 3px solid #d1d5db; border-top-color: #65a30d; border-radius: 50%; animation: spin .7s linear infinite; }
.button-link,
.tool-form button,
.trial-button { display: inline-block; padding: 8px 20px; border: 0; border-radius: 4px; background: var(--button); color: #fff; text-decoration: none; font-weight: 500; cursor: pointer; }
.button-link:hover,
.tool-form button:hover,
.trial-button:hover { background: #619115; color: #fff; }
@keyframes pulse { 50% { opacity: .3; } }

.result-book { overflow: hidden; }
.table-scroll { overflow: auto; }
.result-book table,
.stats-table { width: 100%; border-collapse: collapse; }
.result-book th,
.result-book td,
.stats-table th,
.stats-table td { padding: 8px 10px; border: 1px solid var(--border); text-align: left; white-space: nowrap; }
.result-book th,
.stats-table th { color: #fff; background: var(--gradient); }
.result-book .number-db { color: var(--highlight); font-size: 18px; font-weight: 700; }
.book-form { display: grid; grid-template-columns: repeat(3, minmax(140px, 1fr)) minmax(150px, .75fr); gap: 10px; padding: 10px; }
.book-form label { display: grid; gap: 5px; color: var(--secondary); font-size: 14px; font-weight: 500; }
.book-form input,
.book-form select { width: 100%; height: 38px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 4px; background: #fff; }
.book-form button { align-self: end; height: 38px; padding: 7px 15px; border: 0; border-radius: 4px; background: var(--button); color: #fff; font-weight: 500; cursor: pointer; }
.book-form button:hover { background: #619115; }
.book-ranges { box-shadow: none; }
.book-ranges a { flex: 1 0 auto; text-align: center; }
.book-summary { margin-bottom: 15px; padding: 11px 15px; border-radius: 10px; background: #fff; box-shadow: var(--shadow); text-align: center; }

.stats-tool { overflow: hidden; }
.tool-form { display: grid; grid-template-columns: repeat(2, minmax(160px, 1fr)); gap: 10px; padding: 10px; }
.tool-form label { display: grid; gap: 5px; font-size: 14px; font-weight: 500; }
.tool-form input,
.tool-form select { width: 100%; height: 38px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 4px; background: #fff; }
.tool-form > button { justify-self: end; min-width: 185px; }
.number-stepper { display: grid; grid-template-columns: 40px minmax(55px, 1fr) 55px 40px; }
.number-stepper button { min-width: 0; height: 38px; padding: 0; border: 1px solid var(--border); border-radius: 0; background: var(--line); color: var(--content); }
.number-stepper button:first-child { border-radius: 4px 0 0 4px; }
.number-stepper button:last-child { border-radius: 0 4px 4px 0; }
.number-stepper input { border-right: 0; border-left: 0; border-radius: 0; text-align: center; }
.number-stepper > span { height: 38px; display: grid; place-items: center; border: 1px solid var(--border); background: #fff; color: var(--secondary); font-weight: 400; }
.tool-message { padding: 0 10px 10px; color: var(--secondary); }
.stats-result { padding: 0; }
.stats-output > p { margin: 0; padding: 10px; }
.stats-number-table { width: 100%; min-width: 720px; border-collapse: collapse; table-layout: fixed; }
.stats-number-table th,
.stats-number-table td { height: 58px; border: 1px solid var(--border); text-align: center; }
.stats-number-table th { width: 72px; background: #fff2ca; color: var(--secondary); font-weight: 500; }
.stats-number-table td b,
.stats-number-table td small { display: block; }
.stats-number-table td b { margin-bottom: 7px; color: var(--button); font-size: 18px; line-height: 1; }
.stats-number-table td small { color: var(--secondary); font-style: italic; line-height: 1; }
.stats-number-table .stat-empty { display: block; min-height: 40px; background: var(--lotto-bg); }
.stats-gan-table td { text-align: center; }
.stats-grid { display: grid; grid-template-columns: repeat(10, 1fr); border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
.stat-number { min-height: 54px; display: grid; place-items: center; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.stat-number b { color: var(--highlight); font-size: 18px; }
.stat-number small { color: var(--secondary); }

.trial-tabs { display: grid; grid-template-columns: repeat(3, 1fr); margin-bottom: 15px; overflow: hidden; border-radius: 10px; background: #fff; box-shadow: var(--shadow); }
.trial-tabs a { min-height: 37px; display: grid; place-items: center; padding: 6px 8px; border-right: 1px solid var(--border); color: #333; text-decoration: none; }
.trial-tabs a:last-child { border-right: 0; }
.trial-tabs a:hover,
.trial-tabs a.active { color: #fff; background: var(--brand); }
.trial-tool { overflow: hidden; }
.trial-tool__head { padding: 12px 10px 10px; text-align: center; border: 3px solid var(--brand); border-bottom-width: 1px; border-radius: 10px 10px 0 0; }
.trial-tool__head h1 { margin: 0 0 9px; color: var(--brand); font-size: 20px; line-height: 1.35; }
.trial-controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.trial-controls select { min-width: 126px; height: 38px; padding: 6px 34px 6px 12px; border: 1px solid var(--border); border-radius: 4px; background: #fff; }
.trial-button { min-width: 118px; min-height: 38px; padding: 7px 14px; border: 0; border-radius: 4px; background: var(--button); color: #fff; font-weight: 500; cursor: pointer; }
.trial-button:hover { background: #619115; }
.trial-button:disabled { opacity: .65; cursor: wait; }
.trial-result { margin: 0; border-right: 3px solid var(--brand); border-left: 3px solid var(--brand); }
.trial-prize-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.trial-prize-table th,
.trial-prize-table td { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); text-align: center; }
.trial-prize-table tbody tr:nth-child(even) { background: var(--lotto-bg); }
.trial-prize-table th { width: 62px; padding: 7px 4px; font-weight: 600; }
.trial-prize-table thead th { width: auto; padding: 7px 4px; color: var(--link); background: #f8f9fa; }
.trial-prize-table thead th:first-child { width: 62px; color: #333; }
.trial-prize-table td { padding: 0; }
.trial-values { display: grid; grid-template-columns: repeat(var(--trial-columns, 1), minmax(0, 1fr)); }
.trial-values--1 { --trial-columns: 1; }
.trial-values--2 { --trial-columns: 2; }
.trial-values--3,
.trial-values--6 { --trial-columns: 3; }
.trial-values--4 { --trial-columns: 4; }
.trial-values--7 { --trial-columns: 1; }
.trial-values--stack { --trial-columns: 1; }
.trial-number { min-height: 38px; display: grid; place-items: center; padding: 4px 2px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); font-size: 22px; line-height: 1.25; font-weight: 700; }
.trial-number:nth-child(3n),
.trial-number:last-child { border-right: 0; }
.trial-values--1 .trial-number:last-child,
.trial-values--2 .trial-number:nth-child(2n),
.trial-values--4 .trial-number:nth-child(4n) { border-right: 0; }
.trial-prize-table .prize-db th,
.trial-prize-table .prize-db .trial-number { color: var(--highlight); }
.trial-prize-table .prize-db .trial-number { font-size: 26px; }
.trial-prize-table--multi { min-width: 500px; }
.trial-prize-table--multi .trial-number { border-right: 0; }
.trial-spinner { position: relative; width: 22px; height: 22px; display: block; }
.trial-spinner i { position: absolute; top: 9px; left: 9px; width: 4px; height: 4px; border-radius: 50%; background: var(--button); transform-origin: 2px 2px; animation: trial-dot .77s linear infinite; }
.trial-spinner i:nth-child(1) { transform: rotate(0deg) translateY(-8px); animation-delay: -.67s; }
.trial-spinner i:nth-child(2) { transform: rotate(45deg) translateY(-8px); animation-delay: -.58s; }
.trial-spinner i:nth-child(3) { transform: rotate(90deg) translateY(-8px); animation-delay: -.48s; }
.trial-spinner i:nth-child(4) { transform: rotate(135deg) translateY(-8px); animation-delay: -.38s; }
.trial-spinner i:nth-child(5) { transform: rotate(180deg) translateY(-8px); animation-delay: -.29s; }
.trial-spinner i:nth-child(6) { transform: rotate(225deg) translateY(-8px); animation-delay: -.19s; }
.trial-spinner i:nth-child(7) { transform: rotate(270deg) translateY(-8px); animation-delay: -.1s; }
.trial-spinner i:nth-child(8) { transform: rotate(315deg) translateY(-8px); animation-delay: 0s; }
.trial-spinner--active { width: 20px; height: 20px; border: 2px solid #ccc; border-top-color: #007bff; border-radius: 50%; animation: trial-spin .8s linear infinite; }
.number-flash { animation: number-flash .2s ease-in-out; }
.trial-loto .is-special { color: var(--highlight); }
@keyframes trial-dot { from { opacity: 1; } to { opacity: .08; } }
@keyframes trial-spin { to { transform: rotate(360deg); } }
@keyframes number-flash { from { opacity: .4; } to { opacity: 1; } }
.trial-view-modes { min-height: 43px; display: flex; align-items: center; gap: 13px; padding: 8px 14px; border-bottom: 1px solid var(--border); font-size: 13px; }
.trial-view-modes input { accent-color: var(--brand); }
.trial-loto-head,
.trial-loto-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) 42px minmax(0, 1fr); }
.trial-loto-head { font-weight: 600; text-align: center; }
.trial-loto-head > *,
.trial-loto-row > * { min-height: 34px; display: flex; align-items: center; padding: 5px 8px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.trial-loto-head > *,
.trial-loto-row b { justify-content: center; }
.trial-loto-row:nth-child(even) { background: var(--lotto-bg); }
.trial-loto-table { width: 100%; min-width: 500px; border-collapse: collapse; table-layout: fixed; }
.trial-loto-table th,
.trial-loto-table td { min-height: 34px; padding: 5px 8px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); text-align: center; }
.trial-loto-table th:first-child { width: 62px; }
.trial-loto-table tbody tr:nth-child(odd) { background: var(--lotto-bg); }
.trial-more { padding: 12px 16px; border-top: 1px solid var(--border); }
.trial-description { padding: 16px 18px; }
.trial-description h2 { margin: 16px 0 8px; font-size: 20px; }
.trial-description > :last-child { margin-bottom: 0; }

@media (max-width: 520px) {
  .trial-tool__head h1 { font-size: 17px; }
  .trial-controls select,
  .trial-button { min-width: 0; flex: 1 1 120px; }
  .trial-number { font-size: 19px; }
  .trial-prize-table th { width: 44px; }
  .trial-view-modes { flex-wrap: wrap; }
}

.feature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.feature-card { margin: 0; padding: 16px; color: var(--content); text-decoration: none; }
.feature-card:hover { transform: translateY(-1px); }
.feature-card > span { float: right; color: var(--brand); }
.feature-card h2 { margin: 0; color: var(--brand); font-size: 18px; }
.feature-card p { margin: 6px 0 0; color: var(--secondary); }

.post-grid { display: grid; gap: 12px; }
.post-card { display: grid; grid-template-columns: 180px 1fr; margin: 0; }
.post-card__image { min-height: 120px; background: #e7edf3; }
.post-card__image img { width: 100%; height: 100%; object-fit: cover; }
.post-card > div { padding: 12px; }
.post-card time,
.article-meta { color: var(--secondary); font-size: 13px; }
.post-card h2 { margin: 4px 0; font-size: 18px; line-height: 1.35; }
.post-card p { margin: 0; color: #555; }
.article-card { padding: 18px; }
.article-card > h1 { margin: 0 0 5px; font-size: 26px; }
.entry-content { margin-top: 16px; }

.prediction-tabs {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 15px;
  overflow: hidden;
  border-radius: 10px;
  background: var(--gradient);
  box-shadow: var(--shadow);
}
.prediction-tab {
  position: relative;
  flex: 1 1 150px;
  min-height: 41px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 9px 15px;
  color: #fff;
  text-align: center;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background .2s ease;
}
.prediction-tab:hover { color: #fff; background: rgba(255,255,255,.1); }
.prediction-tab.active { background: rgba(255,255,255,.2); font-weight: 700; }
.prediction-tab.active::after { content: ""; position: absolute; left: 20%; right: 20%; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: #fff; }
.prediction-tab--province { flex-basis: auto; min-width: 145px; font-size: 13px; }
.prediction-list-card { margin-bottom: 15px; overflow: hidden; border-radius: 10px; background: #fff; box-shadow: var(--shadow); }
.prediction-list-card > .xsmb-editor-content { margin: 0 0 15px; border-radius: 10px; }
.prediction-list-card > .xsmb-editor-content h2 { margin: 4px 0 8px; font-size: 22px; line-height: 1.35; }
.prediction-list-card > .xsmb-editor-content p { margin: 0; }
.prediction-list-title { margin: 0; padding: 9px 14px; color: #fff; background: var(--gradient); font-size: 16px; line-height: 23px; font-weight: 600; }
.prediction-list-title > span { margin-right: 5px; }
.prediction-items { display: grid; }
.prediction-item { border-bottom: 1px solid #f1f1f1; transition: background .2s ease; }
.prediction-item:last-child { border-bottom: 0; }
.prediction-item:hover { background: #f8f9fa; }
.prediction-item > a { display: flex; align-items: flex-start; gap: 15px; padding: 12px 15px; color: var(--content); text-decoration: none; }
.prediction-item__thumb { width: 120px; height: 80px; flex: 0 0 120px; overflow: hidden; border-radius: 8px; background: #e7edf3; box-shadow: 0 2px 6px rgba(0,0,0,.1); }
.prediction-item__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.prediction-item:hover .prediction-item__thumb img { transform: scale(1.05); }
.prediction-item__info { min-width: 0; display: grid; align-content: start; justify-items: start; }
.prediction-item__info time { display: inline-block; margin-bottom: 4px; padding: 2px 10px; border-radius: 15px; color: #fff; background: linear-gradient(135deg, #f89d3c, #e67e22); font-size: 11px; line-height: 18px; font-weight: 700; }
.prediction-item__title { margin-bottom: 3px; color: #1a5276; font-size: 15px; line-height: 1.4; font-weight: 600; }
.prediction-item:hover .prediction-item__title { color: #e74c3c; }
.prediction-item__excerpt { display: -webkit-box; overflow: hidden; color: #777; font-size: 13px; line-height: 1.4; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.prediction-pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; padding: 10px; border-top: 1px solid var(--line); }
.prediction-pagination a { width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: 6px; color: #333; background: #f1f1f1; text-decoration: none; font-size: 13px; font-weight: 600; }
.prediction-pagination a:hover { color: #000; background: #e2e2e2; }
.prediction-pagination a.active { color: #fff; background: linear-gradient(135deg, #667eea, #764ba2); box-shadow: 0 2px 6px rgba(102,126,234,.4); }
.prediction-breadcrumb { margin-bottom: 15px; padding: 5px 0; color: #666; font-size: 13px; }
.prediction-breadcrumb a { color: #0d6efd; text-decoration: none; }
.prediction-breadcrumb a:hover { text-decoration: underline; }
.prediction-breadcrumb span { color: #333; font-weight: 500; }
.prediction-article { height: auto !important; padding: 18px; }
.prediction-article > h1 { margin: 0 0 10px; color: var(--content); font-size: 20px; line-height: 1.4; }
.prediction-article__summary { margin: 0 0 15px; color: var(--secondary); font-style: italic; }
.prediction-body { font-size: 15px; line-height: 1.8; }
.prediction-body h2 { font-size: 20px; }
.prediction-body h3 { margin: 20px 0 10px; padding-bottom: 5px; border-bottom: 2px solid #f39c12; color: #1a5276; font-size: 18px; }
.prediction-body h4 { margin: 15px 0 8px; color: #e74c3c; font-size: 16px; }
.prediction-body h5 { margin: 10px 0 6px; color: #2c3e50; font-size: 15px; }
.prediction-body table { width: 100%; margin-bottom: 15px; border-collapse: collapse; font-size: 14px; }
.prediction-body table th,
.prediction-body table td { padding: 10px 15px; border: 1px solid #f5c17b; }
.prediction-body table td { background: #fff9e6; }
.prediction-body table tr:hover td { background: #fff3cd; }
.prediction-body .pascal-table-wrapper { margin: 10px 0 15px; padding: 15px; border: 1px solid #dee2e6; border-radius: 10px; background: #f8f9fa; text-align: center; }
.prediction-body .pascal-row-dd { display: flex; justify-content: center; gap: 4px; margin: 4px 0; }
.prediction-body .pascal-num { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; background: linear-gradient(135deg, #667eea, #764ba2); box-shadow: 0 2px 4px rgba(0,0,0,.15); font-size: 13px; font-weight: 700; }
.prediction-related { margin-top: 15px; }
.xsmb-empty { padding: 20px; text-align: center; color: var(--secondary); }
.xsmb-page-h1 { position: absolute !important; width: 1px !important; height: 1px !important; margin: -1px !important; padding: 0 !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.xsmb-editor-content { padding: 16px 18px; }
.xsmb-editor-content > :last-child { margin-bottom: 0; }
.xsmb-bottom-content { width: calc(50% - 16px); margin: 0 25% 15px; }
.content-layout--wide + .xsmb-bottom-content { width: calc(75% - 16px); margin-left: 0; }
.xsmb-ad { width: min(1116px, calc(100% - 24px)); margin: 10px auto; text-align: center; }
.site-sidebar .xsmb-ad { width: 100%; margin: 0 0 15px; }
.loading { opacity: .6; pointer-events: none; }

.site-footer { position: relative; z-index: 2; background: rgba(255, 255, 255, .78); border-top: 1px solid #d8dce8; color: var(--content); }
.site-footer__inner { width: min(1116px, calc(100% - 24px)); margin: auto; display: grid; grid-template-columns: 1.25fr 1fr 1fr 1fr; gap: 22px; padding: 28px 0; }
.site-footer strong { color: var(--brand); font-size: 20px; }
.site-footer p { margin: 5px 0; }
.site-footer nav,
.footer-contact { display: grid; align-content: start; gap: 5px; }
.site-footer nav b,
.footer-contact b { margin-bottom: 3px; }
.site-footer a { color: #555; text-decoration: none; }
.site-footer a:hover { color: var(--brand); }
.copyright { padding: 10px 12px; border-top: 1px solid #ddd; text-align: center; font-size: 13px; }

@media (max-width: 991px) {
  .site-header__inner { grid-template-columns: 145px 1px 1fr auto; }
  .brand img { width: 135px; }
  .site-nav__inner > .nav-link,
  .nav-item > .nav-link { padding: 0 7px; font-size: 14px; }
  .content-layout { grid-template-columns: 2fr 1fr; }
  .site-sidebar--left { display: none; }
  .content-layout--wide { grid-template-columns: 2fr 1fr; }
  .xsmb-bottom-content { width: calc(66.666% - 16px); margin-left: 0; }
  .stats-grid { grid-template-columns: repeat(5, 1fr); }
}

@media (max-width: 767px) {
  .site-header__inner { height: 82px; grid-template-areas: "copy copy copy" "brand button button"; grid-template-columns: 1fr auto auto; gap: 4px 10px; padding: 7px 0; }
  .brand { grid-area: brand; }
  .brand img { width: 126px; height: 39px; }
  .brand-divider { display: none; }
  .header-copy { grid-area: copy; }
  .header-copy .header-title { font-size: 13px; }
  .header-copy span { display: none; }
  .nav-toggle { grid-area: button; display: block; justify-self: end; }
  .site-nav { position: fixed; top: 0; left: 0; width: min(80%, 380px); height: 100vh; transform: translateX(-105%); transition: transform .25s ease; border: 0; border-radius: 0 20px 20px 0; box-shadow: 0 0 8px rgba(0,0,0,.25); overflow-y: auto; }
  .site-nav.is-open { transform: translateX(0); }
  .site-nav__inner { width: 100%; height: auto; display: grid; padding: 70px 0 20px; }
  .site-nav__inner > .nav-link,
  .nav-item > .nav-link { min-height: 45px; padding: 0 20px; border-bottom: 1px solid var(--line); }
  .nav-item { display: grid; grid-template-columns: minmax(0, 1fr) 46px; }
  .nav-dropdown-toggle { min-width: 46px; margin: 0; padding: 0; border-bottom: 1px solid var(--line); }
  .nav-dropdown { position: static; grid-column: 1 / -1; min-width: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none; }
  .nav-dropdown a { min-height: 42px; padding-left: 38px; background: #f7f7f7; }
  .nav-item:hover:not(.is-open) > .nav-dropdown { display: none; }
  .site-notice { margin-top: 10px; }
  .site-main { margin-top: 10px; }
  .content-layout,
  .content-layout--wide { grid-template-columns: 1fr; }
  .primary-content { order: 1; }
  .site-sidebar--right { order: 2; }
  .site-sidebar--left { display: none; }
  .xsmb-bottom-content { width: auto; margin: 0 8px 15px; }
  .tool-form { grid-template-columns: 1fr; }
  .tool-form > button { width: 100%; justify-self: stretch; }
  .book-form { grid-template-columns: 1fr 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .site-footer__inner { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px) {
  body { font-size: 14px; }
  .site-main { width: calc(100% - 4px); }
  .content-layout > * { margin: 0 2px; }
  .result-card,
  .xsmb-card,
  .side-card,
  .page-heading,
  .xsmb-editor-content { border-radius: 0; }
  .result-card__head h2 { font-size: 17px; }
  .result-card__head span { font-size: 13px; }
  .result-table th { width: 42px; padding: 5px 2px; }
  .result-table td span { font-size: 19px; padding: 4px 1px; }
  .result-table .prize-db td span { font-size: 23px; }
  .multi-result-table,
  .multi-loto-table { min-width: 460px; }
  .multi-result-table td span { font-size: 18px; }
  .result-filter { align-items: flex-start; flex-direction: column; }
  .result-filter__digits { width: 100%; justify-content: center; }
  .loto-grid__head,
  .loto-cell { grid-template-columns: 32px minmax(0, 1fr) 32px minmax(0, 1fr); }
  .loto-grid__head > *,
  .loto-cell > * { padding: 4px; }
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
  .book-form { grid-template-columns: 1fr; }
  .post-card { grid-template-columns: 1fr; }
  .post-card__image { height: 180px; }
  .prediction-tabs { border-radius: 0; }
  .prediction-tab { flex-basis: 33.333%; min-width: 0; padding: 8px 6px; font-size: 12px; }
  .prediction-tab--province { flex-basis: 50%; }
  .prediction-list-card { border-radius: 0; }
  .prediction-list-card > .xsmb-editor-content h2 { font-size: 18px; }
  .prediction-item > a { gap: 8px; padding: 8px 12px; }
  .prediction-item__thumb { width: 90px; height: 60px; flex-basis: 90px; }
  .prediction-item__info time { padding: 2px 7px; font-size: 10px; line-height: 16px; }
  .prediction-item__title { font-size: 13px; }
  .prediction-item__excerpt { display: none; }
  .prediction-article { padding: 14px 12px; }
  .prediction-body h3 { font-size: 16px; }
  .prediction-body .pascal-num { width: 22px; height: 22px; font-size: 11px; }
  .site-footer__inner { grid-template-columns: 1fr; }
}
