:root {
  --bg: #111111;
  --panel: #1a1a1a;
  --panel-2: #202020;
  --line: #2a2a2a;
  --text: #ffffff;
  --muted: #b8b8b8;
  --orange: #ff9500;
  --orange-deep: #f57c00;
  --blue: #00a8ff;
  --green: #26d07c;
  --yellow: #ffd166;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 78% 12%, rgba(0, 168, 255, 0.15), transparent 28rem),
    radial-gradient(circle at 18% 18%, rgba(255, 149, 0, 0.18), transparent 24rem),
    linear-gradient(145deg, #070707 0%, #111 48%, #171717 100%);
}

button,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.splash {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.75rem;
  background: #080808;
  transition: opacity 420ms ease, visibility 420ms ease;
}

.splash.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.splash-mark {
  width: min(38vw, 12rem);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 2rem;
  background: radial-gradient(circle, rgba(255, 149, 0, 0.28), rgba(0, 168, 255, 0.08), transparent 70%);
  box-shadow: 0 0 80px rgba(255, 149, 0, 0.38);
}

.splash img {
  width: 74%;
  border-radius: 1.4rem;
}

.splash h1 {
  margin: 0;
  font-size: clamp(2.1rem, 8vw, 5rem);
  letter-spacing: 0;
  text-align: center;
}

.splash p,
.splash span {
  margin: 0;
  color: var(--muted);
  text-align: center;
}

.splash span {
  color: var(--blue);
  font-weight: 700;
}

.app-shell {
  display: grid;
  grid-template-columns: 17rem 1fr;
  min-height: 100vh;
}

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  border-right: 1px solid var(--line);
  background: rgba(12, 12, 12, 0.86);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text);
  font-weight: 900;
  text-decoration: none;
}

.brand img {
  width: 3.2rem;
  height: 3.2rem;
  object-fit: cover;
  border-radius: 0.9rem;
  box-shadow: 0 0 28px rgba(255, 149, 0, 0.28);
}

.rail-nav {
  display: grid;
  gap: 0.55rem;
}

.nav-item {
  min-height: 3.1rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0 0.85rem;
  border: 1px solid transparent;
  border-radius: 0.5rem;
  color: var(--muted);
  background: transparent;
  text-align: left;
}

.nav-item.active {
  color: var(--text);
  background: linear-gradient(135deg, rgba(255, 149, 0, 0.18), rgba(0, 168, 255, 0.1));
  border-color: rgba(255, 149, 0, 0.42);
}

.nav-icon {
  width: 1.75rem;
  height: 1.75rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #080808;
  background: var(--orange);
  font-size: 0.75rem;
  font-weight: 900;
}

.nav-item.active .nav-icon {
  background: var(--blue);
}

.rail-note {
  margin-top: auto;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.9rem;
}

.rail-note strong {
  display: inline-grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  margin-bottom: 0.65rem;
  border-radius: 50%;
  background: var(--orange);
  color: #050505;
}

main {
  min-width: 0;
  padding: 1.5rem clamp(1rem, 3vw, 2rem) 6rem;
}

