:root {
  --red: #c13f42;
  --red-mid: #b33639;
  --red-dark: #7f2023;
  --lip: #4e0f11;
  --panel: #131211;
  --shadow: rgba(0, 0, 0, 0.55);
  --row-h: 180px;
  --bulb-size: 14px;
  --bulb-gap: 14px;
  --bulb-color: #ffdc5c;
}

* { box-sizing: border-box; }

body.tf2-bg {
  margin: 0;
  font-family: "Impact", "Haettenschweiler", "Arial Black", system-ui, sans-serif;
  background: radial-gradient(ellipse at center, #4b2a64 0%, #311848 58%, #240e35 100%);
  color: #fff;
}

.slot {
  position: relative;
  width: min(900px, 95vw);
  margin: 0 auto;
}

/* ==============================
   DESKTOP vs MOBILE visibility
============================== */
.slot-desktop { display: block; }
.slot-mobile  { display: none; }

@media (max-width: 900px) {
  .slot-desktop { display: none; }
  .slot-mobile  { display: block; }
}

/* ==============================
   DESKTOP SLOT MACHINE
============================== */

/* Marquee */
.marquee-cap {
  width: 62%;
  min-width: 460px;
  height: 96px;
  margin: 0 auto -24px;
  border-radius: 20px 20px 14px 14px;
  background: linear-gradient(#d14f54, var(--red) 60%, var(--red-mid));
  border: 6px solid var(--red-dark);
  box-shadow: inset 0 -12px 0 var(--red-dark), 0 18px 30px var(--shadow);
  position: relative;
}
.cap-sheen {
  position: absolute;
  inset: 12px 16px auto 16px;
  height: 20px;
  border-radius: 12px;
  background: linear-gradient(transparent, rgba(255, 255, 255, 0.18) 55%, transparent);
}
.marquee-text {
  margin: 0;
  text-align: center;
  font-size: 32px;
  line-height: 70px;
  letter-spacing: 0.05em;
  color: white;
  text-transform: uppercase;
  text-shadow: 0 2px 0 #ffd27e, 0 0 14px rgba(255, 205, 93, 0.55);
  -webkit-text-stroke: 1px #ffd27e;
  font-weight: 900;
}

/* Cabinet */
.cabinet {
  position: relative;
  padding: 34px 46px 64px;
  border-radius: 18px;
  background: linear-gradient(#d14f54, var(--red) 58%, var(--red-mid));
  border: 7px solid var(--red-dark);
  box-shadow: inset 0 -14px 0 var(--lip), 0 34px 58px var(--shadow);
}
.bezel {
  position:relative;
  background: linear-gradient(#262221, #0f0d0c);
  border-radius: 16px;
  padding: 18px;
  box-shadow: inset 0 0 0 4px #0a0908, inset 0 10px 22px rgba(0, 0, 0, 0.65);
}
.screen {
  display: grid;
  place-items: center;
  height: 260px;
  width: 100%;
  border-radius: 14px;
  background-color: white;
  box-shadow: inset 0 12px 26px rgba(0, 0, 0, 0.6),
              inset 0 0 0 2px #1c1918,
              inset 0 -12px 22px rgba(0, 0, 0, 0.55);
}

/* Reels */
.reels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  width: 100%;
  padding: 10px 20px;
}
.reel-slot { display: flex; flex-direction: column; align-items: center; }
.reel-window {
  position: relative;
  height: var(--row-h);
  width: 100%;
  min-height: 140px;
  max-height: 200px;
  overflow: hidden;
  border-radius: 12px;
  border: 3px solid transparent;
  background:
    linear-gradient(#272727, #272727) padding-box,
    linear-gradient(135deg,#fff4c4,#ffe58a 25%,#ffd144 45%,#f2b93d 60%,#e59a1a 80%,#b06f12) border-box;
  box-shadow:
    inset 0 14px 22px rgba(0,0,0,.65),
    inset 0 -14px 22px rgba(0,0,0,.65),
    0 0 18px rgba(255,216,106,.50),
    0 0 28px rgba(242,185,61,.28);
  display: grid;
  place-items: center;
}
.symbols {
  list-style:none;
  margin:0;
  padding:0;
  transform:translate3d(0,0,0);
  transition: transform 1s cubic-bezier(0.2,0.7,0.2,1);
}
.symbols li {
  height: var(--row-h);
  display: grid;
  grid-template-rows: 1fr auto;
  place-items: center;
  padding: 8px 8px 12px;
}
.symbols img {
  max-height: calc(var(--row-h) - 48px);
  object-fit: contain;
  border-radius: 10px;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.35));
}
.symbols .label {
  margin-top:4px;
  margin-bottom:8px;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.reel-window.is-spinning .symbols {
  filter: saturate(0.95) brightness(0.98);
}

/* Lever */
.lever {
  all: unset;
  position: absolute;
  right: -140px;
  top: 50%;
  width: 200px;
  height: 220px;
  transform: translateY(-50%);
  cursor: pointer;
  z-index: 4;
}
.lever-body {
  position:absolute;
  left:60px;
  top:90%;
  transform:translateY(-50%);
  width:60px;
  height:112px;
  border-radius:32px;
  background: radial-gradient(circle at 30% 30%, #f8e9c7, #e4c98f 45%, #b78a3f 72%);
  border:2px solid #7a5521;
}
.lever-hinge {
  position:absolute;
  right:100px;
  top:20px;
  width:14px;
  height:190px;
  transform-origin:50% 168px;
  transform: rotate(6deg);
  transition: transform 0.22s cubic-bezier(0.25,1.3,0.2,1);
}
.lever-arm {
  position:absolute;
  inset:0;
  border-radius:14px;
  background:linear-gradient(#efdcb6,#cbaa6e);
  border:2px solid #7a5521;
}
.lever-knob {
  position:absolute;
  left:50%;
  top:-26px;
  width:48px;
  height:48px;
  transform:translateX(-50%);
  border-radius:50%;
  background: radial-gradient(circle at 30% 30%, #ff8a8b, #c12126 70%);
  border:3px solid #6c0c0f;
}
.lever:active .lever-hinge {
  transform: rotate(65deg);
  transition: transform 0.12s cubic-bezier(0.2,0.8,0.2,1);
}

/* Base & Spin */
.base {
  width: 94%;
  height: 200px;
  margin: 0 auto 48px;
  border-radius: 10px 10px 12px 12px;
  background: linear-gradient(#c6494d, var(--red) 58%, var(--red-mid));
  border: 7px solid var(--red-dark);
}
.spin {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -150px;

  width: 260px;
  height: 96px;
  border: 0;
  border-radius: 28px;

  font-size: 38px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 900;
  color: #5a0506;
  text-shadow: 0 2px 2px rgba(255, 255, 255, 0.7);

  background: radial-gradient(circle at 30% 30%, #fff6c9 0%, #ffe17a 40%, #f2b93d 70%, #c98a1a 100%);

  box-shadow:
    inset 0 -8px 0 #a56b00,
    inset 0 4px 8px rgba(255,255,255,0.6),
    0 0 16px rgba(255, 235, 120, 0.9),
    0 0 32px rgba(255, 200, 80, 0.8),
    0 0 64px rgba(255, 170, 40, 0.7);

  cursor: pointer;
  transition: transform 0.15s ease;

  animation: spinPulse 2s infinite ease-in-out;
}

.spin:hover {
  background: radial-gradient(circle at 30% 30%, #fffbe3 0%, #ffe58a 40%, #fbd144 70%, #d59f26 100%);
}

.spin:active {
  transform: translateX(-50%) translateY(3px) scale(0.96);
  box-shadow:
    inset 0 -4px 0 #7a4a00,
    inset 0 3px 6px rgba(255,255,255,0.4),
    0 0 8px rgba(255, 215, 90, 0.8),
    0 0 16px rgba(255, 180, 50, 0.7);
}

/* Glowing pulse animation */
@keyframes spinPulse {
  0% {
    box-shadow:
      inset 0 -8px 0 #a56b00,
      inset 0 4px 8px rgba(255,255,255,0.6),
      0 0 12px rgba(255, 235, 120, 0.7),
      0 0 24px rgba(255, 200, 80, 0.6),
      0 0 40px rgba(255, 170, 40, 0.5);
  }
  50% {
    box-shadow:
      inset 0 -8px 0 #a56b00,
      inset 0 4px 8px rgba(255,255,255,0.6),
      0 0 20px rgba(255, 245, 160, 1),
      0 0 40px rgba(255, 210, 100, 0.9),
      0 0 80px rgba(255, 180, 60, 0.8);
  }
  100% {
    box-shadow:
      inset 0 -8px 0 #a56b00,
      inset 0 4px 8px rgba(255,255,255,0.6),
      0 0 12px rgba(255, 235, 120, 0.7),
      0 0 24px rgba(255, 200, 80, 0.6),
      0 0 40px rgba(255, 170, 40, 0.5);
  }
}


/* ==============================
   MOBILE SLOT MACHINE
============================== */
.slot-mobile {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

.mobile-screen {
  background: linear-gradient(#d14f54, var(--red) 58%, var(--red-mid));
  border: 5px solid var(--red-dark);
  border-radius: 16px;
  padding: 16px;
}

.slot-mobile .reels {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px;
}
.slot-mobile .reel-window {
  height: 140px;
  min-height: 120px;
  max-height: 160px;
}
.slot-mobile .symbols li { height: 140px; }
.slot-mobile .symbols img { max-height: 90px; }

.mobile-spin {
  position: relative;
  left: unset;
  transform: unset;
  bottom:unset;
  margin-top: 16px;
  width: 220px;
  height: 72px;
  border: 0;
  border-radius: 14px;
  font-size: 22px;
  font-weight: 900;
  color: #7a0c0e;
  background: linear-gradient(#ffe17a,#f2b93d 60%,#c98a1a);
  box-shadow:
    inset 0 -6px 0 #a56b00,
    0 12px 20px rgba(0,0,0,.4),
    0 0 12px rgba(255,215,90,.5);
  cursor: pointer;
}
.mobile-spin:active {
  transform:unset;
  box-shadow: inset 0 -6px 0 #a56b00,
              0 12px 20px rgba(0, 0, 0, 0.5);
}

/* ==============================
   FILTERS (shared)
============================== */
.filters-bar {
  position: relative;
  width: min(300px, 90%);
  height: 56px;
  margin: 12px auto 0;
  border-radius: 9999px;
  border: 2px solid transparent;
  background:
    linear-gradient(#201d1b, #2a2624) padding-box,
    linear-gradient(135deg,#fff4c4,#ffd86a 35%,#f2b93d 60%,#e59a1a 85%,#b06f12) border-box;
  box-shadow:
    0 0 14px rgba(242,185,61,.25),
    inset 0 6px 12px rgba(0,0,0,.35);
}
.filters-bar:focus-within {
  box-shadow:
    0 0 18px rgba(255,216,106,.35),
    inset 0 6px 12px rgba(0,0,0,.35);
}
.select-wrap {
  position: absolute;
  inset: 4px;
  border-radius: 9999px;
  background: linear-gradient(180deg,#2a2624,#201d1b);
  box-shadow: inset 0 0 0 1px rgba(255,216,106,.25);
}
.select-wrap select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  -webkit-appearance: none;
  appearance: none;
  border: none;
  outline: none;
  background: transparent;
  color: #ffe58a;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: 16px;
  padding: 0 44px 0 16px;
  border-radius: 9999px;
  cursor: pointer;
}
.select-wrap .caret {
  position: absolute;
  top: 50%;
  right: 16px;
  width: 12px;
  height: 12px;
  transform: translateY(-50%) rotate(45deg);
  border-right: 2px solid #ffd86a;
  border-bottom: 2px solid #ffd86a;
  opacity: .9;
  pointer-events: none;
}
.select-wrap select option,
.select-wrap select optgroup {
  background-color: #0e0e0e;
  color: #ffffff;
}
.select-wrap select option:checked,
.select-wrap select option:hover {
  background-color: #1b1b1b;
  color: #ffe58a;
}
.select-wrap select::-webkit-scrollbar { width: 10px; }
.select-wrap select::-webkit-scrollbar-thumb { background: #2a2a2a; }
.select-wrap select::-webkit-scrollbar-track { background: #0e0e0e; }

/* ==============================
   REDUCED MOTION
============================== */
@media (prefers-reduced-motion: reduce) {
  .lever-hinge,
  .symbols {
    transition: none !important;
  }
}
.bulb-frame {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

.bulb {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: #ffdc5c;
  box-shadow: 0 0 8px #ffdc5c;
  animation: blink 1s infinite ease-in-out;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}
