:root {
  --bg-0: #0f0b0b;
  --bg-1: #181110;
  --bg-2: #251a17;
  --panel: rgba(18, 14, 13, 0.9);
  --panel-strong: rgba(14, 11, 10, 0.95);
  --panel-border: rgba(223, 195, 154, 0.12);
  --panel-inner: rgba(255, 242, 220, 0.04);
  --bezel: linear-gradient(135deg, #f5e9d0 0%, #d4b489 24%, #6f533d 58%, #ead9b9 100%);
  --text: #f5efe5;
  --muted: rgba(230, 218, 201, 0.64);
  --soft: rgba(230, 218, 201, 0.42);
  --accent-warm: #d3a164;
  --accent-rose: #cf7f94;
  --accent-cyan: #7cb9c9;
  --accent-gold: #efd08a;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.34);
  --font-display: "Didot", "Bodoni 72", "Iowan Old Style", "Times New Roman", serif;
  --font-body: "Avenir Next", "Gill Sans", "Trebuchet MS", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  font-family: var(--font-body);
  background:
    radial-gradient(circle at 18% 16%, rgba(203, 151, 93, 0.14), transparent 24%),
    radial-gradient(circle at 82% 12%, rgba(129, 149, 163, 0.08), transparent 22%),
    linear-gradient(180deg, var(--bg-0) 0%, var(--bg-1) 42%, #0d0909 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(9, 7, 7, 0.32), rgba(9, 7, 7, 0.72)),
    url("assets/generated/page-atmosphere.png") center / cover no-repeat;
  opacity: 0.54;
  pointer-events: none;
}

.page-noise,
.page-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.page-noise {
  opacity: 0.035;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 18px 18px;
  mix-blend-mode: luminosity;
}

.page-glow-a {
  background: radial-gradient(circle at 12% 20%, rgba(205, 157, 99, 0.14), transparent 22%);
}

.page-glow-b {
  background: radial-gradient(circle at 88% 18%, rgba(130, 155, 170, 0.08), transparent 22%);
}

.machine-shell {
  position: relative;
  z-index: 1;
  width: min(1680px, calc(100vw - 16px));
  min-height: 100svh;
  margin: 0 auto;
  padding: 4px 0 12px;
}

.panel {
  position: relative;
  background:
    linear-gradient(180deg, var(--panel-inner), transparent 32%),
    var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.panel::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 23px;
  border: 1px solid rgba(255, 245, 227, 0.04);
  pointer-events: none;
}

.reveal {
  animation: rise-in 0.7s ease both;
}

.utility-button,
.action-button {
  appearance: none;
  border: 0;
  cursor: pointer;
  font: inherit;
}

.utility-button {
  min-width: 92px;
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.015)),
    rgba(17, 13, 12, 0.78);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 10px 18px rgba(0, 0, 0, 0.18);
  transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.utility-button:hover,
.utility-button:focus-visible,
.action-button:hover,
.action-button:focus-visible {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 12px 22px rgba(0, 0, 0, 0.22);
}

.cabinet {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(232px, 18vw, 268px);
  gap: 8px;
  align-items: stretch;
}

.screen-panel,
.control-panel {
  min-height: 0;
  padding: 10px;
}

.screen-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  gap: 2px;
}

.screen-stage {
  position: relative;
  aspect-ratio: 1440 / 1040;
  height: auto;
  max-height: calc(100svh - 188px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 28px;
  border: 3px solid transparent;
  background:
    linear-gradient(rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.02)) padding-box,
    var(--bezel) border-box;
  box-shadow:
    inset 0 0 0 1px rgba(255, 243, 220, 0.16),
    0 18px 34px rgba(0, 0, 0, 0.24);
}

.screen-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(108deg, transparent 28%, rgba(255, 255, 255, 0.08) 47%, transparent 63%),
    radial-gradient(circle at 50% -6%, rgba(212, 165, 100, 0.14), transparent 34%);
  mix-blend-mode: screen;
  opacity: 0.55;
  pointer-events: none;
  animation: glass-sweep 9s linear infinite;
}

.screen-stage::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 20px;
  border: 1px solid rgba(255, 243, 220, 0.08);
  pointer-events: none;
}

#slot-canvas {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}

.hero-overlay {
  display: none;
}

.hero-card {
  width: min(248px, calc(100vw - 56px));
  padding: 8px 10px;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 36%),
    rgba(15, 12, 11, 0.86);
  border: 1px solid rgba(227, 205, 173, 0.12);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.2);
}

.hero-kicker,
.session-label {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.26em;
  font-size: 0.68rem;
  color: rgba(226, 208, 185, 0.66);
}

.hero-card h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(0.86rem, 1vw, 1rem);
  line-height: 1;
}

.hero-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.66rem;
}

.hero-note {
  font-size: 0.56rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.playbar {
  padding: 0 2px;
  margin-top: -6px;
}

.machine-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: end;
  padding: 8px 12px 8px;
  border-radius: 16px;
  background: rgba(13, 10, 10, 0.82);
  border: 1px solid rgba(227, 205, 173, 0.08);
}

.ticker-block {
  min-width: 0;
}

.ticker-block p {
  margin: 0;
}

#status-line {
  font-size: 0.98rem;
}

#feature-line {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.86rem;
}

.mini-ledger {
  display: grid;
  grid-template-columns: repeat(3, minmax(84px, 108px));
  gap: 6px;
}

.mini-ledger-item,
.bankroll-chip {
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(8, 7, 7, 0.72);
  border: 1px solid rgba(255, 244, 221, 0.06);
}

.mini-ledger-item span,
.bankroll-chip span,
.meter-title span,
.jackpot-list-item span {
  display: block;
  margin-bottom: 6px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--soft);
}