.hero {
  min-height: min(720px, calc(100vh - 3rem));
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(19rem, 0.9fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.hero-copy {
  max-width: 46rem;
}

.eyebrow,
.section-kicker {
  margin: 0 0 0.55rem;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

.hero h1 {
  margin: 0;
  font-size: clamp(3rem, 7vw, 7.5rem);
  line-height: 0.94;
  letter-spacing: 0;
}

.hero p {
  max-width: 37rem;
  margin: 1.25rem 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 2rem;
}

.primary-action,
.secondary-action,
.text-button,
.view-button {
  min-height: 2.8rem;
  border: 0;
  border-radius: 0.5rem;
  font-weight: 900;
}

.primary-action,
.view-button {
  padding: 0 1rem;
  color: #070707;
  background: linear-gradient(135deg, var(--orange), var(--yellow));
  box-shadow: 0 12px 30px rgba(255, 149, 0, 0.2);
}

.secondary-action,
.text-button {
  padding: 0 1rem;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line);
}

.text-button {
  color: var(--blue);
}

.hero-orbit {
  justify-self: center;
  width: min(100%, 34rem);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  position: relative;
}

.hero-orbit::before {
  content: "";
  position: absolute;
  inset: 4%;
  border-radius: 50%;
  background: conic-gradient(from 220deg, var(--orange), var(--yellow), #fff, var(--orange));
  filter: drop-shadow(0 0 34px rgba(255, 149, 0, 0.35));
}

.hero-orbit img {
  position: relative;
  width: 82%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 22%;
  box-shadow: var(--shadow);
}

.dashboard,
.content-panel {
  padding-top: 2rem;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-head.left {
  justify-content: flex-start;
}

.section-head.compact {
  margin-top: 2rem;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.6rem);
  letter-spacing: 0;
}

.next-draw-pill {
  min-width: 15rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(0, 168, 255, 0.35);
  border-radius: 0.5rem;
  background: rgba(0, 168, 255, 0.08);
}

.next-draw-pill span,
.next-draw-pill em {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  font-style: normal;
}

.next-draw-pill strong {
  display: block;
  margin: 0.15rem 0;
}

.next-draw-pill em {
  color: var(--blue);
  font-size: 1.15rem;
  font-weight: 900;
}

.draw-grid,
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: 1rem;
}

.draw-card,
.game-card,
.result-card,
.history-row,
.settings-card,
.about-card,
.calendar-day {
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01)), var(--panel);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.22);
}

.draw-card,
.game-card,
.result-card,
.history-row,
.calendar-day {
  padding: 1rem;
}

.draw-card {
  position: relative;
  overflow: hidden;
}

.draw-card::before,
.game-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 0.18rem;
  background: linear-gradient(90deg, var(--orange), var(--blue));
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}

.card-top h3 {
  margin: 0 0 0.4rem;
  font-size: 1.15rem;
}

.meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 1.7rem;
  padding: 0 0.55rem;
  border-radius: 999px;
  color: #06130d;
  background: var(--green);
  font-size: 0.74rem;
  font-weight: 900;
  white-space: nowrap;
}

.status.pending {
  background: var(--yellow);
}

.status.upcoming {
  color: #07131b;
  background: var(--blue);
}

.card-stat {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin: 1rem 0;
}

.stat {
  min-height: 4.8rem;
  padding: 0.75rem;
  border-radius: 0.45rem;
  background: #121212;
  border: 1px solid var(--line);
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
}

.stat strong {
  display: block;
  margin-top: 0.25rem;
  font-size: 1.05rem;
}

.favorite {
  width: 2.3rem;
  height: 2.3rem;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: #111;
  font-size: 1.1rem;
}

.favorite.active {
  color: #050505;
  background: var(--orange);
  border-color: var(--orange);
}

.result-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: 1rem;
}

.numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 1rem 0;
}

.ball {
  width: 2.55rem;
  height: 2.55rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #050505;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.1) 26%, transparent 42%),
    linear-gradient(145deg, #ffd166, var(--orange) 54%, var(--orange-deep));
  border: 2px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 22px rgba(255, 149, 0, 0.28), inset 0 -0.35rem 0.7rem rgba(0, 0, 0, 0.22);
  font-weight: 900;
}

.ball-yellow {
  color: #050505;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.1) 26%, transparent 42%),
    linear-gradient(145deg, #ffe486, var(--yellow) 50%, #ffb000);
  box-shadow: 0 0 22px rgba(255, 209, 102, 0.3), inset 0 -0.35rem 0.7rem rgba(0, 0, 0, 0.2);
}

.ball-blue {
  color: var(--text);
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.14) 25%, transparent 42%),
    linear-gradient(145deg, var(--blue), #1265ff 56%, #08306b);
  box-shadow: 0 0 22px rgba(0, 168, 255, 0.32), inset 0 -0.35rem 0.7rem rgba(0, 0, 0, 0.28);
}

.ball-red {
  color: var(--text);
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.12) 25%, transparent 42%),
    linear-gradient(145deg, #ff6868, #e32626 56%, #7c0808);
  box-shadow: 0 0 22px rgba(255, 80, 80, 0.28), inset 0 -0.35rem 0.7rem rgba(0, 0, 0, 0.26);
}

