:root {
  color-scheme: dark;
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
  background: #141311;
  color: #f7f0e2;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --surface: #201e1a;
  --surface-raised: #29251f;
  --line: #494237;
  --text-muted: #b6ad9d;
  --gold: #e6b958;
  --gold-bright: #f6d77f;
  --ember: #ef5c43;
  --green: #94d3a1;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(ellipse at 82% 2%, rgba(108, 69, 34, 0.22), transparent 34rem),
    #141311;
}

button {
  color: inherit;
  font: inherit;
}

button:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--gold-bright);
  outline-offset: 3px;
}

.page-shell {
  width: min(1240px, calc(100% - 36px));
  margin: 0 auto;
}

.site-header {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 84px;
  border-bottom: 1px solid rgba(230, 185, 88, 0.2);
}

.wordmark {
  display: block;
  width: 92px;
  height: 62px;
  object-fit: contain;
  background: #050505;
  border-radius: 6px;
}

.header-label,
.eyebrow,
.balance-label,
.control-label {
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.15em;
}

.header-label span {
  color: var(--ember);
  padding: 0 5px;
}

.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 200px;
  overflow: hidden;
  padding: 28px 34px;
  border-bottom: 1px solid var(--line);
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 720px;
}

.hero .eyebrow {
  margin: 0 0 10px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.1rem, 5vw, 3.35rem);
  font-weight: 600;
  letter-spacing: -0.035em;
}

.hero-description {
  margin-bottom: 12px;
  color: #d3c9b8;
  font-size: 1.05rem;
}

.play-only {
  display: inline-block;
  margin: 0;
  padding: 7px 10px;
  border: 1px solid rgba(148, 211, 161, 0.38);
  border-radius: 999px;
  color: var(--green);
  font-size: 0.83rem;
}

.dragon-art {
  width: clamp(112px, 19vw, 205px);
  height: clamp(112px, 19vw, 205px);
  margin-right: 4%;
  object-fit: contain;
  opacity: 0.42;
  filter: sepia(0.35) saturate(0.8);
}

.game-panel {
  padding: 22px 26px 28px;
  background: linear-gradient(160deg, rgba(42, 37, 30, 0.96), rgba(27, 25, 21, 0.98));
  border: 1px solid rgba(230, 185, 88, 0.23);
  border-radius: 14px;
  box-shadow: 0 18px 70px rgba(0, 0, 0, 0.24);
}

