:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #e8edf4;
  background: #0d1320;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, #1b2742 0%, #0d1320 55%);
}

.page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.card {
  width: min(620px, 100%);
  background: rgba(20, 30, 50, 0.9);
  border: 1px solid rgba(148, 178, 255, 0.25);
  border-radius: 18px;
  padding: 16px;
  backdrop-filter: blur(6px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

h1 {
  margin: 0;
  font-size: 1.3rem;
}

.lead {
  margin: 6px 0 0;
  color: #a8b6cf;
  font-size: 0.9rem;
  line-height: 1.6;
}

.ghost,
.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 12px;
  padding: 0 14px;
  color: #fff;
  font-weight: 800;
}

.primary {
  border: none;
  background: linear-gradient(135deg, #2979ff, #5e35ff);
}

.ghost {
  border: 1px solid rgba(122, 156, 216, 0.4);
  background: rgba(21, 37, 61, 0.75);
  color: #d6e1f3;
}

.ghost:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.link-button {
  text-decoration: none;
  white-space: nowrap;
}

.machine-panel {
  min-height: 260px;
  display: grid;
  align-content: center;
  gap: 12px;
  border: 1px solid rgba(245, 197, 66, 0.34);
  border-radius: 18px;
  padding: 18px;
  background:
    radial-gradient(circle at center, rgba(41, 121, 255, 0.24), transparent 56%),
    linear-gradient(135deg, #101c31, #0a1020);
  box-shadow: inset 0 0 40px rgba(91, 150, 255, 0.14);
  text-align: center;
}

.machine-panel.is-chance {
  background:
    radial-gradient(circle at center, rgba(245, 197, 66, 0.28), transparent 56%),
    conic-gradient(from 0deg, #ff3b7f, #ffb938, #fff45c, #40f279, #35d8ff, #6d5bff, #ff3bde, #ff3b7f);
  animation: rainbow-button 1.2s linear infinite;
}

.machine-panel.is-judge {
  box-shadow:
    inset 0 0 44px rgba(255, 224, 138, 0.28),
    0 0 28px rgba(245, 197, 66, 0.26);
}

.machine-panel.is-burst {
  animation:
    rainbow-button 0.45s linear infinite,
    burst-flash 0.22s ease-in-out infinite alternate;
}

.mode {
  display: none;
}

.display {
  display: grid;
  gap: 6px;
}

.reel-stage {
  position: relative;
}

.reels {
  display: grid;
  grid-template-columns: repeat(3, minmax(72px, 1fr));
  gap: 10px;
  align-items: center;
}

.reel {
  display: grid;
  place-items: center;
  min-height: 112px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 45%, rgba(0, 0, 0, 0.26)),
    rgba(8, 13, 24, 0.68);
  color: #fff;
  font-size: clamp(3.4rem, 15vw, 7rem);
  font-weight: 950;
  line-height: 0.9;
  text-shadow:
    0 0 18px rgba(245, 197, 66, 0.42),
    0 4px 0 rgba(0, 0, 0, 0.28);
}

.display span {
  font-weight: 800;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 12px 0;
}

.stats div {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(122, 156, 216, 0.22);
  border-radius: 12px;
  padding: 10px;
  background: rgba(8, 13, 24, 0.55);
}

.stats span {
  color: #91a4c4;
  font-size: 0.74rem;
}

.stats strong {
  color: #f4f8ff;
  font-size: 1.05rem;
}

.actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.is-hidden {
  display: none;
}

.judge-button {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  min-width: min(82%, 280px);
  min-height: 64px;
  border: 2px solid rgba(255, 255, 255, 0.62);
  border-radius: 999px;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.26), transparent 58%),
    linear-gradient(135deg, #2979ff, #5e35ff);
  color: #fff;
  font-size: 1rem;
  font-weight: 950;
  box-shadow:
    0 0 24px rgba(245, 197, 66, 0.48),
    0 12px 30px rgba(0, 0, 0, 0.38);
  z-index: 2;
}

.judge-button.is-pressed {
  transform: translate(-50%, -50%) scale(0.96);
  box-shadow:
    0 0 18px rgba(91, 150, 255, 0.52),
    0 8px 22px rgba(0, 0, 0, 0.35);
}

.machine-panel.is-judge .judge-button {
  min-height: 76px;
  border-color: rgba(255, 224, 138, 0.86);
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.34), transparent 58%),
    linear-gradient(135deg, #ff315f, #ffb938 46%, #fff45c);
  color: #180b12;
  font-size: 1.08rem;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.42);
  animation: judge-pulse 0.72s ease-in-out infinite alternate;
}