.mini-ledger-item strong,
.bankroll-chip strong {
  font-family: var(--font-display);
  font-size: 1.18rem;
  line-height: 1;
}

.control-panel {
  display: grid;
  grid-template-rows: auto auto auto auto auto auto;
  gap: 5px;
  align-content: start;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 30%),
    var(--panel-strong);
}

.compact-card,
.ledger-card {
  padding: 9px;
  border-radius: 18px;
  background: rgba(15, 12, 11, 0.82);
  border: 1px solid rgba(227, 205, 173, 0.08);
}

.ledger-grid {
  display: grid;
  gap: 10px;
}

.jackpot-list,
.meter-stack {
  display: grid;
  gap: 6px;
}

.jackpot-list-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.04), transparent 30%),
    rgba(11, 9, 9, 0.86);
  border: 1px solid rgba(227, 205, 173, 0.06);
}

.jackpot-list-item span {
  margin: 0;
}

.jackpot-list-item strong {
  font-family: var(--font-display);
  font-size: 1.26rem;
  line-height: 1;
}

.jackpot-list-item.mini strong {
  color: #f7e6b0;
}

.jackpot-list-item.minor strong {
  color: #c4eef2;
}

.jackpot-list-item.major strong {
  color: #e6c1da;
}

.jackpot-list-item.grand strong {
  color: #f0cf8e;
}

.meter-card {
  padding: 8px 9px 9px;
  border-radius: 14px;
  background: rgba(10, 9, 9, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.meter-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.meter-title strong {
  font-size: 0.9rem;
}

.meter-bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.meter-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  transition: width 220ms ease;
}

.meter-fill.voltage {
  background: linear-gradient(90deg, #d56f76, #e0b060);
  box-shadow: 0 0 16px rgba(218, 160, 96, 0.32);
}

.meter-fill.mirror {
  background: linear-gradient(90deg, #6eaed1, #75d8cb);
  box-shadow: 0 0 16px rgba(117, 216, 203, 0.28);
}

.meter-fill.vault {
  background: linear-gradient(90deg, #cb7dd8, #e2bf7b);
  box-shadow: 0 0 16px rgba(203, 125, 216, 0.26);
}

.action-grid {
  display: grid;
  grid-template-columns: 0.9fr 0.9fr 1.4fr 1fr 1fr;
  gap: 6px;
}

.action-button {
  min-height: 52px;
  padding: 9px 12px;
  border-radius: 14px;
  font-family: var(--font-display);
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease;
}

.action-button.primary {
  grid-column: span 1;
  color: #17110d;
  background:
    linear-gradient(180deg, #f2e2c5 0%, #ddc39b 45%, #c8955c 100%);
  box-shadow: 0 14px 26px rgba(125, 88, 49, 0.24);
}

.action-button.accent {
  color: #111719;
  background:
    linear-gradient(180deg, #dee7e8 0%, #c6d6d8 46%, #a9bcc2 100%);
  box-shadow: 0 12px 22px rgba(84, 103, 113, 0.18);
}

.action-button.secondary {
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015)),
    rgba(17, 13, 13, 0.92);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.18);
}

.action-button:disabled,
.utility-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
  box-shadow: none;
}

.session-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.drawer-card {
  overflow: hidden;
}

.drawer-toggle {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: rgba(226, 208, 185, 0.72);
}

.drawer-toggle::-webkit-details-marker {
  display: none;
}

.drawer-toggle::after {
  content: "+";
  font-size: 1rem;
  letter-spacing: normal;
}

.drawer-card[open] .drawer-toggle::after {
  content: "−";
}

.drawer-body {
  padding-top: 8px;
}

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

.utility-dock-button {
  min-width: 0;
  min-height: 44px;
}

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

.feature-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.feature-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.86rem;
  letter-spacing: 0.03em;
}

.ethics-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.ethics-card li + li {
  margin-top: 8px;
}

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

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes glass-sweep {
  0% {
    transform: translateX(-16%);
  }
  100% {
    transform: translateX(16%);
  }
}

@media (max-width: 1180px) {
  .cabinet {
    grid-template-columns: minmax(0, 1fr) 236px;
  }

  .machine-shell {
    width: min(100vw - 18px, 1680px);
  }
}

@media (max-width: 980px) {
  .cabinet {
    grid-template-columns: 1fr;
  }

  .screen-stage {
    aspect-ratio: auto;
    height: min(60svh, 780px);
  }

  #slot-canvas {
    width: auto;
    height: calc(100% - 12px);
  }

  .control-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: none;
  }

  .ledger-card,
  .utility-dock {
    grid-column: span 2;
  }
}

@media (max-width: 720px) {
  .machine-shell {
    width: min(100vw - 10px, 1680px);
    padding-top: 8px;
  }

  .screen-panel,
  .control-panel {
    padding: 8px;
  }

  .screen-stage {
    height: min(48svh, 620px);
    border-radius: 20px;
  }

  #slot-canvas {
    height: calc(100% - 12px);
  }

  .hero-overlay {
    display: none;
  }

  .hero-card {
    width: min(170px, calc(100vw - 30px));
    padding: 10px 12px;
  }

  .hero-card h2 {
    font-size: 1.02rem;
  }

  .hero-card p {
    font-size: 0.78rem;
  }

  #hero-text {
    display: none;
  }

  .hero-note {
    font-size: 0.58rem;
    line-height: 1.35;
  }

  .machine-footer {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .mini-ledger {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mini-ledger-item strong,
  .bankroll-chip strong {
    font-size: 1.12rem;
  }

  .control-panel {
    grid-template-columns: 1fr;
  }

  .ledger-card,
  .utility-dock {
    grid-column: span 1;
  }

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

  .action-button.primary {
    grid-column: span 2;
  }

  .compact-card,
  .ledger-card {
    padding: 12px;
  }
}
