:root {
  --bg: #0a0a0a;
  --bg-soft: #141414;
  --gold: #f2b632;
  --gold-light: #ffd873;
  --gold-dim: #8a6a22;
  --white: #f5f5f5;
  --slot-border: rgba(242, 182, 50, 0.35);
  --slot-bg: #171512;
  --slot-h: clamp(40px, 13vw, 40px);
  --slot-h-tall: clamp(110px, 17vw, 198px);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--white);
  font-family: "Nunito", "Segoe UI", sans-serif;
  overflow-x: hidden;
}

.stage {
  position: relative;
  width: 100%;
}

.screen {
  position: relative;
  width: 100%;
  min-height: 100vh;
  background: radial-gradient(ellipse at 50% 30%, #171412 0%, #0a0a0a 65%);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.screen[hidden] {
  display: none;
}

/* ---------- Decorative balls & sparkles ---------- */

.deco {
  position: absolute;
  pointer-events: none;
  user-select: none;
  z-index: 1;
}

.deco--tl {
  top: -40px;
  left: -20px;
  width: 130px;
  filter: drop-shadow(0 0 30px rgba(242, 182, 50, 0.25));
}

.deco--tr {
  top: -10px;
  right: 40px;
  width: 70px;
  opacity: 0.9;
}

.deco--bl {
  bottom: 24px;
  left: 40px;
  width: 70px;
  opacity: 0.9;
}

.deco--br {
  bottom: -60px;
  right: -30px;
  width: 170px;
  filter: drop-shadow(0 0 30px rgba(242, 182, 50, 0.25));
}

.deco--sparkle-tl {
  top: 0;
  left: 0;
  width: 38vw;
  max-width: 520px;
  opacity: 0.45;
  mix-blend-mode: screen;
}

.deco--sparkle-br {
  bottom: 0;
  right: 0;
  width: 38vw;
  max-width: 520px;
  opacity: 0.45;
  mix-blend-mode: screen;
  transform: translateY(430px);
}

/* ---------- Content ---------- */

.content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.badge {
  display: inline-block;
  padding: 10px 26px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  color: var(--gold);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 28px;
  box-shadow: 0 0 20px rgba(242, 182, 50, 0.15) inset;
}

.title {
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 900;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  margin: 0 0 18px;
  line-height: 1.05;
  color: var(--white);
}

.title--winner {
  margin-bottom: 32px;
}

.title .accent {
  color: var(--gold);
}

.subtitle {
  font-size: clamp(15px, 2vw, 19px);
  color: #d8d8d8;
  margin: 0 0 30px;
  font-weight: 600;
}

.subtitle strong {
  color: var(--gold-light);
  font-weight: 800;
}

.divider {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 560px;
  margin-bottom: 40px;
}

.divider span {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.divider p {
  margin: 0;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}

/* ---------- Slots ---------- */

.slots {
  display: flex;
  width: 100%;
  gap: clamp(6px, 1vw, 14px);
  margin-bottom: 36px;
  flex-wrap: nowrap;
}

.slot {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  height: var(--slot-h);
  border-radius: 16px;
  border: 1.5px solid var(--slot-border);
  background:
    radial-gradient(circle at 50% 40%, rgba(242, 182, 50, 0.10), transparent 70%),
    var(--slot-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.slot span {
  font-size: calc(var(--slot-h) * 0.3);
  font-weight: 900;
  color: var(--white);
}

.slot--static {
  border-color: var(--gold);
  box-shadow: 0 0 18px rgba(242, 182, 50, 0.35);
}

.slot--static span {
  color: var(--white);
}

.slot--plus7 {
  height: var(--slot-h-tall);
  /* background:
    center / cover no-repeat url("assets/slot-active.png"),
    var(--slot-bg);
  border-color: transparent; */
  border-color: var(--gold);
  box-shadow: 0 0 18px rgba(242, 182, 50, 0.35);
}

.slot--plus7 span {
  font-size: calc(var(--slot-h-tall) * 0.3);
  color: var(--white);
}

.slot--empty {
  border-style: solid;
  opacity: 0.5;
}

.slot--final {
  border-color: var(--gold);
  box-shadow: 0 0 18px rgba(242, 182, 50, 0.35);
}

.slot--final span {
  color: var(--gold);
}

.screen--winner .slot {
  height: var(--slot-h-tall);
}

.screen--winner .slot span {
  font-size: calc(var(--slot-h-tall) * 0.3);
}

/* Spinning reel slot */

.slot--spin {
  border-color: var(--gold);
  box-shadow: 0 0 18px rgba(242, 182, 50, 0.25);
  height: var(--slot-h-tall);
  overflow: visible;
  z-index: 4;
}

.reel-window {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.55) 12%, black 38%, black 62%, rgba(0,0,0,0.55) 88%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.55) 12%, black 38%, black 62%, rgba(0,0,0,0.55) 88%, transparent 100%);
}

.reel {
  display: flex;
  flex-direction: column;
  align-items: center;
  will-change: transform;
}

.reel span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--slot-h);
  font-size: calc(var(--slot-h-tall) * 0.3);
  font-weight: 900;
  color: var(--gold);
  flex-shrink: 0;
  transition: opacity 0.2s ease, font-size 0.2s ease, color 0.2s ease;
}

