.lottery-page {
  width: min(calc(100% - 32px), 1320px);
  margin: 0 auto;
  padding: 76px 0 110px;
}

html,
body {
  overflow-x: hidden;
}

.lottery-page,
.lottery-page * {
  box-sizing: border-box;
}

.draw-hero,
.draw-card-grid,
.analysis-layout,
.zone-panel,
.side-panel,
.side-card,
.learn-card,
.related-section,
.related-grid {
  min-width: 0;
}

.lottery-header .nav-feature-link {
  color: var(--accent);
  background: rgba(244, 207, 93, 0.12);
  border: 1px solid rgba(244, 207, 93, 0.34);
  box-shadow: 0 8px 20px rgba(244, 207, 93, 0.08);
}

.lottery-header .nav-feature-link:hover {
  color: #ffdf75;
  background: rgba(244, 207, 93, 0.18);
  border-color: rgba(244, 207, 93, 0.46);
}

.lottery-header .brand-lockup,
.draw-hero h1,
.draw-stat-card strong,
.section-heading-row h2,
.side-card h2,
.learn-card h2,
.related-card strong,
.draw-card strong,
.mini-stat strong,
.zone-summary-row strong {
  color: var(--text);
}

.lottery-header .main-nav a {
  color: var(--muted);
}

.draw-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 46px;
  align-items: end;
  padding: 40px 0 34px;
}

.draw-kicker {
  display: inline-flex;
  margin: 0 0 14px;
  padding: 8px 14px;
  border: 1px solid rgba(244, 207, 93, 0.4);
  border-radius: 999px;
  color: var(--accent);
  background: rgba(244, 207, 93, 0.08);
  font-weight: 800;
}

.draw-hero h1 {
  max-width: 860px;
  margin: 0;
  font-size: clamp(42px, 6vw, 78px);
  line-height: 0.98;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.draw-hub-title span {
  display: inline-block;
  margin-top: 10px;
  color: var(--accent);
  font-size: 0.62em;
  line-height: 1.08;
}

.hero-copy {
  max-width: 760px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.9;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.ghost-button,
.learn-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid rgba(24, 210, 148, 0.46);
  border-radius: 8px;
  color: var(--text);
  background: rgba(24, 210, 148, 0.1);
  font-weight: 800;
}

.draw-stat-card,
.zone-panel,
.side-card,
.learn-card,
.draw-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(12, 29, 32, 0.78);
  box-shadow: var(--shadow);
}

:root[data-theme="light"] .draw-stat-card,
:root[data-theme="light"] .zone-panel,
:root[data-theme="light"] .side-card,
:root[data-theme="light"] .learn-card,
:root[data-theme="light"] .draw-card {
  background: rgba(255, 255, 255, 0.9);
}

:root[data-theme="light"] .draw-kicker,
:root[data-theme="light"] .mode-pill,
:root[data-theme="light"] .responsible-note {
  color: #7a5700;
  border-color: rgba(122, 87, 0, 0.32);
  background: rgba(244, 207, 93, 0.18);
}

:root[data-theme="light"] .ghost-button,
:root[data-theme="light"] .learn-link {
  color: #07563f;
  border-color: rgba(15, 159, 114, 0.36);
  background: rgba(15, 159, 114, 0.1);
}

.draw-stat-card {
  padding: 26px;
}

.draw-stat-card span,
.draw-stat-card p {
  color: var(--muted);
}

.draw-stat-card strong {
  display: block;
  margin: 10px 0;
  font-size: 42px;
  line-height: 1;
}

.analysis-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 24px;
  align-items: start;
}

.zone-panel {
  padding: 24px;
}

.section-heading-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  margin-bottom: 18px;
}

.section-heading-row h2,
.side-card h2,
.learn-card h2 {
  margin: 0;
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1.08;
}

.mode-pill {
  display: inline-flex;
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent);
  background: rgba(244, 207, 93, 0.08);
  font-weight: 800;
  white-space: nowrap;
}

.zone-grid-wrap {
  max-width: 100%;
  min-width: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-inline: contain;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(3, 19, 18, 0.42);
}

.zone-grid-wrap-three {
  max-height: 760px;
}

.zone-grid {
  display: grid;
  gap: 8px;
  min-width: 760px;
}

.zone-grid-two {
  grid-template-columns: repeat(10, minmax(58px, 1fr));
}

.zone-grid-three {
  grid-template-columns: repeat(10, minmax(58px, 1fr));
}

.zone-cell {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 54px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  color: #05110f;
  font-size: 21px;
  font-weight: 900;
}

.zone-grid-three .zone-cell {
  min-height: 42px;
  font-size: 15px;
}

