:root {
  --ink: #061a33;
  --navy: #081d37;
  --navy-2: #12365e;
  --cream: #f6f1e7;
  --paper: #fffaf0;
  --gold: #d8ae45;
  --gold-2: #f4ce62;
  --teal: #38bca4;
  --rose: #e84966;
  --muted: #607087;
  --line: rgba(8, 29, 55, 0.16);
  --shadow: 0 24px 70px rgba(6, 26, 51, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 12% 8%, rgba(244, 206, 98, 0.18), transparent 30%),
    radial-gradient(circle at 92% 0%, rgba(56, 188, 164, 0.12), transparent 28%),
    linear-gradient(180deg, #061529 0%, var(--navy) 42%, #04101f 100%);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

body.has-mobile-bar {
  padding-bottom: 0;
}

button,
input,
select {
  font: inherit;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(8, 29, 55, 0.9);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand,
.partner-link {
  color: white;
  text-decoration: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: block;
  flex-shrink: 0;
  box-shadow: 0 0 0 4px rgba(216, 174, 69, 0.14);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.hero-section {
  width: min(1180px, calc(100% - 32px));
  min-height: clamp(560px, 78vh, 760px);
  margin: 0 auto;
  position: relative;
  display: flex;
  align-items: center;
  padding: 48px 0;
  isolation: isolate;
}

.hero-media {
  position: absolute;
  inset: 32px 0;
  border-radius: 0;
  background:
    linear-gradient(90deg, rgba(8, 29, 55, 0.98) 0%, rgba(8, 29, 55, 0.85) 38%, rgba(8, 29, 55, 0.44) 100%),
    url("lottery_banner.webp") center right / cover no-repeat;
  overflow: hidden;
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, transparent 0 42%, rgba(244, 206, 98, 0.18) 48%, transparent 54%),
    radial-gradient(circle at 78% 44%, rgba(244, 206, 98, 0.22), transparent 18%);
  mix-blend-mode: screen;
}

.hero-spectacle {
  position: absolute;
  inset: 32px 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

.hero-ball {
  position: absolute;
  width: clamp(54px, 7vw, 86px);
  height: clamp(54px, 7vw, 86px);
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  font-weight: 950;
  border: 2px solid rgba(255, 234, 157, 0.9);
  background:
    radial-gradient(circle at 34% 24%, rgba(255, 255, 255, 0.96) 0 7%, transparent 8%),
    radial-gradient(circle at 50% 54%, #f5bf2f 0 46%, #9e5d05 74%);
  box-shadow:
    inset -12px -16px 24px rgba(74, 37, 0, 0.45),
    0 18px 44px rgba(0, 0, 0, 0.35),
    0 0 34px rgba(244, 206, 98, 0.32);
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.72);
}

.ball-one {
  right: 18%;
  top: 16%;
}

.ball-two {
  right: 8%;
  bottom: 20%;
}

.ball-three {
  right: 34%;
  bottom: 12%;
  transform: scale(0.78);
}

.hero-streak {
  position: absolute;
  left: -18%;
  width: 280px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(244, 206, 98, 0.95), transparent);
  box-shadow: 0 0 24px rgba(244, 206, 98, 0.65);
  transform: rotate(-18deg);
}

.streak-one {
  top: 26%;
}

.streak-two {
  top: 63%;
  transform: rotate(14deg);
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(650px, 100%);
  padding: 72px 42px;
  color: white;
}

.eyebrow {
  color: var(--gold-2);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  margin: 0 0 10px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(2.5rem, 6vw, 5.8rem);
  line-height: 0.96;
  letter-spacing: 0;
  margin-bottom: 24px;
}

h2 {
  font-size: clamp(2rem, 3vw, 3.2rem);
  line-height: 1;
  letter-spacing: 0;
  margin-bottom: 12px;
}

h3 {
  font-size: 1.3rem;
}

.hero-content p:not(.eyebrow) {
  max-width: 560px;
  font-size: 1.08rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.82);
}

.hero-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.trust-row {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.trust-row span {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  color: rgba(255, 255, 255, 0.86);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 0.9rem;
  font-weight: 800;
}

.primary-button,
.secondary-button,
.ghost-button,
.small-button,
.generate-button,
.icon-button {
  border: 0;
  cursor: pointer;
  font-weight: 800;
}

.primary-button,
.secondary-button,
.generate-button {
  min-height: 48px;
  padding: 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.primary-button,
.generate-button {
  background: linear-gradient(135deg, var(--gold-2), var(--gold));
  color: var(--navy);
  box-shadow: 0 14px 34px rgba(216, 174, 69, 0.24);
}

.secondary-button {
  background: rgba(255, 255, 255, 0.12);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.primary-button,
.secondary-button,
.ghost-button,
.small-button,
.generate-button,
.pack-buy,
.game-tile,
.segment {
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    filter 180ms ease;
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.small-button:hover,
.generate-button:hover,
.pack-buy:hover {
  transform: translateY(-2px);
}

.ghost-button,
.small-button {
  min-height: 38px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.small-button {
  color: var(--navy);
  background: var(--gold);
  border-color: transparent;
}

.small-button.subtle {
  background: rgba(8, 29, 55, 0.08);
}

.compact {
  min-height: 38px;
  padding-inline: 14px;
}

.credit-card {
  position: absolute;
  right: 42px;
  top: 86px;
  width: 170px;
  padding: 18px 20px;
  background: var(--paper);
  color: var(--navy);
  border: 2px solid var(--gold);
  box-shadow: var(--shadow);
  z-index: 3;
}

.credit-card span,
.balance-tile span,
.balance-tile small {
  display: block;
  color: var(--muted);
  font-weight: 700;
}

.credit-card strong,
.balance-tile strong {
  font-size: 2.5rem;
  line-height: 1;
}

.workspace-section {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 32px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(330px, 0.75fr);
  gap: 20px;
  align-items: start;
}

.generator-panel,
.credits-panel,
.b2b-section,
.app-dialog {
  background: var(--paper);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.36);
}

.generator-panel,
.credits-panel,
.b2b-section {
  padding: clamp(22px, 4vw, 36px);
}

.section-heading p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.55;
}

.generator-form {
  display: grid;
  gap: 18px;
}

.flow-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 22px 0;
}

.flow-step {
  padding: 14px;
  background: #efe7d8;
  border: 1px solid rgba(8, 29, 55, 0.08);
  position: relative;
  overflow: hidden;
}

.flow-step::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 20%, rgba(255, 255, 255, 0.42), transparent 80%);
  opacity: 0;
  transform: translateX(-120%);
}

.flow-step.active::after {
  opacity: 1;
  animation: shimmer 3.6s ease-in-out infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-120%);
  }

  45%,
  100% {
    transform: translateX(120%);
  }
}

