:root {
  --bg-deep: #22030b;
  --bg-wine: #5f0f1d;
  --bg-plum: #310918;
  --panel-ink: #1a0e14;
  --cream: #fff0cf;
  --gold: #f7c767;
  --gold-deep: #b67411;
  --gold-shadow: rgba(182, 116, 17, 0.45);
  --ruby: #c92443;
  --ruby-deep: #7a0d24;
  --emerald: #0e4e40;
  --emerald-soft: #17735e;
  --text-main: #fff7e5;
  --text-dark: #25140f;
  --lamp-on: #ffe692;
  --lamp-red: #ff4f75;
  --lamp-red-deep: #a10d31;
  --lamp-shadow: rgba(255, 230, 146, 0.45);
  --border-soft: rgba(255, 255, 255, 0.12);
  --shadow-heavy: 0 24px 60px rgba(0, 0, 0, 0.45);
  --radius-xl: 34px;
  --radius-lg: 24px;
  --radius-md: 18px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  min-height: 100vh;
  font-family: "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top, rgba(247, 199, 103, 0.15), transparent 28%),
    radial-gradient(circle at 15% 20%, rgba(244, 72, 105, 0.22), transparent 22%),
    radial-gradient(circle at 85% 18%, rgba(23, 115, 94, 0.24), transparent 25%),
    linear-gradient(180deg, #460514 0%, var(--bg-deep) 48%, #140106 100%);
  color: var(--text-main);
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 92%);
}

.page-shell {
  position: relative;
  width: min(1380px, calc(100vw - 48px));
  height: 100vh;
  margin: 0 auto;
  padding: 18px 0 20px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 18px;
}

.page-glow {
  position: absolute;
  inset: auto auto 20% 0;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(247, 199, 103, 0.18), transparent 70%);
  filter: blur(6px);
  pointer-events: none;
}

.page-glow-right {
  inset: 8% 0 auto auto;
  background: radial-gradient(circle, rgba(23, 115, 94, 0.18), transparent 72%);
}

.marquee-frame {
  position: relative;
  padding: 14px;
  border-radius: calc(var(--radius-xl) + 10px);
  background:
    radial-gradient(circle, var(--lamp-on) 0 4px, transparent 4.8px) 0 0 / 28px 28px,
    linear-gradient(140deg, #5d0717 0%, #c02542 38%, #6e0d23 100%);
  box-shadow:
    0 0 0 1px rgba(255, 240, 207, 0.25),
    0 0 26px rgba(255, 230, 146, 0.22),
    var(--shadow-heavy);
}

.machine.marquee-frame {
  background:
    radial-gradient(circle, var(--lamp-red) 0 4px, transparent 4.8px) 0 0 / 22px 22px,
    radial-gradient(circle, var(--lamp-on) 0 2.8px, transparent 3.8px) 11px 11px / 22px 22px,
    linear-gradient(140deg, #5d0717 0%, #c02542 38%, #6e0d23 100%);
  box-shadow:
    0 0 0 1px rgba(255, 240, 207, 0.25),
    0 0 26px rgba(255, 230, 146, 0.18),
    0 0 32px rgba(255, 79, 117, 0.24),
    var(--shadow-heavy);
}

.marquee-frame::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: calc(var(--radius-xl) + 2px);
  border: 1px solid rgba(255, 250, 235, 0.16);
  pointer-events: none;
}

.marquee-inner {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.eyebrow,
.machine-kicker,
.result-kicker,
.detail-label {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.26em;
  font-size: 0.75rem;
}

.brand-lockup h1,
.machine-head h2,
.result-title,
.detail-title,
.reel-value,
.spin-button,
.copy-button {
  font-family: "Bodoni 72", "Didot", "Times New Roman", serif;
}

.topbar {
  display: flex;
  align-items: end;
}

.brand-lockup h1 {
  margin: 6px 0 0;
  font-size: clamp(2.2rem, 4.5vw, 3.6rem);
  line-height: 0.92;
  text-wrap: balance;
}

.stage-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(520px, 0.92fr);
  gap: 20px;
  min-height: 0;
  align-items: stretch;
}

.machine,
.result-card {
  min-height: 0;
}

.machine-shell {
  height: 100%;
  padding: 22px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), transparent 18%),
    linear-gradient(180deg, #2b171b 0%, #1a0d11 100%);
}

.machine-head {
  display: block;
}

.detail-label,
.eyebrow {
  color: rgba(255, 232, 176, 0.86);
}

.machine-head h2 {
  margin: 0;
  font-size: clamp(1.8rem, 2.6vw, 2.4rem);
  line-height: 0.98;
  max-width: 12ch;
}

