:root {
  --bg-deep: #11061f;
  --bg-mid: #20103a;
  --card: rgba(255, 255, 255, 0.09);
  --card-strong: rgba(255, 255, 255, 0.14);
  --stroke: rgba(255, 255, 255, 0.16);
  --text: #fff8e7;
  --muted: rgba(255, 248, 231, 0.72);
  --soft: rgba(255, 248, 231, 0.56);
  --gold: #ffd36a;
  --gold-deep: #b87718;
  --pink: #ff6bd6;
  --purple: #7c4dff;
  --danger: #ff8f9a;
  --success: #9ff0c2;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --max-width: 760px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 14% 10%, rgba(255, 107, 214, 0.26), transparent 31%),
    radial-gradient(circle at 92% 16%, rgba(255, 211, 106, 0.18), transparent 28%),
    radial-gradient(circle at 50% 100%, rgba(124, 77, 255, 0.26), transparent 34%),
    linear-gradient(145deg, var(--bg-deep), var(--bg-mid) 52%, #120520);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.app-shell {
  width: min(100%, var(--max-width));
  margin: 0 auto;
  padding: 22px 16px 44px;
}

.hero-card,
.glass-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--stroke);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.055));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-card {
  min-height: 260px;
  display: flex;
  align-items: flex-end;
  margin-bottom: 18px;
  padding: 28px;
  border-radius: 34px;
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 33px;
  background:
    linear-gradient(140deg, rgba(255, 211, 106, 0.18), transparent 42%),
    linear-gradient(320deg, rgba(255, 107, 214, 0.14), transparent 48%);
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(2px);
  opacity: 0.9;
}

.orb-one {
  width: 150px;
  height: 150px;
  right: -28px;
  top: -28px;
  background: radial-gradient(circle, rgba(255, 211, 106, 0.78), rgba(255, 211, 106, 0.08) 67%, transparent);
}

.orb-two {
  width: 110px;
  height: 110px;
  left: -18px;
  top: 48px;
  background: radial-gradient(circle, rgba(255, 107, 214, 0.64), rgba(124, 77, 255, 0.10) 70%, transparent);
}

.hero-content {
  position: relative;
  z-index: 1;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: -0.045em;
}

h1 {
  max-width: 10ch;
  font-size: clamp(3rem, 14vw, 5.7rem);
  line-height: 0.86;
}

h2 {
  font-size: clamp(1.55rem, 6vw, 2.15rem);
}

