/* The slots' progressive jackpot: the pools above the reels, the Jackpot Wheel, the win screen, the notice. */

:root {
  --jp-mini: #22e08f;
  --jp-major: #b77dff;
  --jp-grand: #ffc53d;
}

/* ---------- The three pools ---------- */

.jp-bar {
  display: grid;
  grid-template-columns: 1fr 1.35fr 1fr;
  align-items: end;
  gap: 8px;
  width: min(100%, 620px);
  margin: 0 auto 4px;
}
.jp-bar[hidden] { display: none; }
.jp-plaque {
  --tone: var(--jp-mini);
  position: relative;
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 8px 10px 9px;
  overflow: hidden;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--tone) 16%, var(--bg-2)), var(--bg-1));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone) 45%, transparent), 0 6px 16px rgb(0 0 0 / 0.3);
  color: var(--text);
  cursor: pointer;
  transition: transform 160ms var(--ease-out), box-shadow 200ms;
}
.jp-plaque[data-tier="major"] { --tone: var(--jp-major); }
.jp-plaque[data-tier="grand"] {
  --tone: var(--jp-grand);
  padding: 11px 12px 12px;
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--tone) 70%, transparent), 0 0 24px rgb(255 197 61 / 0.18), 0 8px 20px rgb(0 0 0 / 0.35);
}
.jp-plaque::after {
  /* A sheen that sweeps across now and then. */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 35%, rgb(255 255 255 / 0.14) 50%, transparent 65%);
  translate: -120% 0;
  animation: jp-sheen 5s var(--ease-in-out) infinite;
}
.jp-plaque[data-tier="major"]::after { animation-delay: 1.6s; }
.jp-plaque[data-tier="grand"]::after { animation-delay: 0.8s; }
@keyframes jp-sheen { 0%, 70% { translate: -120% 0; } 100% { translate: 120% 0; } }
@media (hover: hover) {
  .jp-plaque:hover { transform: translateY(-2px); }
}
.jp-plaque__tier { color: var(--tone); font: 800 10.5px / 1 var(--font-display); letter-spacing: 0.14em; text-transform: uppercase; }
.jp-plaque__amount { display: inline-flex; align-items: center; gap: 6px; }
.jp-plaque__coin, .jp-plaque__coin svg { width: 15px; height: 15px; }
.jp-plaque__value { font: 800 14px / 1 var(--font-display); letter-spacing: -0.01em; }
.jp-plaque[data-tier="grand"] .jp-plaque__value { font-size: clamp(16px, 2.4vw, 21px); color: #fff4cf; text-shadow: 0 0 14px rgb(255 197 61 / 0.45); }
.jp-plaque[data-tier="grand"] .jp-plaque__coin, .jp-plaque[data-tier="grand"] .jp-plaque__coin svg { width: 19px; height: 19px; }
.jp-plaque.is-tick .jp-plaque__value { animation: jp-tick 480ms var(--ease-out); }
@keyframes jp-tick { 30% { color: #fff; text-shadow: 0 0 16px var(--tone); } }
.jp-plaque.is-reset { animation: jp-reset 900ms var(--ease-spring); }
@keyframes jp-reset { 20% { transform: scale(1.08); box-shadow: 0 0 0 2px var(--tone), 0 0 30px var(--tone); } }

/* ---------- The Jackpot Wheel ---------- */

.jp-overlay {
  --tone: var(--jp-grand);
  position: fixed;
  inset: 0;
  z-index: 91;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: radial-gradient(circle at 50% 45%, rgb(40 26 0 / 0.82), rgb(3 6 12 / 0.96) 70%);
  animation: fade-in 280ms var(--ease-out);
}
.jp-overlay[data-tier="mini"] { --tone: var(--jp-mini); }
.jp-overlay[data-tier="major"] { --tone: var(--jp-major); }
.jp-overlay.is-leaving { pointer-events: none; animation: jp-out 420ms var(--ease-in-out) forwards; }
@keyframes jp-out { to { opacity: 0; transform: scale(1.05); } }
.jp-overlay__rays {
  position: absolute;
  inset: -50%;
  background: repeating-conic-gradient(from 0deg, rgb(255 197 61 / 0.1) 0deg 8deg, transparent 8deg 20deg);
  mask-image: radial-gradient(circle, black 18%, transparent 62%);
  animation: spin 22s linear infinite;
}
.jp-overlay.is-won .jp-overlay__rays {
  background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--tone) 22%, transparent) 0deg 8deg, transparent 8deg 20deg);
  animation-duration: 9s;
}