.reel-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  min-height: 0;
  align-self: stretch;
}

.reel-column {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  min-height: 0;
}

.reel-label {
  font-size: 0.9rem;
  color: rgba(255, 241, 200, 0.88);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.reel-window {
  position: relative;
  min-height: 0;
  height: 100%;
  padding: 18px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  border: 1px solid rgba(255, 244, 216, 0.12);
  background:
    radial-gradient(circle, rgba(255, 79, 117, 0.98) 0 2.8px, transparent 3.6px) top 9px center / 18px 18px repeat-x,
    radial-gradient(circle, rgba(255, 79, 117, 0.98) 0 2.8px, transparent 3.6px) bottom 9px center / 18px 18px repeat-x,
    radial-gradient(circle, rgba(255, 79, 117, 0.98) 0 2.8px, transparent 3.6px) left 9px center / 18px 18px repeat-y,
    radial-gradient(circle, rgba(255, 79, 117, 0.98) 0 2.8px, transparent 3.6px) right 9px center / 18px 18px repeat-y,
    linear-gradient(180deg, rgba(255, 245, 226, 0.04), transparent 16%),
    radial-gradient(circle at top, rgba(255, 255, 255, 0.08), transparent 30%),
    linear-gradient(180deg, #0f0f11 0%, #261318 100%);
  overflow: hidden;
  box-shadow:
    0 0 0 2px rgba(161, 13, 49, 0.55),
    0 0 18px rgba(255, 79, 117, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 -28px 48px rgba(0, 0, 0, 0.32),
    0 12px 28px rgba(0, 0, 0, 0.24);
}

.reel-window::before,
.reel-window::after {
  content: "";
  position: absolute;
  inset-inline: 10px;
  height: 32px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 244, 222, 0.22), transparent);
  filter: blur(6px);
  pointer-events: none;
}

.reel-window::before {
  top: 10px;
}

.reel-window::after {
  bottom: 8px;
  transform: rotate(180deg);
}

.reel-window.is-spinning {
  border-color: rgba(247, 199, 103, 0.45);
  box-shadow:
    0 0 0 2px rgba(161, 13, 49, 0.72),
    0 0 24px rgba(255, 79, 117, 0.24),
    0 0 0 1px rgba(247, 199, 103, 0.22),
    0 0 18px rgba(247, 199, 103, 0.18),
    inset 0 -28px 48px rgba(0, 0, 0, 0.3);
}

.reel-window.is-spinning .reel-value {
  animation: shake-reel 0.13s linear infinite;
  filter: blur(0.9px);
}

.reel-window.is-locked {
  animation: lock-flash 0.45s ease;
}

.reel-value {
  position: relative;
  z-index: 1;
  margin: 0;
  text-align: center;
  text-wrap: balance;
  color: var(--cream);
  font-size: clamp(1.5rem, 1.8vw, 2.2rem);
  line-height: 1.04;
  text-shadow:
    0 2px 0 rgba(0, 0, 0, 0.35),
    0 0 22px rgba(255, 229, 150, 0.14);
}

.machine-controls {
  display: grid;
  gap: 8px;
  align-self: end;
  padding-top: 4px;
}

.spin-button,
.copy-button {
  appearance: none;
  border: 0;
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    filter 160ms ease,
    opacity 160ms ease;
}

.spin-button {
  width: 100%;
  padding: 16px 20px;
  border-radius: 20px;
  background:
    linear-gradient(180deg, #ffe49d 0%, #f6c75d 45%, #cb8a1a 100%);
  color: #381607;
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  box-shadow:
    0 10px 0 #6a3600,
    0 18px 26px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.spin-button:hover,
.copy-button:hover {
  transform: translateY(-2px);
  filter: brightness(1.03);
}

.spin-button:active,
.copy-button:active {
  transform: translateY(4px);
}

.spin-button:disabled,
.copy-button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  filter: saturate(0.65);
}

.machine-note {
  margin: 0;
  color: rgba(255, 244, 222, 0.76);
  font-size: 0.88rem;
  text-align: center;
}

.result-card {
  position: relative;
  height: 100%;
  min-height: 0;
  padding: 22px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 16px;
  border-radius: calc(var(--radius-xl) + 4px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 14%),
    linear-gradient(180deg, #f9e3b2 0%, #f6d494 100%);
  color: var(--text-dark);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.18),
    0 16px 42px rgba(0, 0, 0, 0.34);
}

.result-card::before {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(106, 54, 0, 0.12);
  pointer-events: none;
}

.pitch-shell {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
}

.pitch-copy-group {
  min-width: 0;
}

.result-title {
  margin: 0;
  font-size: clamp(1.6rem, 2.2vw, 2.2rem);
  line-height: 0.96;
  max-width: 11ch;
}

.pitch {
  margin: 10px 0 0;
  font-size: clamp(1.12rem, 1.18vw, 1.34rem);
  line-height: 1.46;
  max-width: 44ch;
  font-weight: 600;
}

.pitch-actions {
  width: 220px;
  display: flex;
}

.copy-button {
  width: 100%;
  padding: 14px 18px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, #1f6d5b 0%, #0f4e40 100%);
  color: var(--text-main);
  font-size: 1rem;
  box-shadow:
    0 8px 0 #082a21,
    0 14px 22px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  min-height: 0;
  align-content: start;
}

.detail-card {
  min-width: 0;
  padding: 16px 14px;
  border-radius: 20px;
  display: grid;
  align-content: start;
  gap: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.2));
  border: 1px solid rgba(106, 54, 0, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.36);
}

