/* CASINO777 — PROVODA.CLUB design language */

/* ========== @font-face ========== */
@font-face {
  font-family: 'Proxima Nova Bold';
  src: url('/static/fonts/ProximaNova-Bold.woff') format('woff');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Proxima Nova Regular';
  src: url('/static/fonts/ProximaNova-Regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Proxima Nova SemiboldIt';
  src: url('/static/fonts/ProximaNova-SemiboldIt.woff') format('woff');
  font-weight: 600;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'IBMPlexSans-BoldItalic';
  src: url('/static/fonts/IBMPlexSans-BoldItalic.ttf') format('truetype');
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'IBMPlexSans-SemiBoldItalic';
  src: url('/static/fonts/IBMPlexSans-SemiBoldItalic.ttf') format('truetype');
  font-weight: 600;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'IBMPlexSans-LightItalic';
  src: url('/static/fonts/IBMPlexSans-LightItalic.ttf') format('truetype');
  font-weight: 300;
  font-style: italic;
  font-display: swap;
}

/* ========== Custom properties ========== */
:root {
  --bg: #191a21;
  --cyan: #43c5ff;
  --text: #ffffff;
  --surface-light: rgba(255,255,255,0.08);
  --surface-dim: rgba(255,255,255,0.03);
  --border: rgba(255,255,255,0.06);
  --border-mid: rgba(255,255,255,0.12);
  --border-active: rgba(67,197,255,0.3);
  --border-active-strong: rgba(67,197,255,0.65);
  --font-body: 'Proxima Nova Bold', 'Segoe UI', Arial, sans-serif;
  --font-regular: 'Proxima Nova Regular', 'Segoe UI', Arial, sans-serif;
  --font-btn: 'Proxima Nova SemiboldIt', 'Segoe UI', Arial, sans-serif;
  --font-title: 'IBMPlexSans-BoldItalic', 'Segoe UI', Arial, sans-serif;
  --font-heading: 'IBMPlexSans-SemiBoldItalic', 'Segoe UI', Arial, sans-serif;
  --font-subtitle: 'IBMPlexSans-LightItalic', 'Segoe UI', Arial, sans-serif;
}

/* ========== Reset ========== */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(67,197,255,0.045), transparent 60%),
    var(--bg);
}

/* Noise overlay (PROVODA signature) */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 100000;
  pointer-events: none;
  background: url('/static/noise.gif') repeat;
  opacity: 0.025;
}

/* bg-glow: subtle radial instead of starfield */
.bg-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 20% 80%, rgba(67,197,255,0.03), transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(67,197,255,0.025), transparent 50%);
}

/* ========== Topbar ========== */
.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 48px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(6px);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-body);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  text-decoration: none;
}
.logo::before {
  content: '';
  display: inline-block;
  width: 32px;
  height: 32px;
  background: url('/static/logo.png') center / contain no-repeat;
  flex-shrink: 0;
}
.logo span {
  color: var(--cyan);
}
/* PROVODA-логотип теперь является ссылкой на главный экран. */
.logo-link {
  cursor: pointer;
  color: #fff;
  transition: opacity 0.2s ease, filter 0.2s ease;
}
.logo-link:hover {
  opacity: 0.9;
  filter: drop-shadow(0 0 12px rgba(67,197,255,0.6));
}

.guest {
  font-family: var(--font-regular);
  color: rgba(255,255,255,0.45);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.guest span {
  color: var(--cyan);
  font-family: var(--font-body);
  margin-left: 8px;
}

/* ========== Layout ========== */
.wrap {
  position: relative;
  z-index: 2;
  max-width: 1400px;
  margin: 0 auto;
  padding: 28px 40px 40px;
  min-height: calc(100vh - 74px);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.screen {
  display: none;
  width: 100%;
}
.screen.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: fade 0.4s ease;
}
#screen-case.active { width: 100%; }
#screen-loading, #screen-roulette, #screen-error { text-align: center; }
#screen-loading.active, #screen-error.active {
  justify-content: center;
  min-height: 60vh;
}

@keyframes fade {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

h1 {
  margin: 0 0 16px;
  font-family: var(--font-title);
  font-style: italic;
  font-size: 42px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #fff;
}

.muted {
  font-family: var(--font-regular);
  color: rgba(255,255,255,0.45);
  font-size: 14px;
}

/* ========== Section labels ========== */
.section-label {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-title);
  font-style: italic;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 18px;
}
.section-label-dot {
  width: 10px;
  height: 10px;
  background: var(--cyan);
  border-radius: 0;
}
.section-label-prizes {
  margin-top: 30px;
  margin-bottom: 14px;
}

/* ========== Frame ========== */
.frame {
  position: relative;
  width: 100%;
  max-width: 1280px;
  padding: 28px 40px 44px;
  border: 1px solid var(--border-mid);
  border-radius: 0;
  background: rgba(255,255,255,0.03);
}

/* ========== Frame content grid ========== */
.frame-content {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 8px;
}

.case-info {
  padding-left: 40px;
  text-align: left;
}
.case-info .info-label {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--cyan);
  text-transform: uppercase;
}
.case-info .info-line {
  width: 60px;
  height: 1px;
  background: rgba(255,255,255,0.12);
  margin: 10px 0 18px;
}
.case-info .info-amount {
  font-family: var(--font-title);
  font-style: italic;
  font-size: 84px;
  font-weight: 700;
  line-height: 0.9;
  color: #fff;
}
.case-info .info-unit {
  font-family: var(--font-subtitle);
  font-style: italic;
  font-size: 16px;
  font-weight: 300;
  letter-spacing: 0.22em;
  color: rgba(255,255,255,0.6);
  margin-top: 10px;
  text-transform: uppercase;
}

/* ========== Case stage ========== */
.case-stage {
  position: relative;
  width: 420px;
  height: 340px;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Старый прямоугольный «пол» под кейсом убран: его границы 480×140
   проступали как квадратный артефакт, а свечение и так даёт `.case-glow`. */
.case-stage .floor { display: none; }

.case-main {
  position: relative;
  width: 360px;
  height: 360px;
  z-index: 2;
}
.case-glow {
  position: absolute;
  /* Круглый glow вместо прямоугольного inset: -40px — новый PNG не закрывает
     углы старого блока, и за кейсом виден прямоугольный «след». */
  width: 110%;
  aspect-ratio: 1 / 1;
  left: 50%;
  top: 52%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, rgba(67,197,255,0.40) 0%, rgba(67,197,255,0.15) 35%, transparent 68%);
  filter: blur(14px);
  pointer-events: none;
  animation: mainGlow 2.4s ease-in-out infinite alternate;
  z-index: 0;
}
@keyframes mainGlow {
  from { opacity: 0.6; transform: translate(-50%, -50%) scale(1); }
  to   { opacity: 1;   transform: translate(-50%, -50%) scale(1.05); }
}

/* Конус света сверху над кейсом. */
.case-rays {
  position: absolute;
  left: 50%;
  top: -12%;
  width: 130%;
  height: 130%;
  transform: translateX(-50%);
  background:
    conic-gradient(from 180deg at 50% 0%,
      transparent 0deg,
      rgba(67,197,255,0.0) 18deg,
      rgba(67,197,255,0.18) 30deg,
      rgba(67,197,255,0.0) 42deg,
      transparent 60deg,
      rgba(67,197,255,0.10) 72deg,
      transparent 84deg,
      rgba(255,255,255,0.0) 360deg);
  filter: blur(16px);
  opacity: 0.85;
  mix-blend-mode: screen;
  pointer-events: none;
  animation: caseRays 9s linear infinite;
  z-index: 0;
}
@keyframes caseRays {
  0%   { transform: translateX(-50%) rotate(-5deg); opacity: 0.55; }
  50%  { transform: translateX(-50%) rotate(5deg);  opacity: 0.95; }
  100% { transform: translateX(-50%) rotate(-5deg); opacity: 0.55; }
}
/* Вращающееся неоновое кольцо за кейсом. */
.case-ring {
  position: absolute;
  width: 86%;
  aspect-ratio: 1 / 1;
  left: 50%;
  top: 52%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background:
    conic-gradient(from 0deg,
      rgba(67,197,255,0.0) 0deg,
      rgba(67,197,255,0.55) 60deg,
      rgba(255,255,255,0.85) 90deg,
      rgba(67,197,255,0.55) 120deg,
      rgba(67,197,255,0.0) 200deg,
      rgba(67,197,255,0.0) 360deg);
  -webkit-mask: radial-gradient(circle, transparent 46%, #000 48%, #000 50%, transparent 52%);
          mask: radial-gradient(circle, transparent 46%, #000 48%, #000 50%, transparent 52%);
  filter: blur(2px) drop-shadow(0 0 14px rgba(67,197,255,0.6));
  mix-blend-mode: screen;
  opacity: 0.7;
  pointer-events: none;
  animation: caseRing 7s linear infinite;
  z-index: 0;
}
@keyframes caseRing {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}
/* Парящие искры вокруг кейса. */
.case-sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}
.case-sparkles .spark {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, rgba(67,197,255,0.95) 40%, rgba(67,197,255,0) 70%);
  box-shadow: 0 0 12px rgba(67,197,255,0.9), 0 0 24px rgba(67,197,255,0.5);
  opacity: 0;
  animation: sparkFloat 5.2s ease-in-out infinite;
}
.case-sparkles .s1 { left: 15%; top: 60%; animation-delay: 0.0s; }
.case-sparkles .s2 { left: 25%; top: 28%; animation-delay: 0.6s; width: 4px; height: 4px; }
.case-sparkles .s3 { left: 78%; top: 24%; animation-delay: 1.3s; }
.case-sparkles .s4 { left: 86%; top: 68%; animation-delay: 2.0s; width: 5px; height: 5px; }
.case-sparkles .s5 { left: 50%; top: 12%; animation-delay: 2.7s; width: 4px; height: 4px; }
.case-sparkles .s6 { left: 10%; top: 42%; animation-delay: 3.4s; width: 3px; height: 3px; }
.case-sparkles .s7 { left: 92%; top: 46%; animation-delay: 4.1s; width: 4px; height: 4px; }
.case-sparkles .s8 { left: 40%; top: 78%; animation-delay: 1.9s; width: 5px; height: 5px; }

/* ========== Земля под кейсом (screen-case) ==========
   Дублирует структуру preview-case-* — голопод, тень, свет, пыль. */
