:root {
  color-scheme: dark;
  --gold: #f8c04e;
  --gold-bright: #ffe38a;
  --amber: #d88416;
  --black: #030303;
  --panel: #10100f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow: auto;
  background:
    radial-gradient(circle at 50% 8%, rgba(255, 198, 67, .16), transparent 28%),
    linear-gradient(135deg, #050505 0%, #111 38%, #050505 100%);
  color: #fff6cb;
  font-family: Georgia, "Times New Roman", serif;
}

button {
  font: inherit;
}

.slot-page {
  width: 100vw;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(2px, .35vw, 5px);
}

.slot-shell {
  width: min(94vw, 1320px);
  display: grid;
  gap: clamp(3px, .48vw, 8px);
  position: relative;
}

.slot-shell::before {
  content: "";
  position: absolute;
  z-index: 40;
  left: 16%;
  right: 16%;
  top: 19%;
  height: 52%;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 244, 179, .76), rgba(255, 190, 34, .34) 22%, transparent 56%),
    repeating-conic-gradient(from 0deg, rgba(255, 218, 95, .5) 0deg 8deg, transparent 8deg 20deg);
  mix-blend-mode: screen;
  filter: blur(1px) drop-shadow(0 0 28px rgba(255, 196, 44, .72));
  transform: scale(.76);
}

.win-celebration::before {
  animation: winBurst 1.45s ease-out both;
}

.jackpot-celebration::before {
  animation: jackpotBurst 2.3s ease-out both;
}

.cabinet {
  position: relative;
  aspect-ratio: 3 / 2;
  width: 100%;
  min-height: 0;
  isolation: isolate;
  filter: drop-shadow(0 24px 45px rgba(0, 0, 0, .75));
}

.cabinet-art {
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image: url("../../assets/frame/kot-slot-clean.png");
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
  pointer-events: none;
}

.brand-mark {
  position: absolute;
  z-index: 6;
  left: 18.4%;
  top: 10.8%;
  width: 63.2%;
  text-align: center;
  color: var(--gold-bright);
  text-shadow: 0 0 10px #000, 0 0 18px rgba(255, 190, 55, .8);
  pointer-events: none;
}

.brand-777 {
  display: none;
}

.brand-kot {
  margin-top: 0;
  font-size: clamp(24px, 3.25vw, 56px);
  font-weight: 900;
  line-height: .92;
  letter-spacing: .045em;
  color: #ffd865;
  text-transform: uppercase;
  -webkit-text-stroke: 1px rgba(78, 42, 0, .75);
  text-shadow:
    0 1px 0 #fff6b6,
    0 2px 0 #6a3900,
    0 4px 8px rgba(0, 0, 0, .95),
    0 0 16px rgba(255, 184, 28, .72);
}

.brand-kot::before {
  content: none;
}

.brand-kot strong {
  display: none;
}

.credit {
  position: relative;
  z-index: 4;
  padding: .34rem .58rem;
  border: 2px solid rgba(255, 207, 83, .75);
  background: linear-gradient(180deg, rgba(21, 18, 12, .95), rgba(0, 0, 0, .95));
  box-shadow: inset 0 0 14px rgba(255, 184, 28, .25), 0 0 14px rgba(255, 171, 15, .2);
  text-align: center;
}

.label {
  display: block;
  margin-bottom: .12rem;
  color: var(--gold);
  font-size: clamp(8px, .76vw, 12px);
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-shadow:
    0 1px 0 rgba(255, 246, 182, .8),
    0 2px 0 rgba(80, 43, 0, .9),
    0 0 9px rgba(255, 184, 28, .48);
}

.credit strong,
.bet-meter strong {
  display: block;
  color: #fff2bc;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(13px, 1.35vw, 22px);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: .04em;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, .75),
    0 2px 0 rgba(82, 43, 0, .95),
    0 0 12px rgba(255, 215, 91, .48);
}

.credit-balance {
  width: 100%;
}

.reel-stage {
  position: absolute;
  z-index: 5;
  left: 17.55%;
  top: 23.8%;
  width: 64.9%;
  height: 45.1%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5.8%;
  padding: 0;
  background: transparent;
  border-radius: clamp(12px, 1.2vw, 18px);
  box-shadow: none;
}

.payline {
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  top: 50%;
  height: 3px;
  transform: translateY(-50%);
  background: linear-gradient(90deg, transparent, rgba(255, 225, 113, .95), transparent);
  box-shadow: 0 0 10px rgba(255, 220, 98, .82);
  pointer-events: none;
}