.topline,
.game-toolbar,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.topline {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.balance-card {
  display: grid;
  gap: 4px;
}

.balance-card strong {
  color: var(--gold-bright);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.8rem;
  font-weight: 600;
}

.reset-button {
  width: fit-content;
  padding: 3px 0;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: #766b57;
  text-underline-offset: 3px;
  cursor: pointer;
}

.reset-button:hover {
  color: var(--gold-bright);
}

.round-controls {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.mode-switch {
  display: flex;
  gap: 5px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #171613;
}

.mode-button,
.button {
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.mode-button {
  background: transparent;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.mode-button:hover,
.button-secondary:hover {
  border-color: #88734e;
  color: var(--gold-bright);
}

.mode-button.is-active {
  background: #44351f;
  color: var(--gold-bright);
}

.game-toolbar {
  margin: 21px 0 14px;
}

.game-toolbar h2,
.section-heading h2,
.draw-panel h2,
.bonus-stage h2 {
  margin-bottom: 4px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  font-weight: 600;
}

.muted {
  margin-bottom: 0;
  color: var(--text-muted);
  font-size: 0.89rem;
  line-height: 1.45;
}

.toolbar-actions {
  display: flex;
  gap: 8px;
}

.button {
  font-size: 0.9rem;
  font-weight: 750;
}

.button-secondary {
  border-color: var(--line);
  background: #28251f;
  color: #eee3d0;
}

.button-primary {
  width: 100%;
  min-height: 48px;
  border-color: #ffd574;
  background: linear-gradient(135deg, #edc262, #b97831);
  color: #241a0d;
  box-shadow: 0 5px 20px rgba(208, 145, 55, 0.16);
}

.button-primary:hover {
  background: linear-gradient(135deg, #ffdb7b, #d08c39);
  transform: translateY(-1px);
}

.button:disabled,
.mode-button:disabled,
.number-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.ticket-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 9px;
  margin-bottom: 22px;
}

.ticket-card {
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(15, 14, 12, 0.42);
  text-align: left;
  cursor: pointer;
}

.ticket-card:hover {
  border-color: #8d7449;
}

.ticket-card.is-active {
  border-color: var(--gold);
  background: rgba(102, 74, 33, 0.34);
  box-shadow: inset 0 0 0 1px rgba(230, 185, 88, 0.15);
}

.ticket-title {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--gold-bright);
  font-size: 0.8rem;
  font-weight: 800;
}

.ticket-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 22px;
}

.ticket-number {
  padding: 3px 5px;
  border-radius: 4px;
  background: #39342a;
  color: #eee3d0;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

.play-area {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(235px, 0.75fr);
  gap: 18px;
}

.number-panel,
.draw-panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(14, 13, 11, 0.47);
}

.section-heading {
  margin-bottom: 15px;
}

.section-heading .eyebrow,
.draw-panel .eyebrow,
.bonus-stage .eyebrow {
  margin-bottom: 5px;
}

.spot-count {
  color: var(--gold-bright);
  font-size: 0.85rem;
  font-weight: 750;
  white-space: nowrap;
}

.number-board {
  display: grid;
  grid-template-columns: repeat(10, minmax(28px, 1fr));
  gap: 6px;
}

.number-button {
  position: relative;
  min-height: 39px;
  border: 1px solid #474137;
  border-radius: 6px;
  background: #28251f;
  color: #e6ddcd;
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.number-button:hover {
  border-color: var(--gold);
  background: #393124;
}

.number-button.is-selected {
  border-color: var(--gold-bright);
  background: #70511f;
  color: #fff1c9;
  box-shadow: inset 0 0 0 1px rgba(255, 215, 120, 0.16);
}

.number-button.is-drawn:not(.is-selected) {
  border-color: #547a59;
  background: #24372a;
  color: #b6edbf;
}

.number-button.is-hit {
  border-color: #f0c967;
  background: #f0c967;
  color: #20170a;
  font-weight: 850;
  box-shadow: 0 0 12px rgba(240, 201, 103, 0.28);
}

.game-message {
  min-height: 1.4em;
  margin: 12px 0 0;
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.draw-panel h2 {
  margin-bottom: 4px;
}

.drawn-numbers {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 6px;
  min-height: 142px;
  margin: 17px 0;
  padding: 11px;
  border: 1px dashed #5d5140;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
}

.drawn-ball {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid #77674b;
  border-radius: 50%;
  background: #3a3225;
  color: #f1dfb8;
  font-size: 0.81rem;
  font-weight: 800;
}

.drawn-ball.is-hit {
  border-color: #f0c967;
  background: #f0c967;
  color: #20170a;
}

.empty-draw {
  align-self: center;
  margin: auto;
  color: #928876;
  font-size: 0.84rem;
  text-align: center;
}

.draw-summary {
  min-height: 1.3em;
  margin: -5px 0 12px;
  color: var(--gold-bright);
  font-size: 0.9rem;
  font-weight: 750;
}

.next-round {
  width: 100%;
  margin-top: 8px;
}

.cost-note {
  margin: 10px 0 0;
  color: #a69b88;
  font-size: 0.78rem;
  text-align: center;
}

.bonus-stage {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-top: 18px;
  padding: 18px 20px;
  border: 1px solid rgba(230, 185, 88, 0.52);
  border-radius: 11px;
  background:
    radial-gradient(circle at 85% 20%, rgba(160, 94, 40, 0.3), transparent 18rem),
    #241e16;
}

.bonus-stage[hidden] {
  display: none;
}

.bonus-copy {
  max-width: 560px;
}

.bonus-copy p:last-child {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.bonus-choices {
  display: flex;
  gap: 10px;
}

.bonus-choice {
  display: grid;
  width: 74px;
  height: 74px;
  place-content: center;
  gap: 3px;
  border: 1px solid #80673e;
  border-radius: 12px;
  background: linear-gradient(145deg, #4a3922, #211d18);
  color: var(--gold-bright);
  font-size: 1.4rem;
  cursor: pointer;
}

.bonus-choice span {
  color: #cabb9d;
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.bonus-choice:hover:not(:disabled) {
  border-color: var(--gold-bright);
  transform: translateY(-2px);
}

.bonus-choice:disabled {
  cursor: default;
}

.rules-panel {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  color: #ddd2c0;
}

.rules-panel summary {
  padding: 16px 0 6px;
  color: var(--gold-bright);
  font-weight: 750;
  cursor: pointer;
}

.rules-disclaimer {
  max-width: 760px;
  margin: 10px 0 12px;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
}

th,
td {
  padding: 8px 10px;
  border-bottom: 1px solid #3c372e;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--gold-bright);
  font-weight: 750;
}

.rules-list {
  display: grid;
  gap: 6px;
  padding-left: 19px;
  color: var(--text-muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 19px 2px 26px;
  color: #8e8576;
  font-size: 0.77rem;
}

.olsp-offer {
  display: block;
  margin-top: 22px;
  padding: 12px 16px;
  border-top: 1px solid var(--line, #315b5a);
  border-bottom: 1px solid var(--line, #315b5a);
  background: rgba(17, 24, 28, 0.52);
}

.olsp-offer-line {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 5px 12px;
  margin: 0;
  line-height: 1.55;
}

.olsp-offer-line a {
  color: var(--gold, #e5bd69);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.olsp-disclosure {
  color: var(--muted, #aeb8b7);
  font-size: 0.76rem;
}

@media (max-width: 760px) {
  .olsp-offer {
    padding: 11px 12px;
  }
}

.site-footer .footer-credit {
  color: var(--gold);
  font-weight: 800;
}

.site-footer .exterior-signature {
  color: #b6a987;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.7rem;
  font-style: italic;
  letter-spacing: 0.1em;
  opacity: 0.8;
  text-align: right;
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100% - 20px, 620px);
  }

  .site-header {
    min-height: 70px;
  }

  .wordmark {
    width: 75px;
    height: 50px;
  }

  .hero {
    min-height: 180px;
    padding: 24px 12px;
  }

  .dragon-art {
    position: absolute;
    right: 0;
    width: 145px;
    height: 145px;
    margin: 0;
    opacity: 0.24;
  }

  .hero-copy {
    max-width: 92%;
  }

  .game-panel {
    padding: 17px 13px 22px;
  }

  .topline {
    align-items: flex-start;
  }

  .round-controls {
    justify-items: end;
  }

  .mode-switch {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .mode-button {
    padding: 8px 10px;
  }

  .game-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar-actions {
    width: 100%;
  }

  .toolbar-actions .button {
    flex: 1;
  }

  .play-area {
    grid-template-columns: 1fr;
  }

  .number-panel,
  .draw-panel {
    padding: 14px;
  }

  .number-board {
    gap: 5px;
  }

  .number-button {
    min-height: 35px;
    font-size: 0.78rem;
  }

  .bonus-stage {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px;
  }

  .bonus-choices {
    width: 100%;
    justify-content: space-around;
  }

  .site-footer {
    flex-direction: column;
  }
}

@media (max-width: 420px) {
  .header-label {
    font-size: 0.62rem;
  }

  .topline {
    flex-direction: column;
  }

  .round-controls {
    width: 100%;
    justify-items: start;
  }

  .mode-switch {
    width: 100%;
    justify-content: space-between;
  }

  .ticket-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