.case-stage .case-ground {
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: 5%;
  height: 38%;
  background: radial-gradient(ellipse at 50% 100%,
    rgba(67,197,255,0.30) 0%,
    rgba(67,197,255,0.10) 35%,
    transparent 70%);
  filter: blur(22px);
  pointer-events: none;
  z-index: 0;
  mix-blend-mode: screen;
}
.case-stage .case-podium {
  position: absolute;
  left: 50%;
  bottom: 14%;
  width: 80%;
  height: 22%;
  transform: translateX(-50%) perspective(420px) rotateX(74deg);
  transform-origin: center bottom;
  background:
    radial-gradient(ellipse at 50% 50%,
      transparent 38%,
      rgba(67,197,255,0.55) 40%, rgba(67,197,255,0.55) 41%,
      transparent 43%,
      transparent 50%,
      rgba(67,197,255,0.30) 52%, rgba(67,197,255,0.30) 52.5%,
      transparent 54%,
      transparent 64%,
      rgba(67,197,255,0.18) 66%, rgba(67,197,255,0.18) 66.5%,
      transparent 68%);
  filter: blur(0.8px) drop-shadow(0 0 12px rgba(67,197,255,0.6));
  pointer-events: none;
  opacity: 0.85;
  mix-blend-mode: screen;
  animation: casePodium 4.5s ease-in-out infinite;
  z-index: 0;
}
@keyframes casePodium {
  0%, 100% { opacity: 0.7;  transform: translateX(-50%) perspective(420px) rotateX(74deg) scale(1); }
  50%      { opacity: 1;    transform: translateX(-50%) perspective(420px) rotateX(74deg) scale(1.04); }
}
.case-stage .case-spill {
  position: absolute;
  left: 50%;
  bottom: 16%;
  width: 60%;
  aspect-ratio: 2.4 / 1;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at 50% 50%,
    rgba(180,235,255,0.55) 0%,
    rgba(67,197,255,0.35) 25%,
    rgba(67,197,255,0.10) 55%,
    transparent 75%);
  filter: blur(8px);
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: 0;
  animation: caseSpill 4.5s ease-in-out infinite;
}
@keyframes caseSpill {
  0%, 100% { opacity: 0.85; transform: translateX(-50%) scale(1); }
  50%      { opacity: 1;    transform: translateX(-50%) scale(0.92); }
}
.case-stage .case-shadow {
  position: absolute;
  left: 50%;
  bottom: 14%;
  width: 50%;
  aspect-ratio: 4 / 1;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at 50% 50%,
    rgba(0,0,0,0.7) 0%,
    rgba(0,0,0,0.35) 35%,
    transparent 70%);
  filter: blur(10px);
  pointer-events: none;
  z-index: 0;
  animation: caseShadow 4.5s ease-in-out infinite;
}
@keyframes caseShadow {
  0%, 100% { opacity: 0.85; transform: translateX(-50%) scale(1); }
  50%      { opacity: 0.55; transform: translateX(-50%) scale(0.82); }
}
.case-stage .case-dust {
  position: absolute;
  left: 50%;
  bottom: 14%;
  width: 60%;
  height: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 1;
}
.case-stage .case-dust .dust {
  position: absolute;
  bottom: 0;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, rgba(67,197,255,0.9) 50%, rgba(67,197,255,0) 75%);
  box-shadow: 0 0 8px rgba(67,197,255,0.9);
  opacity: 0;
  animation: caseDustRise 6s ease-in infinite;
}
.case-stage .case-dust .d1 { left: 18%; animation-delay: 0.0s; }
.case-stage .case-dust .d2 { left: 32%; animation-delay: 1.0s; width: 2px; height: 2px; }
.case-stage .case-dust .d3 { left: 48%; animation-delay: 2.0s; }
.case-stage .case-dust .d4 { left: 62%; animation-delay: 3.0s; width: 2px; height: 2px; }
.case-stage .case-dust .d5 { left: 76%; animation-delay: 4.0s; }
.case-stage .case-dust .d6 { left: 88%; animation-delay: 5.0s; width: 2px; height: 2px; }
@keyframes caseDustRise {
  0%   { opacity: 0;   transform: translateY(0)     scale(0.6); }
  15%  { opacity: 0.9; transform: translateY(-10px) scale(1); }
  60%  { opacity: 0.7; transform: translateY(-60px) scale(0.9); }
  100% { opacity: 0;   transform: translateY(-110px) scale(0.4); }
}

.case-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 0.5s ease, transform 0.5s ease;
  pointer-events: none;
  filter: drop-shadow(0 16px 28px rgba(0,0,0,0.55))
          drop-shadow(0 0 22px rgba(67,197,255,0.45));
  z-index: 2;
}
.case-img-closed {
  opacity: 1;
  transform: scale(1);
}
.case-img-opened {
  opacity: 0;
  transform: scale(1.05);
}

/* Case opening shake — animates ONLY the closed-case PNG, not the wrapper.
   Earlier this lived on .case-main, so .case-glow / .case-rays / .case-ring /
   .case-sparkles all shook along with the case (the «cloud» behind the
   case visibly trembled). Now the lid jiggles, the spotlight stays calm. */
.case-main.opening .case-img-closed {
  animation: caseShake 0.35s ease-in-out infinite;
}
@keyframes caseShake {
  0%, 100% { transform: translateX(0) rotate(0) scale(1); }
  20%      { transform: translateX(-5px) rotate(-1.5deg) scale(1); }
  40%      { transform: translateX(5px) rotate(1.5deg) scale(1); }
  60%      { transform: translateX(-3px) rotate(-1deg) scale(1); }
  80%      { transform: translateX(3px) rotate(1deg) scale(1); }
}

/* Lid opens: crossfade closed -> opened */
.case-main.opened .case-img-closed {
  opacity: 0;
  transform: scale(0.95);
}
.case-main.opened .case-img-opened {
  opacity: 1;
  transform: scale(1);
}
.case-main.opened .case-glow {
  animation: openFlash 0.8s ease-out forwards;
}
@keyframes openFlash {
  0%   { opacity: 1; transform: scale(1); filter: blur(12px); }
  30%  { opacity: 1; transform: scale(1.5); filter: blur(16px); }
  100% { opacity: 0.6; transform: scale(1.1); filter: blur(12px); }
}

/* ========== Buttons ========== */
.btn {
  display: inline-block;
  margin-top: 18px;
  min-height: 44px;
  padding: 12px 32px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cyan);
  background: rgba(67,197,255,0.08);
  border: 1px solid rgba(67,197,255,0.3);
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.btn:hover:not(:disabled) {
  background: rgba(67,197,255,0.15);
  border-color: rgba(67,197,255,0.65);
  color: #fff;
}
.btn:active:not(:disabled) {
  transform: translateY(1px);
}
.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn-primary {
  display: block;
  margin: 32px auto 0;
  padding: 18px 72px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(135deg, #0e8fc7, #43c5ff);
  border: none;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.18s ease;
  box-shadow: 0 2px 16px rgba(67,197,255,0.25);
  position: relative;
}
.btn-primary::before,
.btn-primary::after {
  display: none;
}
.btn-primary:hover:not(:disabled) {
  box-shadow: 0 4px 28px rgba(67,197,255,0.45);
  transform: translateY(-1px);
}
.btn-primary:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: 0 1px 8px rgba(67,197,255,0.2);
}
.btn-primary:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ========== Utility ========== */
.hidden { display: none !important; }

/* ========== Prize grid ========== */
.prize-grid {
  display: grid !important;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  width: 100%;
  max-width: 1280px;
}

/* Единый «слот»-карточка для всех призов: одинаковая высота, одинаковая
   позиция бэйджа rarity. Внутри — либо PNG-билет, либо emoji (для физ.
   призов). Никаких clip-path/обводок — рамка PNG несёт свой дизайн. */
.prize-item {
  --r-color: #43c5ff;
  --r-color-soft: rgba(67,197,255,0.5);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 244px;
  padding: 16px 12px 14px;
  font-family: var(--font-body);
  text-align: center;
  cursor: pointer;
  isolation: isolate;
  border-radius: 6px;
  /* Многослойный фон: лёгкий top-tint цвета rarity на тёмном стекле. */
  background:
    radial-gradient(140% 70% at 50% 0%,
      color-mix(in srgb, var(--r-color) 12%, transparent) 0%,
      transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,0.045) 0%, rgba(255,255,255,0.01) 100%);
  /* Объём: верхний внутренний блик + нижняя тёмная кромка + внешняя тень. */
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    inset 0 -1px 0 rgba(0,0,0,0.35),
    0 6px 18px rgba(0,0,0,0.45);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}
/* Тонкая 1px градиент-рамка: ярче сверху (цвет rarity), темнее снизу. */
.prize-item::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--r-color) 50%, transparent) 0%,
    rgba(255,255,255,0.06) 45%,
    rgba(0,0,0,0.25) 100%);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
          mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  z-index: 4;
  transition: background 0.3s ease;
}
/* Лёгкий горизонтальный «софит» по верхней кромке. */
.prize-item::after {
  content: '';
  position: absolute;
  top: 0;
  left: 18%;
  right: 18%;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--r-color) 50%,
    transparent 100%);
  opacity: 0.55;
  filter: blur(0.4px);
  pointer-events: none;
  z-index: 5;
}
.prize-item:hover {
  transform: translateY(-3px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    inset 0 -1px 0 rgba(0,0,0,0.35),
    0 12px 28px rgba(0,0,0,0.55),
    0 0 22px color-mix(in srgb, var(--r-color) 25%, transparent);
}
.prize-item:hover::before {
  background: linear-gradient(180deg,
    var(--r-color) 0%,
    color-mix(in srgb, var(--r-color) 35%, transparent) 50%,
    color-mix(in srgb, var(--r-color) 12%, transparent) 100%);
}
.prize-item:hover::after {
  opacity: 0.85;
}
/* Радиальный halo за артом — в спокойном состоянии нейтральный (приглушённый
   белый), на hover расцветает в цвет тира. Это убирает визуальный шум
   когда юзер просто скроллит грид: разноцветные подсветки больше не
   спорят за внимание, а cyan/violet/gold проявляется только под курсором. */
.prize-glow {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 90%;
  aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%,
    rgba(255,255,255,0.10) 0%,
    rgba(255,255,255,0.04) 32%,
    transparent 64%);
  filter: blur(18px);
  pointer-events: none;
  z-index: 0;
  mix-blend-mode: screen;
  opacity: 0.6;
  transition: background 0.35s ease, opacity 0.35s ease;
}
.prize-item:hover .prize-glow {
  background: radial-gradient(circle at 50% 50%,
    color-mix(in srgb, var(--r-color) 55%, transparent) 0%,
    color-mix(in srgb, var(--r-color) 20%, transparent) 32%,
    transparent 64%);
  opacity: 1;
  animation: prizeGlowPulse 2.4s ease-in-out infinite;
}
@keyframes prizeGlowPulse {
  0%, 100% { opacity: 0.7; transform: translate(-50%, -50%) scale(1); }
  50%      { opacity: 1;   transform: translate(-50%, -50%) scale(1.06); }
}
/* Зона арта — фиксированная высота, всё внутри по центру. */
.prize-imgwrap {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: prizeFloat 4s ease-in-out infinite;
}
.prize-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.4s cubic-bezier(0.34, 1.5, 0.64, 1);
}
/* Наушники в PNG имеют большой прозрачный запас по краям — из-за
   `object-fit: contain` они визуально мельче мыши, хотя физически крупнее.
   Поднимаем через scale, чтобы соответствовали реальной иерархии вещей. */
