* {
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
}

body {
  margin: 0;
  background: #0f172a;
  color: #e5e7eb;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,.02),
    rgba(255,255,255,.02) 1px,
    transparent 3px,
    transparent 6px
  );
  z-index: 1;
}

/* HEADER */
/* ======================
   HEADER (CUSTOM IMAGE)
====================== */

.hero {
  position: relative;
  z-index: 5;
  text-align: center;
  padding: 30px 20px;
  background-image: url("../images/WelcomeBanner.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(2,6,23,0.75),
    rgba(15,23,42,0.85)
  );
  z-index: 0;
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero h1 {
  position: relative;
  text-shadow:
    0 0 10px rgba(34,197,94,0.35),
    0 0 20px rgba(34,197,94,0.15);
}

.hero h1::after {
  content: '';
  display: block;
  width: 80px;
  height: 3px;
  margin: 12px auto 0;
  background: linear-gradient(90deg, #22c55e, #38bdf8);
  border-radius: 999px;
}

#clock {
  margin-top: 10px;
  color: #38bdf8;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-shadow: 0 0 8px rgba(56,189,248,0.4);
}

/* CONTAINER */
.container {
  max-width: 1100px;
  margin: auto;
  padding: 40px 20px;
}

/* TABLE BOX */
.table-box {
  background: #020617;
  border-radius: 14px;
  padding: 25px;
  margin-bottom: 30px;
  text-align: center;
}

.table-title {
  margin-bottom: 20px;
}

.table-desc {
  margin-top: 20px;
  font-size: 0.9rem;
  opacity: 0.8;
}

/* GRID */
.grid {
  display: grid;
  gap: 15px;
  justify-items: center;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  justify-items: center;
}

.grid img {
  width: 100%;
  border-radius: 10px;
}

@media (max-width: 768px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

/* BUTTON */
.btn-group {
  display: flex;
  gap: 15px;
  margin-bottom: 40px;
}

.center {
  justify-content: center;
}

/* =====================
   MODERN BUTTON SYSTEM
===================== */

.btn {
  --btn-bg: #1e293b;
  --btn-color: #e5e7eb;
  --btn-border: rgba(255,255,255,0.08);

  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  padding: 12px 28px;
  border-radius: 12px;

  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.3px;

  color: var(--btn-color);
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);

  cursor: pointer;
  text-decoration: none;
  user-select: none;

  transition:
    transform 0.15s ease,
    box-shadow 0.2s ease,
    background 0.3s ease,
    border-color 0.3s ease;
}

/* === DEPTH === */
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    to bottom,
    rgba(255,255,255,0.08),
    transparent 60%
  );
  pointer-events: none;
}

/* =====================
   PRIMARY (HIJAU)
===================== */

.btn-primary {
  --btn-bg: linear-gradient(135deg, #22c55e, #16a34a);
  --btn-color: #020617;
  --btn-border: rgba(34,197,94,0.5);

  box-shadow:
    0 10px 25px rgba(34,197,94,0.25),
    inset 0 1px 0 rgba(255,255,255,0.3);
}

/* =====================
   SECONDARY (BEBAS)
===================== */

.btn-secondary {
  --btn-bg: linear-gradient(135deg, #38bdf8, #0ea5e9);
  --btn-color: #020617;
  --btn-border: rgba(56,189,248,0.5);

  box-shadow:
    0 10px 25px rgba(56,189,248,0.25),
    inset 0 1px 0 rgba(255,255,255,0.3);
}

.btn.loading {
  pointer-events: none;
  opacity: 0.75;
  gap: 10px;
}

.btn.loading::after {
  content: "";
  display: inline-block; /* WAJIB */
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* =====================
   INTERACTIONS
===================== */

.btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 14px 30px rgba(0,0,0,0.35);
}

.btn:active {
  transform: translateY(0);
  box-shadow:
    0 6px 15px rgba(0,0,0,0.25);
}

.btn:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(255,255,255,0.2),
    0 0 0 6px rgba(34,197,94,0.4);
}

/* =====================
   MOBILE TUNING
===================== */

@media (max-width: 480px) {
  .btn {
    width: 100%;
    padding: 14px 0;
  }

  .btn-group {
    flex-direction: column;
  }
}

/* RUNNING TEXT */
.running-text-wrapper {
  position: relative;
  overflow: hidden;
  background: linear-gradient(90deg, #020617, #0f172a, #020617);
  border-radius: 12px;
  padding: 10px 0;
  margin-bottom: 20px;
  border: 1px solid rgba(34,197,94,0.25);
}

/* TRACK */
.running-text-track {
  display: flex;
  width: max-content;
  animation: ticker 18s linear infinite;
}

/* ITEM */
.running-text-item {
  white-space: nowrap;
  padding-right: 60px; /* JARAK antar loop */
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: 1px;
  color: #facc15;
  text-shadow:
    0 0 6px rgba(250,204,21,0.6),
    0 0 12px rgba(250,204,21,0.35);
}

/* ANIMASI BENAR */
@keyframes ticker {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

.running-text-wrapper {
  position: relative;
  padding: 12px 0;
  border-top: 1px solid rgba(250,204,21,.4);
  border-bottom: 1px solid rgba(250,204,21,.4);
}

.running-text-wrapper::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(250,204,21,.15),
    transparent
  );
  pointer-events: none;
}

.running-text-wrapper::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.03),
    rgba(255,255,255,0.03) 1px,
    transparent 3px,
    transparent 6px
  );
  pointer-events: none;
}

