/* ==========================================
   Zippy Pay Lottery — Custom Styles
   Design tokens from Figma
   ========================================== */

/* === PRIMARY BUTTON === */
.zippy-btn-primary {
  background: linear-gradient(168deg, #4FC3B3 0%, rgba(79, 195, 179, 0.95) 100%);
  border: 0.53px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0px 12px 40px rgba(79, 195, 179, 0.4);
  transition: all 0.2s ease;
  display: block;
}
.zippy-btn-primary:hover {
  box-shadow: 0px 12px 40px rgba(79, 195, 179, 0.6);
  filter: brightness(1.05);
}

/* === CHECKBOX === */
.zippy-checkbox {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  accent-color: #42AA99;
  cursor: pointer;
  flex-shrink: 0;
}

/* === BACKGROUND GRID (Start Screen) === */
.start-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 120px 120px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, black 20%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, black 20%, transparent 80%);
}

/* === FLOATING PARTICLES (Start Screen) === */
.particle {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%,
    rgba(130, 220, 210, 0.7) 0%,
    rgba(79, 195, 179, 0.5) 40%,
    rgba(79, 195, 179, 0.15) 70%,
    transparent 100%);
  box-shadow:
    0 8px 24px rgba(79, 195, 179, 0.25),
    0 2px 6px rgba(79, 195, 179, 0.15);
}

/* Sizes */
.particle-xl  { width: 40px; height: 40px; }
.particle-lg  { width: 28px; height: 28px; }
.particle-md  { width: 20px; height: 20px; }
.particle-sm  { width: 12px; height: 12px; }
.particle-xs  { width: 7px;  height: 7px;  }
.particle-xxs { width: 4px;  height: 4px;  }

/* Each particle has a unique slow floating path + subtle glow pulse */
.particle-1 {
  left: 8%;  top: 14%;
  animation: particleFloat1 18s ease-in-out infinite, particleGlow 4s ease-in-out infinite;
}
.particle-2 {
  left: 55%; top: 22%;
  animation: particleFloat2 22s ease-in-out infinite 2s, particleGlow 5s ease-in-out infinite 1s;
}
.particle-3 {
  left: 20%; top: 55%;
  animation: particleFloat3 20s ease-in-out infinite 4s, particleGlow 4.5s ease-in-out infinite 0.5s;
}
.particle-4 {
  left: 65%; top: 60%;
  animation: particleFloat4 24s ease-in-out infinite 1s, particleGlow 5.5s ease-in-out infinite 2s;
}
.particle-5 {
  left: 35%; top: 10%;
  animation: particleFloat5 16s ease-in-out infinite 3s, particleGlow 3.5s ease-in-out infinite;
}
.particle-6 {
  left: 78%; top: 38%;
  opacity: 0.5;
  animation: particleFloat6 19s ease-in-out infinite 5s, particleGlow 6s ease-in-out infinite 1.5s;
}
.particle-7 {
  left: 12%; top: 75%;
  animation: particleFloat7 17s ease-in-out infinite 2s, particleGlow 4s ease-in-out infinite 3s;
}
.particle-8 {
  left: 80%; top: 70%;
  opacity: 0.4;
  animation: particleFloat8 21s ease-in-out infinite 6s, particleGlow 5s ease-in-out infinite 2s;
}
.particle-9 {
  left: 50%; top: 85%;
  opacity: 0.3;
  animation: particleFloat9 15s ease-in-out infinite 1s, particleGlow 4s ease-in-out infinite;
}

/* Glow pulse — subtle brightness fluctuation */
@keyframes particleGlow {
  0%, 100% { filter: brightness(1);   opacity: var(--base-opacity, 1); }
  50%      { filter: brightness(1.35); opacity: calc(var(--base-opacity, 1) * 1.2); }
}

