/* Has Hunter Been Fired? */
:root {
  --felt-1:      #1a0d10;
  --felt-2:      #3d1216;
  --cab-1:       #8e1620;
  --cab-2:       #56090f;
  --gold:        #f2c14e;
  --gold-deep:   #b8860b;
  --gold-light:  #ffe9a8;
  --reel-bg:     #fbf7ef;
  --reel-edge:   #ddd3bd;
  --no-red:      #e01020;
  --tile:        112px;
  /* Where the NO comes to rest: down past the reels, scaled back, so the two
     faces and the logo stay readable once the drama is over. */
  --verdict-rest-y:     44%;
  --verdict-rest-scale: .42;
  --ink:         #12080a;
  --console:     #24151a;
}

* { box-sizing: border-box; }

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

body {
  background:
    radial-gradient(ellipse at 50% 12%, #4a1a1f 0%, var(--felt-2) 42%, var(--felt-1) 100%);
  color: #f7ecd8;
  font-family: "Trebuchet MS", "Segoe UI", Tahoma, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 24px 16px 0;
  overflow-x: hidden;
}

.stage {
  width: 100%;
  max-width: 760px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
}

/* ------------------------------------------------------------ headline */
.headline {
  margin: 4px 0 22px;
  text-align: center;
  font-size: clamp(1.7rem, 6.2vw, 3.4rem);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--gold-light);
  text-shadow:
    0 1px 0 var(--gold-deep),
    0 2px 0 #7a5a06,
    0 3px 0 #5e4505,
    0 6px 18px rgba(0, 0, 0, .65);
}

/* ------------------------------------------------------------- cabinet */
.machine-wrap {
  position: relative;
  width: 100%;
  max-width: 660px;
  display: flex;
  justify-content: center;
}

.machine {
  position: relative;
  width: 100%;
  padding: 16px 26px 20px;
  border-radius: 26px;
  background: linear-gradient(180deg, var(--cab-1) 0%, var(--cab-2) 100%);
  border: 3px solid var(--gold-deep);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, .22),
    inset 0 -14px 26px rgba(0, 0, 0, .45),
    0 24px 50px rgba(0, 0, 0, .55);
}

.machine.shake { animation: shake .5s ease-in-out 2; }

@keyframes shake {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  20%      { transform: translate(-6px, 2px) rotate(-.5deg); }
  40%      { transform: translate(6px, -2px) rotate(.5deg); }
  60%      { transform: translate(-4px, 1px) rotate(-.3deg); }
  80%      { transform: translate(4px, -1px) rotate(.3deg); }
}

/* -------------------------------------------------------------- marquee */
.marquee-bottom { margin: 14px 0 0; }

.marquee {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 12px;
  padding: 5px 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #2a1013, #430d13);
  border: 2px solid var(--gold-deep);
}

.marquee-text {
  font-size: clamp(.8rem, 2.6vw, 1.1rem);
  font-weight: 800;
  letter-spacing: 6px;
  color: var(--gold);
  opacity: .55;
  transition: opacity .2s;
}

.bulb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #6b3b10;
  box-shadow: inset 0 0 4px rgba(0, 0, 0, .6);
}

/* The fake win: gold lights for the moment the face is sitting on the payline. */
.machine.tease .marquee-text { opacity: 1; color: var(--gold); }
.machine.tease .bulb { animation: blink-gold .38s steps(1) infinite; }
.machine.tease .bulb:last-child { animation-delay: .19s; }