.ball-green {
  color: #06130d;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.12) 25%, transparent 42%),
    linear-gradient(145deg, #6ff0b0, var(--green) 58%, #0b7642);
}

.ball-purple {
  color: var(--text);
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.12) 25%, transparent 42%),
    linear-gradient(145deg, #c992ff, #7c3cff 56%, #33106f);
  box-shadow: 0 0 22px rgba(124, 60, 255, 0.3), inset 0 -0.35rem 0.7rem rgba(0, 0, 0, 0.28);
}

.ball-teal {
  color: #031716;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.12) 25%, transparent 42%),
    linear-gradient(145deg, #72fff1, #12c8bd 56%, #04756f);
  box-shadow: 0 0 22px rgba(18, 200, 189, 0.3), inset 0 -0.35rem 0.7rem rgba(0, 0, 0, 0.22);
}

.ball-pink {
  color: var(--text);
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.12) 25%, transparent 42%),
    linear-gradient(145deg, #ff9bd5, #ff3f9a 56%, #9a064f);
  box-shadow: 0 0 22px rgba(255, 63, 154, 0.28), inset 0 -0.35rem 0.7rem rgba(0, 0, 0, 0.28);
}

.ball-orange {
  color: #050505;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.1) 26%, transparent 42%),
    linear-gradient(145deg, #ffd166, var(--orange) 54%, var(--orange-deep));
}

.ball.bonus {
  border-color: var(--yellow);
  outline: 2px solid rgba(255, 149, 0, 0.62);
  outline-offset: 2px;
}

.ball.power {
  border-color: var(--blue);
  color: var(--text);
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.14) 25%, transparent 42%),
    linear-gradient(145deg, var(--blue), #1065ff 52%, #041a4d);
}

.ball.mini {
  width: 2.25rem;
  height: 2.25rem;
  font-size: 0.9rem;
  flex: none;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.tag {
  display: inline-flex;
  min-height: 1.55rem;
  align-items: center;
  padding: 0 0.48rem;
  border-radius: 999px;
  color: var(--muted);
  border: 1px solid var(--line);
  font-size: 0.72rem;
  font-weight: 800;
}

.hidden {
  display: none !important;
}

#result-filter {
  min-height: 2.7rem;
  padding: 0 0.85rem;
  border-radius: 0.5rem;
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--panel);
}

.stats-panel {
  padding: 1rem;
  margin-bottom: 2rem;
  border: 1px solid rgba(0, 168, 255, 0.28);
  border-radius: 0.5rem;
  background:
    linear-gradient(135deg, rgba(255, 149, 0, 0.09), rgba(0, 168, 255, 0.08)),
    var(--panel);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.24);
}

.stats-controls {
  display: grid;
  grid-template-columns: minmax(12rem, 1fr) minmax(8rem, 0.6fr) minmax(10rem, 0.7fr);
  gap: 0.75rem;
}

.stats-controls label {
  display: grid;
  gap: 0.35rem;
}

.stats-controls span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.stats-controls select {
  min-height: 2.7rem;
  padding: 0 0.85rem;
  border-radius: 0.5rem;
  border: 1px solid var(--line);
  color: var(--text);
  background: #111;
}

.stats-summary {
  margin: 1rem 0;
}

.stat-hero {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-height: 5rem;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: #101010;
}

.stat-hero span,
.stat-hero em {
  display: block;
  color: var(--muted);
  font-style: normal;
  font-size: 0.84rem;
}

.stat-hero strong {
  display: block;
  margin: 0.12rem 0;
  font-size: clamp(1.15rem, 3vw, 1.85rem);
}

.hot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0.7rem;
}

.hot-card {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 4.6rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: #111;
}

.hot-card div {
  min-width: 0;
  flex: 1;
}

.hot-card strong,
.hot-card span {
  display: block;
}

.hot-card span {
  color: var(--muted);
  font-size: 0.78rem;
}

.hot-card i {
  display: block;
  width: 100%;
  height: 0.38rem;
  margin-top: 0.45rem;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--orange) var(--bar), #272727 var(--bar));
}

.history-list {
  display: grid;
  gap: 0.8rem;
}

.history-row {
  display: grid;
  grid-template-columns: minmax(12rem, 0.8fr) minmax(16rem, 1fr) auto;
  align-items: center;
  gap: 1rem;
}