.reel span:not(.is-current) {
  opacity: 0.15;
  font-size: calc(var(--slot-h-tall) * 0.15);
  color: #b9b9b9;
  font-weight: 800;
}

.spin-arrow {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: clamp(14px, 1.6vw, 20px);
  height: auto;
  z-index: 3;
  opacity: 0.85;
}

.spin-arrow--up {
  top: -13px;
}

.spin-arrow--down {
  bottom: -13px;
}

/* ---------- Progress dots ---------- */

.progress {
  display: flex;
  align-items: center;
  gap: 0;
}

.progress .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4a4a4a;
  flex-shrink: 0;
  transition: background 0.3s ease;
}

.progress .dot.is-active {
  background: var(--gold);
  box-shadow: 0 0 8px rgba(242, 182, 50, 0.6);
}

.progress .line {
  width: clamp(10px, 2vw, 20px);
  height: 1px;
  background: #4a4a4a;
  transition: background 0.3s ease;
}

.progress .line.is-active {
  background: var(--gold);
}

/* ---------- Active slot (awaiting keyboard input) ---------- */

.slot--spin.is-waiting {
  background:
    center / cover no-repeat url("assets/slot-active.png"),
    var(--slot-bg);
  animation: waiting-pulse 1.4s ease-in-out infinite;
}

@keyframes waiting-pulse {
  0%, 100% {
    box-shadow: 0 0 18px rgba(242, 182, 50, 0.25);
  }
  50% {
    box-shadow: 0 0 26px rgba(242, 182, 50, 0.55);
  }
}

/* ---------- Result (found count) ---------- */

.result {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.result[hidden] {
  display: none;
}

.result__count {
  margin: 0;
  font-weight: 800;
  font-size: 18px;
  color: var(--white);
  transition: font-size 0.25s ease, color 0.25s ease;
}

.result.is-empty .result__count {
  font-size: clamp(24px, 3.4vw, 34px);
  color: var(--gold-light);
}

.result__undo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1.5px solid var(--gold);
  background: rgba(242, 182, 50, 0.08);
  color: var(--gold-light);
  font-family: inherit;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.result__undo:hover {
  background: rgba(242, 182, 50, 0.16);
  box-shadow: 0 0 18px rgba(242, 182, 50, 0.25);
}

.result__undo[hidden] {
  display: none;
}

.result__undo img {
  width: 18px;
  height: 18px;
  filter: invert(78%) sepia(46%) saturate(683%) hue-rotate(1deg) brightness(103%) contrast(101%);
}

/* ---------- Winner name ---------- */

.winner-name {
  margin: -18px 0 32px;
  font-weight: 800;
  font-size: clamp(18px, 2.4vw, 24px);
  color: var(--gold-light);
}

/* ---------- Info button & modal ---------- */

.info-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1.5px solid rgba(242, 182, 50, 0.35);
  background: rgba(23, 21, 18, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.2s ease, background 0.2s ease;
}

.info-btn:hover {
  opacity: 1;
  background: rgba(23, 21, 18, 0.75);
}

.info-btn img {
  width: 20px;
  height: 20px;
  filter: invert(78%) sepia(46%) saturate(683%) hue-rotate(1deg) brightness(103%) contrast(101%);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.65);
}

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

.modal {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 80vh;
  overflow-y: auto;
  border-radius: 20px;
  border: 1.5px solid var(--slot-border);
  background: #171512;
  padding: 32px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s ease, background 0.2s ease;
}

.modal__close:hover {
  opacity: 1;
  background: rgba(242, 182, 50, 0.1);
}

.modal__close img {
  width: 15px;
  height: 15px;
  filter: invert(100%);
}

.modal__title {
  margin: 0 0 20px;
  font-size: 22px;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--gold);
}

.modal__tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 20px;
  border-bottom: 1.5px solid var(--slot-border);
}

.modal__tab {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0 2px 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  color: #8a8a8a;
  cursor: pointer;
  position: relative;
  transition: color 0.2s ease;
}

.modal__tab:hover {
  color: #d8d8d8;
}

.modal__tab.is-active {
  color: var(--gold);
}

.modal__tab.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1.5px;
  height: 2px;
  background: var(--gold);
  border-radius: 2px;
}

.modal__body p {
  margin: 0 0 14px;
  font-size: 15px;
  line-height: 1.5;
  color: #d8d8d8;
}

.modal__body[hidden] {
  display: none;
}

.modal__body p:last-child {
  margin-bottom: 0;
}

.modal__body strong {
  color: var(--gold-light);
  font-weight: 800;
}

/* ---------- Responsive ---------- */

@media (max-width: 640px) {
  .deco--tl { width: 90px; }
  .deco--br { width: 120px; }
  .deco--tr, .deco--bl { width: 50px; }
}
