@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap");

:root {
  color-scheme: dark;
  --background: #020817;
  --surface: #07141c;
  --surface-raised: #10242c;
  --surface-soft: #040c14;
  --foreground: #effbff;
  --muted: #91aab5;
  --border: rgb(89 205 225 / 13%);
  --border-strong: rgb(112 222 238 / 24%);
  --lime: #f2b84b;
  --lime-soft: rgb(242 184 75 / 15%);
  --violet: #ffe0a3;
  --violet-soft: rgb(255 224 163 / 15%);
  --cyan: #9ad48f;
  --orange: #d28d37;
  --danger: #ef7974;
  --electric-cyan: #2cd8ef;
  --electric-teal: #24c9c3;
  --signal-green: #79e2a7;
  --font-sans:
    "Space Grotesk", "Noto Sans JP", ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "Space Grotesk", "Noto Sans JP", ui-sans-serif, system-ui, sans-serif;
  font-family: var(--font-sans);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--foreground);
  background:
    linear-gradient(rgb(2 8 23 / 18%), rgb(2 8 23 / 78%)),
    repeating-linear-gradient(0deg, transparent 0 39px, rgb(44 216 239 / 2.6%) 40px),
    repeating-linear-gradient(90deg, transparent 0 39px, rgb(44 216 239 / 2.6%) 40px),
    radial-gradient(circle at 50% 18%, rgb(23 187 222 / 26%), transparent 360px),
    radial-gradient(circle at 84% 42%, rgb(44 216 239 / 12%), transparent 430px),
    radial-gradient(circle at 8% 62%, rgb(20 93 151 / 16%), transparent 520px),
    var(--background);
  background-attachment: fixed;
  font-feature-settings: "palt";
  overflow-x: hidden;
}

button,
select {
  font: inherit;
}

button:focus-visible,
select:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 4px;
}

.shell {
  width: min(860px, calc(100% - 32px));
  margin-inline: auto;
}

.particle-canvas {
  position: fixed;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.92;
}

.topbar,
main,
.site-footer {
  position: relative;
  z-index: 1;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  filter: blur(130px);
  pointer-events: none;
  opacity: 0.16;
}

.ambient-one {
  top: -220px;
  right: -100px;
  background: #22bcd0;
}

.ambient-two {
  top: 42%;
  left: -340px;
  background: #9f672a;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: min(860px, calc(100% - 32px));
  min-height: 70px;
  margin-inline: auto;
  border-bottom: 1px solid var(--border);
}

.studio-brand {
  display: inline-flex;
  align-items: center;
  color: var(--foreground);
  text-decoration: none;
}

.brand-copy {
  display: grid;
  gap: 2px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.13em;
}

.brand-copy b {
  color: var(--muted);
  font-size: 0.56rem;
  font-weight: 500;
  letter-spacing: 0.16em;
}

.data-status {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.12em;
}

.status-pulse {
  width: 8px;
  height: 8px;
  background: #ffc857;
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgb(255 200 87 / 10%);
}

.data-status.is-ready .status-pulse {
  background: var(--lime);
  background: #91e27f;
  box-shadow: 0 0 0 5px rgb(145 226 127 / 10%), 0 0 16px rgb(145 226 127 / 28%);
}

.data-status.is-error .status-pulse {
  background: var(--danger);
  box-shadow: 0 0 0 5px rgb(255 107 112 / 12%);
}

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 34px;
  align-items: end;
  padding-block: 66px 54px;
}

.overline,
.section-code {
  margin: 0;
  color: var(--lime);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.16em;
}

.hero h1 {
  --title-color: #eee8dc;
  display: grid;
  margin: 16px 0 0;
  font-size: clamp(2.45rem, 9vw, 4rem);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: 0;
}

.hero-title-line {
  display: flex;
  flex-wrap: wrap;
}

.hero-title-primary {
  column-gap: 0.27em;
  font-size: 1em;
  line-height: 0.92;
}

.hero-title-word {
  display: inline-flex;
  white-space: nowrap;
}

.hero-title-char {
  display: inline-block;
  margin-right: 0.01em;
  color: var(--title-color);
  -webkit-text-stroke: 0.012em transparent;
  animation: title-glyph-orbit 12s linear infinite;
  animation-delay: calc(-8.4s + var(--title-delay, 0ms));
  paint-order: stroke fill;
}

.hero-title-word .hero-title-char:last-child {
  margin-right: 0;
}

.hero-title-studio {
  display: flex;
  gap: 0.16em;
  align-items: flex-end;
  color: var(--title-color);
  font-weight: inherit;
}

@keyframes title-glyph-orbit {
  0%,
  69.5%,
  73.5%,
  100% {
    color: var(--title-color);
    -webkit-text-stroke-color: transparent;
    filter: brightness(1);
    text-shadow: 0 0 0 transparent;
  }

  70% {
    color: #fff;
    -webkit-text-stroke-color: rgb(190 250 255 / 92%);
    filter: brightness(1.28);
    text-shadow: -0.07em 0 0.16em rgb(44 216 239 / 95%), 0 0 0.28em rgb(44 216 239 / 48%);
  }

  70.8% {
    color: #fff;
    -webkit-text-stroke-color: rgb(224 254 255 / 100%);
    filter: brightness(1.34);
    text-shadow: 0 -0.07em 0.16em rgb(44 216 239 / 100%), 0 0 0.34em rgb(44 216 239 / 58%);
  }

  71.6% {
    color: #fff;
    -webkit-text-stroke-color: rgb(190 250 255 / 92%);
    filter: brightness(1.28);
    text-shadow: 0.07em 0 0.16em rgb(44 216 239 / 95%), 0 0 0.28em rgb(44 216 239 / 48%);
  }

  72.4% {
    color: #fff;
    -webkit-text-stroke-color: rgb(185 249 255 / 88%);
    filter: brightness(1.22);
    text-shadow: 0 0.07em 0.16em rgb(44 216 239 / 88%), 0 0 0.24em rgb(44 216 239 / 42%);
  }

  73% {
    color: var(--title-color);
    -webkit-text-stroke-color: rgb(146 237 247 / 34%);
    filter: brightness(1.08);
    text-shadow: 0 0 0.18em rgb(44 216 239 / 34%);
  }
}

