.lottery-page {
  background: #f6f4ee;
  color: #102421;
}

.lottery-main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 72px;
}

.game-switcher {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid #e2ded3;
  border-bottom: 1px solid #e2ded3;
  background: #fff;
}

.game-switcher a {
  min-width: 0;
  padding: 13px 18px;
  border-right: 1px solid #e2ded3;
  color: #17322e;
  text-align: center;
  text-decoration: none;
}

.game-switcher a:last-child { border-right: 0; }
.game-switcher a[aria-current="page"] { box-shadow: inset 0 -4px #d43768; }
.game-switcher span { display: block; font-weight: 900; }
.game-switcher small { display: block; margin-top: 2px; color: #65736f; }

.lottery-answer-hero,
.lottery-page-heading {
  padding: 34px 0;
}

.lottery-answer-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 48px;
  align-items: center;
}

.lottery-answer-hero h1,
.lottery-page-heading h1 {
  max-width: 820px;
  margin: 6px 0 14px;
  font-size: clamp(2.25rem, 5vw, 4.8rem);
  line-height: .98;
  letter-spacing: 0;
  text-transform: uppercase;
}

.lottery-direct-answer,
.lottery-page-heading > p {
  max-width: 780px;
  color: #4d605b;
  font-size: 1.08rem;
  line-height: 1.65;
}

.lottery-latest {
  display: grid;
  min-height: 214px;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: 24px;
  border: 1px solid #ddd7ca;
  border-top: 5px solid #008877;
  border-radius: 6px;
  background: #fff;
  text-align: center;
  box-shadow: 0 14px 30px rgba(30, 43, 39, .08);
}

.lottery-latest > span:first-child {
  color: #65736f;
  font-size: .78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.lottery-results-panel,
.lottery-history-filters,
.lottery-history-results {
  border: 1px solid #e0dbcf;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(30, 43, 39, .07);
}

.lottery-results-panel > header,
.lottery-history-results > header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  padding: 22px 24px;
  border-bottom: 1px solid #e5e0d5;
}

.lottery-results-panel h2,
.lottery-history-results h2 {
  margin: 3px 0 0;
  font-size: 1.45rem;
  letter-spacing: 0;
}

.lottery-draw-list { display: grid; }

.lottery-draw-row {
  display: grid;
  grid-template-columns: minmax(140px, .8fr) minmax(220px, 1.25fr) minmax(150px, .8fr);
  gap: 20px;
  align-items: center;
  min-height: 102px;
  padding: 16px 24px;
  border-bottom: 1px solid #ece8df;
}

.lottery-draw-row:last-child { border-bottom: 0; }
.lottery-draw-row.is-pending { background: #faf9f6; }
.lottery-draw-meta { display: grid; gap: 5px; }
.lottery-draw-meta strong { font-size: 1rem; text-transform: uppercase; }
.lottery-draw-meta time { color: #65736f; font-weight: 800; }
.lottery-result-value { text-align: center; }
.lottery-result-extra { display: grid; justify-items: end; gap: 5px; color: #65736f; }

.lottery-balls {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: 52px;
  gap: 7px;
}

.lottery-ball {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid #d9d2c4;
  border-radius: 50%;
  background: #f4f1e9;
  color: #102421;
  font-size: 1.28rem;
  font-weight: 900;
  box-shadow: inset 0 4px 10px rgba(255, 255, 255, .9), 0 4px 8px rgba(30, 43, 39, .08);
}

.lottery-awaiting { color: #7b8581; font-weight: 800; }
.lottery-mega { display: inline-flex; align-items: center; gap: 7px; color: #334a45; font-weight: 800; }
.bonus-dot { display: inline-block; width: 14px; height: 14px; border: 1px solid #cfc9bc; border-radius: 50%; }
.bonus-dot.white { background: #fff; box-shadow: inset -2px -2px 4px rgba(0, 0, 0, .12); }
.bonus-dot.gold { border-color: #c39300; background: #ffd530; box-shadow: inset -2px -2px 4px rgba(117, 77, 0, .24); }

.lottery-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 22px 0 50px;
}

.lottery-actions a {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  padding: 0 18px;
  border: 1px solid #d8d2c5;
  border-radius: 4px;
  background: #fff;
  color: #143b35;
  font-weight: 900;
  text-decoration: none;
}

.lottery-actions .pink-button { border-color: #d43768; background: #d43768; color: #fff; }

.lottery-facts {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 48px;
  padding: 42px 0;
  border-top: 1px solid #d9d4c8;
  border-bottom: 1px solid #d9d4c8;
}

.lottery-facts h2,
.lottery-schedule h2,
.lottery-faq h2 { margin: 5px 0 12px; font-size: 2rem; letter-spacing: 0; }
.lottery-facts p { color: #53645f; line-height: 1.65; }
.lottery-facts dl { display: grid; grid-template-columns: 1fr 1fr; margin: 0; }
.lottery-facts dl div { padding: 14px; border-bottom: 1px solid #ded9cd; }
.lottery-facts dt { color: #65736f; font-size: .75rem; font-weight: 900; text-transform: uppercase; }
.lottery-facts dd { margin: 4px 0 0; font-size: 1.15rem; font-weight: 900; }

.source-note {
  margin-top: 26px;
  padding: 18px 20px;
  border-left: 4px solid #d43768;
  background: #fff;
  color: #4d605b;
  line-height: 1.55;
}

.history-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.history-metrics span { padding: 11px 14px; border: 1px solid #ddd7ca; border-radius: 4px; background: #fff; color: #65736f; }
.history-metrics strong { color: #102421; }

.lottery-history-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 15px;
  padding: 22px;
  margin-bottom: 22px;
}

.lottery-history-filters label { display: grid; min-width: 0; gap: 7px; color: #334a45; font-size: .78rem; font-weight: 900; text-transform: uppercase; }
.lottery-history-filters input,
.lottery-history-filters select {
  width: 100%;
  min-width: 0;
  height: 48px;
  padding: 0 12px;
  border: 1px solid #d4cec1;
  border-radius: 4px;
  background: #fff;
  color: #102421;
  font: inherit;
  font-size: 1rem;
  text-transform: none;
}

.lottery-filter-actions { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lottery-filter-actions button { min-height: 48px; border: 1px solid #d4cec1; border-radius: 4px; background: #fff; color: #d43768; font-weight: 900; }
.lottery-filter-actions .pink-button { border-color: #d43768; background: #d43768; color: #fff; }

.lottery-history-results { overflow: hidden; }
.lottery-history-results table { width: 100%; border-collapse: collapse; }
.lottery-history-results th { padding: 14px 16px; background: #007f70; color: #fff; font-size: .76rem; text-align: left; text-transform: uppercase; }
.lottery-history-results td { padding: 14px 16px; border-bottom: 1px solid #e5e0d5; vertical-align: middle; }
.lottery-history-results td strong,
.lottery-history-results td small { display: block; }
.lottery-history-results td small { margin-top: 3px; color: #65736f; }
.lottery-history-results .lottery-ball { width: 38px; height: 38px; font-size: .95rem; }
.lottery-history-results .lottery-balls { grid-auto-columns: 38px; gap: 4px; }

.lottery-pagination { display: flex; justify-content: center; align-items: center; gap: 12px; padding: 15px; }
.lottery-pagination button { min-width: 100px; min-height: 42px; border: 0; border-radius: 4px; background: #008877; color: #fff; font-weight: 900; }
.lottery-pagination button:disabled { background: #d7d1c5; color: #fff; }

.guide-steps { display: grid; gap: 0; border-top: 1px solid #d9d4c8; }
.guide-steps article { display: grid; grid-template-columns: 60px 1fr; gap: 20px; padding: 28px 0; border-bottom: 1px solid #d9d4c8; }
.guide-steps article > span { display: grid; width: 46px; height: 46px; place-items: center; border-radius: 50%; background: #008877; color: #fff; font-weight: 900; }
.guide-steps h2 { margin: 0 0 8px; font-size: 1.4rem; letter-spacing: 0; }
.guide-steps p { max-width: 780px; margin: 0; color: #53645f; line-height: 1.65; }

.lottery-schedule { display: grid; grid-template-columns: 1fr 1.3fr; gap: 40px; padding: 48px 0; }
.lottery-schedule ol { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.lottery-schedule li { display: flex; justify-content: space-between; gap: 18px; padding: 14px 16px; border-bottom: 1px solid #d9d4c8; }

.lottery-faq { padding: 40px 0; border-top: 1px solid #d9d4c8; }
.lottery-faq details { max-width: 820px; padding: 17px 0; border-bottom: 1px solid #d9d4c8; }
.lottery-faq summary { cursor: pointer; font-weight: 900; }
.lottery-faq details p { color: #53645f; line-height: 1.65; }

.games-live-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 50px; }
.game-live { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; min-height: 180px; padding: 24px; border: 1px solid #ddd7ca; border-top: 5px solid #008877; border-radius: 6px; background: #fff; color: #102421; text-decoration: none; box-shadow: 0 12px 28px rgba(30, 43, 39, .07); }
.game-live > div { display: grid; gap: 5px; }
.game-live > div > span { color: #65736f; font-weight: 900; text-transform: uppercase; }
.game-live > div > strong { font-size: 2rem; }
.game-live small { color: #65736f; }
.game-live .game-open { grid-column: 1 / -1; color: #d43768; font-weight: 900; }
.cash-pot-live { grid-template-columns: 1fr; border-top-color: #d43768; }

.sr-only,
.lottery-ball .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 760px) {
  .lottery-main { width: min(100% - 28px, 620px); padding-top: 18px; }
  .game-switcher { grid-template-columns: repeat(3, minmax(0, 1fr)); position: sticky; top: 0; z-index: 15; }
  .game-switcher a { padding: 11px 5px; }
  .game-switcher small { display: none; }
  .lottery-answer-hero { grid-template-columns: 1fr; gap: 16px; padding: 26px 0; }
  .lottery-answer-hero h1,
  .lottery-page-heading h1 { font-size: 2.5rem; }
  .lottery-latest { min-height: 170px; }
  .lottery-results-panel > header,
  .lottery-history-results > header { align-items: start; padding: 18px; }
  .lottery-draw-row { grid-template-columns: minmax(0, 1fr) auto; gap: 10px 16px; min-height: 126px; padding: 16px; }
  .lottery-result-value { grid-column: 2; grid-row: 1 / span 2; }
  .lottery-result-extra { grid-column: 1; justify-items: start; }
  .lottery-balls { grid-auto-columns: 43px; gap: 5px; }
  .lottery-ball { width: 43px; height: 43px; font-size: 1.08rem; }
  .lottery-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .lottery-actions a { justify-content: center; text-align: center; }
  .lottery-actions a:first-child { grid-column: 1 / -1; }
  .lottery-facts,
  .lottery-schedule { grid-template-columns: 1fr; gap: 22px; }
  .lottery-facts dl { grid-template-columns: 1fr 1fr; }
  .lottery-history-filters { grid-template-columns: 1fr; padding: 16px; }
  .lottery-filter-actions { grid-column: auto; }
  .lottery-history-results { overflow: visible; border: 0; background: transparent; box-shadow: none; }
  .lottery-history-results > header { border: 1px solid #e0dbcf; border-radius: 6px 6px 0 0; background: #fff; }
  .lottery-history-results table,
  .lottery-history-results tbody,
  .lottery-history-results tr,
  .lottery-history-results td { display: block; width: 100%; box-sizing: border-box; }
  .lottery-history-results thead { display: none; }
  .lottery-history-results tbody { display: grid; gap: 10px; }
  .lottery-history-results tr { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 17px; border: 1px solid #e0dbcf; border-radius: 6px; background: #fff; box-shadow: 0 8px 18px rgba(30, 43, 39, .05); }
  .lottery-history-results td { padding: 0; border: 0; }
  .lottery-history-results td::before { display: block; margin-bottom: 6px; color: #65736f; content: attr(data-label); font-size: .68rem; font-weight: 900; text-transform: uppercase; }
  .lottery-history-results td[data-label="Winning result"] { grid-column: 1 / -1; }
  .lottery-pagination { display: grid; grid-template-columns: 1fr 1fr; }
  .lottery-pagination span { grid-column: 1 / -1; grid-row: 1; text-align: center; }
  .lottery-pagination button { width: 100%; }
  .games-live-grid { grid-template-columns: 1fr; }
  .game-live { min-height: 160px; padding: 19px; }
}

@media (max-width: 360px) {
  .lottery-main { width: calc(100% - 20px); }
  .lottery-draw-row { padding: 13px; }
  .lottery-balls { grid-auto-columns: 38px; }
  .lottery-ball { width: 38px; height: 38px; font-size: .95rem; }
}