.detail-copy {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.34;
  color: rgba(61, 23, 10, 0.82);
}

.detail-main {
  font-size: 0.98rem;
  line-height: 1.3;
  font-weight: 700;
  color: #3d170a;
}

@keyframes shake-reel {
  0% {
    transform: translateY(-16px) scaleY(1.04);
  }

  50% {
    transform: translateY(16px) scaleY(0.97);
  }

  100% {
    transform: translateY(-16px) scaleY(1.04);
  }
}

@keyframes lock-flash {
  0% {
    box-shadow:
      0 0 0 1px rgba(247, 199, 103, 0.24),
      0 0 0 rgba(247, 199, 103, 0),
      inset 0 -28px 48px rgba(0, 0, 0, 0.3);
  }

  50% {
    box-shadow:
      0 0 0 1px rgba(247, 199, 103, 0.34),
      0 0 38px rgba(247, 199, 103, 0.32),
      inset 0 -28px 48px rgba(0, 0, 0, 0.2);
  }

  100% {
    box-shadow:
      0 0 0 1px rgba(247, 199, 103, 0),
      0 0 0 rgba(247, 199, 103, 0),
      inset 0 -28px 48px rgba(0, 0, 0, 0.3);
  }
}

@media (max-width: 1240px) {
  .stage-grid {
    grid-template-columns: minmax(0, 1fr) minmax(470px, 0.9fr);
  }

  .result-title,
  .machine-head h2 {
    max-width: none;
  }

  .pitch-shell {
    flex-direction: column;
  }

  .pitch-actions {
    width: 100%;
  }

  .copy-button {
    width: 210px;
  }
}

@media (max-height: 820px) {
  .page-shell {
    padding: 14px 0;
    gap: 12px;
  }

  .topbar {
    align-items: start;
  }

  .brand-lockup h1 {
    font-size: clamp(2rem, 4vw, 3.1rem);
  }

  .machine-shell,
  .result-card {
    padding: 18px;
  }

  .machine-shell {
    gap: 12px;
  }

  .machine-head h2,
  .result-title {
    font-size: clamp(1.65rem, 2.2vw, 2.2rem);
  }

  .reel-board {
    gap: 12px;
  }

  .reel-window {
    min-height: 170px;
    padding: 14px;
  }

  .reel-value {
    font-size: clamp(1.28rem, 1.45vw, 1.8rem);
  }

  .spin-button {
    padding: 14px 16px;
    font-size: 1.16rem;
  }

  .machine-note {
    font-size: 0.88rem;
  }

  .pitch {
    margin-top: 10px;
    font-size: 1.02rem;
    line-height: 1.4;
  }

  .copy-button {
    padding: 12px 14px;
    font-size: 0.94rem;
  }

  .detail-grid {
    gap: 10px;
  }

  .detail-card {
    padding: 12px 11px 10px;
  }

  .detail-copy {
    font-size: 0.82rem;
    line-height: 1.24;
  }

  .detail-main {
    font-size: 0.9rem;
    line-height: 1.22;
  }
}

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

  body {
    overflow: auto;
  }

  .page-shell {
    height: auto;
    min-height: 100vh;
  }

  .topbar {
    align-items: start;
  }

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

@media (max-width: 760px) {
  .page-shell {
    width: min(100vw - 24px, 100%);
    padding-top: 16px;
    gap: 14px;
  }

  .machine-shell,
  .result-card {
    padding: 18px;
  }

  .machine-head {
    flex-direction: column;
    align-items: start;
  }

  .reel-board {
    grid-template-columns: 1fr;
  }

  .reel-window {
    min-height: 160px;
  }

  .pitch-actions {
    grid-template-columns: 1fr;
  }
}