.hero-version {
  margin-bottom: 0.35em;
  color: #ffc768;
  font-size: 0.28em;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  text-shadow: 0 0 12px rgb(255 199 104 / 28%);
}

.hero-data-status {
  margin-top: 18px;
}

.hero-lead {
  max-width: 660px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.7;
}

.hero-stats {
  display: grid;
  margin: 0;
  border-top: 1px solid var(--border-strong);
}

.hero-stats div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: baseline;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}

.hero-stats dt {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
}

.hero-stats dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.latest-results {
  padding-bottom: 52px;
}

.latest-heading {
  margin-bottom: 16px;
}

.latest-draw-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.latest-draw-card {
  position: relative;
  overflow: hidden;
  padding: 19px 21px 21px;
  background:
    linear-gradient(rgb(255 239 206 / 3.5%), transparent 42%),
    linear-gradient(135deg, rgb(255 255 255 / 7%), rgb(255 255 255 / 1.5%)),
    repeating-linear-gradient(
      90deg,
      rgb(255 255 255 / 2%) 0,
      rgb(255 255 255 / 2%) 1px,
      transparent 1px,
      transparent 7px
    ),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 5%),
    0 0 22px rgb(44 216 239 / 5%),
    0 18px 44px rgb(0 0 0 / 24%);
}

.latest-draw-card.is-latest {
  border-color: rgb(242 184 75 / 32%);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 6%),
    0 0 26px rgb(242 184 75 / 14%),
    0 18px 60px rgb(86 52 14 / 20%);
}

.latest-draw-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: linear-gradient(transparent, var(--lime), transparent);
  content: "";
  opacity: 0.7;
}

.latest-draw-head {
  display: flex;
  gap: 20px;
  align-items: end;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.latest-draw-head > div {
  display: grid;
  gap: 5px;
}

.latest-draw-head span {
  color: var(--lime);
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.latest-draw-head strong {
  font-size: 1.1rem;
  font-weight: 700;
}

.latest-draw-head time {
  color: var(--muted);
  font-size: 0.67rem;
  font-variant-numeric: tabular-nums;
}

.latest-draw-numbers {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 16px;
}

.result-ball {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: #1c160c;
  background: linear-gradient(145deg, #fff1c7, #d89a38);
  border: 1px solid rgb(255 231 175 / 58%);
  border-radius: 50%;
  font-size: 0.78rem;
  font-weight: 800;
  box-shadow:
    inset 0 1px 1px rgb(255 255 255 / 70%),
    inset 0 -5px 10px rgb(117 65 14 / 22%),
    0 0 14px rgb(242 184 75 / 20%),
    0 5px 16px rgb(0 0 0 / 28%);
}

.bonus-divider {
  width: 1px;
  height: 32px;
  margin-inline: 2px;
  background: var(--border-strong);
}

.result-bonus-wrap {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  white-space: nowrap;
}

.result-bonus-wrap small {
  color: var(--muted);
  font-size: 0.45rem;
  font-weight: 700;
  letter-spacing: 0.09em;
}

.result-ball.result-bonus {
  color: var(--foreground);
  background: linear-gradient(145deg, #41443f, #171919);
  border-color: rgb(242 184 75 / 45%);
  box-shadow:
    inset 0 1px 1px rgb(255 255 255 / 12%),
    0 0 18px rgb(242 184 75 / 12%);
}

.workspace {
  padding-bottom: 70px;
}

.primary-analysis-frame {
  position: relative;
  padding: 24px 26px 28px;
  overflow: hidden;
  background:
    linear-gradient(rgb(44 216 239 / 4%), transparent 38%),
    repeating-linear-gradient(
      90deg,
      rgb(255 255 255 / 2%) 0,
      rgb(255 255 255 / 2%) 1px,
      transparent 1px,
      transparent 7px
    ),
    #111719;
  border: 1px solid rgb(151 221 226 / 34%);
  border-radius: 11px;
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 4%),
    inset 0 0 34px rgb(44 216 239 / 3%),
    0 0 34px rgb(44 216 239 / 9%),
    0 18px 44px rgb(0 0 0 / 28%);
}

.primary-analysis-frame::after {
  position: absolute;
  right: 12%;
  bottom: -2px;
  left: 12%;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--electric-teal), transparent);
  border-radius: 50%;
  box-shadow: 0 0 17px rgb(36 201 195 / 58%);
  content: "";
  pointer-events: none;
}

.primary-analysis-frame .latest-results {
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

.analysis-toolbar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  align-items: center;
  padding: 19px 22px;
  background:
    linear-gradient(rgb(255 239 206 / 3.5%), transparent 42%),
    linear-gradient(135deg, rgb(255 255 255 / 8%), rgb(255 255 255 / 2%)),
    repeating-linear-gradient(
      90deg,
      rgb(255 255 255 / 2%) 0,
      rgb(255 255 255 / 2%) 1px,
      transparent 1px,
      transparent 7px
    ),
    var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 7%),
    0 0 28px rgb(44 216 239 / 6%),
    0 24px 72px rgb(0 0 0 / 28%);
}

.analysis-toolbar h2,
.section-heading h2 {
  margin: 7px 0 0;
  font-size: clamp(1.3rem, 2.1vw, 1.85rem);
  font-weight: 650;
  letter-spacing: -0.045em;
  text-shadow: 0 0 24px rgb(255 255 255 / 8%);
}

.select-field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
}

.select-field select {
  min-width: 158px;
  padding: 9px 38px 9px 12px;
  color: var(--foreground);
  background: var(--surface-soft);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 650;
  cursor: pointer;
}

.range-summary {
  margin: 0;
  padding: 14px 0 0;
  color: var(--muted);
  border-top: 1px solid var(--border);
  border-left: 0;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  line-height: 1.7;
  font-variant-numeric: tabular-nums;
}