.prize-img[src*="headphones"] { transform: scale(1.22); }
.prize-item:hover .prize-img[src*="headphones"] { transform: scale(1.28); }
.prize-emoji {
  font-size: 78px;
  line-height: 1;
}
@keyframes prizeFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}
.prize-item:hover .prize-img,
.prize-item:hover .prize-emoji {
  transform: scale(1.06);
}
/* Название приза — у всех карточек в одной позиции под артом. */
.prize-name {
  position: relative;
  z-index: 1;
  margin-top: 8px;
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.78);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.2;
  min-height: 14px;
  padding: 0 4px;
}
/* Rarity-бэйдж: всегда внизу карточки. */
.prize-rarity {
  position: relative;
  z-index: 2;
  margin-top: auto;
  padding: 4px 14px;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: #0a0e16;
  background: var(--r-color);
  box-shadow: 0 0 10px color-mix(in srgb, var(--r-color) 60%, transparent);
  white-space: nowrap;
}

/* ========== Rarity tiers (5 уровней) ==========
   Цвет применяется к halo, рамке и капсуле бэйджа. */
.prize-item.rarity-legendary { --r-color: #ffb845; --r-color-soft: rgba(255,184,69,0.6); }
.prize-item.rarity-epic      { --r-color: #b14bff; --r-color-soft: rgba(177,75,255,0.55); }
.prize-item.rarity-rare      { --r-color: #43c5ff; --r-color-soft: rgba(67,197,255,0.55); }
.prize-item.rarity-uncommon  { --r-color: #5da7c0; --r-color-soft: rgba(93,167,192,0.45); }
.prize-item.rarity-common    { --r-color: #6c7889; --r-color-soft: rgba(108,120,137,0.4);  }

/* Бэйдж: насыщенные градиенты для топ-тиров, ровный цвет для остальных. */
.prize-item.rarity-legendary .prize-rarity {
  background: linear-gradient(90deg, #ffd66b 0%, #ff9a1f 100%);
  color: #1a0e00;
}
.prize-item.rarity-epic .prize-rarity {
  background: linear-gradient(90deg, #c878ff 0%, #7b2ff5 100%);
  color: #fff;
}
.prize-item.rarity-rare .prize-rarity {
  background: linear-gradient(90deg, #6cdcff 0%, #1f9bd6 100%);
  color: #021a26;
}
.prize-item.rarity-uncommon .prize-rarity { color: #08161d; }
.prize-item.rarity-common   .prize-rarity { color: #0d1320; }

/* Лёгкая «дышащая» подсветка LEGENDARY — единственный непрерывный эффект
   во всём гриде, чтобы топовый приз ловил взгляд. */
.prize-item.rarity-legendary {
  animation: legendaryPulse 3.5s ease-in-out infinite;
}
@keyframes legendaryPulse {
  0%, 100% {
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,0.08),
      inset 0 -1px 0 rgba(0,0,0,0.35),
      0 6px 18px rgba(0,0,0,0.45),
      0 0 0 rgba(255,184,69,0);
  }
  50% {
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,0.08),
      inset 0 -1px 0 rgba(0,0,0,0.35),
      0 6px 18px rgba(0,0,0,0.45),
      0 0 28px rgba(255,184,69,0.45);
  }
}

/* Tile в рулетке всё ещё использует prize.color из БД через tint-* —
   там нет rarity-*. Это ок: рулетка крутится 6 секунд, цвет её не критичен. */
.tile.tint-bonus { --tile-color: #43c5ff; }
.tile.tint-cash  { --tile-color: #ffbe2e; }
.tile.tint-phys  { --tile-color: #43c5ff; }

/* ========== LEGENDARY mystery «?» (SVG) ========== */
.prize-mystery-svg {
  width: auto;
  height: 100%;
  max-width: 100%;
  filter:
    drop-shadow(0 0 16px rgba(255,184,69,0.65))
    drop-shadow(0 6px 10px rgba(0,0,0,0.55));
  animation: mysteryFloat 4s ease-in-out infinite;
}
@keyframes mysteryFloat {
  0%, 100% { transform: translateY(0)    scale(1); }
  50%      { transform: translateY(-3px) scale(1.03); }
}
/* Mystery-карточка: усиленный halo и золотой акцент по фону. */
.prize-item.mystery {
  background:
    radial-gradient(140% 80% at 50% 0%,
      rgba(255,184,69,0.18) 0%,
      rgba(255,184,69,0.05) 35%,
      transparent 65%),
    linear-gradient(180deg, rgba(255,255,255,0.045) 0%, rgba(255,255,255,0.01) 100%);
}
.prize-item.mystery .prize-glow {
  background: radial-gradient(circle at 50% 50%,
    rgba(255,184,69,0.55) 0%,
    rgba(255,184,69,0.20) 30%,
    transparent 62%);
  filter: blur(22px);
}
/* Tile-вариант mystery в рулетке использует ту же SVG, отдельных стилей не нужно. */
.tile.mystery .prize-mystery-svg {
  filter:
    drop-shadow(0 0 14px rgba(255,184,69,0.6))
    drop-shadow(0 4px 8px rgba(0,0,0,0.5));
}

/* ---------- Tile варианта в рулетке ---------- */
.tile.has-image {
  background: transparent;
  clip-path: none;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,0.4));
  overflow: visible;
}
.tile.has-image .tile-frame,
.tile.has-image .tile-corner { display: none; }
.tile-glow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100%;
  aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%,
    color-mix(in srgb, var(--tile-color) 45%, transparent) 0%,
    color-mix(in srgb, var(--tile-color) 18%, transparent) 32%,
    transparent 62%);
  filter: blur(16px);
  pointer-events: none;
  mix-blend-mode: screen;
  z-index: 0;
}
.tile-imgwrap {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}
.tile-img {
  width: 100%;
  height: auto;
  max-height: 86%;
  object-fit: contain;
}
.tile.win.has-image {
  animation: winpulseImg 0.8s ease-in-out infinite alternate;
}
@keyframes winpulseImg {
  from { filter: drop-shadow(0 0 8px var(--tile-color)) drop-shadow(0 6px 12px rgba(0,0,0,0.4)); transform: scale(1); }
  to   { filter: drop-shadow(0 0 28px var(--tile-color)) drop-shadow(0 0 56px var(--tile-color)); transform: scale(1.05); }
}

/* ─── Топовые плитки в стрипе мерцают, чтобы юзер их заметил мимо ─── */
.tile.tier-legendary { --tile-color: #ffb845; animation: tierTease 1.6s ease-in-out infinite; }
.tile.tier-epic      { --tile-color: #b14bff; animation: tierTease 1.8s ease-in-out infinite; }
.tile.tier-rare      { --tile-color: #43c5ff; animation: tierTease 2.2s ease-in-out infinite; }
@keyframes tierTease {
  0%, 100% {
    filter: drop-shadow(0 6px 12px rgba(0,0,0,0.4));
  }
  50% {
    filter:
      drop-shadow(0 0 18px var(--tile-color))
      drop-shadow(0 0 4px var(--tile-color));
  }
}
/* Тогда .tile.win переопределяет анимацию (выше по специфичности). */
.tile.win { animation: winpulseImg 0.8s ease-in-out infinite alternate !important; }

/* Яркая вспышка в момент остановки на победной плитке. */
.tile.win-flash::before {
  content: '';
  position: absolute;
  inset: -8px;
  background: radial-gradient(circle at 50% 50%, #fff 0%, transparent 70%);
  opacity: 0;
  pointer-events: none;
  z-index: 5;
  animation: winFlashPulse 0.7s ease-out forwards;
}
@keyframes winFlashPulse {
  0%   { opacity: 0;    transform: scale(0.6); }
  20%  { opacity: 0.95; transform: scale(1.1); }
  100% { opacity: 0;    transform: scale(1.4); }
}

@media (max-width: 1200px) {
  .prize-grid { grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 800px) {
  .prize-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ========== Roulette ========== */
.roulette-header {
  text-align: center;
  margin: 8px auto 22px;
}
.roulette-header .section-label {
  display: inline-flex;
  margin-bottom: 0;
}
.roulette-subtitle {
  margin-top: 10px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
}
.roulette {
  position: relative;
  width: 100%;
  max-width: 1400px;
  margin: 24px auto 0;
  height: 220px;
  padding: 0 8px;
}
/* Указатель: треугольник + хвост-линия + glow-пульс */
.pointer {
  position: absolute;
  left: 50%;
  top: -10px;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 22px solid var(--cyan);
  z-index: 4;
  filter: drop-shadow(0 0 10px var(--cyan));
  animation: pointerPulse 1.1s ease-in-out infinite alternate;
}
.pointer::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 22px;
  width: 2px;
  height: 220px;
  background: linear-gradient(to bottom, rgba(67,197,255,0.7), rgba(67,197,255,0.15) 60%, transparent);
  box-shadow: 0 0 6px rgba(67,197,255,0.4);
  transform: translateX(-50%);
}
@keyframes pointerPulse {
  from { filter: drop-shadow(0 0 8px var(--cyan)); }
  to   { filter: drop-shadow(0 0 22px var(--cyan)) drop-shadow(0 0 36px rgba(67,197,255,0.4)); }
}

/* Маска барабана: рамка с неоновым низом/верхом + боковые fade-out */
.strip-mask {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background:
    linear-gradient(180deg,
      rgba(67,197,255,0.06) 0%,
      transparent 14%,
      transparent 86%,
      rgba(67,197,255,0.06) 100%),
    linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0));
  border: 1px solid rgba(255,255,255,0.06);
  border-top: 1px solid rgba(67,197,255,0.45);
  border-bottom: 1px solid rgba(67,197,255,0.45);
  box-shadow:
    inset 0 0 32px rgba(67,197,255,0.08),
    0 0 30px rgba(67,197,255,0.12);
  transition: box-shadow 0.4s ease;
}
.strip-mask.spinning {
  box-shadow:
    inset 0 0 50px rgba(67,197,255,0.18),
    0 0 50px rgba(67,197,255,0.25);
}
/* Подсветочные полоски сверху/снизу, мерцают во время прокрутки. */
.strip-glow-top,
.strip-glow-bottom {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(67,197,255,0.5) 35%,
    rgba(67,197,255,1) 50%,
    rgba(67,197,255,0.5) 65%,
    transparent 100%);
  z-index: 3;
  pointer-events: none;
  filter: blur(0.5px);
  opacity: 0.6;
}
.strip-glow-top    { top: 0; }
.strip-glow-bottom { bottom: 0; }
.strip-mask.spinning .strip-glow-top,
.strip-mask.spinning .strip-glow-bottom {
  animation: stripGlowSweep 1.6s linear infinite;
}
@keyframes stripGlowSweep {
  0%   { opacity: 0.4; }
  50%  { opacity: 1; }
  100% { opacity: 0.4; }
}
.strip-mask::before,
.strip-mask::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 140px;
  z-index: 2;
  pointer-events: none;
}
.strip-mask::before { left: 0;  background: linear-gradient(90deg, var(--bg) 10%, transparent); }
.strip-mask::after  { right: 0; background: linear-gradient(-90deg, var(--bg) 10%, transparent); }
.strip {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  display: flex;
  will-change: transform;
}

.tile {
  --tile-color: #43c5ff;
  width: 180px;
  height: 100%;
  flex: 0 0 180px;
  margin-right: 6px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  isolation: isolate;
  background:
    radial-gradient(120% 80% at 50% 0%,
      color-mix(in srgb, var(--tile-color) 22%, transparent) 0%,
      color-mix(in srgb, var(--tile-color) 6%, transparent) 32%,
      transparent 60%),
    linear-gradient(180deg, #1a2230 0%, #0f1622 100%);
  clip-path: polygon(
    14px 0, calc(100% - 14px) 0,
    100% 14px, 100% calc(100% - 14px),
    calc(100% - 14px) 100%, 14px 100%,
    0 calc(100% - 14px), 0 14px
  );
  filter: drop-shadow(0 6px 12px rgba(0,0,0,0.4));
  transition: filter 0.2s ease, transform 0.2s ease;
}
.tile-frame {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg,
    var(--tile-color) 0%,
    color-mix(in srgb, var(--tile-color) 55%, #fff) 50%,
    var(--tile-color) 100%);
  clip-path: polygon(
    14px 0, calc(100% - 14px) 0,
    100% 14px, 100% calc(100% - 14px),
    calc(100% - 14px) 100%, 14px 100%,
    0 calc(100% - 14px), 0 14px
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
          mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  padding: 2px;
  pointer-events: none;
  z-index: 0;
  filter: drop-shadow(0 0 6px var(--tile-color));
}
.tile-corner {
  position: absolute;
  width: 6px;
  height: 6px;
  background: var(--tile-color);
  box-shadow: 0 0 8px var(--tile-color);
  z-index: 3;
}
.tile-corner.tl { top: 16px; left: 16px; }
.tile-corner.tr { top: 16px; right: 16px; }
.tile-corner.bl { bottom: 16px; left: 16px; }
.tile-corner.br { bottom: 16px; right: 16px; }

.tile-body {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 14px;
}
.tile-big {
  font-family: var(--font-heading);
  font-style: italic;
  font-weight: 800;
  font-size: 38px;
  line-height: 1;
  letter-spacing: 0.02em;
  color: #fff;
  -webkit-text-stroke: 1px var(--tile-color);
  text-shadow:
    0 0 6px var(--tile-color),
    0 0 16px color-mix(in srgb, var(--tile-color) 70%, transparent),
    0 0 28px color-mix(in srgb, var(--tile-color) 35%, transparent);
}
.tile-emoji {
  -webkit-text-stroke: 0;
  font-size: 46px;
  text-shadow: 0 0 18px var(--tile-color), 0 4px 10px rgba(0,0,0,0.5);
}
.tile-unit {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: rgba(255,255,255,0.78);
  margin-top: 4px;
}
.tile-name {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 6px;
}
.tile.win {
  animation: winpulse 0.8s ease-in-out infinite alternate;
}
@keyframes winpulse {
  from { filter: drop-shadow(0 0 8px var(--tile-color)) drop-shadow(0 6px 12px rgba(0,0,0,0.4)); transform: scale(1); }
  to   { filter: drop-shadow(0 0 24px var(--tile-color)) drop-shadow(0 0 48px var(--tile-color)); transform: scale(1.04); }
}

/* ========== Modal ========== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  /* Мягкий fade-in бэкдропа — чтобы модалка не «выскакивала» резко после рулетки. */
  animation: backdropFade 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes backdropFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.modal-backdrop.active { display: flex; }

.modal-card {
  position: relative;
  width: min(520px, 92vw);
  padding: 40px 48px 28px;
  background: #14151e;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  text-align: center;
  /* Более мягкая анимация: плавный rise + fade без bouncy-эффекта.
     Прежний bounce (cubic 1.56) ощущался как «выпрыгивание». */
  animation: popup 0.55s cubic-bezier(0.16, 0.84, 0.3, 1);
}
.modal-card::before {
  display: none;
}
@keyframes popup {
  from { transform: translateY(16px) scale(0.96); opacity: 0; }
  to   { transform: translateY(0)    scale(1);    opacity: 1; }
}

.modal-title {
  font-family: var(--font-title);
  font-style: italic;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #fff;
  margin-bottom: 24px;
}
.modal-img {
  width: auto;
  max-width: 280px;
  max-height: 220px;
  object-fit: contain;
  filter:
    drop-shadow(0 12px 24px rgba(0,0,0,0.55))
    drop-shadow(0 0 28px rgba(67,197,255,0.4));
  animation: modalImgIn 0.5s cubic-bezier(0.34, 1.5, 0.64, 1);
}
/* Крупный заголовок выигрыша (+200 БОНУСОВ / БАТОНЧИК / ИГРОВОЙ ПК). */
.modal-headline {
  margin-top: 20px;
  font-family: var(--font-title);
  font-style: italic;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #fff;
  line-height: 1;
}
.modal-headline:empty { display: none; }
/* Описание под заголовком: что это и как использовать. */
.modal-desc {
  margin: 12px auto 0;
  max-width: 440px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.55;
  color: rgba(255,255,255,0.7);
  text-align: center;
}
.modal-desc:empty { display: none; }

/* ========== Модалка с описанием приза ========== */
.modal-info-card {
  --info-rarity: #43c5ff;
  position: relative;
  width: min(680px, 94vw);
  padding: 44px 52px 36px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Тонкая верхняя «лента» цвета редкости + outer glow */
  border-top: 2px solid var(--info-rarity);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04),
    0 24px 48px rgba(0,0,0,0.55),
    0 0 60px color-mix(in srgb, var(--info-rarity) 22%, transparent);
}
/* Декоративная подсветка-полоса под border-top — мягко уходит в стороны. */
.modal-info-card::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 16%;
  right: 16%;
  height: 2px;
  background: var(--info-rarity);
  filter: blur(3px);
  opacity: 0.7;
  pointer-events: none;
}
.modal-info-card .modal-img {
  margin-top: 6px;
  max-width: 320px;
  max-height: 230px;
}
/* Заголовок крупнее + цветной нижний акцент */
.modal-info-card .modal-headline {
  margin-top: 18px;
  font-size: 32px;
  letter-spacing: 0.04em;
  color: #fff;
  position: relative;
  padding-bottom: 14px;
}
.modal-info-card .modal-headline::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 60px;
  height: 2px;
  background: var(--info-rarity);
  border-radius: 2px;
}
/* X-кнопка в углу — менее громоздкая чем большая «ЗАКРЫТЬ» */
.modal-icon-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 50%;
  font-size: 22px;
  font-weight: 300;
  line-height: 1;
  color: rgba(255,255,255,0.55);
  cursor: pointer;
  transition: all 0.2s ease;
}
.modal-icon-close:hover {
  border-color: var(--info-rarity);
  color: #fff;
  background: color-mix(in srgb, var(--info-rarity) 10%, transparent);
}
.modal-info-desc {
  margin-top: 18px;
  max-width: 540px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.7;
  color: rgba(255,255,255,0.82);
  text-align: center;
}
.modal-info-desc p {
  margin: 0 0 12px;
}
.modal-info-desc p:last-child { margin: 0; }

/* Список характеристик: «ключ ····· значение» с тонкими разделителями.
   Премиальный, чистый — типа описания товара в каталоге Apple/Logitech. */
.modal-info-specs {
  margin: 18px auto 0;
  padding: 0;
  max-width: 460px;
  text-align: left;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.modal-info-specs-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 4px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.modal-info-specs-row dt {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  margin: 0;
  flex: 0 0 auto;
}
.modal-info-specs-row dd {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin: 0;
  text-align: right;
}

/* Блок «На выбор: Snickers / Mars / ...» */
.modal-info-options {
  width: 100%;
  margin-top: 22px;
  padding: 16px 20px 18px;
  background: color-mix(in srgb, var(--info-rarity) 6%, transparent);
  border: 1px solid color-mix(in srgb, var(--info-rarity) 22%, transparent);
  border-radius: 4px;
  text-align: left;
}
.modal-info-options-label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--info-rarity);
  margin-bottom: 12px;
}
.modal-info-options-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.modal-info-options-list li {
  padding: 8px 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 3px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,0.95);
}
/* «Как получить» — full-width плашка снизу. Иконка слева в круглом плейте,
   справа заголовок + текст в одну колонку. Перекрываем max-width базового
   .modal-note (там 320px → плашка резалась). */
.modal-note-rich {
  display: flex !important;
  align-items: flex-start;
  gap: 18px;
  width: 100% !important;
  max-width: 100% !important;
  margin-top: 24px;
  padding: 18px 22px !important;
  text-align: left;
  background: color-mix(in srgb, var(--info-rarity) 5%, rgba(255,255,255,0.02)) !important;
  border: 1px solid color-mix(in srgb, var(--info-rarity) 18%, rgba(255,255,255,0.05)) !important;
  border-radius: 6px !important;
  box-sizing: border-box;
  line-height: 1.55 !important;
}
/* Иконка «как получить» — тонкая line-art, единый нейтральный цвет.
   Раньше она была в цвете тира → у легендарок выглядела жёлто-обведённой
   и спорила за внимание с самим артом приза. Теперь спокойная, серая. */
.modal-note-rich .modal-note-ic {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  color: rgba(255,255,255,0.55);
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 50%;
}
.modal-note-rich .modal-note-ic svg {
  display: block;
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
}
.modal-note-rich .modal-note-body {
  flex: 1 1 auto;
  min-width: 0;
  padding-top: 2px;
}
.modal-note-rich .modal-note-title {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--info-rarity);
  margin-bottom: 6px;
  line-height: 1;
}
.modal-note-rich .modal-note-text {
  font-family: var(--font-body);
  font-size: 14.5px;
  font-weight: 400;
  line-height: 1.55;
  color: rgba(255,255,255,0.88);
}
.modal-note-rich:empty { display: none !important; }

/* Спонсорский блок (главный приз — ПК от партнёра) */
.modal-sponsor {
  margin-top: 18px;
  padding: 14px 26px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: color-mix(in srgb, var(--info-rarity) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--info-rarity) 30%, transparent);
  border-radius: 4px;
  position: relative;
}
/* HTML-атрибут hidden должен побеждать display: inline-flex */
.modal-sponsor[hidden] { display: none !important; }
.modal-sponsor::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 16%;
  right: 16%;
  height: 1px;
  background: var(--info-rarity);
  opacity: 0.6;
  filter: blur(0.5px);
}
.modal-sponsor-label {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
}
.modal-sponsor-link {
  font-family: var(--font-heading);
  font-style: italic;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.06em;
  color: var(--info-rarity);
  text-decoration: none;
  text-shadow: 0 0 8px color-mix(in srgb, var(--info-rarity) 35%, transparent);
  transition: all 0.2s ease;
  cursor: pointer;
}
.modal-sponsor-link::after {
  content: '↗';
  display: inline-block;
  margin-left: 8px;
  font-style: normal;
  font-weight: 600;
  font-size: 14px;
  transform: translateY(-1px);
  transition: transform 0.2s ease;
}
.modal-sponsor-link:hover {
  color: #fff;
  text-shadow: 0 0 14px var(--info-rarity), 0 0 28px color-mix(in srgb, var(--info-rarity) 50%, transparent);
}
.modal-sponsor-link:hover::after {
  transform: translate(2px, -3px);
}

/* Цвет редкости в модалке через CSS-vars */
.modal-info-card.info-rarity-legendary { --info-rarity: #ffb845; }
.modal-info-card.info-rarity-epic      { --info-rarity: #b14bff; }
.modal-info-card.info-rarity-rare      { --info-rarity: #43c5ff; }
.modal-info-card.info-rarity-uncommon  { --info-rarity: #5da7c0; }
.modal-info-card.info-rarity-common    { --info-rarity: #6c7889; }

/* ========== История выигрышей (модалка) ========== */
.modal-history-card {
  width: min(640px, 92vw);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  padding: 32px 32px 24px;
}
.modal-history-card .modal-title { margin-bottom: 18px; }
.modal-history-card .history-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 6px;
  margin: 0 -8px 18px;
  padding-left: 8px;
  padding-right: 14px;
}
/* Скроллбар в стиле сайта. */
.modal-history-card .history-list::-webkit-scrollbar { width: 6px; }
.modal-history-card .history-list::-webkit-scrollbar-track { background: rgba(255,255,255,0.04); border-radius: 3px; }
.modal-history-card .history-list::-webkit-scrollbar-thumb { background: rgba(67,197,255,0.35); border-radius: 3px; }
.modal-history-card .history-list::-webkit-scrollbar-thumb:hover { background: rgba(67,197,255,0.55); }
.history-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.history-empty {
  padding: 24px 8px;
  text-align: center;
  font-family: var(--font-body);
  font-size: 13px;
  color: rgba(255,255,255,0.45);
  line-height: 1.6;
}
.history-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 4px;
  transition: border-color 0.25s ease, transform 0.25s ease;
}
.history-item:hover {
  border-color: rgba(67,197,255,0.35);
  transform: translateY(-2px);
}
.history-item-img {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.25);
  border-radius: 4px;
  overflow: hidden;
}
.history-item-img img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.history-item-img .h-emoji {
  font-size: 32px;
  line-height: 1;
}
.history-item-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.history-item-name {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.history-item-date {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 500;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.06em;
}
@keyframes modalImgIn {
  0%   { opacity: 0; transform: scale(0.7); }
  100% { opacity: 1; transform: scale(1); }
}
.modal-amount {
  font-family: var(--font-title);
  font-style: italic;
  font-size: 96px;
  font-weight: 700;
  line-height: 0.9;
  color: #fff;
}
.modal-unit {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.24em;
  color: var(--cyan);
  text-transform: uppercase;
  margin-top: 8px;
}
.modal-name {
  margin-top: 14px;
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.85);
  text-transform: uppercase;
}
/* Note в модалке результата — простая строка без рамки/фона, чтобы не путать
   с кнопкой. Значимый акцент даёт только цвет текста и опц. иконка ✓. */
.modal-note {
  margin-top: 18px;
  padding: 0;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: rgba(67,197,255,0.85);
  background: none;
  border: 0;
  border-radius: 0;
  max-width: 100%;
  line-height: 1.45;
}
.modal-note:empty { display: none; }
.modal-close {
  margin-top: 24px;
  min-width: 240px;
}

/* ========== Preview screen (unified: ready / progress / empty) ========== */
#screen-preview.active {
  display: block;
  padding: 24px 0 40px;
}

.preview-hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 40px;
  align-items: center;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 56px 48px;
  background: linear-gradient(135deg, rgba(67,197,255,0.04), rgba(255,255,255,0.015));
  border: 1px solid var(--border-mid);
  overflow: hidden;
  min-height: 520px;
}
.preview-hero::before {
  content: '';
  position: absolute;
  left: -120px; top: -120px;
  width: 520px; height: 520px;
  background: radial-gradient(circle, rgba(67,197,255,0.12), transparent 60%);
  pointer-events: none;
  z-index: 0;
}
.preview-hero::after {
  content: '';
  position: absolute;
  right: -80px; bottom: -140px;
  width: 460px; height: 460px;
  background: radial-gradient(circle, rgba(67,197,255,0.08), transparent 65%);
  pointer-events: none;
  z-index: 0;
}

.preview-left, .preview-right { position: relative; z-index: 1; }

.preview-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  background: rgba(67,197,255,0.08);
  border: 1px solid rgba(67,197,255,0.25);
  font-family: var(--font-title);
  font-style: italic;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--cyan);
  text-transform: uppercase;
  margin-bottom: 22px;
}
.preview-label-dot {
  width: 6px; height: 6px;
  background: var(--cyan);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--cyan);
  animation: previewPulse 1.8s ease-in-out infinite;
}
@keyframes previewPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(1.2); }
}

