:root {
  --bg-primary: #0a0e17;
  --bg-dark: #000814;
  --card: #0f1626;
  --gold: #f0c14b;
  --gold-glow: #ffd700;
  --green-ramadhan: #1a472a;
  --green-light: #2e7d32;
  --accent-red: #c62828;
  --text: #f0f4ff;
  --muted: #b0bec5;
  --border: #2a3b5a;
  --header-bg: #0d1b2a;
}

* {
  box-sizing: border-box;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

body {
  margin: 0;
  background: var(--bg-primary);
  color: var(--text);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(46,125,50,0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 75%, rgba(240,196,75,0.06) 0%, transparent 50%);
}

.container {
  max-width: 1100px;
  margin: auto;
  padding: 16px;
}

.logo-header {
  text-align: center;
  padding: 24px 0 16px;
  background: var(--bg-dark);
  border-bottom: 3px solid var(--gold);
}

.logo-header img {
  max-width: 280px;
  height: auto;
  filter: drop-shadow(0 0 12px var(--gold-glow));
  transition: transform 0.35s;
}

.logo-header img:hover {
  transform: scale(1.06);
}

.event-header {
  background: linear-gradient(135deg, #0f1a2e, #051121);
  border-radius: 16px;
  padding: 28px 24px;
  margin: 24px 0 32px;
  border: 1px solid rgba(240,196,75,0.18);
  box-shadow: 0 8px 32px rgba(0,0,0,0.55);
  text-align: center;
  overflow: hidden;
  position: relative;
}

/* ── MODE DESKTOP / LAYAR BESAR ── */
.title-desktop {
  margin: 0;
  font-size: clamp(1.7rem, 5vw, 2.6rem);
  font-weight: 900;
  letter-spacing: 0.8px;
  color: var(--gold);
  text-shadow: 
    0 0 12px rgba(255,215,0,0.8),
    0 0 24px rgba(255,215,0,0.5);
  white-space: normal;
  line-height: 1.35;
  display: block;
}

.fire-emoji {
  font-size: 1.4em;
  margin: 0 6px;
  vertical-align: middle;
  animation: pulse-fire 2.4s infinite ease-in-out;
  text-shadow: 0 0 14px #ff4500, 0 0 24px #ff8c00;
}

@keyframes pulse-fire {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.22); opacity: 0.9; }
}

/* ── MODE MOBILE ── */
.title-marquee {
  display: none;
  overflow: hidden;
  white-space: nowrap;
  width: 100%;
}

.title-marquee span {
  display: inline-block;
  padding-left: 100%;
  color: var(--gold);
  font-size: clamp(1.1rem, 5vw, 1.5rem);
  font-weight: 800;
  text-shadow: 0 1px 8px rgba(240,196,75,0.6);
  animation: scroll-left 17s linear infinite;
}