.loading-state,
.error-state {
  display: flex;
  min-height: 360px;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.loading-state {
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.loader {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--lime);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.error-state {
  flex-direction: column;
  text-align: center;
}

.error-state p {
  margin: 4px 0;
}

.error-state button {
  margin-top: 20px;
  padding: 10px 18px;
  color: var(--background);
  background: var(--lime);
  border: 0;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.analysis-section,
.drought-section,
.prediction-section,
.history-section {
  padding-top: 54px;
}

.section-heading {
  display: flex;
  gap: 16px;
  align-items: stretch;
  flex-direction: column;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-heading > p {
  max-width: 470px;
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.7;
  text-align: left;
}

.view-toggle {
  display: inline-flex;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
}

.view-toggle button {
  padding: 7px 12px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.view-toggle button[aria-pressed="true"] {
  color: #041417;
  background: linear-gradient(135deg, var(--electric-cyan), var(--signal-green));
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 48%), 0 6px 20px rgb(44 216 239 / 18%);
}

.analysis-section {
  position: relative;
  margin-top: 50px;
  padding: 24px 26px 26px;
  background:
    linear-gradient(rgb(44 216 239 / 4%), transparent 38%),
    repeating-linear-gradient(
      90deg,
      rgb(255 255 255 / 2%) 0,
      rgb(255 255 255 / 2%) 1px,
      transparent 1px,
      transparent 7px
    ),
    #111719;
  border: 1px solid rgb(151 221 226 / 34%);
  border-radius: 11px;
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 4%),
    inset 0 0 34px rgb(44 216 239 / 3%),
    0 0 34px rgb(44 216 239 / 9%),
    0 18px 44px rgb(0 0 0 / 28%);
}

.analysis-section::after,
.drought-section::after,
.pair-section::after,
.triple-section::after {
  position: absolute;
  right: 12%;
  bottom: -2px;
  left: 12%;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--electric-teal), transparent);
  border-radius: 50%;
  box-shadow: 0 0 17px rgb(36 201 195 / 58%);
  content: "";
  pointer-events: none;
}

.primary-analysis-frame .analysis-toolbar {
  gap: 0;
  margin-top: 26px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.primary-analysis-frame .analysis-section {
  margin-top: 24px;
  padding: 24px 0 0;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  box-shadow: none;
}

.primary-analysis-frame .analysis-section::after {
  display: none;
}

.frequency-heading-main {
  display: grid;
}

.frequency-select {
  width: min(100%, 230px);
  margin-top: 14px;
}

.frequency-select select {
  width: 100%;
}

.primary-analysis-frame .range-summary {
  margin: -4px 0 14px;
}

.analysis-section .section-code,
.drought-section .section-code,
.pair-section .section-code,
.triple-section .section-code {
  color: var(--electric-cyan);
}

.series-legend {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.7rem;
}

.series-legend span {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.series-legend i {
  width: 18px;
  height: 4px;
  border-radius: 99px;
}

.legend-main {
  background: linear-gradient(90deg, var(--electric-cyan), var(--electric-teal));
  box-shadow: 0 0 10px rgb(44 216 239 / 45%);
}

.legend-bonus {
  background: var(--signal-green);
  box-shadow: 0 0 10px rgb(121 226 167 / 38%);
}

.series-legend small {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.6rem;
}

.dual-bar-chart,
.drought-chart {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dual-bar-chart.is-all {
  grid-template-columns: 1fr;
  column-gap: 24px;
}

.dual-bar-row {
  display: grid;
  grid-template-columns: 28px 44px minmax(120px, 1fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 5px 0;
  border-bottom: 1px solid rgb(255 255 255 / 5%);
}

.chart-rank {
  color: #5e6677;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-variant-numeric: tabular-nums;
}

.number-ball {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: #1c160c;
  background: linear-gradient(145deg, #fff1c7, #d89a38);
  border: 1px solid rgb(255 231 175 / 58%);
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 750;
  box-shadow:
    inset 0 1px 1px rgb(255 255 255 / 70%),
    inset 0 -5px 10px rgb(117 65 14 / 22%),
    0 0 16px rgb(242 184 75 / 23%),
    0 5px 16px rgb(0 0 0 / 28%);
}

.dual-series {
  display: grid;
  gap: 6px;
}

.series-line {
  display: grid;
  grid-template-columns: 14px minmax(80px, 1fr) 30px;
  gap: 8px;
  align-items: center;
}

.series-code {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.54rem;
}

.series-track {
  position: relative;
  height: 21px;
  overflow: hidden;
  background: rgb(255 255 255 / 6%);
  border-radius: 99px;
}

.series-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--bar-width, 0%);
  background: linear-gradient(90deg, #168fb9, var(--electric-cyan) 62%, var(--electric-teal));
  border-radius: inherit;
  box-shadow: 0 0 12px rgb(44 216 239 / 54%), 0 0 28px rgb(44 216 239 / 24%);
  transition: width 380ms cubic-bezier(0.22, 1, 0.36, 1);
}

.series-fill::after {
  position: absolute;
  top: 50%;
  right: 0;
  width: 13px;
  height: 13px;
  background: #d9fcff;
  border: 2px solid #168fb9;
  border-radius: 50%;
  box-shadow: 0 0 12px rgb(44 216 239 / 68%);
  content: "";
  transform: translate(1px, -50%);
}

.series-bonus .series-track {
  height: 5px;
}

.series-bonus .series-fill {
  background: linear-gradient(90deg, #299b87, #52d5ac 72%, var(--signal-green));
  box-shadow: 0 0 13px rgb(121 226 167 / 25%);
}

.series-bonus .series-fill::after {
  width: 7px;
  height: 7px;
  background: #e4fff0;
  border-color: #268f7b;
  box-shadow: 0 0 10px rgb(121 226 167 / 48%);
}

.dual-bar-row:hover .number-ball {
  border-color: rgb(255 235 184 / 82%);
  box-shadow:
    inset 0 1px 1px rgb(255 255 255 / 76%),
    inset 0 -5px 10px rgb(117 65 14 / 22%),
    0 0 24px rgb(242 184 75 / 44%);
}

.series-line strong {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 650;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.drought-section,
.pair-section,
.triple-section {
  position: relative;
  margin-top: 36px;
  padding: 25px 28px 28px;
  background:
    linear-gradient(rgb(121 226 167 / 4%), transparent 42%),
    repeating-linear-gradient(
      90deg,
      rgb(255 255 255 / 2%) 0,
      rgb(255 255 255 / 2%) 1px,
      transparent 1px,
      transparent 7px
    ),
    radial-gradient(circle at 95% 10%, rgb(44 216 239 / 9%), transparent 32%),
    #111719;
  border: 1px solid rgb(151 221 226 / 30%);
  border-radius: 11px;
  box-shadow:
    inset 0 0 32px rgb(121 226 167 / 3%),
    0 0 30px rgb(36 201 195 / 8%),
    0 18px 44px rgb(0 0 0 / 26%);
}

.ranking-disclosure > summary {
  list-style: none;
}

.ranking-disclosure > summary::-webkit-details-marker {
  display: none;
}

.ranking-summary {
  position: relative;
  min-height: 48px;
  margin-bottom: 0;
  padding-right: 52px;
  cursor: pointer;
  transition: margin-bottom 280ms ease;
}

.ranking-summary::after {
  position: absolute;
  top: 50%;
  right: 2px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--electric-cyan);
  background: rgb(44 216 239 / 7%);
  border: 1px solid rgb(44 216 239 / 24%);
  border-radius: 50%;
  box-shadow: inset 0 0 12px rgb(44 216 239 / 6%), 0 0 16px rgb(44 216 239 / 8%);
  content: "+";
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 1;
  transform: translateY(-50%);
  transition:
    color 220ms ease,
    background 220ms ease,
    border-color 220ms ease,
    box-shadow 220ms ease,
    transform 320ms cubic-bezier(0.16, 1, 0.3, 1);
}

.ranking-summary:hover::after {
  color: #fff;
  background: rgb(44 216 239 / 13%);
  border-color: rgb(44 216 239 / 46%);
  box-shadow: inset 0 0 14px rgb(44 216 239 / 10%), 0 0 22px rgb(44 216 239 / 22%);
}

.ranking-disclosure[open] > .ranking-summary {
  margin-bottom: 20px;
}

.ranking-disclosure[open] > .ranking-summary::after {
  content: "−";
  transform: translateY(-50%) rotate(180deg);
}

.compact-heading > p {
  text-align: left;
}

.drought-chart {
  gap: 0;
}

.pair-chart,
.triple-chart {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.triple-row {
  display: grid;
  grid-template-columns: 32px 134px minmax(140px, 1fr) 52px;
  gap: 16px;
  align-items: center;
  min-height: 58px;
  border-top: 1px solid var(--border);
}

.triple-rank,
.triple-rate {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-variant-numeric: tabular-nums;
}

.triple-rank {
  color: var(--electric-cyan);
}

.triple-rate {
  text-align: right;
}

.triple-numbers {
  display: inline-flex;
  gap: 7px;
  align-items: center;
}

.triple-number {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
}

.triple-bar-wrap {
  display: grid;
  grid-template-columns: minmax(80px, 1fr) 48px;
  gap: 12px;
  align-items: center;
}

.triple-track {
  position: relative;
  height: 21px;
  overflow: hidden;
  background: rgb(255 255 255 / 6%);
  border-radius: 99px;
}

.triple-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--bar-width, 0%);
  background: linear-gradient(90deg, #177fa7, var(--electric-cyan) 65%, #d5b96f);
  border-radius: inherit;
  box-shadow: 0 0 12px rgb(44 216 239 / 52%), 0 0 28px rgb(44 216 239 / 22%);
  transition: width 380ms cubic-bezier(0.22, 1, 0.36, 1);
}

.triple-fill::after {
  position: absolute;
  top: 50%;
  right: 0;
  width: 13px;
  height: 13px;
  background: #fff1c8;
  border: 2px solid #b98737;
  border-radius: 50%;
  box-shadow: 0 0 13px rgb(242 184 75 / 64%);
  content: "";
  transform: translate(1px, -50%);
}

.triple-bar-wrap > strong {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-align: right;
}

.pair-row {
  display: grid;
  grid-template-columns: 32px 94px minmax(180px, 1fr) 52px;
  gap: 16px;
  align-items: center;
  min-height: 58px;
  border-top: 1px solid var(--border);
}

.pair-rank,
.pair-rate {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-variant-numeric: tabular-nums;
}

.pair-rank {
  color: var(--electric-cyan);
}

.pair-rate {
  text-align: right;
}

.pair-numbers {
  display: inline-flex;
  gap: 7px;
  align-items: center;
}

.pair-number {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
}

.pair-bar-wrap {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) 48px;
  gap: 12px;
  align-items: center;
}

.pair-track {
  position: relative;
  height: 21px;
  overflow: hidden;
  background: rgb(255 255 255 / 6%);
  border-radius: 99px;
}

.pair-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--bar-width, 0%);
  background: linear-gradient(90deg, #177fa7, var(--electric-cyan) 65%, #9ad48f);
  border-radius: inherit;
  box-shadow: 0 0 12px rgb(44 216 239 / 52%), 0 0 28px rgb(44 216 239 / 22%);
  transition: width 380ms cubic-bezier(0.22, 1, 0.36, 1);
}

.pair-fill::after {
  position: absolute;
  top: 50%;
  right: 0;
  width: 13px;
  height: 13px;
  background: #d9fcff;
  border: 2px solid #168fb9;
  border-radius: 50%;
  box-shadow: 0 0 12px rgb(44 216 239 / 68%);
  content: "";
  transform: translate(1px, -50%);
}

.pair-bar-wrap > strong {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-align: right;
}

.drought-row {
  display: grid;
  grid-template-columns: 92px minmax(180px, 1fr) 130px;
  gap: 22px;
  align-items: center;
  min-height: 57px;
  border-top: 1px solid var(--border);
}

.drought-meta {
  display: flex;
  gap: 14px;
  align-items: baseline;
}

.drought-meta small {
  color: var(--electric-cyan);
  font-family: var(--font-mono);
  font-size: 0.56rem;
}

.drought-meta strong {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 650;
}

.drought-bar-wrap {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) 52px;
  gap: 14px;
  align-items: center;
}

.drought-track {
  position: relative;
  height: 21px;
  overflow: hidden;
  background: rgb(255 255 255 / 6%);
  border-radius: 99px;
}

.drought-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--bar-width, 0%);
  background: linear-gradient(90deg, #147e9f, var(--electric-teal) 68%, var(--signal-green));
  border-radius: inherit;
  box-shadow: 0 0 12px rgb(44 216 239 / 52%), 0 0 28px rgb(44 216 239 / 24%);
  transition: width 380ms cubic-bezier(0.22, 1, 0.36, 1);
}

.drought-fill::after {
  position: absolute;
  top: 50%;
  right: 0;
  width: 13px;
  height: 13px;
  background: #e0fff1;
  border: 2px solid #278f7b;
  border-radius: 50%;
  box-shadow: 0 0 13px rgb(121 226 167 / 68%);
  content: "";
  transform: translate(1px, -50%);
}

html.reveal-enabled [data-reveal] {
  opacity: 0;
  filter: blur(8px) saturate(1.25);
  transform: scale(1.2);
  transform-origin: 50% 36%;
  transition:
    opacity 700ms ease,
    filter 900ms ease,
    transform 950ms cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, filter, transform;
}

html.reveal-enabled [data-reveal].is-visible {
  opacity: 1;
  filter: blur(0) saturate(1);
  transform: scale(1);
}

html.reveal-enabled [data-reveal] .series-fill,
html.reveal-enabled [data-reveal] .drought-fill,
html.reveal-enabled [data-reveal] .pair-fill,
html.reveal-enabled [data-reveal] .triple-fill {
  transform: scaleX(0);
  transform-origin: left center;
}

html.reveal-enabled [data-reveal].is-visible .series-fill,
html.reveal-enabled [data-reveal].is-visible .drought-fill,
html.reveal-enabled [data-reveal].is-visible .pair-fill,
html.reveal-enabled [data-reveal].is-visible .triple-fill {
  animation: chart-bar-grow 760ms cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: calc(120ms + var(--item-delay, 0ms));
}

html.reveal-enabled [data-reveal].is-visible .series-bonus .series-fill {
  animation-delay: calc(190ms + var(--item-delay, 0ms));
}

html.reveal-enabled [data-reveal] :is(
  .latest-heading,
  .section-heading,
  .latest-draw-card,
  .series-legend,
  .dual-bar-row,
  .drought-row,
  .pair-row,
  .triple-row,
  .frequency-heat-legend,
  .prediction-placeholder,
  .ticket,
  .model-note,
  tbody tr
) {
  opacity: 0;
  transform: translate3d(0, 18px, 0);
}

html.reveal-enabled [data-reveal].is-visible :is(
  .latest-heading,
  .section-heading,
  .latest-draw-card,
  .series-legend,
  .dual-bar-row,
  .drought-row,
  .pair-row,
  .triple-row,
  .frequency-heat-legend,
  .prediction-placeholder,
  .ticket,
  .model-note,
  tbody tr
) {
  animation: content-rise 620ms cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: calc(80ms + var(--item-delay, 0ms));
}

html.reveal-enabled [data-reveal].is-visible .ranking-disclosure:not([open]) :is(
  .drought-fill,
  .pair-fill,
  .triple-fill,
  .drought-row,
  .pair-row,
  .triple-row
) {
  animation: none;
}

@keyframes chart-bar-grow {
  0% {
    filter: brightness(0.72) saturate(0.8);
    transform: scaleX(0);
  }
  72% {
    filter: brightness(1.18) saturate(1.12);
  }
  100% {
    filter: brightness(1) saturate(1);
    transform: scaleX(1);
  }
}

@keyframes content-rise {
  0% {
    opacity: 0;
    transform: translate3d(0, 18px, 0) scale(0.985);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

.drought-bar-wrap > strong {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 650;
  text-align: right;
}

.last-seen {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  text-align: right;
}

.prediction-section {
  padding-top: 46px;
}

.prediction-heading {
  margin-bottom: 22px;
}

.prediction-heading-side {
  display: grid;
  gap: 12px;
  width: 100%;
}

.prediction-heading-side > p {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.7;
}

.prediction-settings {
  display: grid;
  grid-template-columns: minmax(170px, 0.78fr) minmax(0, 1.22fr);
  gap: 10px;
}

.prediction-range,
.prediction-locks {
  display: grid;
  gap: 9px;
  padding: 12px 14px;
  background: rgb(255 255 255 / 3%);
  border: 1px solid var(--border);
  border-radius: 7px;
}

.prediction-range > span,
.prediction-locks > span {
  color: var(--foreground);
  font-size: 0.68rem;
  font-weight: 700;
}

.prediction-range > span small,
.prediction-locks > span small {
  margin-left: 5px;
  color: var(--muted);
  font-size: 0.56rem;
  font-weight: 500;
}

.prediction-range select {
  width: 100%;
  min-width: 0;
  padding: 8px 28px 8px 9px;
  color: var(--foreground);
  background: var(--surface-soft);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  font-size: 0.7rem;
  cursor: pointer;
}

.fixed-number-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.fixed-number-fields label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.58rem;
}

.fixed-number-fields select {
  width: 100%;
  min-width: 0;
  padding: 8px 28px 8px 9px;
  color: var(--foreground);
  background: var(--surface-soft);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.35;
  cursor: pointer;
}

.prediction-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
  justify-content: flex-start;
}

.prediction-navigation {
  display: inline-flex;
  gap: 5px;
}

.predict-button,
.history-button {
  min-height: 40px;
  padding: 9px 16px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
}

.prediction-navigation .history-button {
  width: 40px;
  min-width: 40px;
  padding-inline: 0;
  font-family: var(--font-mono);
  font-size: 0.68rem;
}

.predict-button {
  min-width: 132px;
  color: #1a1308;
  background: linear-gradient(#f8d482, #cf8f32);
  border: 1px solid #f3c566;
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 55%),
    0 7px 24px rgb(210 141 55 / 20%);
}

.predict-button:hover {
  background: linear-gradient(#ffe1a0, #dc9b3c);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 62%),
    0 9px 30px rgb(210 141 55 / 28%);
}

.history-button {
  color: var(--foreground);
  background: linear-gradient(#242727, #111313);
  border: 1px solid rgb(242 184 75 / 25%);
}

.history-button:disabled {
  color: #5f5f5a;
  border-color: var(--border);
  cursor: not-allowed;
  opacity: 0.55;
}

#prediction-position {
  min-width: 48px;
  color: var(--muted);
  font-size: 0.58rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.prediction-placeholder {
  grid-column: 1 / -1;
  display: grid;
  min-height: 170px;
  place-content: center;
  justify-items: center;
  padding: 26px;
  background:
    radial-gradient(circle at 50% 30%, rgb(210 141 55 / 10%), transparent 48%),
    repeating-linear-gradient(
      90deg,
      rgb(255 255 255 / 2%) 0,
      rgb(255 255 255 / 2%) 1px,
      transparent 1px,
      transparent 7px
    ),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: inset 0 0 32px rgb(242 184 75 / 4%), 0 0 24px rgb(242 184 75 / 6%);
  text-align: center;
}

.prediction-signal {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  margin-bottom: 13px;
  color: #98d687;
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.prediction-signal::before {
  width: 7px;
  height: 7px;
  background: #98d687;
  border-radius: 50%;
  box-shadow: 0 0 12px rgb(152 214 135 / 45%);
  content: "";
}

.prediction-placeholder strong {
  font-size: clamp(1.1rem, 2vw, 1.55rem);
}

.prediction-placeholder p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.tickets-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.ticket {
  --ticket-accent: var(--lime);
  position: relative;
  min-width: 0;
  overflow: hidden;
  padding: 21px;
  background:
    linear-gradient(rgb(255 239 206 / 3.5%), transparent 42%),
    linear-gradient(135deg, color-mix(in srgb, var(--ticket-accent) 8%, transparent), transparent 42%),
    repeating-linear-gradient(
      90deg,
      rgb(255 255 255 / 2%) 0,
      rgb(255 255 255 / 2%) 1px,
      transparent 1px,
      transparent 7px
    ),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow:
    inset 0 0 28px color-mix(in srgb, var(--ticket-accent) 3%, transparent),
    0 0 24px color-mix(in srgb, var(--ticket-accent) 9%, transparent),
    0 14px 34px rgb(0 0 0 / 23%);
}

.ticket::after {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--ticket-accent), transparent 70%);
  content: "";
}

.ticket-thompson {
  --ticket-accent: #98d687;
}

.ticket-reversion {
  --ticket-accent: #d99549;
}

.ticket-ensemble {
  --ticket-accent: #e7c98f;
}

.model-index {
  color: var(--ticket-accent);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
}

.ticket h3 {
  margin: 6px 0 0;
  font-size: 1.1rem;
  font-weight: 650;
}

.ticket-head p {
  min-height: 2.8em;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.6;
}

.ticket-numbers {
  display: flex;
  gap: 9px;
  justify-content: flex-start;
  margin-top: 18px;
}

.ticket-ball {
  display: grid;
  width: clamp(50px, 8vw, 58px);
  aspect-ratio: 1;
  place-items: center;
  color: var(--foreground);
  background: var(--surface-raised);
  border: 1px solid color-mix(in srgb, var(--ticket-accent) 48%, transparent);
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: clamp(0.86rem, 2vw, 1rem);
  font-weight: 750;
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 10%),
    inset 0 0 15px color-mix(in srgb, var(--ticket-accent) 8%, transparent);
}

.ticket-ball.is-arriving {
  animation:
    ball-arrival 720ms cubic-bezier(0.16, 1, 0.3, 1) var(--arrival-delay) both,
    ball-settle-glow 940ms ease-out calc(var(--arrival-delay) + 610ms) both;
}

.ticket-ball.is-fixed {
  border-color: rgb(255 220 143 / 88%);
  outline: 2px solid rgb(242 184 75 / 58%);
  outline-offset: 2px;
  box-shadow:
    inset 0 1px 1px rgb(255 255 255 / 34%),
    inset 0 -4px 8px rgb(0 0 0 / 24%),
    0 0 0 2px rgb(242 184 75 / 22%),
    0 0 22px rgb(242 184 75 / 55%);
}

@keyframes ball-arrival {
  0% {
    opacity: 0;
    transform: translateX(110px) scale(0.72) rotate(18deg);
  }
  72% {
    opacity: 1;
    transform: translateX(-7px) scale(1.06) rotate(-2deg);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1) rotate(0);
  }
}

@keyframes ball-settle-glow {
  0% {
    box-shadow: 0 0 0 0 hsl(var(--heat-hue, 42) 80% 52% / 0%);
  }
  38% {
    color: #fff;
    box-shadow:
      0 0 0 2px hsl(var(--heat-hue, 42) 82% 58% / 58%),
      0 0 34px hsl(var(--heat-hue, 42) 82% 54% / 72%),
      inset 0 0 18px hsl(var(--heat-hue, 42) 82% 58% / 25%);
  }
  100% {
    box-shadow:
      inset 0 1px 1px rgb(255 255 255 / 24%),
      inset 0 -4px 8px rgb(0 0 0 / 24%),
      0 0 var(--heat-glow, 12px) hsl(var(--heat-hue, 42) 78% 52% / 46%);
  }
}

.method-tags {
  display: flex;
  gap: 7px;
  margin-top: 17px;
}

.method-tags span {
  padding: 6px 8px;
  color: var(--muted);
  background: rgb(255 255 255 / 4%);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.54rem;
  letter-spacing: 0.05em;
}

.model-note {
  margin-top: 18px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 7px;
}

.model-note summary {
  padding: 13px 17px;
  color: var(--muted);
  font-size: 0.72rem;
  cursor: pointer;
}

.model-note > div {
  display: grid;
  gap: 10px;
  padding: 0 17px 16px;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

.model-note p {
  margin: 12px 0 0;
  font-size: 0.7rem;
  line-height: 1.8;
}

.model-note strong {
  color: var(--foreground);
  font-family: var(--font-mono);
  white-space: nowrap;
}

.model-note .prediction-warning {
  color: var(--foreground);
  font-family: var(--font-sans);
  font-weight: 800;
  white-space: normal;
}

.model-note .service-notice {
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.model-note .service-notice strong {
  display: inline-block;
  margin-bottom: 4px;
  color: var(--lime);
  font-family: var(--font-sans);
  font-weight: 700;
  white-space: normal;
}

.history-section {
  padding-top: 46px;
}

.history-heading {
  align-items: stretch;
}

.compact-select select {
  min-width: 140px;
}

.frequency-heat-legend {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.58rem;
}

.prediction-heat-legend {
  margin: -8px 0 14px;
}

.history-heat-legend {
  margin: -6px 0 13px;
}

.frequency-heat-legend > span:first-child {
  margin-right: 5px;
}

.frequency-heat-legend small {
  font-size: inherit;
}

.frequency-heat-gradient {
  width: min(180px, 24vw);
  height: 7px;
  background: linear-gradient(90deg, #123f93, #2a9fc5 33%, #e2b54e 68%, #a91f27);
  border: 1px solid rgb(255 255 255 / 15%);
  border-radius: 99px;
  box-shadow: 0 0 16px rgb(44 216 239 / 18%), 0 0 16px rgb(228 72 67 / 14%);
}

.history-bonus-key {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  margin-left: 12px;
}

.history-bonus-key i {
  width: 13px;
  height: 13px;
  background: linear-gradient(145deg, #fff0bd, #c28229);
  border: 1px solid rgb(255 231 175 / 66%);
  border-radius: 50%;
  box-shadow: 0 0 12px rgb(242 184 75 / 34%);
}

.table-wrap {
  overflow-x: auto;
  border-top: 1px solid var(--border-strong);
}

.draw-table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
}

.draw-table th,
.draw-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.draw-table thead th {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.draw-table tbody th {
  color: var(--foreground);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 650;
  white-space: nowrap;
}

.draw-table tbody td {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
}

.table-numbers {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.table-bonus-divider {
  width: 1px;
  height: 29px;
  margin-inline: 5px 3px;
  background: rgb(255 255 255 / 24%);
}

.table-numbers > span:not(.table-bonus-divider),
.table-bonus {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--foreground);
  background: #172023;
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 50%;
  font-size: 0.72rem;
}

.table-bonus {
  position: relative;
  color: #1c160c;
  background: linear-gradient(145deg, #fff0bd, #c28229);
  border: 1px solid rgb(255 231 175 / 66%);
  box-shadow:
    inset 0 1px 1px rgb(255 255 255 / 68%),
    inset 0 -4px 8px rgb(117 65 14 / 24%),
    0 0 15px rgb(242 184 75 / 30%);
}

.frequency-heat-ball {
  color: #fff;
  background: var(--heat-background, linear-gradient(145deg, #3186dc, #123b88));
  border-color: var(--heat-border, #6db8ff);
  box-shadow:
    inset 0 1px 1px rgb(255 255 255 / 24%),
    inset 0 -4px 8px rgb(0 0 0 / 24%),
    0 0 var(--heat-glow, 12px) var(--heat-shadow, rgb(49 134 220 / 55%));
  text-shadow: 0 1px 2px rgb(0 0 0 / 42%);
}

.pwa-install-section {
  position: relative;
  z-index: 1;
  display: none;
  margin-top: 34px;
  margin-bottom: 30px;
}

.pwa-install-card {
  position: relative;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 16px;
  padding: 20px;
  overflow: hidden;
  background:
    radial-gradient(circle at 92% 8%, rgb(44 216 239 / 20%), transparent 150px),
    linear-gradient(145deg, rgb(9 30 43 / 96%), rgb(3 10 20 / 98%));
  border: 1px solid rgb(108 226 241 / 25%);
  border-radius: 16px;
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 7%),
    0 0 0 1px rgb(0 0 0 / 40%),
    0 18px 55px rgb(0 0 0 / 35%),
    0 0 35px rgb(44 216 239 / 8%);
}

.pwa-install-card::after {
  position: absolute;
  top: -76px;
  right: -76px;
  width: 180px;
  height: 180px;
  border: 1px solid rgb(44 216 239 / 13%);
  border-radius: 50%;
  box-shadow: 0 0 28px rgb(44 216 239 / 8%);
  content: "";
  pointer-events: none;
}

.pwa-install-icon {
  position: relative;
  z-index: 1;
  width: 72px;
  height: 72px;
  border: 1px solid rgb(136 232 245 / 28%);
  border-radius: 17px;
  box-shadow: 0 0 22px rgb(44 216 239 / 20%);
}

.pwa-install-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.pwa-install-copy h2 {
  margin: 5px 0 6px;
  color: var(--foreground);
  font-size: 1.14rem;
  line-height: 1.2;
}

.pwa-install-copy > p:not(.section-code) {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.65;
}

.pwa-current-guide:not(:empty) {
  margin-top: 8px !important;
  color: #bcecf2 !important;
}

.pwa-install-button {
  position: relative;
  z-index: 1;
  grid-column: 1 / -1;
  min-height: 48px;
  color: #061116;
  background: linear-gradient(105deg, #aeeef1, #f5c66b 82%);
  border: 0;
  border-radius: 11px;
  box-shadow: 0 8px 28px rgb(44 216 239 / 18%);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  transition: filter 180ms ease, transform 180ms ease;
}

.pwa-install-button:active {
  filter: brightness(1.12);
  transform: translateY(1px);
}

.pwa-browser-guide {
  position: relative;
  z-index: 1;
  grid-column: 1 / -1;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

.pwa-browser-guide summary {
  padding: 15px 2px 2px;
  color: #c8e2e8;
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.pwa-browser-guide ul {
  display: grid;
  gap: 8px;
  padding: 10px 0 0;
  margin: 0;
  list-style: none;
}

.pwa-browser-guide li {
  padding: 10px 11px;
  background: rgb(3 13 22 / 68%);
  border: 1px solid rgb(105 204 220 / 10%);
  border-radius: 9px;
  font-size: 0.67rem;
  line-height: 1.65;
}

.pwa-browser-guide li strong {
  display: block;
  margin-bottom: 2px;
  color: #c7dde3;
  font-size: 0.69rem;
}

.pwa-browser-guide li.is-current {
  color: #d9f7fb;
  background: linear-gradient(100deg, rgb(44 216 239 / 12%), rgb(242 184 75 / 7%));
  border-color: rgb(92 220 238 / 28%);
  box-shadow: inset 3px 0 0 var(--electric-cyan);
}

.pwa-browser-guide li.is-current strong {
  color: #fff;
}

.pwa-browser-note {
  padding: 11px;
  margin: 10px 0 0;
  color: #c9d7dd;
  background: rgb(242 184 75 / 8%);
  border-left: 2px solid var(--lime);
  border-radius: 0 8px 8px 0;
  font-size: 0.65rem;
  line-height: 1.7;
}

.pwa-dismiss-button {
  position: relative;
  z-index: 1;
  grid-column: 1 / -1;
  justify-self: center;
  padding: 4px 12px;
  color: #78909a;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 0.62rem;
}

.site-footer {
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  padding-block: 24px;
}

.footer-inner p {
  margin: 0;
  color: #5f6675;
  font-family: var(--font-mono);
  font-size: 0.56rem;
  letter-spacing: 0.11em;
}

.footer-copyright {
  color: #8aa7b2 !important;
}

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

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .hero-stats {
    max-width: 560px;
  }

  .analysis-toolbar {
    grid-template-columns: 1fr;
  }

  .range-summary {
    grid-column: 1 / -1;
    padding: 18px 0 0;
    border-top: 1px solid var(--border);
    border-left: 0;
  }

  .dual-bar-chart.is-all {
    grid-template-columns: 1fr;
  }

  .drought-section,
  .pair-section,
  .triple-section {
    padding-inline: 32px;
  }
}

@media (max-width: 680px) {
  .pwa-install-section {
    display: block;
  }

  .shell,
  .topbar {
    width: min(100% - 20px, 860px);
  }

  .topbar {
    min-height: 72px;
  }

  .brand-copy {
    font-size: 0.65rem;
  }

  .data-status {
    font-size: 0.54rem;
  }

  .hero {
    gap: 34px;
    padding-block: 48px 42px;
  }

  .hero h1 {
    font-size: clamp(2.45rem, 14vw, 4rem);
  }

  .hero-lead {
    font-size: 0.72rem;
  }

  .latest-results {
    padding-bottom: 40px;
  }

  .primary-analysis-frame {
    padding: 18px 16px 20px;
  }

  .primary-analysis-frame .latest-results {
    padding-bottom: 24px;
  }

  .latest-draw-grid {
    grid-template-columns: 1fr;
  }

  .latest-draw-card {
    padding: 17px 14px 18px;
  }

  .latest-draw-numbers {
    gap: 4px;
  }

  .result-ball {
    width: 35px;
    height: 35px;
  }

  .analysis-toolbar {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 17px 16px;
  }

  .select-field select {
    width: 100%;
  }

  .range-summary {
    grid-column: auto;
  }

  .prediction-section,
  .history-section {
    padding-top: 38px;
  }

  .analysis-section {
    margin-top: 38px;
    padding: 18px 16px 20px;
  }

  .primary-analysis-frame .analysis-section {
    margin-top: 20px;
    padding: 20px 0 0;
  }

  .section-heading,
  .prediction-heading,
  .history-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .section-heading > p,
  .compact-heading > p {
    text-align: left;
  }

  .view-toggle {
    align-self: flex-start;
  }

  .series-legend {
    flex-wrap: wrap;
  }

  .series-legend small {
    width: 100%;
    margin-left: 0;
  }

  .dual-bar-row {
    grid-template-columns: 22px 38px minmax(90px, 1fr);
    gap: 8px;
  }

  .number-ball {
    width: 35px;
    height: 35px;
  }

  .series-line {
    grid-template-columns: 12px minmax(50px, 1fr) 25px;
    gap: 6px;
  }

  .drought-section,
  .pair-section,
  .triple-section {
    margin-top: 30px;
    padding: 21px 16px 23px;
    border-radius: 11px;
  }

  .drought-row {
    grid-template-columns: 72px minmax(120px, 1fr);
    gap: 14px;
    padding: 9px 0;
  }

  .drought-meta {
    gap: 9px;
  }

  .last-seen {
    grid-column: 2;
    text-align: left;
  }

  .pair-row {
    grid-template-columns: 28px 82px minmax(100px, 1fr);
    gap: 10px;
    min-height: 56px;
  }

  .pair-number {
    width: 36px;
    height: 36px;
    font-size: 0.68rem;
  }

  .pair-rate {
    display: none;
  }

  .pair-bar-wrap {
    grid-template-columns: minmax(60px, 1fr) 42px;
    gap: 7px;
  }

  .triple-row {
    grid-template-columns: 28px 122px minmax(70px, 1fr);
    gap: 10px;
    min-height: 56px;
  }

  .triple-number {
    width: 36px;
    height: 36px;
    font-size: 0.68rem;
  }

  .triple-rate {
    display: none;
  }

  .triple-bar-wrap {
    grid-template-columns: minmax(30px, 1fr) 42px;
    gap: 7px;
  }

  .tickets-grid {
    grid-template-columns: 1fr;
  }

  .prediction-heading-side {
    width: 100%;
  }

  .prediction-settings {
    grid-template-columns: 1fr;
  }

  .prediction-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .fixed-number-fields {
    grid-template-columns: 1fr;
  }

  .predict-button {
    min-width: 124px;
  }

  .ticket {
    padding: 19px 16px;
  }

  .ticket-numbers {
    gap: 4px;
  }

  .ticket-ball {
    width: min(12.2vw, 48px);
  }

  .frequency-heat-legend {
    flex-wrap: wrap;
    justify-content: flex-start;
    margin-top: -2px;
  }

  .frequency-heat-legend > span:first-child {
    width: 100%;
  }

  .frequency-heat-gradient {
    width: min(190px, 56vw);
  }

  .history-bonus-key {
    width: auto;
    margin-left: 4px;
  }

  .footer-inner {
    gap: 8px;
    flex-direction: column;
  }
}

@media (display-mode: standalone) {
  .pwa-install-section {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