/* Each particle drifts on a unique elliptical / organic path */
@keyframes particleFloat1 {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(30px, -40px); }
  50%  { transform: translate(-15px, -70px); }
  75%  { transform: translate(-35px, -25px); }
  100% { transform: translate(0, 0); }
}
@keyframes particleFloat2 {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-40px, 25px); }
  50%  { transform: translate(-20px, -35px); }
  75%  { transform: translate(30px, -15px); }
  100% { transform: translate(0, 0); }
}
@keyframes particleFloat3 {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(25px, 30px); }
  50%  { transform: translate(50px, -20px); }
  75%  { transform: translate(10px, -40px); }
  100% { transform: translate(0, 0); }
}
@keyframes particleFloat4 {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-35px, -30px); }
  50%  { transform: translate(15px, -60px); }
  75%  { transform: translate(40px, -20px); }
  100% { transform: translate(0, 0); }
}
@keyframes particleFloat5 {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(20px, 35px); }
  50%  { transform: translate(-25px, 20px); }
  75%  { transform: translate(-10px, -15px); }
  100% { transform: translate(0, 0); }
}
@keyframes particleFloat6 {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-20px, -25px); }
  50%  { transform: translate(15px, -50px); }
  75%  { transform: translate(25px, 10px); }
  100% { transform: translate(0, 0); }
}
@keyframes particleFloat7 {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(35px, -20px); }
  50%  { transform: translate(20px, -55px); }
  75%  { transform: translate(-15px, -30px); }
  100% { transform: translate(0, 0); }
}
@keyframes particleFloat8 {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-25px, 20px); }
  50%  { transform: translate(-40px, -15px); }
  75%  { transform: translate(10px, -35px); }
  100% { transform: translate(0, 0); }
}
@keyframes particleFloat9 {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(15px, -20px); }
  50%  { transform: translate(-20px, -10px); }
  75%  { transform: translate(-5px, 15px); }
  100% { transform: translate(0, 0); }
}

/* Extra particles for desktop draw page */
.particle-10 {
  left: 90%; top: 15%;
  animation: particleFloat2 19s ease-in-out infinite 3s, particleGlow 4s ease-in-out infinite 2s;
}
.particle-11 {
  left: 40%; top: 80%;
  animation: particleFloat5 23s ease-in-out infinite 1s, particleGlow 5s ease-in-out infinite;
}
.particle-12 {
  left: 75%; top: 85%;
  animation: particleFloat7 20s ease-in-out infinite 4s, particleGlow 4.5s ease-in-out infinite 1s;
}

/* Speed up particles during draw */
.particles-fast .particle {
  animation-duration: 2s, 1s !important;
}

/* === TICKET CARD === */
.ticket-card {
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 0 1px rgba(20, 241, 149, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.05);
}
.ticket-card-top {
  background: linear-gradient(156deg, rgba(26, 45, 74, 0.9) 0%, rgba(15, 31, 54, 0.9) 100%);
  padding: 16px;
}
.ticket-number-area {
  border-radius: 16px;
  padding: 20px 16px;
  position: relative;
  overflow: hidden;
}
.ticket-number-area::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(20, 241, 149, 0.2) 0%, rgba(0, 245, 255, 0.157) 50%, rgba(20, 241, 149, 0.2) 100%);
  border-radius: 16px;
}
.ticket-number-area::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  box-shadow: inset 0 0 20px rgba(20, 241, 149, 0.15), inset 0 1px 1px rgba(255, 255, 255, 0.1);
  pointer-events: none;
}
.ticket-number-display {
  font-family: 'Roboto', sans-serif;
  font-weight: 800;
  font-size: 32px;
  color: #14F195;
  text-align: center;
  letter-spacing: 1.4px;
  position: relative;
  z-index: 1;
}
.ticket-card-divider {
  border-top: 2px dashed rgba(255, 255, 255, 0.15);
  margin: 0 13px;
}
.ticket-card-bottom {
  background: linear-gradient(156deg, rgba(26, 45, 74, 0.7) 0%, rgba(15, 31, 54, 0.7) 100%);
  padding: 20px 16px;
  text-align: center;
}
.ticket-download-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(20, 241, 149, 0.25);
  box-shadow: 0 0 15px rgba(20, 241, 149, 0.2), inset 0 1px 2px rgba(255, 255, 255, 0.1);
  background: #154B58;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.ticket-download-btn:hover {
  box-shadow: 0 0 25px rgba(20, 241, 149, 0.4);
  background: #1A5D6C;
}