.preview-headline {
  font-family: var(--font-title);
  font-style: italic;
  font-weight: 700;
  font-size: 54px;
  line-height: 0.98;
  letter-spacing: -0.01em;
  color: #fff;
  text-transform: uppercase;
  margin: 0 0 18px;
  text-shadow: 0 4px 32px rgba(67,197,255,0.15);
}

.preview-lead {
  font-family: var(--font-regular);
  font-size: 15px;
  line-height: 1.5;
  color: rgba(255,255,255,0.6);
  margin: 0 0 28px;
  max-width: 480px;
}

.preview-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 28px;
}
.preview-stat {
  padding: 16px 20px 18px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-left: 2px solid var(--cyan);
}
.preview-stat-label {
  font-family: var(--font-regular);
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.preview-stat-value {
  font-family: var(--font-title);
  font-style: italic;
  font-weight: 700;
  font-size: 28px;
  line-height: 1;
  color: #fff;
}
/* «Доступно кейсов» — главный фокус блока. Крупный, геометричный, без
   италика — взгляд цепляется именно за это число. */
.preview-stat-value-cyan {
  color: var(--cyan);
  font-style: normal;
  font-weight: 900;
  font-size: 38px;
  letter-spacing: -0.02em;
  text-shadow: 0 0 18px rgba(67,197,255,0.35);
}
/* UI-метка «ОТКРЫТО 1 · ЗАРАБОТАНО 2» под цифрой кейсов.
   Масштабируется на любые числа (1/2, 100/200) — без визуальной перегрузки.
   Стилизована как мини-таблица ключ/значение в стиле каталога Linear/Apple. */
.preview-cases-meta {
  margin-top: 10px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-body);
  letter-spacing: 0.06em;
}
.preview-cases-meta-pair {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}
.preview-cases-meta-key {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
}
.preview-cases-meta-val {
  font-family: var(--font-title);
  font-style: italic;
  font-size: 14px;
  font-weight: 700;
  color: rgba(255,255,255,0.92);
}
.preview-cases-meta-dot {
  color: rgba(255,255,255,0.18);
  font-size: 12px;
}