.jp-stage { position: relative; display: grid; justify-items: center; gap: 10px; padding: 16px; text-align: center; }
.jp-title {
  font: 900 clamp(38px, 8vw, 78px) / 1 var(--font-display);
  letter-spacing: -0.02em;
  text-transform: uppercase;
  background: linear-gradient(180deg, #fff 8%, #ffdf85 45%, #ff9f1a 92%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 0 #8a5200) drop-shadow(0 18px 40px rgb(255 159 26 / 0.55));
  animation: jp-slam 700ms var(--ease-spring);
}
@keyframes jp-slam { from { opacity: 0; transform: scale(2.4); filter: blur(6px); } }
.jp-sub { color: #f3dca0; font-weight: 700; letter-spacing: 0.04em; animation: rise-in 500ms var(--ease-out) 300ms both; }

.jp-wheel {
  position: relative;
  width: min(78vw, 360px);
  aspect-ratio: 1;
  margin-top: 10px;
  opacity: 0;
  transform: scale(0.6) rotate(-25deg);
  transition: opacity 500ms var(--ease-out), transform 700ms var(--ease-spring);
}
.jp-wheel.is-live { opacity: 1; transform: none; }
.jp-wheel__svg { display: block; width: 100%; height: 100%; filter: drop-shadow(0 24px 40px rgb(0 0 0 / 0.6)); }
.jp-rim { fill: #3a2408; stroke: #ffdf85; stroke-width: 4; }
.jp-slice { stroke: rgb(0 0 0 / 0.35); stroke-width: 1.2; }
.jp-slice--mini { fill: #11845a; }
.jp-slice--major { fill: #6c3fd1; }
.jp-slice--grand { fill: #d38b00; }
.jp-slice__label { fill: #fff; font: 800 13px var(--font-display); letter-spacing: 0.08em; }
.jp-stud { fill: #fff4cf; }
.jp-hub { fill: #ffcf5a; stroke: #7a5211; stroke-width: 3; }
.jp-hub__inner { fill: #2b1a05; }
.jp-pointer {
  position: absolute;
  top: -10px;
  left: 50%;
  width: 34px;
  height: 44px;
  translate: -50% 0;
  clip-path: polygon(50% 100%, 0 0, 100% 0);
  background: linear-gradient(180deg, #fff4cf, #ffb300);
  filter: drop-shadow(0 4px 6px rgb(0 0 0 / 0.5));
  transform-origin: 50% 0;
}
.jp-pointer.is-flick { animation: jp-flick 160ms var(--ease-out); }
@keyframes jp-flick { 40% { transform: rotate(-12deg); } }
.jp-wheel.is-landed { animation: jp-landed 900ms var(--ease-spring); }
@keyframes jp-landed { 30% { transform: scale(1.06); } }

/* ---------- The win screen ---------- */

.jp-win { display: grid; justify-items: center; gap: 6px; animation: jp-win-in 800ms var(--ease-spring); }
@keyframes jp-win-in { from { opacity: 0; transform: scale(0.35) rotate(-6deg); } }
.jp-win__crown { display: grid; color: var(--tone); filter: drop-shadow(0 0 18px var(--tone)); }
.jp-win__crown .icon { width: 64px; height: 64px; stroke-width: 1.4; }
.jp-win__tier {
  color: var(--tone);
  font: 900 clamp(26px, 6vw, 44px) / 1 var(--font-display);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-shadow: 0 0 30px color-mix(in srgb, var(--tone) 60%, transparent);
}
.jp-win__label {
  font: 900 clamp(44px, 10vw, 96px) / 0.95 var(--font-display);
  letter-spacing: -0.02em;
  text-transform: uppercase;
  background: linear-gradient(180deg, #fff 10%, #ffdf85 45%, #ff9f1a 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 5px 0 #8a5200) drop-shadow(0 20px 44px rgb(255 159 26 / 0.6));
  animation: jp-pulse 1.4s var(--ease-in-out) infinite alternate;
}
@keyframes jp-pulse { to { transform: scale(1.05); } }
.jp-win__amount {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
  padding: 10px 22px;
  border-radius: 999px;
  background: rgb(0 0 0 / 0.4);
  box-shadow: inset 0 0 0 1.5px rgb(255 223 133 / 0.5);
  color: #fff4cf;
  font: 900 clamp(26px, 6vw, 46px) / 1 var(--font-display);
}
.jp-win__coin, .jp-win__coin svg { width: 1em; height: 1em; }
.jp-collect { min-width: 220px; margin-top: 18px; animation: rise-in 500ms var(--ease-out) 1.2s both; }

/* ---------- Someone else's jackpot ---------- */

.jp-notice {
  --tone: var(--jp-grand);
  position: fixed;
  top: calc(var(--topbar-h) + 12px);
  left: 50%;
  z-index: 89;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 24px);
  padding: 10px 16px 10px 12px;
  border-radius: 14px;
  background: linear-gradient(120deg, color-mix(in srgb, var(--tone) 22%, #121826), #121826 70%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone) 55%, transparent), 0 14px 40px rgb(0 0 0 / 0.5), 0 0 30px color-mix(in srgb, var(--tone) 25%, transparent);
  color: var(--text-2);
  font-size: 13.5px;
  translate: -50% 0;
  animation: jp-notice-in 600ms var(--ease-spring);
}
.jp-notice[data-tier="mini"] { --tone: var(--jp-mini); }
.jp-notice[data-tier="major"] { --tone: var(--jp-major); }
.jp-notice strong { color: var(--text); }
.jp-notice__tier { color: var(--tone) !important; }
.jp-notice__icon { display: grid; color: var(--tone); }
.jp-notice__amount { margin-left: 4px; color: #fff4cf; font-weight: 800; white-space: nowrap; }
.jp-notice.is-leaving { animation: jp-notice-out 480ms var(--ease-in-out) forwards; }
@keyframes jp-notice-in { from { opacity: 0; transform: translateY(-24px) scale(0.9); } }
@keyframes jp-notice-out { to { opacity: 0; transform: translateY(-16px); } }

/* ---------- How it works ---------- */

.modal--jackpot { width: min(480px, 100%); }
.jp-rules { display: grid; gap: 12px; color: var(--text-2); line-height: 1.55; }
.jp-rules ul { display: grid; gap: 4px; margin: 0; padding-left: 20px; }
.jp-rules__tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.jp-rules__tier { --tone: var(--jp-mini); display: grid; justify-items: center; gap: 2px; padding: 10px; border-radius: 12px; background: color-mix(in srgb, var(--tone) 12%, var(--bg-2)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone) 40%, transparent); }
.jp-rules__tier[data-tier="major"] { --tone: var(--jp-major); }
.jp-rules__tier[data-tier="grand"] { --tone: var(--jp-grand); }
.jp-rules__tier strong { color: var(--tone); font-family: var(--font-display); }

/* The chat's card for a jackpot. */
.chat-win--jackpot { background: linear-gradient(140deg, rgb(255 197 61 / 0.22), var(--bg-2) 72%); box-shadow: inset 0 0 0 1px rgb(255 197 61 / 0.55); }
.chat-win--jackpot .chat-win__head { color: var(--accent); }
.chat-win--jackpot .chat-win__amount strong { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  .jp-plaque::after, .jp-overlay__rays, .jp-title, .jp-sub, .jp-win, .jp-win__label, .jp-collect,
  .jp-notice, .jp-plaque.is-tick .jp-plaque__value, .jp-plaque.is-reset, .jp-wheel.is-landed { animation: none; }
  .jp-wheel { transition: none; }
}