.hero-copy {
  max-width: 36rem;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.glass-card {
  margin-top: 18px;
  padding: 20px;
  border-radius: var(--radius-lg);
}

.section-heading {
  margin-bottom: 18px;
}

form {
  display: grid;
  gap: 15px;
}

.field {
  display: grid;
  gap: 7px;
}

label {
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 750;
}

select,
input {
  width: 100%;
  min-height: 54px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  background: rgba(13, 6, 29, 0.72);
  color: var(--text);
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

select:focus,
input:focus {
  border-color: rgba(255, 211, 106, 0.76);
  box-shadow: 0 0 0 4px rgba(255, 211, 106, 0.13);
  background: rgba(13, 6, 29, 0.9);
}

.error-message {
  min-height: 18px;
  margin: 0;
  color: var(--danger);
  font-size: 0.82rem;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.delete-btn {
  border: 0;
  border-radius: 999px;
  font-weight: 850;
}

.primary-btn {
  min-height: 58px;
  margin-top: 4px;
  color: #1a1023;
  background:
    radial-gradient(circle at 28% 0%, rgba(255, 255, 255, 0.72), transparent 30%),
    linear-gradient(135deg, var(--gold), #ffad33 48%, #ff76d7);
  box-shadow: 0 18px 36px rgba(255, 173, 51, 0.22);
}

.primary-btn:active,
.secondary-btn:active,
.ghost-btn:active,
.delete-btn:active {
  transform: translateY(1px);
}

.secondary-btn {
  min-height: 50px;
  padding: 0 15px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.ghost-btn {
  min-height: 42px;
  padding: 0 14px;
  color: var(--gold);
  background: rgba(255, 211, 106, 0.10);
  border: 1px solid rgba(255, 211, 106, 0.20);
  white-space: nowrap;
}

.delete-btn {
  min-height: 34px;
  padding: 0 12px;
  color: var(--danger);
  background: rgba(255, 143, 154, 0.10);
  border: 1px solid rgba(255, 143, 154, 0.18);
}

.micro-disclaimer {
  margin: 16px 0 0;
  color: var(--soft);
  font-size: 0.82rem;
  line-height: 1.45;
}

.site-footer {
  width: min(100% - 32px, var(--max-width));
  margin: 0 auto 28px;
  text-align: center;
}

.site-footer p {
  margin: 0;
  color: var(--soft);
  font-size: 0.82rem;
  line-height: 1.45;
}

.site-footer a {
  color: var(--gold);
  text-decoration: none;
  font-weight: 600;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  text-decoration: underline;
}

.result-card {
  border-color: rgba(255, 211, 106, 0.25);
}

.number-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0 18px;
}

.number-ball,
.powerball-ball {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 999px;
  color: #1b1023;
  font-size: 1.25rem;
  font-weight: 950;
  letter-spacing: -0.04em;
  background:
    radial-gradient(circle at 34% 22%, #fff9d7, transparent 26%),
    linear-gradient(145deg, #ffe08a, #ffb22f 58%, #c16c00);
  box-shadow:
    inset 0 -7px 12px rgba(121, 60, 0, 0.28),
    0 15px 22px rgba(0, 0, 0, 0.22);
  animation: popIn 420ms cubic-bezier(.2, .8, .2, 1) both;
}

.number-ball:nth-child(2) { animation-delay: 40ms; }
.number-ball:nth-child(3) { animation-delay: 80ms; }
.number-ball:nth-child(4) { animation-delay: 120ms; }
.number-ball:nth-child(5) { animation-delay: 160ms; }
.number-ball:nth-child(6) { animation-delay: 200ms; }
.number-ball:nth-child(7) { animation-delay: 240ms; }

.powerball-wrap {
  display: inline-grid;
  gap: 8px;
  margin: 0 0 16px;
}

.powerball-wrap p {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.powerball-ball {
  background:
    radial-gradient(circle at 34% 22%, #fff, transparent 25%),
    linear-gradient(145deg, #ff95df, #ff4fc9 55%, #b7158a);
  color: #fff;
}

.lucky-note {
  margin: 12px 0 16px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.085);
  color: var(--muted);
  line-height: 1.55;
}

.action-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.status-message {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--success);
  font-size: 0.9rem;
  font-weight: 700;
}

.history-top {
  display: grid;
  gap: 12px;
}

.saved-list {
  display: grid;
  gap: 12px;
}

.empty-state {
  margin: 0;
  padding: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-md);
  color: var(--soft);
  line-height: 1.5;
  background: rgba(255, 255, 255, 0.045);
}

.saved-item {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.065);
}

.saved-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--soft);
  font-size: 0.82rem;
}

.saved-pill {
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.saved-numbers {
  color: var(--text);
  font-size: 1.08rem;
  font-weight: 850;
}

.saved-actions {
  display: flex;
  justify-content: flex-end;
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.78);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (min-width: 680px) {
  .app-shell {
    padding-top: 34px;
  }

  .hero-card {
    min-height: 310px;
    padding: 36px;
  }

  .glass-card {
    padding: 26px;
  }

  form {
    grid-template-columns: 1fr 1fr;
  }

  .field:nth-child(3),
  .field:nth-child(4),
  .primary-btn,
  .micro-disclaimer {
    grid-column: 1 / -1;
  }

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

  .history-top {
    grid-template-columns: 1fr auto;
    align-items: start;
  }

  .number-ball,
  .powerball-ball {
    width: 64px;
    height: 64px;
    font-size: 1.42rem;
  }
}