.flow-step.active {
  background: var(--navy);
  color: white;
  border-color: var(--navy);
}

.flow-step span {
  width: 28px;
  height: 28px;
  margin-bottom: 10px;
  display: grid;
  place-items: center;
  background: var(--gold);
  color: var(--navy);
  font-weight: 900;
}

.flow-step strong,
.flow-step small {
  display: block;
}

.flow-step small {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.35;
}

.flow-step.active small {
  color: rgba(255, 255, 255, 0.72);
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: #ebe3d3;
}

.segment {
  min-height: 52px;
  border: 0;
  background: transparent;
  color: var(--navy);
  font-weight: 900;
  cursor: pointer;
}

.segment.active {
  background: var(--navy);
  color: white;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

label span,
.label-title {
  display: block;
  margin-bottom: 8px;
  font-weight: 800;
  color: var(--navy);
}

input,
select {
  width: 100%;
  min-height: 52px;
  border: 1px solid transparent;
  background: white;
  color: var(--navy);
  padding: 0 14px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(216, 174, 69, 0.2);
}

.hidden {
  display: none !important;
}

.multi-fields {
  display: grid;
  gap: 12px;
}

.access-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.75fr);
  gap: 16px;
  align-items: end;
  padding: 16px;
  background: #efe7d8;
  border: 1px dashed rgba(8, 29, 55, 0.22);
}

.access-card strong {
  display: block;
  margin-bottom: 6px;
}