@keyframes scroll-left {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

/* ── ATURAN SWITCH ── */
@media (max-width: 640px) {
  .event-header {
    padding: 20px 14px;
    margin: 16px 0 24px;
  }

  .title-desktop {
    display: none;
  }

  .title-marquee {
    display: block;
  }

  .title-marquee span {
    animation-duration: 10s;
  }
}

@media (min-width: 641px) {
  .title-marquee {
    display: none !important;
  }

  .title-desktop {
    font-size: clamp(1.5rem, 5vw, 1.5rem);
  }
}

.event-desc-container {
  max-width: 760px;
  margin: 0 auto 32px;
  padding: 20px 28px;
  background: rgba(26,71,42,0.12);
  border-radius: 14px;
  border: 1px solid rgba(46,125,50,0.25);
  backdrop-filter: blur(6px);
  font-size: clamp(1rem, 3.2vw, 1.1rem);
  line-height: 1.8;
  color: #e8f5e9;
  text-align: center;
}

.top-info {
  background: var(--card);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 28px;
  border: 1px solid var(--border);
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

.prize-info h3 {
  margin: 0 0 16px;
  font-size: 1.35rem;
  color: var(--gold);
  text-shadow: 0 1px 6px rgba(240,196,75,0.3);
}

.prize-info ul {
  margin: 0;
  padding-left: 28px;
  font-size: 1.05rem;
  line-height: 2;
  color: #e0e7ff;
}

.prize-info li strong {
  color: var(--gold-glow);
}

.leaderboard {
  background: var(--card);
  border-radius: 14px;
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: 0 6px 24px rgba(0,0,0,0.45);
}

.lb-title {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 2px solid rgba(240,196,75,0.18);
  gap: 16px;
}

.lb-title h2 {
  margin: 0;
  font-size: clamp(1.4rem, 4vw, 1.8rem);
  color: var(--gold);
}

.marquee {
  background: rgba(26,71,42,0.25);
  color: #fff9c4;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  overflow: hidden;
  white-space: nowrap;
  box-shadow: 0 0 12px rgba(46,125,50,0.3);
  border: 1px solid rgba(46,125,50,0.4);
}

.marquee span {
  display: inline-block;
  white-space: nowrap;
  animation: marquee 14s linear infinite;
}

.space {
  display: inline-block;
  width: 200px;
}

@keyframes marquee {
  from { transform: translateX(30%); }
  to   { transform: translateX(-100%); }
}

.table-header {
  display: grid;
  grid-template-columns: 70px 1fr 180px;
  padding: 14px 20px;
  background: linear-gradient(to right, var(--green-ramadhan), #0d1b2a);
  border-radius: 10px 10px 0 0;
  font-weight: 800;
  color: var(--gold);
  text-transform: uppercase;
  font-style: oblique;
  font-size: 0.5rem;
  border-bottom: 4px solid var(--gold);
}

.table-header span {
  text-align: center;
  padding: 0 10px;
  border-right: 1px solid rgba(240,196,75,0.15);
}

.table-header span:last-child {
  border-right: none;
}

.row {
  display: grid;
  grid-template-columns: 70px 1fr 180px;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: #0f1626;
  transition: all 0.25s;
}

.row:hover {
  background: #17213a;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(46,125,50,0.2);
}

.row span {
  font-size: 1.05rem;
  padding: 0 10px;
  border-right: 1px solid var(--border);
  text-align: center;
}

.row span:last-child {
  border-right: none;
  text-align: right;
  font-weight: 500;
}

.rank {
  font-weight: 900;
  font-size: 1.35rem;
  color: var(--gold);
}

.user {
  font-weight: 600;
  color: #e3f2fd;
  text-align: left !important;
}

.prize {
  color: #fff9c4;
}

.top1 { background: linear-gradient(135deg, #b8860b, #ffd700); color: #000; }
.top1 .rank, .top1 .prize { color: #111; }

.top2 { background: linear-gradient(135deg, #a67c00, #e6b800); color: #000; }
.top3 { background: linear-gradient(135deg, #996600, #cc9900); color: #000; }
.top4, .top5 { background: linear-gradient(135deg, #4a2c00, #7a4f00); color: #f0f4c3; }

.r6to10 {
  border-left: 2px solid var(--green-light);
}

footer {
  margin-top: 40px;
  padding: 20px 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

.back-button-wrapper {
  text-align: center;
  margin: 32px 0 40px;
}

.back-button {
  display: inline-block;
  padding: 14px 36px;
  font-size: 1.1rem;
  font-weight: 700;
  color: #000;
  background: linear-gradient(135deg, var(--gold), #ffeb3b);
  border: none;
  border-radius: 50px;
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(240,196,75,0.4);
  transition: all 0.3s ease;
  cursor: pointer;
}

.back-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(255,215,0,0.55);
  background: linear-gradient(135deg, #ffeb3b, var(--gold));
}

.back-button:active {
  transform: translateY(1px);
  box-shadow: 0 4px 12px rgba(240,196,75,0.3);
}

/* Responsive */
@media (max-width: 640px) {
  .table-header, .row {
    grid-template-columns: 55px 1fr 140px;
    padding: 12px 14px;
  }
  .event-header {
    padding: 24px 16px;
  }
  .marquee {
    font-size: 0.95rem;
  }
  .back-button {
    padding: 12px 32px;
    font-size: 1rem;
  }
}