.running-text-wrapper {
  animation: pulseGlow 2.5s ease-in-out infinite;
}

@media (max-width: 768px) {
  .running-text-track {
    animation-duration: 26s;
  }
}

/* ===== STAT GRID FIX ===== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 148px);
  gap: 20px;
  justify-content: center;
  margin-bottom: 20px;
}

/* BARIS TERAKHIR (2 ITEM DI TENGAH) */
.stat-grid-center {
  display: grid;
  grid-template-columns: repeat(2, 148px);
  gap: 20px;
  justify-content: center;
  margin-bottom: 20px;
}

/* STAT CARD */
.stat-card {
  text-align: center;
}

.stat-card {
  transition: transform .25s ease;
}
.stat-card:hover {
  transform: translateY(-6px) scale(1.04);
}

.stat-card img {
  width: 148px;
  height: 148px;
  object-fit: cover;
  border-radius: 8px;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .stat-grid {
    grid-template-columns: repeat(2, 148px);
  }
}

.progress {
  background: linear-gradient(180deg, #0f172a, #020617);
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.progress-bar {
  height: 100%;
  width: 0;
  border-radius: 999px;
  position: relative;

  /* ANIMASI UTAMA */
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1),
              background-color 0.5s ease;

  /* SHIMMER */
  overflow: hidden;
}

.progress-bar::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    180deg,
    rgba(255,255,255,.25),
    rgba(255,255,255,0)
  );
  opacity: .4;
  pointer-events: none;
}

/* SHIMMER EFFECT */
.progress-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    transparent 30%,
    rgba(255,255,255,0.35),
    transparent 70%
  );
  transform: translateX(-100%);
  animation: shimmer 1s infinite;
}

/* GLOW UNTUK NILAI TINGGI */
.progress-bar.glow {
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.8);
}

/* SHIMMER KEYFRAME */
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.percentage {
  font-size: 0.85rem;
  font-weight: 600;
  color: #e5e7eb;
  text-shadow: 0 0 4px rgba(0,0,0,.6);
}

.progress-bar.super {
  animation: pulseGlow 1.6s ease-in-out infinite;
}

@media (max-width: 768px) {
  .stat-grid,
  .stat-grid-center {
    grid-template-columns: repeat(2, 148px);
    justify-content: center;
  }
}

@media (max-width: 420px) {
  .stat-grid,
  .stat-grid-center {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }
}

@media (max-width: 768px) {
  .grid.grid-3.mobile-carousel {
    display: flex !important;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 15px;
    padding-bottom: 10px;
  }

  .grid.grid-3.mobile-carousel::-webkit-scrollbar {
    display: none;
  }

  .grid.grid-3.mobile-carousel .carousel-item {
    flex: 0 0 85%;
    scroll-snap-align: center;
    border-radius: 12px;
  }
}

.image-preview {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.image-preview img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 12px;
}

/* ================= AUTH PAGE ================= */