/* === DRAW PAGE — Number Container === */
.draw-number-container {
  position: relative;
  width: 768px;
  max-width: 90vw;
  min-height: 330px;
  border-radius: 24px;
  border: 1px solid rgba(0, 187, 167, 0.3);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
  background: linear-gradient(157deg, rgba(26, 45, 74, 0.8) 0%, rgba(15, 31, 54, 0.8) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.draw-number-container::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 26px;
  background: linear-gradient(90deg, rgba(0, 187, 167, 0.5), rgba(0, 211, 243, 0.5), rgba(0, 187, 167, 0.5));
  filter: blur(12px);
  z-index: -1;
}
.draw-number-container::after {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: 23px;
  background: linear-gradient(157deg, rgba(255, 255, 255, 0.05) 0%, transparent 100%);
  pointer-events: none;
}
.draw-number {
  font-family: 'Inter', sans-serif;
  font-weight: 900;
  font-size: clamp(100px, 14vw, 200px);
  line-height: 1;
  text-align: center;
  background: linear-gradient(90deg, #FFFFFF 0%, #CBFBF1 50%, #96F7E4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  padding: 8px 0;
}

/* === TICKET NUMBER GLOW === */
.ticket-number-glow {
  text-shadow:
    0 0 20px rgba(20, 241, 149, 0.5),
    0 0 40px rgba(20, 241, 149, 0.3),
    0 0 60px rgba(20, 241, 149, 0.1);
}

/* === WINNER GLOW === */
.winner-glow {
  box-shadow:
    0 0 30px rgba(79, 195, 179, 0.3),
    0 0 60px rgba(79, 195, 179, 0.15),
    inset 0 0 30px rgba(79, 195, 179, 0.05);
  animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow:
      0 0 30px rgba(79, 195, 179, 0.3),
      0 0 60px rgba(79, 195, 179, 0.15);
  }
  50% {
    box-shadow:
      0 0 50px rgba(79, 195, 179, 0.5),
      0 0 100px rgba(79, 195, 179, 0.25);
  }
}

/* === SPARKLE === */
.sparkle {
  animation: sparkle 3s ease-in-out infinite;
}
.sparkle-delayed {
  animation: sparkle 3s ease-in-out infinite;
  animation-delay: 1.5s;
}

@keyframes sparkle {
  0%, 100% { opacity: 0.3; transform: scale(1) rotate(0deg); }
  50% { opacity: 0.8; transform: scale(1.2) rotate(15deg); }
}

/* === SLOT MACHINE === */
.slot-spinning {
  animation: slotPulse 0.1s ease-in-out infinite alternate;
}

@keyframes slotPulse {
  0% { opacity: 0.8; }
  100% { opacity: 1; }
}

.slot-reveal {
  animation: revealBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes revealBounce {
  0% { transform: scale(0.8); opacity: 0.5; }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

/* === TABULAR NUMS === */
.tabular-nums {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* === CONGRATS BOUNCE === */
.congrats-bounce {
  animation: congratsBounce 1s ease-out;
}

@keyframes congratsBounce {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.3); }
  70% { transform: scale(0.9); }
  100% { transform: scale(1); opacity: 1; }
}

/* === FORM INPUT AUTOFILL FIX === */
/* For dark backgrounds */
.min-h-screen:not([style]) input:-webkit-autofill {
  -webkit-text-fill-color: white;
  transition: background-color 5000s ease-in-out 0s;
}
/* For white backgrounds */
[style*="background: white"] input:-webkit-autofill {
  -webkit-text-fill-color: #191919;
  transition: background-color 5000s ease-in-out 0s;
}

/* === SMOOTH PAGE TRANSITIONS === */
body {
  transition: opacity 0.2s ease;
}

/* === MOBILE TOUCH TARGETS === */
@media (max-width: 640px) {
  button, a.block {
    min-height: 44px;
  }
}

/* === RESPONSIVE DRAW CONTAINER === */
@media (max-width: 800px) {
  .draw-number-container {
    width: 100%;
    min-height: 240px;
    padding: 24px;
  }
}
