/* Slot Machine Specific Styles */

/* Header */
header {
  text-align: center;
  padding: 24px 12px;
  font-weight: 400;
  letter-spacing: 0.5px;
}

.status {
  text-align: center;
  padding: 8px;
  min-height: 24px;
  opacity: 0.9;
  color: #ffcc33;
}

/* Slot Machine Layout */
.wrap {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 24px;
  height: 100%;
  padding: 24px;
  box-sizing: border-box;
}

/* Reels */
.reel {
  position: relative;
  border: 2px solid #ffcc33;
  border-radius: 16px;
  background: linear-gradient(to bottom, #1a1a1a, #0f0f0f);
  box-shadow: inset 0 2px 6px rgba(255, 204, 51, 0.2),
    inset 0 -3px 10px rgba(0, 0, 0, 0.6), 0 10px 24px rgba(255, 204, 51, 0.15);
  overflow: hidden;
}

.scene {
  width: 100%;
  height: 100%;
  position: relative;
}

/* Reels are a plain vertical strip of panels scrolled via translateY (2D
   transform only) rather than a 3D rotating cylinder - far cheaper to
   composite on weak/software-rendered GPUs such as the Raspberry Pi's. */
.cyl {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  will-change: transform;
}

.panel {
  position: absolute;
  top: 0;
  left: 50%;
  width: 86%;
  height: 92px;
  margin-left: -43%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1.25rem, 2vw, 4rem);
  text-shadow: 0 2px 2px rgba(0, 0, 0, 0.3);
  color: #eaeaea;
  user-select: none;
  font-family: "ironmonger-inlaid", freehouse, serif;
  font-weight: 400;
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: 1px;
  line-height: 1.25;
}

.reel::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 0;
  border-top: 2px solid var(--accent);
  opacity: 0.5;
  transform: translateY(-1px);
  pointer-events: none;
  z-index: 5;
}

.fadeMask {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  background: linear-gradient(
    to bottom,
    rgba(10, 10, 10, 0.95),
    rgba(10, 10, 10, 0) 20%,
    rgba(10, 10, 10, 0) 80%,
    rgba(10, 10, 10, 0.95)
  );
}

.fadeMask::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  transform: translateY(-1px);
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  /* box-shadow instead of filter:drop-shadow - a continuously-animated
     drop-shadow filter is expensive to recomposite every frame on weak/
     software-rendered GPUs (e.g. Raspberry Pi); box-shadow achieves a very
     similar glow on this thin bar much more cheaply. */
  box-shadow: 0 0 6px var(--accent), 0 0 10px var(--accent);
  opacity: 0.6;
  animation: pulse 2.2s ease-in-out infinite;
}

.stopBadge {
  position: absolute;
  bottom: 16px;
  right: 16px;
  background: #1c1;
  color: #012;
  font-weight: 800;
  padding: 8px 12px;
  border-radius: 12px;
  display: none;
  z-index: 6;
  transform: scale(0.8);
  opacity: 0;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.stopBadge.show {
  display: block !important;
  transform: scale(1);
  opacity: 1;
}

/* Controls */
footer.controls {
  display: flex;
  gap: 16px;
  justify-content: center;
  padding: 16px;
  flex-wrap: wrap;
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  /* backdrop-filter dropped: expensive to composite on weak/software-rendered
     GPUs (e.g. Raspberry Pi); the flat overlay color is sufficient. */
  background: rgba(0, 0, 0, 0.75);
  z-index: 999;
}

.loading-overlay.show {
  display: flex;
}

.loading-card {
  padding: 24px;
  text-align: center;
}

.jump-container{
    display: none;
}

@media (prefers-reduced-motion: no-preference) {
  .jump-container {
    --duration: 2;

    width: 100%;
    display: flex;
    flex-shrink: 0;

    padding: 0 1rem;
    gap: clamp(2rem,3vw,5rem);
    height: clamp(3.5rem, 7.5vw, 10rem);
    margin-bottom: .5rem;
  }

  .jump-container li {

    --delay: 0s;
    list-style: none;
    aspect-ratio: 1;
    height: 100%;
    background: var(--accent);
    @supports (color: oklch(100 100 100)) {
      background: linear-gradient(
        #000 25%,
        oklch(68.725% 0.23697 352.595) 0 35%,
        #000 0 45%,
        oklch(from var(--accent) l c h) 0 55%,
        #000 0 65%,
        oklch(68.725% 0.23697 352.595) 0 75%,
        #000 0
      );
    }

    transform-origin: bottom;
    animation: squash-animation;
    animation-duration: calc( var(--duration) * 1s);
    animation-iteration-count: infinite;
    animation-delay: var(--delay, 0s);
  }

  li:nth-child(1){
    --delay: 0s;
  }
  li:nth-child(2){
    --delay: .25s;
  }
  li:nth-child(3){
    --delay: .375s;
  }
  li:nth-child(4){
    --delay: .475s;
  }
  li:nth-child(5){
    --delay: .675s;
  }
}

.loading-title {
  font-weight: 800;
  font-size: clamp(1.375rem, 5vw, 6rem);
  margin-bottom: 4px;
  color: #ffffcc;
}

.loading-sub {
  opacity: 0.85;
  font-size: 14px;
  color: #ffffcc;
}

.hint {
  font-size: 12px;
  opacity: 0.6;
  margin-top: 8px;
}

@keyframes squash-animation {
  0% {
    transform: none;
  }
  10.5% {
    transform: scale(1.2, 0.8);
  }
  21% {
    transform: scale(0.9, 1.1);
  }
  27% {
    transform: scale(1.35, 0.65);
    animation-timing-function: cubic-bezier(0.165, 0.84, 0.44, 1);
  }
  45% {
    transform: translatey(-3em) scale(0.67, 1.5);
    animation-timing-function: cubic-bezier(0.895, 0.03, 0.685, 0.22);
  }
  63% {
    transform: scale(2, 0.25);
  }
  72% {
    transform: scale(0.8, 1.2);
  }
  78% {
    transform: scale(1.1, 0.9);
  }
  82.5% {
    transform: scale(0.95, 1.05);
  }
  87% {
    transform: scale(1.02, 0.98);
  }
  90%,
  100% {
    transform: none;
  }
}
