:root {
  --bg: #0d0221;
  --bg-gradient: linear-gradient(135deg, #0d0221, #1a0a3e);
  --surface: #1a0d35;
  --accent: #7c3aed;
  --accent2: #22c55e;
  --text: #f0fdff;
  --text-muted: rgba(255, 255, 255, 0.6);
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
}

body {
  background: var(--bg-gradient);
  min-height: 100vh;
  color: var(--text);
  font-family: "Raleway", sans-serif;
  margin: 0;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 5000;
  background: rgba(13, 2, 33, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(124, 58, 237, 0.35);
}

.header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 18px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  min-width: 265px;
}

.brand img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(124, 58, 237, 0.45);
}

.brand-title {
  font-family: "Cinzel", serif;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.25px;
}

.main-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.main-nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 14px;
  transition: color 0.2s ease;
}

.main-nav a:hover,
.main-nav a.active {
  color: #ffffff;
}

.hud {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  font-size: 13px;
  color: var(--text-muted);
}

.hud-chip {
  background: rgba(124, 58, 237, 0.25);
  border: 1px solid rgba(124, 58, 237, 0.35);
  border-radius: 999px;
  padding: 4px 10px;
  white-space: nowrap;
}

.layout {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 18px 110px;
}

.notice-strip {
  margin: 10px 0 20px;
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.45);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 13px;
}

.panel {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(124, 58, 237, 0.3);
}

.ticker {
  overflow: hidden;
  white-space: nowrap;
  position: relative;
}

.ticker-track {
  display: inline-block;
  padding-left: 100%;
  animation: ticker 30s linear infinite;
}

@keyframes ticker {
  from {
    transform: translateX(0%);
  }
  to {
    transform: translateX(-100%);
  }
}

.hero {
  position: relative;
  min-height: 330px;
  overflow: hidden;
  margin: 20px 0;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.4;
}

.hero::before {
  content: "";
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  top: -120px;
  right: -80px;
  background: radial-gradient(circle at center, rgba(255, 255, 210, 0.25), rgba(255, 255, 210, 0));
  animation: moonGlow 4s ease-in-out infinite alternate;
}

@keyframes moonGlow {
  from {
    filter: blur(0px);
    opacity: 0.65;
  }
  to {
    filter: blur(4px);
    opacity: 1;
  }
}

.spell-particles,
.constellation {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.spell-particles span,
.constellation span {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.spell-particles span {
  background: rgba(124, 58, 237, 0.65);
  box-shadow: 0 0 10px rgba(124, 58, 237, 0.75);
  animation: swirl 8s linear infinite;
}

.constellation span {
  background: rgba(240, 253, 255, 0.8);
  box-shadow: 0 0 8px rgba(240, 253, 255, 0.85);
  animation: sparkle 3.5s ease-in-out infinite;
}

@keyframes swirl {
  0% {
    transform: translate(0, 0) scale(0.8);
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: translate(-140px, -120px) scale(1.3);
    opacity: 0;
  }
}

@keyframes sparkle {
  0%,
  100% {
    opacity: 0.2;
    transform: scale(0.75);
  }
  50% {
    opacity: 1;
    transform: scale(1.15);
  }
}

.hero-content {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 180px 1fr;
  align-items: center;
  gap: 20px;
  padding: 24px;
}

.hero-mascot {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 2px solid rgba(124, 58, 237, 0.6);
  box-shadow: 0 0 26px rgba(124, 58, 237, 0.45);
  object-fit: cover;
}

h1,
h2,
h3 {
  font-family: "Cinzel", serif;
  margin: 0 0 12px;
}

.muted {
  color: var(--text-muted);
}

.grid {
  display: grid;
  gap: 16px;
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card {
  background: rgba(26, 13, 53, 0.95);
  border: 1px solid rgba(124, 58, 237, 0.3);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
}

.btn,
button,
.chip {
  border: 0;
  border-radius: 10px;
  padding: 9px 12px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
}

.btn.secondary,
button.secondary {
  background: #2b1a58;
  border: 1px solid rgba(124, 58, 237, 0.6);
}

.btn.green,
button.green {
  background: var(--accent2);
  color: #102011;
}

.chip {
  background: rgba(124, 58, 237, 0.22);
  border: 1px solid rgba(124, 58, 237, 0.45);
  display: inline-block;
  margin: 4px 6px 0 0;
  font-size: 12px;
}

.slot-cover {
  width: 100%;
  height: 180px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid rgba(124, 58, 237, 0.35);
}

.img-fallback {
  width: 100%;
  height: 180px;
  border-radius: 10px;
  border: 1px solid rgba(124, 58, 237, 0.35);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.5), rgba(34, 197, 94, 0.35));
  position: relative;
}

.img-fallback::after {
  content: attr(data-label);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: "Cinzel", serif;
  font-weight: 700;
}

.progress {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
}

.slot-board {
  display: grid;
  gap: 6px;
  justify-content: center;
  margin: 16px 0;
}

.slot-cell {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: rgba(124, 58, 237, 0.15);
  border: 1px solid rgba(124, 58, 237, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 2, 22, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.overlay.show {
  display: flex;
}

.overlay-card {
  width: min(520px, 94vw);
  padding: 22px;
  border-radius: 16px;
  background: #14082f;
  border: 1px solid rgba(124, 58, 237, 0.5);
  box-shadow: var(--shadow);
}

#ageGate {
  z-index: 99999;
}

#nameGate {
  z-index: 9999;
}

.cookie {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 8000;
  background: rgba(18, 8, 40, 0.95);
  border-top: 1px solid rgba(124, 58, 237, 0.35);
  padding: 12px 14px;
  display: none;
}

.cookie.show {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.toasts {
  position: fixed;
  right: 14px;
  top: 78px;
  z-index: 9500;
  display: grid;
  gap: 8px;
}

.toast {
  background: rgba(10, 30, 17, 0.95);
  border: 1px solid rgba(34, 197, 94, 0.5);
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: var(--shadow);
  font-size: 13px;
}

.coin-rain {
  position: fixed;
  inset: 0;
  z-index: 7000;
  pointer-events: none;
  overflow: hidden;
}

.coin {
  position: absolute;
  font-size: 20px;
  animation: fall 2.7s linear forwards;
}

@keyframes fall {
  from {
    transform: translateY(-30px) rotate(0);
    opacity: 1;
  }
  to {
    transform: translateY(110vh) rotate(540deg);
    opacity: 0.2;
  }
}

.site-footer {
  border-top: 1px solid rgba(124, 58, 237, 0.35);
  background: rgba(9, 2, 25, 0.96);
}

.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 18px;
  font-size: 13px;
  color: var(--text-muted);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.footer-brand img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
}

.footer-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.leaderboard tr.me {
  background: rgba(34, 197, 94, 0.2);
}

.achievement-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.badge {
  background: rgba(124, 58, 237, 0.13);
  border-radius: 10px;
  border: 1px solid rgba(124, 58, 237, 0.35);
  padding: 10px;
}

.badge.locked {
  filter: grayscale(1);
  opacity: 0.65;
}

@media (max-width: 980px) {
  .header-inner {
    grid-template-columns: 1fr;
  }

  .brand {
    min-width: auto;
  }

  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-mascot {
    margin: 0 auto;
  }

  .grid-3,
  .grid-2,
  .achievement-grid {
    grid-template-columns: 1fr;
  }

  .slot-cell {
    width: 42px;
    height: 42px;
    font-size: 22px;
  }
}