.auth-body {
  min-height: 100vh;
  background: linear-gradient(135deg, #020617, #0f172a);
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-wrapper {
  width: 100%;
  padding: 20px;
}

.auth-box {
  max-width: 420px;
  margin: auto;
  background: #020617;
  padding: 35px 30px;
  border-radius: 16px;
  box-shadow: 0 0 30px rgba(34, 197, 94, 0.15);
  text-align: center;
}

.auth-title {
  margin-bottom: 5px;
  color: #22c55e;
}

.auth-desc {
  font-size: 0.9rem;
  opacity: 0.8;
  margin-bottom: 25px;
}

.input-group {
  text-align: left;
  margin-bottom: 18px;
}

.input-group label {
  font-size: 0.85rem;
  margin-bottom: 6px;
  display: block;
  color: #e5e7eb;
}

.input-group input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  background: #0f172a;
  border: 1px solid #1e293b;
  color: #e5e7eb;
  font-size: 0.9rem;
}

.input-group input:focus {
  outline: none;
  border-color: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

.btn.full {
  width: 100%;
  margin-top: 10px;
}

.auth-note {
  margin-top: 25px;
  font-size: 0.75rem;
  opacity: 0.6;
}

/* RESPONSIVE */
@media (max-width: 480px) {
  .auth-box {
    padding: 28px 22px;
  }
}

/* ================= CARD ELEVATION ================= */

.table-box,
.stat-card {
  transition: transform .25s ease, box-shadow .25s ease;
}

.table-box:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0,0,0,.45);
}

.stat-card:hover {
  transform: translateY(-6px) scale(1.03);
}

/* ===== TYPOGRAPHY UPGRADE ===== */

/* HERO & SECTION TITLE */
.hero h1,
.table-title,
.auth-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  letter-spacing: 0.4px;
}

/* SUB TITLE / DESKRIPSI PENTING */
.hero p,
.table-desc,
.auth-desc {
  font-weight: 500;
  font-size: small;
}

/* =========================================
   HIGHLIGHT KHUSUS GAMBAR TABEL KE-2
========================================= */

/* Target: HANYA table-box ke-2 */
.table-box:nth-of-type(2) .stat-card img {
  position: relative;
  border-radius: 10px;
  border: 1px solid rgba(34,197,94,0.4);

  /* Glow dasar */
  box-shadow:
    0 0 0 rgba(34,197,94,0);

  /* Animasi halus */
  animation: glowCycle 6s linear infinite;

  transition:
    box-shadow 0.4s ease,
    transform 0.25s ease;
}

/* Hover: sedikit naik & glow lebih terasa */
.table-box:nth-of-type(2) .stat-card img:hover {
  transform: translateY(-4px);
  box-shadow:
    0 0 14px rgba(34,197,94,0.45),
    0 0 26px rgba(56,189,248,0.25);
}

/* ANIMASI COLOR CYCLING */
@keyframes glowCycle {
  0% {
    box-shadow: 0 0 8px rgba(34,197,94,0.35);
    border-color: rgba(34,197,94,0.45);
  }
  33% {
    box-shadow: 0 0 10px rgba(56,189,248,0.35);
    border-color: rgba(56,189,248,0.45);
  }
  66% {
    box-shadow: 0 0 10px rgba(250,204,21,0.3);
    border-color: rgba(250,204,21,0.45);
  }
  100% {
    box-shadow: 0 0 8px rgba(34,197,94,0.35);
    border-color: rgba(34,197,94,0.45);
  }
}

/* =========================================
   HOT PROVIDER ( > 85% )
========================================= */

.progress-bar.hot {
  box-shadow:
    0 0 14px rgba(34,197,94,0.9),
    0 0 28px rgba(250,204,21,0.6);

  animation: hotPulse 1.8s ease-in-out infinite;
}

/* Pulse khusus HOT */
@keyframes hotPulse {
  0%, 100% {
    box-shadow:
      0 0 12px rgba(34,197,94,0.7),
      0 0 22px rgba(250,204,21,0.4);
  }
  50% {
    box-shadow:
      0 0 20px rgba(34,197,94,1),
      0 0 36px rgba(250,204,21,0.8);
  }
}

.play-btn{
  margin-top:10px;
  width:100%;
  padding:10px;
  border-radius:10px;
  border:none;
  font-weight:600;
  cursor:pointer;
  background:linear-gradient(135deg,#22c55e,#16a34a);
  color:#020617;
  transition:0.25s;
}

.play-btn:hover{
  transform:translateY(-1px);
  filter:brightness(1.1);
}

.play-btn.disabled{
  background:linear-gradient(135deg,#ef4444,#b91c1c);
  color:#fff;
  cursor:not-allowed;
}

.warning-text{
  font-size:12px;
  color:#f87171;
  margin-top:6px;
  min-height:14px;
}

.play-btn.disabled{
  animation:shake 0.3s;
}

@keyframes shake{
  0%{transform:translateX(0)}
  25%{transform:translateX(-3px)}
  50%{transform:translateX(3px)}
  75%{transform:translateX(-3px)}
  100%{transform:translateX(0)}
}