@keyframes blink-gold {
  0%   { background: var(--gold-light); box-shadow: 0 0 14px 4px rgba(242, 193, 78, .85); }
  50%  { background: #6b3b10; box-shadow: inset 0 0 4px rgba(0, 0, 0, .6); }
}

/* And then it isn't a win, so the lights go straight back out. Nothing
   celebrates on the miss — the machine only ever lit up for the fake. */

/* ---------------------------------------------------------------- reels */
.bezel {
  padding: 12px;
  border-radius: 16px;
  background: linear-gradient(180deg, #2b0e12, #180608);
  border: 2px solid var(--gold-deep);
  box-shadow: inset 0 4px 14px rgba(0, 0, 0, .7);
}

.reels {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  border-radius: 10px;
  overflow: hidden;
}

.reel {
  position: relative;
  height: calc(var(--tile) * 3);      /* three symbols; the middle one is the payline */
  overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(180deg, #e7dfcd 0%, var(--reel-bg) 28%, var(--reel-bg) 72%, #e7dfcd 100%);
  border: 2px solid var(--reel-edge);
  box-shadow: inset 0 8px 14px rgba(0, 0, 0, .28), inset 0 -8px 14px rgba(0, 0, 0, .28);
}

.strip { will-change: transform; }

.tile {
  height: var(--tile);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tile svg { width: 72%; height: 72%; display: block; }

/* The face is a portrait: crop it to a circle like a real reel symbol. */
.tile.jackpot img {
  width: 78%;
  height: 78%;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--gold);
  box-shadow: 0 0 0 2px #7a5a06, 0 4px 10px rgba(0, 0, 0, .4);
}

/* The miss tile is a wordmark, not a portrait — never crop it. Contain the whole
   thing on its own dark card so the lettering stays readable at reel size. */
.tile.miss img {
  width: 90%;
  height: 84%;
  object-fit: contain;
  padding: 7px 9px;
  border-radius: 10px;
  background: #0b0b0b;
  border: 2px solid var(--gold-deep);
  box-shadow: 0 4px 10px rgba(0, 0, 0, .45);
}

.reel.landed .tile.photo img,
.reel.landed .tile.miss svg { animation: pop .45s ease-out; }

/* Nothing of the reel's cream background should show through behind the card. */
.tile.miss { background: transparent; }

@keyframes pop {
  0%   { transform: scale(.82); }
  55%  { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.payline {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  transform: translateY(-1px);
  background: linear-gradient(90deg, transparent, rgba(224, 16, 32, .85) 12%, rgba(224, 16, 32, .85) 88%, transparent);
  opacity: .5;
  pointer-events: none;
}

/* Curved-glass shading. The top and bottom rows fall away into shadow so the
   payline row reads as the one that counts. */
.glass {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg,
    rgba(0, 0, 0, .46) 0%,
    rgba(0, 0, 0, .28) 14%,
    rgba(0, 0, 0, .06) 28%,
    rgba(255, 255, 255, .10) 40%,
    rgba(255, 255, 255, .05) 50%,
    rgba(0, 0, 0, .04) 60%,
    rgba(0, 0, 0, .12) 72%,
    rgba(0, 0, 0, .32) 86%,
    rgba(0, 0, 0, .50) 100%);
}

/* A soft band marking the pay row itself. */
.reels::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 33.333%;
  height: 33.333%;
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255, 226, 150, .38), inset 0 -1px 0 rgba(255, 226, 150, .38);
}

/* Visually gone, still announced. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------------------------------------------------------------- lever */
.lever {
  position: absolute;
  top: 34%;
  right: -34px;
  width: 58px;
  height: 172px;
  z-index: 3;
}

.lever-mount {
  position: absolute;
  bottom: 0;
  left: 2px;
  width: 46px;
  height: 26px;
  border-radius: 7px;
  background: linear-gradient(180deg, #d9d4cb, #7e7a75);
  box-shadow: 0 3px 7px rgba(0, 0, 0, .55), inset 0 2px 0 rgba(255, 255, 255, .5);
}

.lever-arm {
  position: absolute;
  bottom: 18px;
  left: 19px;
  width: 12px;
  height: 132px;
  transform-origin: 50% 100%;
  transform: rotate(5deg);
  transition: transform .45s cubic-bezier(.34, 1.42, .45, 1);
}

/* Down fast, held at the bottom for a beat, then it springs back up and settles
   — a real handle doesn't stay down while the reels run. */
.lever.pulled .lever-arm { animation: lever-pull 1.15s cubic-bezier(.3, .8, .35, 1) both; }

@keyframes lever-pull {
  0%   { transform: rotate(5deg); }
  20%  { transform: rotate(74deg); }
  36%  { transform: rotate(74deg); }
  68%  { transform: rotate(-3deg); }
  84%  { transform: rotate(9deg); }
  100% { transform: rotate(5deg); }
}

.lever-rod {
  position: absolute;
  inset: 0;
  border-radius: 6px;
  background: linear-gradient(90deg, #6f6b66, #e8e3da 40%, #97928b);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .45);
}

.lever-knob {
  position: absolute;
  top: -20px;
  left: 50%;
  width: 44px;
  height: 44px;
  margin-left: -22px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #ff9384, #c41a12 58%, #6f0a05);
  box-shadow: 0 6px 14px rgba(0, 0, 0, .55), inset 0 -5px 9px rgba(0, 0, 0, .35);
}

/* -------------------------------------------------------------- verdict */
.verdict {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(7rem, 34vw, 17rem);
  font-weight: 900;
  line-height: .8;
  letter-spacing: -.02em;
  color: var(--no-red);
  -webkit-text-stroke: clamp(3px, 1.1vw, 8px) #2a0002;
  paint-order: stroke fill;
  text-shadow:
    0 0 26px rgba(224, 16, 32, .75),
    0 10px 28px rgba(0, 0, 0, .75);
  pointer-events: none;
  opacity: 0;
  transform: scale(3.4) rotate(-14deg);
  z-index: 5;
}

.verdict.show {
  animation: slam .55s cubic-bezier(.2, .9, .25, 1.15) forwards,
             verdict-settle .55s cubic-bezier(.4, 0, .2, 1) 1.2s forwards;
}

/* It lands giant, holds for a beat, then drops clear of the reel windows. */
@keyframes verdict-settle {
  from { opacity: 1; transform: scale(1) rotate(-8deg); }
  to   { opacity: 1;
         transform: translateY(var(--verdict-rest-y))
                    scale(var(--verdict-rest-scale)) rotate(-8deg); }
}

@keyframes slam {
  0%   { opacity: 0; transform: scale(3.4) rotate(-14deg); }
  62%  { opacity: 1; transform: scale(.88) rotate(-7deg); }
  80%  { transform: scale(1.06) rotate(-8.5deg); }
  100% { opacity: 1; transform: scale(1) rotate(-8deg); }
}

/* --------------------------------------------------------------- bottom */
.again {
  margin: 30px 0;
  padding: 11px 26px;
  border-radius: 999px;
  border: 2px solid var(--gold-deep);
  background: linear-gradient(180deg, #2a1013, #430d13);
  color: var(--gold);
  font: inherit;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s, transform .12s, background .2s;
}

.again.show { opacity: 1; pointer-events: auto; }
.again:hover { background: linear-gradient(180deg, #3a171b, #5a1119); }
.again:active { transform: translateY(2px); }
.again:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

.foot {
  padding: 0 16px 22px;
  font-size: .75rem;
  letter-spacing: 1px;
  color: #8d6a62;
  text-align: center;
}

/* ------------------------------------------------------------ responsive */
@media (max-width: 560px) {
  :root { --tile: 84px; }
  .machine-wrap { padding-right: 56px; }
  .verdict { right: 56px; }
  :root { --verdict-rest-y: 44%; --verdict-rest-scale: .62; }
  .machine { padding: 12px 12px 14px; border-radius: 20px; }
  .lever { width: 36px; right: -6px; top: 34%; height: 108px; }
  .lever-arm { left: 13px; height: 66px; width: 9px; bottom: 12px; }
  .lever.pulled .lever-arm { animation-name: lever-pull-sm; }

  @keyframes lever-pull-sm {
    0%   { transform: rotate(5deg); }
    20%  { transform: rotate(58deg); }
    36%  { transform: rotate(58deg); }
    68%  { transform: rotate(-3deg); }
    84%  { transform: rotate(9deg); }
    100% { transform: rotate(5deg); }
  }
  .lever-mount { left: 0; width: 32px; height: 19px; }
  .lever-knob { width: 28px; height: 28px; margin-left: -14px; top: -13px; }
  .headline { margin-bottom: 16px; }
  .reels { gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  /* The reels ARE the page, so they still spin. Only the jarring parts go:
     no cabinet shake, and the verdict fades in instead of slamming. */
  .machine.shake { animation: none !important; }

  /* No slam at all here: it simply fades in where it would have come to rest. */
  .verdict.show { animation: verdict-fade .45s ease-out forwards; }

  @keyframes verdict-fade {
    from { opacity: 0;
           transform: translateY(var(--verdict-rest-y))
                      scale(var(--verdict-rest-scale)) rotate(-8deg); }
    to   { opacity: 1;
           transform: translateY(var(--verdict-rest-y))
                      scale(var(--verdict-rest-scale)) rotate(-8deg); }
  }

  .machine.tease .bulb { animation: none; background: var(--gold-light); }
}