.reel {
  position: relative;
  z-index: 1;
  overflow: hidden;
  height: 100%;
  border: 0;
  border-radius: clamp(8px, 1vw, 14px);
  background: transparent;
  box-shadow:
    inset 0 24px 34px rgba(0, 0, 0, .58),
    inset 0 -28px 36px rgba(0, 0, 0, .72);
  contain: paint;
}

.reel::before,
.reel::after {
  content: "";
  position: absolute;
  z-index: 6;
  left: 0;
  right: 0;
  height: 33.333%;
  pointer-events: none;
}

.reel::before {
  top: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, .36), transparent);
}

.reel::after {
  bottom: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, .36), transparent);
}

.reel-track {
  width: 100%;
  height: auto;
  will-change: transform;
}

.symbol-row {
  display: grid;
  place-items: center;
  padding: 3.8% 3.2% 6.2%;
  background: transparent;
  overflow: hidden;
}

.symbol-row img {
  display: block;
  width: auto;
  height: auto;
  max-width: 88%;
  max-height: 86%;
  object-fit: contain;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .62));
}

.symbol-row[data-symbol="timber_nutt_motorcycle_pose"] img,
.symbol-row[data-symbol="kot_mascots_summer"] img {
  max-width: 78%;
  max-height: 76%;
}

.symbol-row-blank::after {
  content: "";
  display: none;
}

.reel.is-settling {
  animation: reelSettle .26s ease-out;
}

.handle {
  position: absolute;
  z-index: 7;
  right: .1%;
  top: 23.8%;
  width: 9.6%;
  height: 50.6%;
  border: 0;
  background: transparent;
  cursor: pointer;
  transform-origin: 50% 82%;
}

.handle:disabled {
  cursor: not-allowed;
}

.handle-knob,
.handle-stem,
.handle-base {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle at 34% 22%, #fff4b6 0 8%, var(--gold-bright) 16%, #d17d08 54%, #5c2a00 100%);
  box-shadow: inset -9px -10px 18px rgba(0, 0, 0, .42), 0 0 22px rgba(255, 184, 27, .56);
}

.handle-knob {
  display: block;
  top: 0;
  width: 74%;
  aspect-ratio: 1;
  border-radius: 50%;
}

.handle-stem {
  display: block;
  top: 14%;
  width: 22%;
  height: 72%;
  border-radius: 999px;
}

.handle-base {
  bottom: 0;
  width: 94%;
  height: 27%;
  border-radius: 999px;
}

.handle-pulled .handle {
  animation: handlePull .52s cubic-bezier(.28, .9, .18, 1);
}

.control-row {
  position: relative;
  z-index: 1;
  width: 100%;
  display: grid;
  grid-template-columns: 1.05fr 1fr 1.18fr 1fr .9fr;
  gap: clamp(5px, .7vw, 12px);
  align-items: center;
}