.history-row .numbers {
  margin: 0;
}

.game-card {
  position: relative;
  overflow: hidden;
}

.game-card h3 {
  margin: 0 0 0.4rem;
}

.game-card .view-button {
  width: 100%;
  margin-top: 1rem;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem;
}

.calendar-day.today {
  border-color: rgba(255, 149, 0, 0.8);
  box-shadow: 0 0 0 1px rgba(255, 149, 0, 0.24), 0 20px 44px rgba(255, 149, 0, 0.08);
}

.calendar-day.next {
  border-color: rgba(0, 168, 255, 0.8);
}

.calendar-day h3 {
  margin: 0 0 0.85rem;
}

.calendar-games {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(19rem, 0.8fr);
  gap: 1rem;
  align-items: start;
}

.settings-card,
.about-card {
  padding: 1rem;
}

.toggle-row {
  min-height: 3.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
}

.toggle-row:last-child {
  border-bottom: 0;
}

.toggle-row span {
  color: var(--muted);
  font-size: 0.86rem;
}

.switch {
  position: relative;
  width: 3.1rem;
  height: 1.7rem;
  flex: none;
}

.switch input {
  position: absolute;
  opacity: 0;
}

.slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #101010;
  border: 1px solid var(--line);
}

.slider::after {
  content: "";
  position: absolute;
  width: 1.18rem;
  height: 1.18rem;
  left: 0.22rem;
  top: 0.2rem;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 180ms ease, background 180ms ease;
}

.switch input:checked + .slider {
  border-color: rgba(0, 168, 255, 0.65);
  background: rgba(0, 168, 255, 0.18);
}

.switch input:checked + .slider::after {
  transform: translateX(1.35rem);
  background: var(--blue);
}

.about-card p {
  color: var(--muted);
  line-height: 1.65;
}

.game-dialog {
  width: min(56rem, calc(100vw - 2rem));
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  color: var(--text);
  background: #111;
  box-shadow: var(--shadow);
}

.game-dialog::backdrop {
  background: rgba(0, 0, 0, 0.76);
  backdrop-filter: blur(6px);
}

.dialog-close {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  width: 2.35rem;
  height: 2.35rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text);
  background: var(--panel);
  font-size: 1.5rem;
}

.detail-hero {
  padding: 1rem 3rem 1rem 1rem;
}

.detail-hero h2 {
  margin: 0.25rem 0 0.5rem;
  font-size: clamp(2rem, 5vw, 4rem);
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(17rem, 0.75fr);
  gap: 1rem;
}

.detail-box {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--panel);
}

.detail-box h3 {
  margin: 0 0 0.75rem;
}

@media (max-width: 900px) {
  .app-shell {
    display: block;
  }

  .rail {
    position: fixed;
    inset: auto 0 0;
    z-index: 10;
    height: auto;
    padding: 0.55rem;
    border-top: 1px solid var(--line);
    border-right: 0;
  }

  .brand,
  .rail-note {
    display: none;
  }

  .rail-nav {
    grid-template-columns: repeat(6, 1fr);
    gap: 0.35rem;
  }

  .nav-item {
    justify-content: center;
    min-height: 3.4rem;
    padding: 0;
    gap: 0.25rem;
    flex-direction: column;
    font-size: 0.72rem;
  }

  .nav-icon {
    width: 1.45rem;
    height: 1.45rem;
  }

  main {
    padding: 1rem 1rem 6rem;
  }

  .hero {
    min-height: calc(100vh - 7rem);
    grid-template-columns: 1fr;
    align-content: center;
  }

  .hero-orbit {
    width: min(82vw, 22rem);
    order: -1;
  }

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

  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .next-draw-pill {
    min-width: 0;
  }

  .history-row,
  .settings-layout,
  .detail-grid,
  .stats-controls {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 470px) {
  .hero-actions {
    display: grid;
  }

  .primary-action,
  .secondary-action {
    width: 100%;
  }

  .card-stat {
    grid-template-columns: 1fr;
  }

  .ball {
    width: 2.28rem;
    height: 2.28rem;
    font-size: 0.9rem;
  }
}
