@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@500;700;900&family=Space+Grotesk:wght@400;500;600&display=swap');

:root {
  --bg-deep: #05040f;
  --bg-panel: rgba(255,255,255,0.04);
  --border-glow: rgba(127,119,221,0.35);
  --purple: #9b8cff;
  --teal: #5DCAA5;
  --gold: #FAC775;
  --coral: #ff8a65;
  --text: #eae8ff;
  --text-dim: #9a97c9;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  color: var(--text);
  background: radial-gradient(ellipse at top, #16123a 0%, var(--bg-deep) 55%, #020103 100%);
  background-attachment: fixed;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(2px 2px at 20% 30%, #fff, transparent),
    radial-gradient(2px 2px at 70% 60%, #fff, transparent),
    radial-gradient(1px 1px at 40% 80%, #fff, transparent),
    radial-gradient(1px 1px at 85% 20%, #fff, transparent),
    radial-gradient(2px 2px at 55% 15%, #fff, transparent),
    radial-gradient(1px 1px at 10% 65%, #fff, transparent),
    radial-gradient(1px 1px at 90% 85%, #fff, transparent);
  background-size: 400px 400px;
  opacity: 0.5;
  animation: twinkle 6s ease-in-out infinite alternate;
}

@keyframes twinkle {
  from { opacity: 0.25; }
  to { opacity: 0.6; }
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 880px;
  margin: 0 auto;
  padding: 48px 20px 80px;
}

h1, h2, h3, .brand {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  letter-spacing: 0.02em;
}

h1 {
  font-size: 40px;
  margin: 0 0 8px;
  background: linear-gradient(90deg, var(--purple), var(--teal) 60%, var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 40px rgba(155,140,255,0.35);
}

h2 { font-size: 22px; color: var(--text); }

p { line-height: 1.6; color: var(--text-dim); }

nav {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin: 0 0 40px;
  font-family: 'Orbitron', sans-serif;
  font-size: 13px;
}
nav a {
  color: var(--text-dim);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: all 0.2s;
}
nav a:hover, nav a.active {
  color: var(--purple);
  border-color: var(--border-glow);
  box-shadow: 0 0 18px rgba(155,140,255,0.25);
}

.card {
  background: var(--bg-panel);
  border: 1px solid var(--border-glow);
  border-radius: 18px;
  padding: 24px;
  margin: 20px 0;
  backdrop-filter: blur(6px);
  box-shadow: 0 0 30px rgba(90,70,180,0.12);
}

.card:hover { border-color: rgba(155,140,255,0.6); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin: 32px 0;
}

.feature {
  background: linear-gradient(160deg, rgba(155,140,255,0.08), rgba(93,202,165,0.05));
  border: 1px solid var(--border-glow);
  border-radius: 16px;
  padding: 22px;
  text-decoration: none;
  color: var(--text);
  display: block;
  transition: transform 0.2s, box-shadow 0.2s;
}
.feature:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(155,140,255,0.25);
}
.feature .icon { font-size: 28px; margin-bottom: 10px; display: block; }
.feature h3 { margin: 0 0 6px; font-size: 16px; color: var(--gold); }
.feature p { margin: 0; font-size: 13px; }

label { display: block; margin: 14px 0 6px; font-size: 13px; color: var(--text-dim); }
input {
  width: 100%;
  padding: 12px 14px;
  font-size: 14px;
  border-radius: 10px;
  border: 1px solid var(--border-glow);
  background: rgba(255,255,255,0.03);
  color: var(--text);
}
input:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 3px rgba(155,140,255,0.15); }
input::placeholder { color: #5c5885; }

button {
  font-family: 'Orbitron', sans-serif;
  font-weight: 600;
  font-size: 14px;
  padding: 12px 20px;
  margin: 14px 8px 0 0;
  border-radius: 10px;
  border: 1px solid var(--purple);
  background: linear-gradient(135deg, rgba(155,140,255,0.25), rgba(93,202,165,0.15));
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
}
button:hover {
  box-shadow: 0 0 20px rgba(155,140,255,0.5);
  transform: translateY(-1px);
}

.stat {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 14px;
  border-bottom: 1px dashed rgba(255,255,255,0.08);
}
.stat span:last-child { color: var(--teal); font-weight: 600; }

#log {
  white-space: pre-wrap;
  font-family: 'Space Grotesk', monospace;
  font-size: 13px;
  background: rgba(0,0,0,0.4);
  color: var(--teal);
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--border-glow);
  min-height: 40px;
  margin-top: 16px;
}

.warn { color: var(--coral); font-weight: 600; }

.info-note {
  font-size: 13px;
  color: var(--text-dim);
  background: rgba(93,202,165,0.08);
  border: 1px solid rgba(93,202,165,0.25);
  border-radius: 10px;
  padding: 10px 14px;
  margin-top: 12px;
  line-height: 1.5;
}
.info-note a { color: var(--teal); }

.result-card img { display: block; border-radius: 14px; margin: 14px 0; box-shadow: 0 0 30px rgba(155,140,255,0.3); }

.odds-row {
  display: flex;
  gap: 8px;
  margin: 16px 0 4px;
  flex-wrap: wrap;
}
.odds-pill {
  flex: 1;
  min-width: 80px;
  text-align: center;
  padding: 10px 6px;
  border-radius: 12px;
  border: 1px solid var(--border-glow);
  font-size: 12px;
}
.odds-pill .pct { font-family: 'Orbitron', sans-serif; font-size: 16px; display: block; margin-bottom: 2px; }
.odds-common { color: #888780; border-color: #888780; }
.odds-rare { color: #378ADD; border-color: #378ADD; }
.odds-epic { color: #7F77DD; border-color: #7F77DD; }
.odds-legendary { color: #EF9F27; border-color: #EF9F27; }

.reveal-box {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 120px;
}
.reveal-spin {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 4px solid transparent;
  border-top-color: var(--purple);
  border-right-color: var(--teal);
  animation: spin 0.7s linear infinite, pulseglow 0.7s ease-in-out infinite alternate;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulseglow {
  from { box-shadow: 0 0 10px rgba(155,140,255,0.3); }
  to { box-shadow: 0 0 30px rgba(155,140,255,0.7); }
}
.reveal-pop {
  animation: popIn 0.5s cubic-bezier(.34,1.56,.64,1);
}
@keyframes popIn {
  from { transform: scale(0.4); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.reveal-pop.legendary img, .reveal-pop.epic img {
  animation: glowPulse 1.6s ease-in-out infinite alternate;
}
@keyframes glowPulse {
  from { filter: drop-shadow(0 0 10px rgba(250,199,117,0.4)); }
  to { filter: drop-shadow(0 0 35px rgba(250,199,117,0.9)); }
}

.feed-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 13px;
  border-bottom: 1px dashed rgba(255,255,255,0.06);
}
.feed-item:last-child { border-bottom: none; }
.feed-rarity { font-weight: 600; }

.tutorial-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(2,1,5,0.85);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.tutorial-card {
  max-width: 420px;
  width: 100%;
  background: linear-gradient(160deg, #1c1740, #0c0a1f);
  border: 1px solid var(--border-glow);
  border-radius: 20px;
  padding: 32px 28px;
  text-align: center;
  box-shadow: 0 0 60px rgba(155,140,255,0.35);
  animation: popIn 0.35s cubic-bezier(.34,1.56,.64,1);
}
.tutorial-emoji { font-size: 56px; line-height: 1; margin-bottom: 14px; }
.tutorial-card h3 { margin: 0 0 10px; font-size: 19px; }
.tutorial-card p { font-size: 15px; color: var(--text); line-height: 1.6; }
.tutorial-dots { display: flex; gap: 6px; justify-content: center; margin: 18px 0 4px; }
.tutorial-dots span {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,0.15);
  transition: background 0.2s;
}
.tutorial-dots span.on { background: var(--purple); }
.tutorial-nav { display: flex; justify-content: center; gap: 10px; margin-top: 8px; }
.tutorial-skip {
  display: block; margin: 14px auto 0; background: none; border: none;
  color: var(--text-dim); font-size: 12px; text-decoration: underline; cursor: pointer;
  font-family: 'Space Grotesk', sans-serif; font-weight: 400; padding: 4px;
}
.help-btn {
  display: inline-block; margin-bottom: 20px;
  font-size: 13px; padding: 8px 16px;
}

footer {
  text-align: center;
  color: var(--text-dim);
  font-size: 12px;
  margin-top: 60px;
  opacity: 0.7;
}