.access-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.access-card p[data-tone="success"] {
  color: #16735e;
  font-weight: 800;
}

.access-card p[data-tone="error"] {
  color: #b5243e;
  font-weight: 800;
}

.email-access {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.email-access .small-button {
  min-height: 52px;
  white-space: nowrap;
}

.email-access .small-button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.games-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
}

.games-toolbar p {
  margin: 0;
  color: var(--muted);
}

.toolbar-buttons {
  display: flex;
  gap: 8px;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.game-tile {
  min-height: 78px;
  border: 2px solid transparent;
  background: var(--navy-2);
  color: white;
  padding: 14px;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.game-tile::after {
  content: "";
  position: absolute;
  inset: -1px;
  background: radial-gradient(circle at var(--x, 20%) var(--y, 30%), rgba(244, 206, 98, 0.18), transparent 38%);
  opacity: 0;
  transition: opacity 180ms ease;
}

.game-tile:hover,
.game-tile:focus-visible {
  border-color: rgba(216, 174, 69, 0.7);
  outline: none;
  transform: translateY(-2px);
}

.game-tile:hover::after,
.game-tile:focus-visible::after,
.game-tile.active::after {
  opacity: 1;
}

.game-tile.active {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 1px rgba(244, 206, 98, 0.42);
}

.game-check {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.1);
  color: var(--gold-2);
  font-weight: 900;
}

.game-tile strong,
.game-tile small {
  display: block;
  position: relative;
  z-index: 1;
}

.game-tile small {
  margin-top: 4px;
  color: var(--gold-2);
}

.generate-button {
  width: 100%;
  min-height: 58px;
  font-size: 1rem;
}

.notice {
  min-height: 24px;
  margin: 16px 0;
  color: var(--muted);
  text-align: center;
}

.notice[data-tone="success"] {
  color: #16735e;
}

.notice[data-tone="error"] {
  color: #b5243e;
  font-weight: 800;
}

.result-panel {
  background: var(--navy);
  color: white;
  padding: 22px;
  position: relative;
  overflow: hidden;
}

.result-panel::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto;
  height: 220px;
  background: radial-gradient(circle, rgba(244, 206, 98, 0.2), transparent 68%);
  pointer-events: none;
}

.result-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  position: relative;
  z-index: 1;
}