.panel-button,
.spin-button,
.bet-meter {
  min-height: clamp(34px, 4.05vw, 62px);
  border: 1px solid rgba(255, 211, 91, .78);
  color: var(--gold-bright);
  background:
    linear-gradient(180deg, rgba(255, 222, 125, .18), transparent 26%),
    linear-gradient(180deg, #272017, #070707 62%, #1b1309);
  box-shadow:
    inset 0 1px 0 rgba(255, 244, 177, .42),
    inset 0 -8px 18px rgba(0, 0, 0, .55),
    inset 0 0 16px rgba(255, 181, 36, .2),
    0 0 12px rgba(255, 184, 28, .22);
  text-align: center;
}

.panel-button,
.spin-button {
  cursor: pointer;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 900;
  letter-spacing: .055em;
  text-transform: uppercase;
  text-shadow:
    0 1px 0 rgba(255, 246, 181, .85),
    0 2px 0 rgba(88, 47, 0, .95),
    0 4px 8px rgba(0, 0, 0, .9),
    0 0 12px rgba(255, 190, 46, .52);
}

.panel-button {
  padding: .24rem .38rem;
  font-size: clamp(9px, .84vw, 15px);
  line-height: 1.05;
}

.spin-button {
  min-height: clamp(46px, 5.2vw, 78px);
  border-radius: 22px;
  font-size: clamp(16px, 1.68vw, 30px);
  background:
    radial-gradient(circle at 42% 37%, rgba(255, 253, 202, .18), transparent 18%),
    radial-gradient(circle at 35% 25%, #fff2a7 0 6%, #e0a11e 18%, #17120c 58%, #030303 100%);
}

.panel-button:hover:not(:disabled),
.spin-button:hover:not(:disabled),
.handle:hover:not(:disabled) {
  filter: brightness(1.15);
}

.panel-button:active:not(:disabled),
.spin-button:active:not(:disabled) {
  transform: translateY(2px);
}

button:disabled {
  opacity: .58;
}

.bet-meter {
  display: grid;
  place-items: center;
  padding: .18rem;
}

.bet-meter .label {
  font-size: clamp(7px, .7vw, 12px);
}

.bet-meter strong {
  font-size: clamp(14px, 1.52vw, 24px);
}

.status {
  position: absolute;
  z-index: 7;
  left: 40.4%;
  right: 40.4%;
  bottom: 16.2%;
  margin: 0;
  color: var(--gold-bright);
  font-size: clamp(8px, .94vw, 15px);
  font-weight: 900;
  text-align: center;
  text-shadow: 0 0 14px rgba(255, 190, 35, .7), 0 2px 3px #000;
}

.disclaimer {
  position: absolute;
  z-index: 7;
  left: 19.8%;
  bottom: 11.3%;
  max-width: 17.2%;
  margin: 0;
  color: rgba(255, 239, 193, .72);
  font: 700 clamp(10px, .85vw, 14px) "Trebuchet MS", Arial, sans-serif;
}

.control-deck {
  position: relative;
  z-index: 10;
  width: 100%;
  padding: clamp(4px, .55vw, 9px);
  border: 1px solid rgba(255, 211, 91, .58);
  background:
    linear-gradient(180deg, rgba(25, 22, 16, .95), rgba(2, 2, 2, .96)),
    #070707;
  box-shadow: 0 0 22px rgba(255, 184, 28, .2), inset 0 0 18px rgba(255, 184, 28, .12);
}

.meter-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr);
  gap: clamp(6px, .8vw, 12px);
  margin-bottom: clamp(5px, .7vw, 12px);
}

.menu-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: clamp(5px, .7vw, 12px);
  margin-bottom: clamp(5px, .62vw, 10px);
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, .68);
}

.modal-backdrop[hidden] {
  display: none;
}

.slot-modal {
  position: relative;
  width: min(76%, 780px);
  max-height: 76%;
  overflow: auto;
  padding: clamp(16px, 2vw, 28px);
  border: 2px solid rgba(255, 211, 91, .9);
  background: linear-gradient(180deg, rgba(24, 21, 15, .98), rgba(2, 2, 2, .98));
  box-shadow: 0 0 30px rgba(255, 184, 28, .32), inset 0 0 18px rgba(255, 184, 28, .18);
  color: #fff8d8;
  font-family: "Trebuchet MS", Arial, sans-serif;
}

.slot-modal h2 {
  margin: 0 0 .8rem;
  color: var(--gold-bright);
  font: 900 clamp(20px, 2vw, 32px) Georgia, "Times New Roman", serif;
}

.modal-content {
  display: grid;
  gap: .65rem;
  font-size: clamp(12px, 1vw, 16px);
}

.modal-content table {
  width: 100%;
  border-collapse: collapse;
}

.modal-content th,
.modal-content td {
  padding: .4rem .5rem;
  border-bottom: 1px solid rgba(255, 211, 91, .28);
  text-align: left;
}

.modal-close {
  position: absolute;
  right: 10px;
  top: 8px;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 211, 91, .6);
  color: var(--gold-bright);
  background: #080808;
  cursor: pointer;
}

.is-spinning .payline {
  animation: paylinePulse .35s linear infinite alternate;
}

.needs-credits .credit-balance {
  animation: creditAlert .6s ease-in-out;
}

.win-celebration .cabinet {
  animation: cabinetWinKick .52s ease-out;
}

.jackpot-celebration .cabinet {
  animation: cabinetJackpotKick .9s ease-out;
}

.win-celebration .payline,
.jackpot-celebration .payline {
  height: 5px;
  animation: paylineWinFlash 1.2s ease-out both;
}

.win-celebration .status,
.jackpot-celebration .status {
  animation: statusWinPop 1.2s ease-out both;
}

@keyframes reelSettle {
  0% { transform: translateY(0); }
  42% { transform: translateY(9px); }
  72% { transform: translateY(-4px); }
  100% { transform: translateY(0); }
}