.payout-notice {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  min-width: min(80%, 260px);
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: 999px;
  padding: 12px 18px;
  background: rgba(8, 13, 24, 0.82);
  color: #ffe08a;
  font-size: clamp(2rem, 11vw, 4.2rem);
  font-weight: 950;
  line-height: 1;
  text-shadow: 0 0 18px rgba(245, 197, 66, 0.7);
  z-index: 3;
}

.payout-notice.is-pop {
  animation: payout-pop 0.9s ease-out;
}

.payout-notice.is-jackpot {
  min-width: min(92%, 360px);
  border-color: rgba(255, 255, 255, 0.92);
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.28), transparent 58%),
    linear-gradient(135deg, #ff315f, #ffb938 44%, #fff45c);
  color: #180b12;
  font-size: clamp(2.7rem, 14vw, 5.8rem);
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.62),
    0 0 18px rgba(255, 255, 255, 0.72);
  box-shadow:
    0 0 34px rgba(255, 224, 138, 0.72),
    0 0 80px rgba(255, 49, 95, 0.42);
}

.payout-notice.is-jackpot.is-pop {
  animation: jackpot-pop 1.5s ease-out;
}

.spec-box,
.log-list {
  border: 1px solid rgba(122, 156, 216, 0.22);
  border-radius: 12px;
  background: rgba(8, 13, 24, 0.55);
}

.spec-box {
  margin-top: 12px;
  padding: 12px;
}

.spec-box h2 {
  margin: 0 0 8px;
  font-size: 0.98rem;
}

.spec-box dl {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 0 0 8px;
}

.spec-box div {
  display: grid;
  gap: 2px;
}

.spec-box dt,
.spec-box p {
  color: #91a4c4;
  font-size: 0.76rem;
}

.spec-box dd {
  margin: 0;
  color: #ffe08a;
  font-weight: 900;
}

.log-list {
  min-height: 120px;
  margin: 12px 0 0;
  padding: 12px 12px 12px 28px;
  color: #c8d3e5;
  line-height: 1.5;
}

.disclaimer {
  margin: 10px 0 0;
  color: #6f809d;
  font-size: 0.68rem;
  line-height: 1.5;
  text-align: center;
}

.policy-link {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 4px 0 0;
  text-align: center;
}

.policy-link a,
.policy-link a:visited {
  color: #a8b6cf;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.6;
  text-underline-offset: 2px;
}

button {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid #f5c542;
  outline-offset: 4px;
}

@keyframes rainbow-button {
  to {
    filter: hue-rotate(360deg);
  }
}

@keyframes payout-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.72);
  }

  18% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.08);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes jackpot-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.58) rotate(-5deg);
  }

  16% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.14) rotate(2deg);
  }

  34% {
    transform: translate(-50%, -50%) scale(0.98) rotate(-1deg);
  }

  72% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.04);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.18);
  }
}

@keyframes judge-pulse {
  from {
    transform: translate(-50%, -50%) scale(1);
    box-shadow:
      0 0 20px rgba(245, 197, 66, 0.48),
      0 12px 30px rgba(0, 0, 0, 0.38);
  }

  to {
    transform: translate(-50%, -50%) scale(1.05);
    box-shadow:
      0 0 34px rgba(255, 224, 138, 0.74),
      0 0 70px rgba(255, 49, 95, 0.34),
      0 12px 30px rgba(0, 0, 0, 0.38);
  }
}

@keyframes burst-flash {
  from {
    filter: brightness(1.08) saturate(1.2);
  }

  to {
    filter: brightness(1.42) saturate(1.7);
  }
}

@media (max-width: 520px) {
  .card-header,
  .actions-grid,
  .stats,
  .spec-box dl {
    grid-template-columns: 1fr;
  }

  .card-header {
    display: grid;
  }

  .link-button {
    width: 100%;
  }

  .actions-grid {
    display: grid;
  }

  .machine-panel {
    min-height: 230px;
  }
}