.preview-progress {
  padding: 18px 22px 20px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  margin-bottom: 28px;
}
.preview-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 16px;
}
.preview-progress-label {
  font-family: var(--font-title);
  font-style: italic;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--cyan);
  text-transform: uppercase;
}
.preview-progress-target {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}
.preview-progress-target .pp-num {
  color: var(--cyan);
  font-size: 26px;
}
.preview-progress-target .pp-sep {
  color: rgba(255,255,255,0.35);
  font-weight: 400;
  margin: 0 2px;
}
.preview-progress-target .pp-tot {
  color: rgba(255,255,255,0.85);
  font-size: 18px;
}
.preview-progress-bar {
  position: relative;
  height: 5px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  margin-bottom: 14px;
  overflow: hidden;
}
.preview-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #0e8fc7, #43c5ff);
  box-shadow: 0 0 12px rgba(67,197,255,0.5);
  transition: width 0.9s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 0;
}
.preview-progress-text {
  font-family: var(--font-regular);
  font-size: 14px;
  color: rgba(255,255,255,0.7);
}
.preview-progress-text b {
  color: #fff;
  font-family: var(--font-body);
}

.preview-actions {
  display: flex;
  gap: 12px;
  align-items: stretch;
}
/* Все кнопки в panel-row живут единым flex-item: одинаковая высота, без
   собственных margin'ов (.btn-primary иначе уезжает на 32px вниз). */
.preview-actions > .btn {
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 32px !important;
  min-height: 56px !important;
  line-height: 1 !important;
  font-size: 14px !important;
  letter-spacing: 0.14em !important;
  white-space: nowrap !important;
}
/* Атрибут [hidden] должен побеждать !important выше. */
.preview-actions > .btn[hidden] { display: none !important; }

.preview-cta {
  flex: 1 1 auto;
  min-width: 240px;
  font-size: 15px !important;
}
.preview-refresh,
.preview-history {
  flex: 0 0 auto;
  min-width: 200px !important;
  background: transparent !important;
  border: 1px solid var(--border-mid) !important;
  color: rgba(255,255,255,0.75) !important;
}
.preview-refresh:hover,
.preview-history:hover {
  border-color: var(--cyan) !important;
  color: #fff !important;
  background: rgba(67,197,255,0.06) !important;
}

