/* Public Styles */

.hk-header {
  background: linear-gradient(to bottom, #d90000 0%, #990000 100%);
  color: yellow;
  text-shadow: 2px 2px 4px #000;
}

@media (max-width: 640px) {
  .hk-header h1 {
    font-size: 1.8rem;
  }
  .hk-header p {
    font-size: 1rem;
  }
  .roller-digit {
    font-size: 1.4rem !important;
    width: 100%;
    height: 100%;
  }
  /* Adjust roller circular size for mobile */
  /* Adjust roller circular size for mobile */
  /* Adjust roller circular size for mobile */
  .roller-container {
    gap: 2px !important;
  }
  .roller-slot {
    width: 2rem !important; /* Mobile Main: Smaller */
    height: 2rem !important;
    max-height: 2rem !important;
  }
  .roller-digit {
    height: 2rem !important;
    font-size: 1.1rem !important;
  }
  /* Mobile Mini: Very Small to fit 5 cols if needed, or just generally tight grids */
  .roller-wrapper-mini .roller-slot {
    width: 1.2rem !important;
    height: 1.2rem !important;
    max-height: 1.2rem !important;
    border-width: 1px !important;
  }
  .roller-wrapper-mini .roller-digit {
    height: 1.2rem !important;
    font-size: 0.75rem !important;
  }

  /* Mobile Result Ball */
  .result-ball {
    width: 1.6rem !important;
    height: 1.6rem !important;
    font-size: 0.8rem !important;
    margin: 0 1px !important;
    border-width: 1px !important;
  }
}

@media (max-width: 640px) {
  .hk-header h1 {
    font-size: 1.5rem;
  }
  .hk-header p {
    font-size: 0.9rem;
  }
}

/* Roller Animation Styles */
.roller-wrapper,
.roller-wrapper-mini {
  display: inline-block;
  /* Remove wrapper ball styling, it's now just a holder */
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.roller-container {
  display: inline-flex;
  gap: 4px; /* Tight gap */
  background: transparent;
  padding: 0;
  border: none;
  border-radius: 0;
  width: auto;
  height: auto;
  align-items: center;
  justify-content: center;
  overflow: visible;
  position: relative;
  flex-wrap: nowrap; /* Never wrap the digits */
}

/* Mini rollers for consolation */
.roller-wrapper-mini .roller-container {
  width: auto;
  height: auto;
  gap: 2px; /* Very tight gap for minis */
}

/* live draw ball (Main Prizes) */
.roller-slot {
  width: 3rem; /* Reduced from 3.5rem */
  height: 3rem;
  max-height: 3rem;
  overflow: hidden !important;
  background: radial-gradient(circle at 35% 35%, #ff5e5e, #8b0000);
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5);
  position: relative;
  display: block;
  flex-shrink: 0;
}

/* Mini slot size (Starter/Consolation) */
.roller-wrapper-mini .roller-slot {
  width: 1.8rem; /* Reduced from 2.2rem */
  height: 1.8rem;
  max-height: 1.8rem;
  border-width: 2px;
}

.roller-numbers {
  display: block;
  will-change: transform;
  width: 100%;
}

.roller-digit {
  height: 3rem; /* Match slot height */
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem; /* Adjusted font */
  font-weight: 900;
  color: #fff;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
  font-family: "Segoe UI", "Roboto", "Helvetica", sans-serif;
}

/* Mini digit size */
.roller-wrapper-mini .roller-digit {
  height: 1.8rem;
  font-size: 1rem; /* Smaller font for minis */
}

.roller-numbers.spinning {
  animation: spin 0.2s linear infinite;
}

@keyframes spin {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-30rem);
  } /* Adjusted for 10 digits * 3rem */
}

/* Home Page Result Ball Animation */
.result-ball {
  display: inline-flex;
  width: 2.4rem; /* Larger */
  height: 2.4rem;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ff5e5e, #8b0000);
  color: white;
  font-weight: bold;
  align-items: center;
  justify-content: center;
  font-family: "Segoe UI", "Roboto", sans-serif; /* Setup clean font */
  box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4);
  margin: 0 4px; /* More spacing */
  font-size: 1.2rem; /* Clearer text */
  border: 2px solid #fff;
  overflow: hidden; /* Hide sliding numbers */
  position: relative;
}

/* The rolling animation on load */
.result-ball::before {
  content: attr(data-n); /* We will use data attribute */
  position: absolute;
  animation: rollIn 1.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* Fallback if no JS sets data-n, or just to hide the text initially? 
   Actually, standard way: 
   .result-ball has the number inside. We want to act like it spun.
   A simple CSS trick:
   @keyframes popSpin {
     0% { transform: translateY(-100%) rotateX(360deg); opacity: 0; }
     100% { transform: translateY(0) rotateX(0); opacity: 1; }
   }
*/
/* Removed the heavy roll CSS animation. We will handle number shuffling in JS. 
   Just a subtle pop in */
.result-ball {
  animation: ballPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) backwards;
}

/* Stagger delay for table rows */
tr:nth-child(1) .result-ball {
  animation-delay: 0.1s;
}
tr:nth-child(2) .result-ball {
  animation-delay: 0.2s;
}
tr:nth-child(3) .result-ball {
  animation-delay: 0.3s;
}

@keyframes ballPop {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Marquee Animation */
@keyframes marquee {
  0% {
    transform: translateX(100%);
  }
  100% {
    transform: translateX(-100%);
  }
}
.animate-marquee {
  animation: marquee 20s linear infinite;
}