.zone-low-upper { background: #bfe9c5; }
.zone-low-lower { background: #f1a9c8; }
.zone-center { background: #bac5c5; }
.zone-high-upper { background: #fff2a6; }
.zone-high-lower { background: #b9ddf2; }

.zone-cell.is-highlighted {
  border: 2px solid #ffc400;
  box-shadow: 0 0 0 2px rgba(255, 196, 0, 0.2), 0 0 18px rgba(255, 196, 0, 0.28);
}

.hit-badge {
  position: absolute;
  top: -9px;
  right: -9px;
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  color: #081015;
  background: #ffc400;
  border: 2px solid #fff7cf;
  font-size: 12px;
  font-weight: 900;
}

.responsible-note {
  margin: 18px 0 12px;
  padding: 14px 16px;
  border: 1px solid rgba(244, 207, 93, 0.5);
  border-radius: 8px;
  color: var(--accent);
  background: rgba(244, 207, 93, 0.08);
  line-height: 1.7;
}

.side-panel {
  display: grid;
  gap: 18px;
}

.side-card {
  padding: 20px;
}

.side-card p {
  color: var(--muted);
  line-height: 1.8;
}

.raw-table-wrap {
  max-width: 100%;
  min-width: 0;
  max-height: 520px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-inline: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.raw-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  min-width: 360px;
}

.raw-table-wrap th,
.raw-table-wrap td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.raw-table-wrap th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-solid);
  color: var(--muted);
  font-weight: 800;
}

.mini-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.mini-stat {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.mini-stat span {
  display: block;
  color: var(--muted);
}

.mini-stat strong {
  display: block;
  margin-top: 8px;
  font-size: 26px;
}

.zone-summary {
  display: grid;
}

.zone-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.zone-summary-name {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.zone-dot {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 5px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.learn-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 26px;
  align-items: end;
  margin-top: 28px;
  padding: 28px;
}

.learn-card p {
  max-width: 920px;
  color: var(--muted);
  line-height: 1.9;
}

.learn-card ul {
  margin: 16px 0 0;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.9;
}

.learn-card li + li {
  margin-top: 4px;
}

.learn-note {
  color: var(--text) !important;
}

.related-section,
.draw-card-grid {
  margin-top: 28px;
}

.related-grid,
.draw-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.related-card,
.draw-card {
  padding: 20px;
  transition: transform 180ms ease, border-color 180ms ease;
}

.related-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.related-card:hover,
.draw-card:hover {
  transform: translateY(-3px);
  border-color: rgba(24, 210, 148, 0.45);
}

.related-card span,
.draw-card span {
  display: block;
  color: var(--muted);
}

.related-card strong,
.draw-card strong {
  display: block;
  margin: 10px 0;
  font-size: 24px;
}

.draw-card p {
  color: var(--muted);
}

@media (max-width: 1080px) {
  .draw-hero,
  .analysis-layout,
  .learn-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .related-grid,
  .draw-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .lottery-page {
    width: min(calc(100% - 20px), 100%);
    max-width: calc(100vw - 20px);
    overflow-x: hidden;
    padding-top: 38px;
  }

  .draw-hero {
    gap: 22px;
    padding: 24px 0;
  }

  .draw-hero h1 {
    max-width: 100%;
    font-size: 32px;
    line-height: 1.12;
  }

  .hero-copy {
    font-size: 16px;
  }

  .section-heading-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .section-heading-row h2,
  .side-card h2,
  .learn-card h2 {
    font-size: clamp(24px, 8vw, 34px);
    line-height: 1.15;
    overflow-wrap: anywhere;
  }

  .mode-pill {
    min-width: 0;
  }

  .zone-panel,
  .side-card,
  .learn-card {
    max-width: 100%;
    overflow: hidden;
    padding: 16px;
  }

  .zone-grid-wrap {
    overflow-x: hidden;
    padding: 4px;
  }

  .zone-grid {
    gap: 3px;
    width: 100%;
    min-width: 0;
  }

  .zone-grid-two {
    grid-template-columns: repeat(10, minmax(0, 1fr));
  }

  .zone-grid-three {
    grid-template-columns: repeat(10, minmax(0, 1fr));
    min-width: 0;
  }

  .zone-cell {
    width: auto;
    min-width: 0;
    min-height: 30px;
    border-radius: 4px;
    font-size: 12px;
    line-height: 1;
  }

  .zone-grid-three .zone-cell {
    width: auto;
    min-height: 24px;
    font-size: 8.5px;
  }

  .zone-cell.is-highlighted {
    border-width: 1px;
    box-shadow: 0 0 0 1px rgba(255, 196, 0, 0.18), 0 0 10px rgba(255, 196, 0, 0.22);
  }

  .hit-badge {
    top: -5px;
    right: -5px;
    min-width: 14px;
    height: 14px;
    padding: 0 3px;
    border-width: 1px;
    font-size: 8px;
  }

  .responsible-note {
    font-size: 14px;
    line-height: 1.75;
  }

  .raw-table-wrap table {
    min-width: 340px;
  }

  .raw-table-wrap th,
  .raw-table-wrap td {
    padding: 10px 9px;
  }

  .related-grid,
  .draw-card-grid,
  .mini-stat-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 360px) {
  .zone-panel,
  .side-card,
  .learn-card {
    padding: 12px;
  }

  .zone-grid {
    gap: 2px;
  }

  .zone-cell {
    min-height: 28px;
    font-size: 11px;
  }

  .zone-grid-three .zone-cell {
    min-height: 22px;
    font-size: 8px;
  }

  .hit-badge {
    top: -4px;
    right: -4px;
    min-width: 13px;
    height: 13px;
    font-size: 7px;
  }
}