/* ========== Preview right visual ========== */
.preview-right {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 380px;
}
.preview-case-visual {
  position: relative;
  width: 100%;
  max-width: 460px;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.preview-case-halo {
  position: absolute;
  /* Круглый glow вместо прямоугольного inset — иначе края подложки
     торчат за PNG, который меньше контейнера. */
  width: 92%;
  aspect-ratio: 1 / 1;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, rgba(67,197,255,0.45), rgba(67,197,255,0.18) 38%, transparent 70%);
  filter: blur(6px);
  animation: previewHalo 4s ease-in-out infinite;
}
@keyframes previewHalo {
  0%, 100% { opacity: 0.85; transform: translate(-50%, -50%) scale(1); }
  50%      { opacity: 1;    transform: translate(-50%, -50%) scale(1.08); }
}
/* Мягкий блик сверху по центру кейса (без прямоугольного inset). */
.preview-case-shine {
  position: absolute;
  width: 70%;
  aspect-ratio: 1 / 1;
  left: 50%;
  top: 18%;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 30%, rgba(255,255,255,0.28), transparent 55%);
  mix-blend-mode: screen;
  pointer-events: none;
  filter: blur(4px);
}
/* Конус света сверху — будто на кейс падает прожектор. */
.preview-case-rays {
  position: absolute;
  left: 50%;
  top: -10%;
  width: 120%;
  height: 130%;
  transform: translateX(-50%);
  background:
    conic-gradient(from 180deg at 50% 0%,
      transparent 0deg,
      rgba(67,197,255,0.0) 18deg,
      rgba(67,197,255,0.18) 30deg,
      rgba(67,197,255,0.0) 42deg,
      transparent 60deg,
      rgba(67,197,255,0.10) 72deg,
      transparent 84deg,
      rgba(255,255,255,0.0) 360deg);
  filter: blur(14px);
  opacity: 0.9;
  mix-blend-mode: screen;
  pointer-events: none;
  animation: previewRays 9s linear infinite;
}
@keyframes previewRays {
  0%   { transform: translateX(-50%) rotate(-4deg); opacity: 0.55; }
  50%  { transform: translateX(-50%) rotate(4deg);  opacity: 0.95; }
  100% { transform: translateX(-50%) rotate(-4deg); opacity: 0.55; }
}
/* Вращающееся неоновое кольцо за кейсом. */
.preview-case-ring {
  position: absolute;
  width: 78%;
  aspect-ratio: 1 / 1;
  left: 50%;
  top: 52%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background:
    conic-gradient(from 0deg,
      rgba(67,197,255,0.0) 0deg,
      rgba(67,197,255,0.55) 60deg,
      rgba(255,255,255,0.85) 90deg,
      rgba(67,197,255,0.55) 120deg,
      rgba(67,197,255,0.0) 200deg,
      rgba(67,197,255,0.0) 360deg);
  -webkit-mask: radial-gradient(circle, transparent 46%, #000 48%, #000 50%, transparent 52%);
          mask: radial-gradient(circle, transparent 46%, #000 48%, #000 50%, transparent 52%);
  filter: blur(2px) drop-shadow(0 0 12px rgba(67,197,255,0.6));
  mix-blend-mode: screen;
  opacity: 0.65;
  pointer-events: none;
  animation: previewRing 7s linear infinite;
}
@keyframes previewRing {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}
/* Парящие искры вокруг кейса. */
.preview-case-sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}
.preview-case-sparkles .spark {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, rgba(67,197,255,0.95) 40%, rgba(67,197,255,0) 70%);
  box-shadow: 0 0 12px rgba(67,197,255,0.9), 0 0 24px rgba(67,197,255,0.5);
  opacity: 0;
  animation: sparkFloat 5.2s ease-in-out infinite;
}
.preview-case-sparkles .s1 { left: 18%; top: 62%; animation-delay: 0.0s; }
.preview-case-sparkles .s2 { left: 28%; top: 30%; animation-delay: 0.7s; width: 4px; height: 4px; }
.preview-case-sparkles .s3 { left: 76%; top: 26%; animation-delay: 1.4s; }
.preview-case-sparkles .s4 { left: 84%; top: 70%; animation-delay: 2.1s; width: 5px; height: 5px; }
.preview-case-sparkles .s5 { left: 50%; top: 14%; animation-delay: 2.8s; width: 4px; height: 4px; }
.preview-case-sparkles .s6 { left: 12%; top: 44%; animation-delay: 3.5s; width: 3px; height: 3px; }
.preview-case-sparkles .s7 { left: 90%; top: 48%; animation-delay: 4.2s; width: 4px; height: 4px; }
@keyframes sparkFloat {
  0%   { opacity: 0; transform: translateY(0)    scale(0.6); }
  20%  { opacity: 1; transform: translateY(-8px) scale(1); }
  60%  { opacity: 1; transform: translateY(-22px) scale(1.05); }
  100% { opacity: 0; transform: translateY(-32px) scale(0.5); }
}
.preview-case-img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 20px 40px rgba(0,0,0,0.5))
          drop-shadow(0 0 40px rgba(67,197,255,0.3));
  animation: previewFloat 4.5s ease-in-out infinite;
  z-index: 1;
}
@keyframes previewFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-14px); }
}
.preview-case-floor {
  position: absolute;
  left: 10%; right: 10%;
  bottom: 10%;
  height: 18px;
  background: radial-gradient(ellipse at center, rgba(67,197,255,0.45), transparent 70%);
  filter: blur(6px);
  animation: previewFloor 4.5s ease-in-out infinite;
  z-index: 0;
}
@keyframes previewFloor {
  0%, 100% { opacity: 0.7; transform: scaleX(1); }
  50%      { opacity: 1;   transform: scaleX(0.88); }
}

/* ========== «Земля» под кейсом ========== */

/* Самый нижний слой — широкая голубая дымка от кейса по поверхности. */
.preview-case-ground {
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: -2%;
  height: 38%;
  background: radial-gradient(ellipse at 50% 100%,
    rgba(67,197,255,0.28) 0%,
    rgba(67,197,255,0.10) 35%,
    transparent 70%);
  filter: blur(20px);
  pointer-events: none;
  z-index: 0;
  mix-blend-mode: screen;
}
/* Голографическая платформа: концентрические неоновые кольца на «полу». */
.preview-case-podium {
  position: absolute;
  left: 50%;
  bottom: 7%;
  width: 78%;
  height: 22%;
  transform: translateX(-50%) perspective(420px) rotateX(74deg);
  transform-origin: center bottom;
  background:
    radial-gradient(ellipse at 50% 50%,
      transparent 38%,
      rgba(67,197,255,0.55) 40%, rgba(67,197,255,0.55) 41%,
      transparent 43%,
      transparent 50%,
      rgba(67,197,255,0.30) 52%, rgba(67,197,255,0.30) 52.5%,
      transparent 54%,
      transparent 64%,
      rgba(67,197,255,0.18) 66%, rgba(67,197,255,0.18) 66.5%,
      transparent 68%);
  filter: blur(0.8px) drop-shadow(0 0 12px rgba(67,197,255,0.6));
  pointer-events: none;
  opacity: 0.85;
  mix-blend-mode: screen;
  animation: previewPodium 4.5s ease-in-out infinite;
  z-index: 0;
}
@keyframes previewPodium {
  0%, 100% { opacity: 0.7;  transform: translateX(-50%) perspective(420px) rotateX(74deg) scale(1); }
  50%      { opacity: 1;    transform: translateX(-50%) perspective(420px) rotateX(74deg) scale(1.04); }
}
/* Световое пятно на «полу» — кейс подсвечивает поверхность под собой. */
.preview-case-spill {
  position: absolute;
  left: 50%;
  bottom: 9%;
  width: 60%;
  aspect-ratio: 2.4 / 1;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at 50% 50%,
    rgba(180,235,255,0.55) 0%,
    rgba(67,197,255,0.35) 25%,
    rgba(67,197,255,0.10) 55%,
    transparent 75%);
  filter: blur(8px);
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: 0;
  animation: previewSpill 4.5s ease-in-out infinite;
}
@keyframes previewSpill {
  0%, 100% { opacity: 0.85; transform: translateX(-50%) scale(1); }
  50%      { opacity: 1;    transform: translateX(-50%) scale(0.92); }
}
/* Тёмная контактная тень — синхронна с подъёмом кейса:
   когда тот выше — тень рассеяннее и тусклее. */
.preview-case-shadow {
  position: absolute;
  left: 50%;
  bottom: 8%;
  width: 50%;
  aspect-ratio: 4 / 1;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at 50% 50%,
    rgba(0,0,0,0.65) 0%,
    rgba(0,0,0,0.35) 35%,
    transparent 70%);
  filter: blur(10px);
  pointer-events: none;
  z-index: 0;
  animation: previewShadow 4.5s ease-in-out infinite;
}
@keyframes previewShadow {
  0%, 100% { opacity: 0.85; transform: translateX(-50%) scale(1); }
  50%      { opacity: 0.55; transform: translateX(-50%) scale(0.82); }
}
/* Поднимающиеся пылинки/искры от поверхности — оживляют сцену. */
.preview-case-dust {
  position: absolute;
  left: 50%;
  bottom: 8%;
  width: 60%;
  height: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 1;
}
.preview-case-dust .dust {
  position: absolute;
  bottom: 0;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, rgba(67,197,255,0.9) 50%, rgba(67,197,255,0) 75%);
  box-shadow: 0 0 8px rgba(67,197,255,0.9);
  opacity: 0;
  animation: dustRise 6s ease-in infinite;
}
.preview-case-dust .d1 { left: 18%; animation-delay: 0.0s; }
.preview-case-dust .d2 { left: 32%; animation-delay: 1.0s; width: 2px; height: 2px; }
.preview-case-dust .d3 { left: 48%; animation-delay: 2.0s; }
.preview-case-dust .d4 { left: 62%; animation-delay: 3.0s; width: 2px; height: 2px; }
.preview-case-dust .d5 { left: 76%; animation-delay: 4.0s; }
.preview-case-dust .d6 { left: 88%; animation-delay: 5.0s; width: 2px; height: 2px; }
@keyframes dustRise {
  0%   { opacity: 0;   transform: translateY(0)     scale(0.6); }
  15%  { opacity: 0.9; transform: translateY(-10px) scale(1); }
  60%  { opacity: 0.7; transform: translateY(-60px) scale(0.9); }
  100% { opacity: 0;   transform: translateY(-110px) scale(0.4); }
}

/* ========== Rules section ========== */
.rules-section {
  width: 100%;
  max-width: 1280px;
  margin: 48px auto 0;
}
.rules-section .section-label {
  margin-bottom: 20px;
}
.rules-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.rule-card {
  position: relative;
  padding: 28px 28px 26px;
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--border-mid);
  overflow: hidden;
  transition: border-color 0.3s ease, background 0.3s ease, transform 0.3s ease;
}
.rule-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), transparent);
  opacity: 0.6;
  transition: opacity 0.3s ease;
}
.rule-card:hover {
  border-color: rgba(67,197,255,0.35);
  background: rgba(67,197,255,0.04);
  transform: translateY(-3px);
}
.rule-card:hover::before { opacity: 1; }

.rule-num {
  font-family: var(--font-title);
  font-style: italic;
  font-weight: 700;
  font-size: 36px;
  color: rgba(67,197,255,0.2);
  line-height: 1;
  margin-bottom: 14px;
}
.rule-title {
  font-family: var(--font-title);
  font-style: italic;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.04em;
  color: #fff;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.rule-desc {
  font-family: var(--font-regular);
  font-size: 13px;
  line-height: 1.55;
  color: rgba(255,255,255,0.4);
}

/* ========== Preview responsive ========== */
@media (max-width: 1100px) {
  .preview-hero {
    grid-template-columns: 1fr;
    padding: 40px 32px;
    min-height: 0;
  }
  .preview-headline { font-size: 40px; }
  .preview-right { min-height: 300px; }
  .preview-case-visual { max-width: 360px; }
  .rules-grid { grid-template-columns: 1fr; }
}

/* ========== Spinner ========== */
.spinner {
  width: 48px;
  height: 48px;
  border: 2px solid rgba(255,255,255,0.06);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ========== [1] Prize grid — tier accent (top soffit per rarity) ========== */
/* The ::after soffit on .prize-item already uses var(--r-color) at opacity 0.55.
   For legendary we add the persistent glow pulse — already defined above as
   legendaryPulse. The soffit/gradient-border already differentiates tiers
   subtly in idle via the color-mix top gradient. We now boost those: */

/* Legendary: brighter soffit + stronger ambient opacity */
.prize-item.rarity-legendary::after {
  opacity: 0.8;
  height: 1.5px;
  filter: blur(0.3px) drop-shadow(0 0 4px rgba(255,184,69,0.9));
}
/* Epic: slightly boosted soffit */
.prize-item.rarity-epic::after {
  opacity: 0.65;
  filter: blur(0.3px) drop-shadow(0 0 3px rgba(177,75,255,0.7));
}
/* Rare: cyan soffit matches brand accent but still visible */
.prize-item.rarity-rare::after {
  opacity: 0.6;
}
/* Uncommon/common stay at default 0.55 */

/* Legendary idle glow — subtly pulsing outline, not aggressive */
@keyframes legendaryIdleGlow {
  0%, 100% {
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,0.08),
      inset 0 -1px 0 rgba(0,0,0,0.35),
      0 6px 18px rgba(0,0,0,0.45),
      0 0 14px rgba(255,184,69,0.12);
  }
  50% {
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,0.08),
      inset 0 -1px 0 rgba(0,0,0,0.35),
      0 6px 18px rgba(0,0,0,0.45),
      0 0 22px rgba(255,184,69,0.22);
  }
}
/* Override the existing legendaryPulse with a more subtle version */
.prize-item.rarity-legendary {
  animation: legendaryIdleGlow 3.5s ease-in-out infinite;
}