.results-list {
  display: grid;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.results-list.is-revealing {
  opacity: 0.18;
  filter: blur(2px);
}

.draw-stage {
  display: none;
  align-items: center;
  gap: 18px;
  margin: 14px 0;
  padding: 18px;
  background:
    radial-gradient(circle at 24% 35%, rgba(244, 206, 98, 0.2), transparent 34%),
    rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(244, 206, 98, 0.28);
  position: relative;
  z-index: 2;
}

.draw-stage.active {
  display: flex;
}

.draw-machine {
  width: 126px;
  height: 126px;
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.machine-ring {
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border: 3px dashed rgba(244, 206, 98, 0.8);
  box-shadow:
    inset 0 0 26px rgba(244, 206, 98, 0.16),
    0 0 28px rgba(244, 206, 98, 0.18);
}

.machine-core {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--navy);
  font-weight: 950;
  background: linear-gradient(135deg, #fff4b8, var(--gold));
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

.machine-ball {
  position: absolute;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  font-size: 0.8rem;
  font-weight: 900;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.9) 0 8%, transparent 9%),
    radial-gradient(circle, #f7c43e 0 46%, #9e5d05 76%);
  border: 1px solid #ffe68e;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

.machine-ball.b1 {
  left: 10px;
  top: 24px;
}

.machine-ball.b2 {
  right: 14px;
  top: 30px;
}

.machine-ball.b3 {
  bottom: 12px;
  left: 48px;
}

.draw-copy {
  display: grid;
  gap: 4px;
}

.draw-copy strong {
  font-size: 1.05rem;
}

.draw-copy span {
  color: rgba(255, 255, 255, 0.72);
}

.empty-result {
  display: grid;
  gap: 6px;
  padding: 22px;
  min-height: 112px;
  place-content: center;
  text-align: center;
  color: rgba(255, 255, 255, 0.76);
  border: 1px dashed rgba(255, 255, 255, 0.22);
}

.empty-result strong {
  color: white;
  font-size: 1.1rem;
}

.result-card {
  background: var(--navy-2);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 16px;
  animation: resultIn 320ms ease both;
  position: relative;
  overflow: hidden;
}

.result-card::after {
  content: "";
  position: absolute;
  inset: auto -12% 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(244, 206, 98, 0.68), transparent);
}

@keyframes resultIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.result-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.number-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.token {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: white;
  font-weight: 900;
  background:
    radial-gradient(circle at 32% 25%, rgba(255, 255, 255, 0.9) 0 7%, transparent 8%),
    radial-gradient(circle at 50% 52%, #f1bf36 0 48%, #a26205 70%);
  border: 2px solid var(--gold-2);
  border-radius: 50%;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
  box-shadow:
    inset -7px -9px 14px rgba(72, 34, 0, 0.38),
    0 7px 18px rgba(0, 0, 0, 0.26);
}

.token.extra {
  background:
    radial-gradient(circle at 50% 50%, var(--navy) 0 42%, transparent 43%),
    conic-gradient(from 0deg, var(--gold-2), #fff1a5, var(--gold), var(--gold-2));
  border-radius: 12px;
  clip-path: polygon(50% 0, 62% 34%, 98% 35%, 69% 56%, 79% 91%, 50% 70%, 21% 91%, 31% 56%, 2% 35%, 38% 34%);
}

.token.sun {
  clip-path: polygon(50% 0, 58% 20%, 78% 8%, 77% 31%, 100% 32%, 82% 47%, 96% 66%, 73% 65%, 78% 88%, 58% 76%, 50% 100%, 42% 76%, 22% 88%, 27% 65%, 4% 66%, 18% 47%, 0 32%, 23% 31%, 22% 8%, 42% 20%);
}

.credits-panel {
  position: sticky;
  top: 92px;
  background: var(--navy);
  color: white;
}

.panel-badge {
  float: right;
  background: var(--gold);
  color: var(--navy);
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 900;
}

.balance-tile {
  border: 1px solid var(--gold);
  padding: 18px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.06);
}

.balance-tile span,
.balance-tile small {
  color: rgba(255, 255, 255, 0.68);
}

.pack-list {
  display: grid;
  gap: 10px;
}

.credit-nudge {
  display: none;
  margin: 0 0 12px;
  padding: 12px 14px;
  color: var(--navy);
  background: var(--gold-2);
  font-weight: 900;
}

.credits-panel.needs-attention .credit-nudge {
  display: block;
}

.credits-panel.needs-attention {
  box-shadow:
    0 0 0 3px rgba(244, 206, 98, 0.75),
    var(--shadow);
}

.pack-card {
  padding: 16px;
  background: var(--navy-2);
  border-left: 5px solid var(--gold);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.pack-card::before {
  content: "";
  position: absolute;
  inset: -40% auto -40% -25%;
  width: 44%;
  background: radial-gradient(circle, rgba(244, 206, 98, 0.18), transparent 68%);
  pointer-events: none;
}

.pack-card h3,
.pack-card p {
  margin: 0;
  position: relative;
  z-index: 1;
}

.pack-card p,
.legal-note {
  color: rgba(255, 255, 255, 0.7);
}

.pack-price {
  margin-top: 16px !important;
  color: white !important;
  font-size: 1.5rem;
  font-weight: 900;
}

.pack-action {
  display: grid;
  gap: 10px;
  justify-items: stretch;
  position: relative;
  z-index: 1;
}

.pack-action span {
  color: var(--gold-2);
  font-size: 0.8rem;
  font-weight: 900;
}

.pack-buy {
  min-height: 44px;
  padding: 12px 16px;
  border: 0;
  background: var(--gold);
  color: var(--navy);
  font-weight: 900;
  cursor: pointer;
}

.pack-buy:hover,
.primary-button:hover,
.generate-button:hover {
  filter: brightness(1.05);
}

.generate-button:disabled {
  opacity: 0.56;
  cursor: not-allowed;
  filter: grayscale(0.3);
}

.b2b-section {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 56px;
}

.b2b-layout {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 18px;
}

.operator-card {
  background: white;
  border: 1px solid var(--line);
  padding: 22px;
  position: relative;
  overflow: hidden;
}

.operator-card::before {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  right: -92px;
  top: -92px;
  border-radius: 50%;
  background: rgba(216, 174, 69, 0.12);
}

.operator-card p {
  color: var(--muted);
  line-height: 1.55;
}

.status-line {
  margin: 14px 0 0;
  font-weight: 900;
}

.b2b-result {
  margin-top: 16px;
}

.app-dialog {
  width: min(920px, calc(100% - 32px));
  max-height: min(760px, calc(100vh - 32px));
  border: 0;
  padding: 0;
  color: var(--ink);
}

.app-dialog::backdrop {
  background: rgba(3, 12, 25, 0.72);
}

[hidden] { display: none !important; }
.auth-dialog { width: min(480px, calc(100% - 24px)); background: var(--cream); }
.auth-dialog h2 { font-size: 1.8rem; margin-bottom: 0; }
.auth-dialog .icon-button { flex-shrink: 0; }
.auth-dialog > p { margin: 20px 24px; line-height: 1.6; }
.auth-form { display: grid; gap: 18px; padding: 0 24px; }
.auth-form label { display: grid; gap: 8px; }
.auth-form input { width: 100%; min-width: 0; }
.auth-form button { width: 100%; }
.auth-status { overflow-wrap: anywhere; }
.auth-status[data-tone="error"] { color: #a12828; }
.auth-status[data-tone="success"] { color: #236345; }
.auth-help { font-size: .85rem; color: var(--muted); }
.account-status { margin: 0; overflow-wrap: anywhere; color: var(--muted); font-size: .9rem; }
.nav-actions { flex-wrap: wrap; }

.dialog-header {
  background: var(--navy);
  color: white;
  padding: 22px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.icon-button {
  width: 42px;
  height: 42px;
  background: rgba(255, 255, 255, 0.12);
  color: white;
  font-size: 1.4rem;
}

.history-controls {
  padding: 16px 22px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.history-controls .secondary-button {
  color: var(--navy);
  border-color: var(--line);
  background: var(--cream);
}

.history-list {
  padding: 0 22px 22px;
  max-height: 520px;
  overflow: auto;
  display: grid;
  gap: 10px;
}

.history-empty {
  padding: 24px;
  background: var(--cream);
  color: var(--muted);
}

.mobile-action-bar {
  display: none;
}

@media (max-width: 900px) {
  .workspace-section,
  .b2b-layout,
  .field-grid,
  .access-card {
    grid-template-columns: 1fr;
  }

  .credits-panel {
    position: static;
  }

  .credit-card {
    position: relative;
    right: auto;
    top: auto;
    margin: 0 24px 42px;
  }

  .hero-section {
    min-height: auto;
    display: block;
    padding-top: 24px;
  }

  .hero-media {
    inset: 24px 0 auto;
    height: 100%;
  }

  .hero-content {
    padding: 56px 24px 24px;
  }

  .flow-strip {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  body {
    padding-bottom: 76px;
  }

  .nav-shell {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 0;
  }

  .segmented-control,
  .game-grid,
  .history-controls {
    grid-template-columns: 1fr;
  }

  .hero-section,
  .workspace-section,
  .b2b-section,
  .nav-shell {
    width: min(100% - 20px, 1180px);
  }

  .hero-content {
    padding: 42px 18px 20px;
  }

  h1 {
    font-size: clamp(2.35rem, 13vw, 3.3rem);
  }

  .games-toolbar,
  .result-heading {
    align-items: stretch;
    flex-direction: column;
  }

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

  .token {
    width: 40px;
    height: 40px;
  }

  .mobile-action-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 10px;
    gap: 10px;
    background: rgba(8, 29, 55, 0.96);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }

  .mobile-action-bar a {
    min-height: 50px;
    display: grid;
    place-items: center;
    color: white;
    text-decoration: none;
    font-weight: 900;
    background: var(--navy-2);
  }

  .mobile-action-bar .mobile-generate-link {
    color: var(--navy);
    background: var(--gold);
  }
}
