/* Page-wide styles: colors, fonts, buttons. */

:root {
  --bg: #15113a;
  --bg-2: #2b2470;
  --panel: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 255, 255, 0.14);
  --ink: #f5f1ff;
  --muted: rgba(245, 241, 255, 0.65);
  --accent: #ffb534;
  --accent-ink: #3a2400;
  --font-display: "Lilita One", "Trebuchet MS", sans-serif;
  --font-body: "Nunito", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background: radial-gradient(ellipse at 50% 0%, var(--bg-2), var(--bg) 70%) fixed;
  overflow-x: hidden;
}

/* slow-drifting colored glows behind everything */
body::before {
  content: "";
  position: fixed;
  inset: -20%;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 122, 60, 0.16), transparent 35%),
    radial-gradient(circle at 80% 70%, rgba(120, 90, 255, 0.22), transparent 40%);
  animation: drift 18s ease-in-out infinite alternate;
}
@keyframes drift {
  from { transform: translate(-3%, -2%) scale(1); }
  to   { transform: translate(3%, 2%) scale(1.08); }
}
@media (prefers-reduced-motion: reduce) { body::before { animation: none; } }

.btn {
  font: 800 1rem var(--font-body);
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
}
.btn:hover { background: rgba(255, 255, 255, 0.14); transform: translateY(-2px); }
.btn-main { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 4px 0 #b9770a; }
.btn-main:hover { background: #ffc65c; }

.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; background: transparent; box-shadow: none; }

button:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }

/* Spark burst when a pack opens */
.burst { position: fixed; z-index: 30; pointer-events: none; }
.burst i {
  position: absolute;
  width: 10px; height: 10px;
  margin: -5px;
  border-radius: 2px;
  animation: spark 0.9s cubic-bezier(.1,.7,.3,1) forwards;
}
@keyframes spark {
  from { transform: translate(0, 0) rotate(0) scale(1); opacity: 1; }
  to   { transform: translate(var(--dx), var(--dy)) rotate(360deg) scale(0.2); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .burst { display: none; } }

/* White flash when the pack bursts */
.flash {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  background: radial-gradient(circle at 50% 45%, #fff 0, rgba(255, 240, 200, 0.85) 30%, transparent 72%);
  animation: flash 0.65s ease-out forwards;
}
@keyframes flash {
  0%   { opacity: 0; }
  18%  { opacity: 1; }
  100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .flash { display: none; } }