/* ========== [2] Confetti canvas overlay ========== */
#confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 110; /* above modal-backdrop (100) but below nothing critical */
}

/* ========== [2] Modal result — tier halo on prize image ========== */
/* Added via JS: .modal-img--halo on #prize-img when tier >= rare */
.modal-img--halo {
  filter:
    drop-shadow(0 12px 24px rgba(0,0,0,0.55))
    drop-shadow(0 0 36px var(--prize-halo-color, rgba(67,197,255,0.6)));
  animation: prizeHaloPulse 2s ease-in-out infinite alternate;
}
@keyframes prizeHaloPulse {
  from { filter:
    drop-shadow(0 12px 24px rgba(0,0,0,0.55))
    drop-shadow(0 0 28px var(--prize-halo-color, rgba(67,197,255,0.45))); }
  to   { filter:
    drop-shadow(0 12px 24px rgba(0,0,0,0.55))
    drop-shadow(0 0 52px var(--prize-halo-color, rgba(67,197,255,0.75))); }
}

/* ========== [3] Hero — floating ambient particles ========== */
.preview-hero-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.hero-particle {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(67,197,255,0.9) 0%, rgba(67,197,255,0) 70%);
  pointer-events: none;
}
.hero-particle.hp1 {
  width: 5px; height: 5px;
  left: 8%; top: 28%;
  opacity: 0.25;
  animation: heroFloat1 9s ease-in-out infinite;
}
.hero-particle.hp2 {
  width: 3px; height: 3px;
  left: 22%; top: 65%;
  opacity: 0.2;
  animation: heroFloat2 12s ease-in-out infinite;
  animation-delay: -3s;
}
.hero-particle.hp3 {
  width: 4px; height: 4px;
  left: 55%; top: 18%;
  opacity: 0.3;
  animation: heroFloat1 10s ease-in-out infinite;
  animation-delay: -5s;
}
.hero-particle.hp4 {
  width: 3px; height: 3px;
  left: 72%; top: 72%;
  opacity: 0.18;
  animation: heroFloat2 14s ease-in-out infinite;
  animation-delay: -8s;
}
.hero-particle.hp5 {
  width: 4px; height: 4px;
  left: 88%; top: 38%;
  opacity: 0.22;
  animation: heroFloat1 11s ease-in-out infinite;
  animation-delay: -2s;
}
@keyframes heroFloat1 {
  0%   { transform: translateY(0)    translateX(0); opacity: 0; }
  15%  { opacity: var(--p-op, 0.28); }
  50%  { transform: translateY(-28px) translateX(8px); opacity: var(--p-op, 0.28); }
  85%  { opacity: var(--p-op, 0.28); }
  100% { transform: translateY(0)    translateX(0); opacity: 0; }
}
@keyframes heroFloat2 {
  0%   { transform: translateY(0)    translateX(0); opacity: 0; }
  15%  { opacity: var(--p-op, 0.22); }
  50%  { transform: translateY(-18px) translateX(-10px); opacity: var(--p-op, 0.22); }
  85%  { opacity: var(--p-op, 0.22); }
  100% { transform: translateY(0)    translateX(0); opacity: 0; }
}
@media (max-width: 600px) {
  .preview-hero-particles { display: none; }
}

/* ========== [4] Rule card icons ========== */
.rule-icon {
  display: block;
  width: 26px;
  height: 26px;
  margin-bottom: 12px;
  color: var(--cyan);
  flex-shrink: 0;
  transition: transform 0.3s ease, filter 0.3s ease;
}
.rule-icon svg {
  display: block;
  width: 100%;
  height: 100%;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}
.rule-card:hover .rule-icon {
  transform: rotate(4deg);
  filter: drop-shadow(0 0 6px rgba(67,197,255,0.7));
}

/* ========== [5] Footer ========== */
.site-footer {
  position: relative;
  z-index: 2;
  width: 100%;
  border-top: 1px solid rgba(255,255,255,0.05);
  padding: 26px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.site-footer-left,
.site-footer-right {
  font-family: var(--font-regular);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.32);
  white-space: nowrap;
}
.site-footer-left strong {
  font-family: var(--font-body);
  color: rgba(255,255,255,0.45);
  font-weight: 700;
}
@media (max-width: 600px) {
  .site-footer {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px 24px;
    gap: 6px;
  }
}

/* ════════════════════════════════════════════════════════════════════════
   POLISH + BOLDER LAYER  (impeccable craft, brief A+B)
   ──────────────────────────────────────────────────────────────────────
   Adds: a11y primitives, mobile breakpoints, reduced-motion support,
   tinted neutrals, skeleton state, bolder editorial typography.
   Append-only — no rewrite of base PROVODA design language above.
   ════════════════════════════════════════════════════════════════════ */

/* ── Tinted neutrals: pure #fff/#000 broken with a faint cool tint ── */
:root {
  --text-strong:   oklch(0.99 0.005 245);
  --text-soft:     oklch(0.97 0.008 245);
  --text-mute:     oklch(0.78 0.012 245);
  --shadow-deep:   oklch(0.05 0.012 250 / 0.55);
  --focus-ring:    rgba(67,197,255,0.85);
  --focus-halo:    rgba(67,197,255,0.30);
}

/* ── Screen-reader only ── */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Skip link — visible on focus only ── */
.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 100001;
  padding: 12px 20px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #0a0e16;
  background: var(--cyan);
  text-decoration: none;
  box-shadow: 0 8px 24px var(--shadow-deep);
  transition: top 0.2s ease;
}
.skip-link:focus { top: 16px; outline: none; }

/* ── Focus rings (keyboard only via :focus-visible) ── */
.btn:focus-visible,
.btn-primary:focus-visible,
.preview-cta:focus-visible,
.preview-refresh:focus-visible,
.preview-history:focus-visible,
.modal-close:focus-visible,
.modal-icon-close:focus-visible,
.logo-link:focus-visible,
.prize-item:focus-visible,
.history-item:focus-visible,
.modal-sponsor-link:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
  box-shadow: 0 0 0 4px var(--focus-halo);
}
/* Prize cards keyboard-reachable */
.prize-item { outline: none; }
.prize-item:focus-visible {
  outline-offset: 4px;
}

/* Make the case-main respond to keyboard activation when used as button */
#btn-open:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 4px;
  box-shadow: 0 0 0 6px var(--focus-halo), 0 4px 28px rgba(67,197,255,0.45);
}

/* ────────────────────────────────────────────────────────────────────
   BOLDER — editorial typography lift
   Tightens hero, sharpens section labels, gives the case more presence.
   ──────────────────────────────────────────────────────────────────── */
.preview-headline {
  font-size: clamp(34px, 5.4vw, 58px);
  letter-spacing: -0.025em;
  line-height: 0.98;
  text-shadow:
    0 4px 32px rgba(67,197,255,0.18),
    0 1px 0 rgba(0,0,0,0.4);
  /* Reserve a fixed 3-line slot so layout doesn't jump between states.
     0.98 line-height × 3 lines = 2.94em — round up a hair for descenders. */
  min-height: calc(0.98em * 3);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
/* Each line is its own block — explicit, no auto-wrap that produces a stray
   4th row when a long word like «БЕСПЛАТНЫЙ» can't fit on one line. */
.preview-headline .hl-line {
  display: block;
  white-space: nowrap;
}
/* A subtle cyan slab under the eyebrow label, gives the headline a stamp */
.preview-label {
  position: relative;
  border-radius: 2px;
}
.preview-label::after {
  content: '';
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), transparent 70%);
  opacity: 0.7;
  pointer-events: none;
}

/* Stat values keep contrast ratio higher on small surfaces */
.preview-stat-value-cyan {
  text-shadow:
    0 0 22px rgba(67,197,255,0.45),
    0 0 1px rgba(67,197,255,0.6);
}

/* Section label — slightly thicker dot, micro-shimmer on idle, kills the
   monotony of a dead square. Sits below shared-design law (no decorative
   blink dies in reduced-motion). */
.section-label-dot {
  width: 10px;
  height: 10px;
  background: var(--cyan);
  box-shadow: 0 0 10px rgba(67,197,255,0.6);
  animation: sectionDotPulse 2.4s ease-in-out infinite;
}
@keyframes sectionDotPulse {
  0%, 100% { opacity: 1;   box-shadow: 0 0 10px rgba(67,197,255,0.6); }
  50%      { opacity: 0.7; box-shadow: 0 0 18px rgba(67,197,255,0.9); }
}

/* CTA gets a more committed glow stamp — feels like a button you press at
   the moment of decision, not a generic link. */
.btn-primary {
  background:
    linear-gradient(135deg, #0a78a9 0%, #0e8fc7 45%, #43c5ff 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.18),
    inset 0 -1px 0 rgba(0,0,0,0.25),
    0 4px 20px rgba(67,197,255,0.30);
  /* Clip the inner-shimmer sweep so it can't bleed into adjacent layout. */
  overflow: hidden;
  isolation: isolate;
}
.btn-primary:hover:not(:disabled) {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.25),
    inset 0 -1px 0 rgba(0,0,0,0.20),
    0 6px 32px rgba(67,197,255,0.55);
}
/* Inner shimmer on hover — single one-shot sweep via animation, NOT
   transition. Using transition + transform-translate caused the band to
   slide back-and-forth on hover-leave and (without overflow:hidden) bleed
   far past the button edge. Animation runs once on hover, no leave anim. */
.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg,
    transparent 30%,
    rgba(255,255,255,0.18) 48%,
    transparent 65%);
  transform: translateX(-110%);
  pointer-events: none;
  display: block;
  border-radius: inherit;
  z-index: 1;
}
.btn-primary:hover:not(:disabled)::after {
  animation: btnShimmerSweep 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) 1;
}
@keyframes btnShimmerSweep {
  from { transform: translateX(-110%); }
  to   { transform: translateX(110%); }
}

/* Hero gets a sharper inner stroke that catches the eye on first paint */
.preview-hero {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    inset 0 -1px 0 rgba(0,0,0,0.5),
    0 28px 60px var(--shadow-deep);
}

/* ────────────────────────────────────────────────────────────────────
   SKELETON state (replaces hard fade on loading)
   ──────────────────────────────────────────────────────────────────── */