@keyframes handlePull {
  0% { transform: rotate(0deg); }
  45% { transform: rotate(14deg) translateY(6%); }
  100% { transform: rotate(0deg); }
}

@keyframes paylinePulse {
  from { opacity: .55; }
  to { opacity: 1; }
}

@keyframes creditAlert {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); box-shadow: 0 0 30px rgba(255, 63, 38, .8); }
}

@keyframes winBurst {
  0% { opacity: 0; transform: scale(.72) rotate(0deg); }
  18% { opacity: .9; transform: scale(1.02) rotate(8deg); }
  72% { opacity: .48; transform: scale(1.18) rotate(28deg); }
  100% { opacity: 0; transform: scale(1.34) rotate(38deg); }
}

@keyframes jackpotBurst {
  0% { opacity: 0; transform: scale(.62) rotate(0deg); filter: blur(0) drop-shadow(0 0 20px rgba(255, 196, 44, .55)); }
  12% { opacity: 1; transform: scale(1.02) rotate(10deg); }
  36% { opacity: .9; transform: scale(1.2) rotate(46deg); filter: blur(1px) drop-shadow(0 0 46px rgba(255, 225, 112, .92)); }
  70% { opacity: .62; transform: scale(1.42) rotate(98deg); }
  100% { opacity: 0; transform: scale(1.7) rotate(138deg); }
}

@keyframes cabinetWinKick {
  0%, 100% { transform: translateX(0); filter: drop-shadow(0 24px 45px rgba(0, 0, 0, .75)); }
  20% { transform: translateX(-3px); filter: drop-shadow(0 24px 55px rgba(255, 184, 28, .42)); }
  42% { transform: translateX(4px); }
  64% { transform: translateX(-2px); }
}

@keyframes cabinetJackpotKick {
  0%, 100% { transform: translateX(0) scale(1); filter: drop-shadow(0 24px 45px rgba(0, 0, 0, .75)); }
  18% { transform: translateX(-5px) scale(1.008); filter: drop-shadow(0 24px 72px rgba(255, 184, 28, .72)); }
  36% { transform: translateX(6px) scale(1.012); }
  56% { transform: translateX(-4px) scale(1.006); }
  76% { transform: translateX(2px) scale(1); }
}

@keyframes paylineWinFlash {
  0% { opacity: .65; box-shadow: 0 0 10px rgba(255, 220, 98, .82); }
  24% { opacity: 1; box-shadow: 0 0 18px rgba(255, 244, 179, 1), 0 0 46px rgba(255, 184, 28, .92); }
  100% { opacity: .72; box-shadow: 0 0 10px rgba(255, 220, 98, .82); }
}

@keyframes statusWinPop {
  0% { transform: scale(.94); }
  20% { transform: scale(1.12); color: #fff4b6; text-shadow: 0 0 22px rgba(255, 221, 92, 1), 0 2px 3px #000; }
  100% { transform: scale(1); }
}

@media (max-width: 800px) {
  .slot-page {
    padding: 3px;
  }

  .slot-shell {
    width: min(94vw, 780px);
  }

  .cabinet {
    aspect-ratio: 3 / 2;
    min-height: auto;
  }

  .brand-mark {
    left: 18.4%;
    top: 10.7%;
    width: 63.2%;
  }

  .brand-kot {
    font-size: clamp(19px, 5.4vw, 36px);
  }

  .credit {
    min-width: 0;
    padding: .18rem .32rem;
  }

  .reel-stage {
    left: 17.55%;
    top: 23.8%;
    width: 64.9%;
    height: 45.1%;
    gap: 5.8%;
  }

  .handle {
    right: .1%;
    top: 23.8%;
    width: 9.6%;
    height: 50.6%;
  }

  .spin-button {
    grid-column: auto;
    grid-row: auto;
    min-height: clamp(38px, 7.8vw, 60px);
  }

  .bet-meter {
    grid-column: auto;
    grid-row: auto;
  }

  .panel-button {
    min-height: clamp(31px, 5.9vw, 46px);
    font-size: clamp(7px, 1.55vw, 12px);
  }

  .status {
    left: 40.4%;
    right: 40.4%;
    bottom: 15.7%;
    font-size: clamp(8px, 2vw, 13px);
  }

  .disclaimer {
    left: 19.8%;
    right: auto;
    bottom: 11.3%;
    max-width: 17.2%;
    text-align: center;
  }
}
