@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Manrope:wght@600;700;800&display=swap");

:root {
  --bg: #07111f;
  --surface: rgba(15, 31, 50, 0.82);
  --surface-solid: #102238;
  --surface-soft: rgba(255, 255, 255, 0.055);
  --text: #f6f8fb;
  --muted: #aebdd0;
  --line: rgba(255, 255, 255, 0.12);
  --accent: #7c5cff;
  --accent-2: #16c7c1;
  --danger: #ef4250;
  --success: #39d98a;
  --warning: #ffcb45;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

html[data-theme="light"] {
  --bg: #f4f7fb;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-solid: #ffffff;
  --surface-soft: rgba(7, 17, 31, 0.045);
  --text: #102238;
  --muted: #5f6f82;
  --line: rgba(16, 34, 56, 0.12);
  --shadow: 0 24px 60px rgba(35, 58, 82, 0.14);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 8%, rgba(124, 92, 255, 0.22), transparent 34rem),
    radial-gradient(circle at 88% 30%, rgba(22, 199, 193, 0.16), transparent 36rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

button, input, select { font: inherit; }

button, a { -webkit-tap-highlight-color: transparent; }

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid rgba(124, 92, 255, 0.42);
  outline-offset: 3px;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 22rem;
  height: 22rem;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.22;
  pointer-events: none;
}

.ambient-one { top: 12%; left: -8rem; background: #7c5cff; }
.ambient-two { right: -8rem; bottom: 5%; background: #16c7c1; }

.topbar {
  width: min(1180px, calc(100% - 32px));
  margin: 18px auto 0;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  font-family: Manrope, sans-serif;
  font-weight: 800;
}

.brand strong { display: block; font-family: Manrope, sans-serif; }
.brand small { display: block; color: var(--muted); }

.topbar-actions { display: flex; align-items: center; gap: 10px; }

.spin-meter {
  display: flex;
  align-items: baseline;
  gap: 4px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
}

.spin-meter__label { color: var(--muted); margin-right: 5px; }
.spin-meter strong { color: var(--warning); font-size: 1.08rem; }

.icon-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
  color: var(--text);
  cursor: pointer;
}

.icon-button svg, .secondary-button svg, .primary-button svg, .back-button svg,
.mode-tab svg, .notice-card svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 52px auto 72px;
}

.view { display: none; }
.view.is-active { display: block; animation: viewIn 0.42s ease; }

@keyframes viewIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.hero { max-width: 790px; margin-bottom: 32px; }
.eyebrow {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1, h2, h3 {
  font-family: Manrope, Inter, sans-serif;
  line-height: 1.13;
  margin: 0;
}

.hero h1 { font-size: clamp(2.5rem, 6vw, 4.85rem); letter-spacing: -0.055em; }
.hero p { max-width: 720px; color: var(--muted); font-size: 1.1rem; }

.game-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.game-card {
  min-height: 360px;
  padding: 26px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
  isolation: isolate;
  transition: transform 0.22s ease, border-color 0.22s ease;
}

.game-card::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: auto -15% -38% 15%;
  height: 70%;
  border-radius: 50%;
  filter: blur(12px);
  opacity: 0.23;
}

.game-card--lotto::before { background: #7fd328; }
.game-card--powerball::before { background: #f23e42; }
.game-card--mega::before { background: #286cff; }

.game-card:hover { transform: translateY(-5px); border-color: rgba(255,255,255,.25); }
.game-card__icon { width: 86px; height: 86px; margin-bottom: 26px; }
.game-card__tag {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.game-card h2 { font-size: 2rem; }
.game-card p { color: var(--muted); min-height: 54px; }
.game-card .primary-button { margin-top: auto; width: 100%; }

.primary-button, .secondary-button, .back-button, .mode-tab, .text-button {
  border: 0;
  cursor: pointer;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 12px 19px;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--accent), #5e8dff);
  color: white;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 12px 30px rgba(90, 82, 255, 0.26);
  transition: transform .18s ease, filter .18s ease;
}

.primary-button:hover { transform: translateY(-2px); filter: brightness(1.06); }
.primary-button--large { min-height: 56px; padding-inline: 25px; }

.notice-card {
  margin-top: 22px;
  padding: 17px 20px;
  display: flex;
  align-items: flex-start;
  gap: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  color: var(--muted);
}
.notice-card svg { flex: 0 0 auto; color: var(--warning); margin-top: 2px; }
.notice-card p { margin: 0; }

.lab-heading {
  display: grid;
  gap: 28px;
  margin-bottom: 28px;
}

.back-button {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.selected-game { display: flex; align-items: center; gap: 18px; }
.selected-game img { width: 78px; height: 78px; }
.selected-game h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
.selected-game p { color: var(--muted); margin: 7px 0 0; }

.mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

.mode-tab {
  min-height: 52px;
  padding: 11px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 13px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.mode-tab.is-active {
  background: linear-gradient(135deg, rgba(124,92,255,.22), rgba(22,199,193,.15));
  color: var(--text);
}

.control-panel {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.field { min-width: 0; }
.field label {
  min-height: 28px;
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
  font-size: .84rem;
  font-weight: 800;
}
.field input[type="text"], .field input[type="file"], .field select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--text);
}
.field input[type="file"] { font-size: .78rem; }
.field small { display: block; color: var(--muted); margin-top: 6px; font-size: .75rem; }

.help-button {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: .72rem;
  font-weight: 900;
  cursor: help;
}

.action-row {
  margin: 18px 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.secondary-button {
  min-height: 56px;
  padding: 12px 19px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  color: var(--text);
  font-weight: 800;
}

.status-message {
  min-height: 24px;
  color: var(--muted);
  font-size: .9rem;
}

.status-message.is-error { color: #ff8790; }
.status-message.is-success { color: var(--success); }

.results-panel, .chart-panel {
  margin-top: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.results-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.results-heading h2 { font-size: clamp(1.45rem, 4vw, 2.1rem); }

.result-badge {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  white-space: nowrap;
  font-size: .78rem;
  font-weight: 800;
}

.ticket-output { display: grid; gap: 11px; }

.ticket {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface-soft);
}

.ticket__number { color: var(--muted); font-weight: 800; font-size: .82rem; }
.ticket__balls { display: flex; flex-wrap: wrap; gap: 8px; }

.ball {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #ffffff, #dce6f4);
  color: #102238;
  font-weight: 900;
  box-shadow: inset 0 -5px 10px rgba(16,34,56,.12), 0 7px 16px rgba(0,0,0,.16);
  animation: ballIn .45s cubic-bezier(.2,.8,.2,1) both;
}

.ball--powerball { background: linear-gradient(145deg, #ff646a, #d7192d); color: white; }
.ball--mega { background: linear-gradient(145deg, #ffd75e, #f5a800); color: #312100; }

@keyframes ballIn {
  from { opacity: 0; transform: translateY(16px) scale(.55) rotate(-12deg); }
  to { opacity: 1; transform: none; }
}

.ticket__score {
  min-width: 82px;
  text-align: right;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 800;
}

.collision-warning { color: var(--warning); }
.collision-clean { color: var(--success); }

.chart-panel canvas {
  display: block;
  width: 100%;
  max-height: 480px;
  border-radius: 14px;
  background: var(--surface-soft);
}
.chart-note { color: var(--muted); font-size: .82rem; }

.tooltip-bubble {
  position: fixed;
  z-index: 50;
  width: min(290px, calc(100vw - 28px));
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #111f33;
  color: #f6f8fb;
  box-shadow: var(--shadow);
  font-size: .82rem;
}

.site-footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 28px;
  padding: 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--muted);
}
.site-footer strong { color: var(--text); }
.site-footer p { margin: 6px 0 0; }
.site-footer__meta { grid-column: 1 / -1; padding-top: 15px; border-top: 1px solid var(--line); font-size: .8rem; }

.unlock-dialog {
  width: min(520px, calc(100% - 28px));
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--surface-solid);
  color: var(--text);
  box-shadow: var(--shadow);
}
.unlock-dialog::backdrop { background: rgba(3, 9, 17, .76); backdrop-filter: blur(5px); }
.unlock-dialog h2 { font-size: 2rem; }
.unlock-dialog ul { color: var(--muted); }
.unlock-dialog .primary-button { width: 100%; margin-top: 8px; }
.unlock-dialog small { display: block; color: var(--muted); margin-top: 14px; }
.unlock-icon { font-size: 3rem; color: var(--accent-2); }
.dialog-close {
  position: absolute;
  top: 12px;
  right: 15px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.8rem;
  cursor: pointer;
}
.text-button { display: block; margin: 14px auto 0; background: transparent; color: var(--accent-2); font-weight: 800; }

.is-hidden { display: none !important; }

@media (max-width: 920px) {
  .game-grid { grid-template-columns: 1fr; }
  .game-card { min-height: 285px; }
  .control-panel { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 680px) {
  .topbar { align-items: flex-start; }
  .brand small { display: none; }
  .spin-meter__label { display: none; }
  .shell { margin-top: 34px; }
  .mode-tabs { grid-template-columns: 1fr; }
  .control-panel { grid-template-columns: 1fr; }
  .action-row { align-items: stretch; flex-direction: column; }
  .ticket { grid-template-columns: 1fr; }
  .ticket__score { text-align: left; }
  .site-footer { grid-template-columns: 1fr; }
  .site-footer__meta { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

@media print {
  body { background: white; color: black; }
  .topbar, #homeView, .lab-heading, .mode-tabs, .control-panel,
  .action-row, .status-message, .site-footer, .chart-panel { display: none !important; }
  .shell { width: 100%; margin: 0; }
  #labView, .results-panel { display: block !important; }
  .results-panel { border: 0; box-shadow: none; background: white; padding: 0; }
  .ticket { break-inside: avoid; background: white; border: 1px solid #ccc; }
  .ball { border: 1px solid #888; box-shadow: none; }
}


/* =========================================================
   v2.0.1 — Plain-language mode help and hover bubbles
   ========================================================= */

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

.mode-tab {
  position: relative;
}

.mode-tab > span:first-of-type {
  min-width: 0;
}

.mode-help-dot {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 21px;
  height: 21px;
  margin-left: 2px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 900;
  line-height: 1;
  opacity: 0.65;
  transition: opacity 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.mode-tab:hover .mode-help-dot,
.mode-tab:focus-visible .mode-help-dot,
.mode-tab.is-active .mode-help-dot {
  opacity: 1;
  transform: scale(1.06);
  background: rgba(255, 255, 255, 0.12);
}

.tooltip-bubble {
  max-width: 330px;
  padding: 14px 16px;
  border-color: rgba(255, 255, 255, 0.18);
  border-radius: 15px;
  background:
    linear-gradient(145deg, rgba(24, 42, 66, 0.98), rgba(13, 26, 44, 0.98));
  color: #ffffff;
  box-shadow:
    0 20px 48px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  font-size: 0.9rem;
  line-height: 1.52;
  pointer-events: auto;
}

.tooltip-bubble::before {
  content: "What does this do?";
  display: block;
  margin-bottom: 6px;
  color: #79e1dc;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

html[data-theme="light"] .tooltip-bubble {
  border-color: rgba(16, 34, 56, 0.14);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.99), rgba(241, 246, 252, 0.99));
  color: #102238;
  box-shadow:
    0 20px 48px rgba(35, 58, 82, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

html[data-theme="light"] .tooltip-bubble::before {
  color: #0a8f8a;
}

@media (max-width: 680px) {
  .mode-tab {
    justify-content: flex-start;
    text-align: left;
  }

  .mode-help-dot {
    margin-left: auto;
  }
}


/* =========================================================
   v2.0.3 — Free-spin offer and lifetime-price marker
   ========================================================= */

.access-offer {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.lifetime-offer {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid rgba(22, 199, 193, 0.26);
  border-radius: 999px;
  background: linear-gradient(
    135deg,
    rgba(22, 199, 193, 0.12),
    rgba(124, 92, 255, 0.12)
  );
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

.lifetime-offer strong {
  margin-left: 4px;
  color: var(--text);
  font-weight: 900;
}

.lifetime-offer.is-unlocked {
  border-color: rgba(57, 217, 138, 0.34);
  background: rgba(57, 217, 138, 0.1);
  color: var(--success);
}

.lifetime-offer.is-unlocked strong {
  margin-left: 0;
  color: var(--success);
}

@media (max-width: 760px) {
  .access-offer {
    align-items: flex-end;
    flex-direction: column;
    gap: 5px;
  }

  .lifetime-offer {
    min-height: 0;
    padding: 5px 9px;
    font-size: 0.68rem;
  }
}

@media (max-width: 520px) {
  .lifetime-offer {
    display: none;
  }
}