#screen-loading.active {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 28px 0 40px;
  min-height: 60vh;
}
#screen-loading .spinner {
  position: absolute;
  /* spinner is now subordinate, skeleton carries the layout weight */
  top: 50%; left: 50%;
  margin: 0;
  transform: translate(-50%, -50%);
  z-index: 2;
}
#screen-loading .loading-text {
  position: absolute;
  top: calc(50% + 44px);
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  z-index: 2;
}

.skeleton-hero {
  position: relative;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 56px 48px;
  background: linear-gradient(135deg, rgba(67,197,255,0.04), rgba(255,255,255,0.015));
  border: 1px solid var(--border-mid);
  min-height: 520px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
}
.skeleton-row {
  height: 14px;
  border-radius: 2px;
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.04) 0%,
    rgba(255,255,255,0.10) 40%,
    rgba(67,197,255,0.12) 50%,
    rgba(255,255,255,0.10) 60%,
    rgba(255,255,255,0.04) 100%);
  background-size: 220% 100%;
  animation: skeletonShimmer 1.6s linear infinite;
}
.skeleton-row-label  { width: 140px; height: 24px; margin-bottom: 14px; }
.skeleton-row-h1     { width: 70%;  height: 54px; }
.skeleton-row-h1-narrow { width: 48%; }
.skeleton-row-lead   { width: 60%;  height: 16px; margin-top: 18px; }
.skeleton-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 24px;
}
.skeleton-stat {
  height: 86px;
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.03) 0%,
    rgba(255,255,255,0.07) 50%,
    rgba(255,255,255,0.03) 100%);
  background-size: 220% 100%;
  animation: skeletonShimmer 1.6s linear infinite;
  border-left: 2px solid rgba(67,197,255,0.4);
}
.skeleton-cta {
  margin-top: 24px;
  height: 56px;
  width: 320px;
  max-width: 80%;
  background: linear-gradient(
    90deg,
    rgba(67,197,255,0.10) 0%,
    rgba(67,197,255,0.30) 50%,
    rgba(67,197,255,0.10) 100%);
  background-size: 220% 100%;
  animation: skeletonShimmer 1.6s linear infinite;
}
@keyframes skeletonShimmer {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* ────────────────────────────────────────────────────────────────────
   MOBILE / TABLET breakpoints (was missing — viewport was 1920-only)
   ──────────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .topbar { padding: 14px 24px; }
  .logo { font-size: 20px; }
  .wrap {
    padding: 22px 20px 32px;
    min-height: calc(100vh - 60px);
  }
  .frame { padding: 20px 22px 32px; }
  .case-stage { width: 360px; height: 300px; }
  .case-main { width: 300px; height: 300px; }
  .preview-headline { font-size: clamp(30px, 5.5vw, 48px); }
  .preview-hero { padding: 36px 28px; }
}

@media (max-width: 600px) {
  html, body { font-size: 14px; }
  .topbar {
    padding: 12px 16px;
    gap: 12px;
  }
  .logo { font-size: 17px; letter-spacing: 0.06em; }
  .logo::before { width: 26px; height: 26px; }
  .guest { font-size: 11px; }

  .wrap {
    padding: 18px 14px 28px;
    min-height: calc(100vh - 54px);
  }

  /* Hero: shrink generous padding */
  .preview-hero {
    grid-template-columns: 1fr;
    padding: 26px 18px;
    min-height: 0;
    gap: 22px;
  }
  .preview-headline { font-size: clamp(28px, 7.5vw, 38px); margin-bottom: 14px; }
  .preview-lead { font-size: 14px; margin-bottom: 22px; }

  /* Stats stack on narrow widths */
  .preview-stats { grid-template-columns: 1fr; gap: 10px; margin-bottom: 22px; }
  .preview-stat { padding: 12px 14px 14px; }
  .preview-stat-value { font-size: 24px; }
  .preview-stat-value-cyan { font-size: 32px; }

  .preview-progress { padding: 14px 16px 16px; margin-bottom: 22px; }
  .preview-progress-target .pp-num { font-size: 22px; }

  /* CTA stack */
  .preview-actions { flex-direction: column; gap: 10px; }
  .preview-actions > .btn {
    min-width: 0 !important;
    width: 100% !important;
    min-height: 50px !important;
  }
  .preview-cta { font-size: 14px !important; }

  /* Right column scales down to a square that fits viewport width */
  .preview-right { min-height: 280px; }
  .preview-case-visual { max-width: 280px; }

  /* Rules stack to a single column with tighter padding */
  .rules-section { margin-top: 32px; }
  .rules-grid { gap: 12px; }
  .rule-card { padding: 22px 22px 20px; }
  .rule-num { font-size: 28px; margin-bottom: 10px; }
  .rule-title { font-size: 15px; }

  /* Frame around case-stage on screen-case */
  .frame { padding: 18px 16px 24px; }
  .case-stage { width: 100%; max-width: 320px; height: 260px; }
  .case-main  { width: 260px; height: 260px; }
  .case-info  { padding-left: 0; }
  .case-info .info-amount { font-size: 56px; }

  /* Section labels smaller on mobile */
  .section-label { font-size: 14px; margin-bottom: 14px; }
  h1 { font-size: 28px; }

  /* Roulette */
  .roulette { height: 160px; padding: 0; }
  .strip-mask::before, .strip-mask::after { width: 70px; }
  .pointer { border-left-width: 11px; border-right-width: 11px; border-top-width: 18px; }
  .pointer::after { height: 160px; }
  .tile { width: 130px; flex: 0 0 130px; }
  .tile-big { font-size: 28px; }
  .roulette-subtitle { font-size: 10px; }

  /* Prize grid: 2 columns on phones */
  .prize-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 8px; }
  .prize-item { height: 220px; padding: 14px 10px 12px; }
  .prize-imgwrap { height: 120px; }
  .prize-name { font-size: 11px; }
  .prize-rarity { font-size: 9px; padding: 3px 12px; letter-spacing: 0.14em; }

  /* Modals shrink padding so content breathes on small screens */
  .modal-card { padding: 28px 22px 22px; }
  .modal-info-card { padding: 32px 22px 24px; }
  .modal-history-card { padding: 22px 18px 18px; max-height: 88vh; }
  .modal-title { font-size: 22px; margin-bottom: 18px; }
  .modal-amount { font-size: 64px; }
  .modal-headline { font-size: 24px; }
  .modal-info-card .modal-headline { font-size: 24px; }
  .modal-img { max-width: 220px; max-height: 170px; }
  .modal-info-card .modal-img { max-width: 220px; max-height: 170px; }
  .modal-info-specs-row { padding: 8px 2px; }
  .modal-info-specs-row dd { font-size: 13px; }
  .modal-note-rich {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px 16px !important;
  }
  .modal-close { min-width: 0; width: 100%; }

  /* History items vertical breathing */
  .history-item { padding: 10px 12px; }
  .history-item-img { flex: 0 0 48px; width: 48px; height: 48px; }
  .history-item-img .h-emoji { font-size: 26px; }

  /* Skeleton */
  .skeleton-hero { padding: 26px 18px; min-height: 0; }
  .skeleton-row-h1 { height: 38px; }
  .skeleton-stats { grid-template-columns: 1fr; }
}

/* Tighter — landscape phones / very narrow */
@media (max-width: 380px) {
  .topbar { padding: 10px 12px; }
  .wrap { padding: 14px 10px 22px; }
  .preview-hero { padding: 22px 14px; }
  .prize-grid { gap: 6px; }
  .prize-item { height: 200px; padding: 12px 8px 10px; }
  .prize-imgwrap { height: 104px; }
  .modal-card { padding: 24px 18px 20px; }
  .tile { width: 116px; flex: 0 0 116px; }
}

/* ────────────────────────────────────────────────────────────────────
   REDUCED MOTION — turns off ambient choreography, keeps state changes
   that are core to the product (open, spin, win flash, modal entry).
   ──────────────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  /* Kill all infinite ambient loops */
  .case-rays, .case-ring, .case-podium, .case-spill, .case-shadow,
  .case-sparkles .spark, .case-dust .dust, .case-glow,
  .preview-case-rays, .preview-case-ring, .preview-case-podium,
  .preview-case-spill, .preview-case-shadow, .preview-case-halo,
  .preview-case-img, .preview-case-floor,
  .preview-case-sparkles .spark, .preview-case-dust .dust,
  .preview-label-dot, .section-label-dot,
  .pointer, .strip-mask.spinning .strip-glow-top,
  .strip-mask.spinning .strip-glow-bottom,
  .prize-item.rarity-legendary,
  .prize-mystery-svg,
  .prize-imgwrap,
  .tile.tier-legendary, .tile.tier-epic, .tile.tier-rare,
  .modal-img--halo,
  .hero-particle,
  .skeleton-row, .skeleton-stat, .skeleton-cta {
    animation: none !important;
  }
  /* Don't hide; just freeze them where they sit */
  .case-rays, .preview-case-rays { opacity: 0.35; }
  .case-ring, .preview-case-ring { opacity: 0.5; }

  /* Soften, don't kill, the key state transitions */
  .case-main.opening { animation: none !important; }
  .case-img, .case-glow,
  .preview-progress-fill,
  .modal-card, .modal-img,
  .modal-backdrop {
    transition-duration: 0.15s !important;
  }
  /* Spin still happens — it IS the product. Cap to 3s and remove easing
     extremes so it's gentler. */
  .strip { transition-duration: 3s !important; }

  /* Skeleton shimmer: replace with a static dim band */
  .skeleton-row, .skeleton-stat, .skeleton-cta {
    background: rgba(255,255,255,0.06) !important;
  }

  /* Disable smooth-scroll on logo home click */
  html { scroll-behavior: auto; }
}

/* ────────────────────────────────────────────────────────────────────
   COLOR REFINEMENT — tints pure #fff and #000 inside rarity badges
   so chips don't read as flat sticker. Extremely subtle on purpose.
   ──────────────────────────────────────────────────────────────────── */
.prize-item.rarity-legendary .prize-rarity { color: oklch(0.18 0.05 60); }
.prize-item.rarity-rare       .prize-rarity { color: oklch(0.20 0.06 230); }
.prize-item.rarity-uncommon   .prize-rarity { color: oklch(0.20 0.04 220); }
.prize-item.rarity-common     .prize-rarity { color: oklch(0.20 0.02 250); }

/* Body text gets a faint cool tint, replaces #ffffff */
body { color: var(--text-strong); }
.modal-amount, .modal-headline, .modal-title,
.preview-headline, h1 { color: var(--text-strong); }

/* ────────────────────────────────────────────────────────────────────
   TOUCH — disable hover-only effects on coarse pointers
   ──────────────────────────────────────────────────────────────────── */
@media (hover: none) and (pointer: coarse) {
  .prize-item:hover { transform: none; }
  .prize-item:hover .prize-glow {
    /* still want the rarity colour to read on tap, just no continuous pulse */
    animation: none;
  }
  .rule-card:hover { transform: none; }
  .history-item:hover { transform: none; }
}

