:root {
  color-scheme: dark;
  --bg: #110d18;
  --panel: rgba(30, 22, 43, 0.9);
  --panel-strong: #251832;
  --ink: #fff8ea;
  --muted: #cdbedb;
  --gold: #f6c75f;
  --gold-strong: #ffe08a;
  --rose: #ef5f87;
  --violet: #8b5cf6;
  --green: #45d483;
  --line: rgba(255, 255, 255, 0.13);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.42);
  font-family: "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  height: 100dvh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 12%, rgba(246, 199, 95, 0.18), transparent 28%),
    radial-gradient(circle at 88% 22%, rgba(139, 92, 246, 0.22), transparent 30%),
    linear-gradient(180deg, #180f22, #0b0710 68%, #050307);
  overflow: hidden;
}

button {
  font: inherit;
}

.casino-shell {
  width: min(100vw, 390px);
  height: 100dvh;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: clamp(7px, 1.4vh, 11px);
  padding: clamp(10px, 2vh, 14px) 16px;
  overflow: hidden;
}

.topbar,
.notice,
.machine,
.locked-grid {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--gold-strong);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(1.15rem, 5.7vw, 1.45rem);
  line-height: 1.05;
}

.credit-card {
  min-width: 86px;
  border-radius: 15px;
  padding: 8px 10px;
  color: #291b05;
  background: linear-gradient(135deg, var(--gold-strong), var(--gold));
  text-align: center;
}

.credit-card span,
.notice span,
.status-panel span,
.locked-grid span {
  display: block;
  opacity: 0.78;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.credit-card strong {
  display: block;
  margin-top: 2px;
  font-size: 1.25rem;
}

.notice {
  display: grid;
  gap: 4px;
  padding: 9px 12px;
  color: var(--muted);
}

.notice strong {
  color: var(--ink);
  font-size: 0.9rem;
}

.machine {
  position: relative;
  display: grid;
  align-content: center;
  gap: clamp(8px, 1.5vh, 12px);
  overflow: hidden;
  padding: clamp(12px, 2vh, 16px) 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 45%),
    linear-gradient(145deg, rgba(48, 28, 71, 0.96), rgba(24, 14, 35, 0.96));
}

.machine::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(246, 199, 95, 0.28);
  border-radius: 22px;
  pointer-events: none;
}

.machine-top {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.light {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: radial-gradient(circle at 35% 35%, #fff8cd, var(--gold));
  box-shadow: 0 0 22px rgba(246, 199, 95, 0.45);
}

.reels {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  border-radius: 24px;
  padding: 6px;
  background: rgba(4, 3, 8, 0.52);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.reel {
  min-height: clamp(76px, 17vh, 96px);
  display: grid;
  place-items: center;
  border: 2px solid rgba(246, 199, 95, 0.48);
  border-radius: 20px;
  color: #26170a;
  background: linear-gradient(180deg, #fff8dc, #edca7a);
  font-size: clamp(1.9rem, 8vw, 2.35rem);
  font-weight: 1000;
  line-height: 1;
  box-shadow: inset 0 -18px 30px rgba(82, 47, 4, 0.12);
  transition: transform 180ms ease, filter 180ms ease;
}

.reel.is-spinning {
  transform: translateY(-6px) scale(1.02);
  filter: blur(1px) brightness(1.08);
}

.status-panel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.status-panel div {
  border-radius: 15px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.08);
}

.status-panel span {
  color: var(--muted);
}

.status-panel strong {
  display: block;
  margin-top: 4px;
  color: var(--gold-strong);
  font-size: 1.08rem;
}

.message {
  position: relative;
  z-index: 1;
  min-height: 38px;
  margin: 0;
  border-radius: 15px;
  padding: 9px 12px;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.22);
  font-size: 0.84rem;
  font-weight: 750;
  text-align: center;
}

.controls {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.25fr 1fr 0.8fr;
  gap: 9px;
}

.controls button {
  min-height: 44px;
  border: 0;
  border-radius: 15px;
  color: #211606;
  background: linear-gradient(180deg, var(--gold-strong), var(--gold));
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  font-weight: 950;
  transition: transform 120ms ease, filter 120ms ease;
}

.controls button:nth-child(2) {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.12);
}

.controls button:nth-child(3) {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.09);
}

.controls button:active {
  transform: translateY(1px) scale(0.98);
}

.controls button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.locked-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 6px;
}

.locked-grid div {
  min-height: 44px;
  display: grid;
  align-content: center;
  gap: 5px;
  border-radius: 17px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.07);
  text-align: center;
}

.locked-grid span {
  color: var(--muted);
}

.locked-grid strong {
  color: var(--gold-strong);
  font-size: 0.66rem;
}

@media (max-width: 360px) {
  .casino-shell {
    gap: 7px;
    padding: 8px;
  }

  .reel {
    min-height: 72px;
    font-size: 2rem;
  }

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

  .locked-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-height: 660px) {
  .casino-shell {
    gap: 6px;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .notice {
    display: none;
  }

  .machine {
    gap: 7px;
    padding: 10px 12px;
  }

  .machine-top {
    display: none;
  }

  .reels {
    padding: 8px;
  }

  .reel {
    min-height: 72px;
  }

  .message {
    min-height: 34px;
    padding: 8px 10px;
    font-size: 0.78rem;
  }

  .controls button {
    min-height: 40px;
    font-size: 0.82rem;
  }

  .locked-grid div {
    min-height: 40px;
  }
}
