/* ═══════════════════════════════════════════════
   Daily Bonus Mini App — Styles
   Dark premium glassmorphism theme
   ═══════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --clr-bg:        #141414;
  --clr-surface:   #141414;
  --clr-glass:     rgba(255,255,255,0.05);
  --clr-border:    rgba(255,255,255,0.1);
  --clr-gold:      #ffffff;
  --clr-gold-dim:  #cccccc;
  --clr-violet:    #333333;
  --clr-violet2:   #666666;
  --clr-text:      #ffffff;
  --clr-text-dim:  #a0a0a0;
  --clr-green:     #cccccc;
  --clr-red:       #888888;
  --clr-blue:      #aaaaaa;
  --radius-lg:     20px;
  --radius-md:     14px;
  --radius-sm:     8px;
  --shadow-glow:   0 0 40px rgba(255,255,255,0.1);
}

html, body {
  height: 100%;
  overflow-x: hidden;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--clr-bg);
  color: var(--clr-text);
  min-height: 100vh;
  position: relative;
}

/* ── Фон ─────────────────────────────────────── */
.bg-grid {
  display: none; /* клеточный фон убран */
}

.bg-glare {
  display: none; /* анимированный блик убран */
}


/* ── Контейнер ────────────────────────────────── */
.container {
  position: relative;
  z-index: 1;
  max-width: 420px;
  margin: 0 auto;
  padding: 10px 16px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

/* ── Заголовок ────────────────────────────────── */
.header {
  text-align: center;
  padding-top: 0;
}

.header-icon {
  font-size: 48px;
  filter: drop-shadow(0 0 16px rgba(255,255,255,0.4)) grayscale(100%);
  animation: pulse-icon 3s ease-in-out infinite;
}

@keyframes pulse-icon {
  0%, 100% { filter: drop-shadow(0 0 16px rgba(255,255,255,0.4)) grayscale(100%); }
  50%       { filter: drop-shadow(0 0 28px rgba(255,255,255,0.7)) grayscale(100%); }
}

.header-title {
  font-size: 24px;
  font-weight: 800;
  color: #ffffff;
  margin-top: 8px;
}

.header-sub {
  font-size: 13px;
  color: var(--clr-text-dim);
  margin-top: 4px;
}

/* ── Колесо ───────────────────────────────────── */
.wheel-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.wheel-pointer {
  font-size: 28px;
  color: #ffffff;
  margin-bottom: -8px;
  z-index: 5;
}

.wheel-container {
  position: relative;
  border-radius: 50%;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.wheel-shine {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
  pointer-events: none;
}

#wheelCanvas {
  border-radius: 50%;
  display: block;
}

/* ── Кнопка ───────────────────────────────────── */
.info-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--clr-text-dim);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  transition: all 0.2s;
}
.info-btn:hover {
  background: rgba(255,255,255,0.05);
  color: #fff;
}
.action-area {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.spin-btn {
  width: 100%;
  max-width: 320px;
  padding: 16px 24px;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 17px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
  outline: none;
}

/* Активное состояние */
.spin-btn:not(:disabled) {
  background: rgba(255,255,255,0.1);
  color: #fff;
  box-shadow: none;
  border: none;
}

.spin-btn:not(:disabled):active {
  transform: scale(0.98);
}


/* Disabled */
.spin-btn:disabled {
  background: rgba(255,255,255,0.05);
  color: var(--clr-text-dim);
  cursor: not-allowed;
  box-shadow: none;
  border: none;
}

/* Loading / spinning */
.spin-btn.loading {
  pointer-events: none;
  opacity: 0.8;
}

@keyframes btn-pulse {
  from { opacity: 0.7; }
  to   { opacity: 1; }
}

/* Кулдаун (таймер на кнопке) */
.spin-btn.cooldown {
  background: rgba(255,255,255,0.05) !important;
  color: var(--clr-text-dim) !important;
  cursor: not-allowed !important;
  pointer-events: none;
}

.spin-btn-icon {
  font-size: 20px;
  line-height: 1;
  filter: grayscale(100%);
}

/* ── Info button ──────────────────────────────── */
.info-btn {
  width: 100%;
  max-width: 320px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  outline: none;
  transition: all 0.2s;
}

.info-btn:active {
  transform: scale(0.98);
}


/* ── Таймер-бар ───────────────────────────────── */
.timer-bar {
  width: 100%;
  max-width: 320px;
  background: var(--clr-glass);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  backdrop-filter: blur(10px);
}

.timer-label {
  font-size: 12px;
  color: var(--clr-text-dim);
  text-align: center;
  margin-bottom: 6px;
}

.timer-value {
  font-size: 28px;
  font-weight: 800;
  text-align: center;
  color: var(--clr-text);
  font-variant-numeric: tabular-nums;
  letter-spacing: 2px;
  text-shadow: 0 0 20px rgba(255,255,255,0.3);
}

.timer-progress-track {
  height: 4px;
  background: rgba(255,255,255,0.07);
  border-radius: 2px;
  margin-top: 10px;
  overflow: hidden;
}

.timer-progress-fill {
  height: 100%;
  background: #ffffff;
  border-radius: 2px;
  transition: width 1s linear;
}

/* ── Призы ────────────────────────────────────── */

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

.prize-item {
  background: var(--clr-glass);
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
  color: var(--clr-text-dim);
  backdrop-filter: blur(8px);
  transition: all 0.2s;
}

.prize-item.highlight {
  background: rgba(255,255,255,0.07);
  color: #ffffff;
}

/* ── Результат (оверлей) ──────────────────────── */
.result-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.result-card {
  background: #1a1a1a;
  border-radius: 24px;
  padding: 32px 24px;
  text-align: center;
  max-width: 340px;
  width: 100%;
}

@keyframes slideUp {
  from { transform: translateY(60px) scale(0.9); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

.result-emoji {
  font-size: 64px;
  line-height: 1;
  animation: bounceIn 0.6s cubic-bezier(0.34,1.56,0.64,1) 0.2s both;
  display: flex;
  justify-content: center;
}

@keyframes bounceIn {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.result-title {
  font-size: 22px;
  font-weight: 800;
  margin-top: 16px;
  color: #ffffff;
}

.result-prize {
  font-size: 18px;
  font-weight: 600;
  color: var(--clr-text);
  margin-top: 10px;
}

.result-balance {
  font-size: 14px;
  color: var(--clr-text-dim);
  margin-top: 8px;
  min-height: 20px;
}

.result-close-btn {
  margin-top: 24px;
  padding: 14px 40px;
  border: none;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: none;
}

.result-close-btn:active {
  transform: scale(0.98);
}

/* ── Состояния ошибки ─────────────────────────── */
.error-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  backdrop-filter: blur(10px);
  z-index: 200;
  animation: toastIn 0.3s ease, toastOut 0.3s ease 3.7s forwards;
  max-width: 320px;
  text-align: center;
}

@keyframes toastIn  { from { opacity:0; transform: translateX(-50%) translateY(20px); } to { opacity:1; transform: translateX(-50%) translateY(0); } }
@keyframes toastOut { from { opacity:1; } to { opacity:0; } }

/* ── Адаптив ─────────────────────────────────── */
@media (max-width: 360px) {
  .header-title { font-size: 20px; }
  #wheelCanvas  { width: 280px; height: 280px; }
}
