/* VOID VORTEX (js/vortex.js): sits under the pack on the main tab, only while the Void biome is active. */
.vortex { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; margin-top: 0.4rem; }
.vortex[hidden] { display: none; }
/* hidden while a pack is opening, like the rest of the extras */
.view-packs:has(#packs-extra[hidden]) .vortex { display: none; }

.vortex-btn {
  position: relative; width: 120px; height: 120px; padding: 0; border: 0; border-radius: 50%;
  background: none; cursor: pointer; color: #f5e6f3;
  filter: drop-shadow(0 0 14px rgba(192, 118, 185, 0.7));
  transition: filter 0.2s, opacity 0.3s;
}
.vortex-btn:disabled { cursor: default; opacity: 0.45; filter: drop-shadow(0 0 5px rgba(90, 31, 176, 0.5)) grayscale(0.4); }
.vortex.ready .vortex-btn:hover { filter: drop-shadow(0 0 24px rgba(220, 140, 235, 0.95)); }
.vortex-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; }

/* the swirl: an inline SVG (built in js/vortex.js) with spiral arms. The arms rotate INSIDE the svg, so the
   element's layout box never changes (rotating a square HTML box made scroll bars appear). */
.vortex-swirl { position: absolute; inset: 0; border-radius: 50%; }
.vortex-swirl svg { display: block; width: 100%; height: 100%; overflow: hidden; }
.vs-a { animation: vortex-spin 5s linear infinite; }
.vs-b { animation: vortex-spin 3s linear infinite reverse; }
.vortex-core { position: absolute; inset: 38%; border-radius: 50%; background: radial-gradient(circle, #000 55%, #1a0b2e); box-shadow: 0 0 18px 6px rgba(0, 0, 0, 0.9), inset 0 0 8px rgba(192, 118, 185, 0.5); }
.vortex-btn:disabled .vs-a { animation-duration: 14s; }
.vortex-btn:disabled .vs-b { animation-duration: 9s; }

.vortex-label { font-family: "Lilita One", sans-serif; letter-spacing: 0.03em; font-size: 0.95rem; color: #e6bfe1; text-shadow: 0 0 10px rgba(192, 118, 185, 0.7); }
.vortex:not(.ready) .vortex-label { color: var(--muted); text-shadow: none; }

/* shakes while ready */
.vortex.ready .vortex-btn { animation: vortex-shake 0.9s ease-in-out infinite; }
@keyframes vortex-spin { to { transform: rotate(360deg); } }
@keyframes vortex-shake {
  0%, 100% { transform: translate(0, 0) rotate(0); }
  15% { transform: translate(-3px, 1px) rotate(-3deg); }
  30% { transform: translate(3px, -2px) rotate(3deg); }
  45% { transform: translate(-2px, -1px) rotate(-2deg); }
  60% { transform: translate(2px, 2px) rotate(2deg); }
  75% { transform: translate(-1px, 1px) rotate(-1deg); }
}
@media (prefers-reduced-motion: reduce) {
  .vs-a, .vs-b { animation: none; }
  .vortex.ready .vortex-btn { animation: none; box-shadow: 0 0 0 3px rgba(192, 118, 185, 0.6); }
}

/* ---------- Minigame window (opens when the vortex is clicked) ---------- */
.vortex-overlay {
  position: fixed; inset: 0; z-index: 55; display: flex; align-items: center; justify-content: center;
  padding: 1rem; background: rgba(3, 1, 8, 0.82); backdrop-filter: blur(3px);
  opacity: 0; transition: opacity 0.25s;
}
.vortex-overlay.show { opacity: 1; }
.vortex-window {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.8rem;
  width: min(96vw, 760px); max-height: 96vh; overflow: auto; padding: 1.6rem 1.4rem 1.4rem;
  border: 1px solid rgba(192, 118, 185, 0.6); border-radius: 18px; color: #f5ecff;
  background: linear-gradient(160deg, rgba(60, 20, 90, 0.95), rgba(8, 3, 16, 0.97));
  box-shadow: 0 0 40px rgba(192, 118, 185, 0.35), 0 20px 60px rgba(0, 0, 0, 0.7);
  transform: scale(0.94); transition: transform 0.25s;
}
.vortex-overlay.show .vortex-window { transform: scale(1); }
.vortex-close {
  position: absolute; top: 0.6rem; right: 0.6rem; width: 2rem; height: 2rem; border: 1px solid rgba(192, 118, 185, 0.5);
  border-radius: 50%; background: rgba(8, 3, 16, 0.6); color: #e6bfe1; font-size: 0.9rem; cursor: pointer;
}
.vortex-close:hover, .vortex-close:focus-visible { background: rgba(192, 118, 185, 0.3); outline: none; }
.vortex-level-count { font-family: "Lilita One", sans-serif; letter-spacing: 0.04em; font-size: 1.1rem; color: #e6bfe1; text-shadow: 0 0 10px rgba(192, 118, 185, 0.7); }
.vortex-level-bar { display: flex; gap: 6px; width: min(100%, 360px); }
.vortex-seg { flex: 1; height: 14px; border-radius: 7px; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(192, 118, 185, 0.35); transition: background 0.3s, box-shadow 0.3s; }
.vortex-seg.on { background: linear-gradient(90deg, #5a1fb0, #c076b9); box-shadow: 0 0 10px rgba(192, 118, 185, 0.8); }
/* the playable area: as large as the window allows (width AND height limited so it always fits) */
.vortex-big { position: relative; width: max(180px, min(600px, 86vw, calc(100vh - 300px))); aspect-ratio: 1; border-radius: 50%; margin: 0.4rem 0; filter: drop-shadow(0 0 22px rgba(192, 118, 185, 0.8)); }
.vortex-big .vortex-core { inset: 40%; }
.vortex-status { font-family: "Lilita One", sans-serif; font-size: 1.5rem; min-height: 2rem; color: #f5e6f3; }
.vortex-overlay:not(.playing) .vortex-status { animation: vortex-pulse 0.5s ease-in-out infinite alternate; }
@keyframes vortex-pulse { from { opacity: 0.5; } to { opacity: 1; } }
@media (max-height: 560px) { .vortex-big { width: max(120px, min(600px, 86vw, calc(100vh - 220px))); } .vortex-window { gap: 0.4rem; padding-top: 1.2rem; } }
@media (prefers-reduced-motion: reduce) { .vortex-overlay, .vortex-window { transition: none; } .vortex-overlay:not(.playing) .vortex-status { animation: none; } }

/* ---------- Targets (inside the big vortex; positions and size are % of the vortex, so they scale) ---------- */
.vortex-big { touch-action: manipulation; }
.vortex-target {
  position: absolute; z-index: 2; transform: translate(-50%, -50%); padding: 0; border: 2px solid #fff; border-radius: 50%; cursor: pointer;
  background: radial-gradient(circle at 35% 30%, #fff 0 12%, #f3b8ee 35%, #a23fc0 70%, #3a1170);
  box-shadow: 0 0 0 3px rgba(5, 2, 10, 0.85), 0 0 16px 4px rgba(245, 160, 240, 0.95);
  animation: vortex-target-in 0.18s ease-out;
}
/* a ring that shrinks onto the target while its time runs out */
.vortex-target::after {
  content: ""; position: absolute; inset: -55%; border-radius: 50%; border: 2px solid rgba(255, 235, 252, 0.9); pointer-events: none;
  animation: vortex-target-ring var(--life, 1500ms) linear forwards;
}
.vortex-target.hit { animation: vortex-target-hit 0.25s ease-out forwards; pointer-events: none; }
.vortex-target.gone { animation: vortex-target-gone 0.25s ease-in forwards; pointer-events: none; }
.vortex-target.hit::after, .vortex-target.gone::after { display: none; }
@keyframes vortex-target-in { from { transform: translate(-50%, -50%) scale(0.2); opacity: 0; } to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
@keyframes vortex-target-ring { from { transform: scale(1); opacity: 0.9; } to { transform: scale(0.45); opacity: 0.25; } }
@keyframes vortex-target-hit { to { transform: translate(-50%, -50%) scale(1.8); opacity: 0; } }
@keyframes vortex-target-gone { to { transform: translate(-50%, -50%) scale(0.2); opacity: 0; } }
.vortex-big.miss { animation: vortex-miss 0.3s ease-out; }
@keyframes vortex-miss { 0% { filter: drop-shadow(0 0 26px rgba(255, 70, 90, 0.95)); } 100% { filter: drop-shadow(0 0 22px rgba(192, 118, 185, 0.8)); } }
.vortex-stats { display: flex; gap: 1.2rem; font-size: 0.95rem; font-weight: 800; color: var(--muted, #d9c7ee); }
.vortex-hits { color: #e6bfe1; }
.vortex-misses { color: #ff9aa8; }
@media (prefers-reduced-motion: reduce) { .vortex-target, .vortex-target::after, .vortex-target.hit, .vortex-target.gone, .vortex-big.miss { animation: none; } .vortex-target.hit, .vortex-target.gone { opacity: 0; } }

/* ---------- Levels: completion and fail states ---------- */
.vortex-overlay.complete .vortex-window { border-color: #ffe08a; box-shadow: 0 0 50px rgba(255, 214, 120, 0.55), 0 20px 60px rgba(0, 0, 0, 0.7); }
.vortex-overlay.complete .vortex-status { color: #ffe08a; text-shadow: 0 0 14px rgba(255, 214, 120, 0.8); animation: none; }
.vortex-overlay.complete .vortex-level-count { color: #ffe08a; }
.vortex-overlay.complete .vortex-seg.on { background: linear-gradient(90deg, #d9a21b, #ffe08a); box-shadow: 0 0 10px rgba(255, 214, 120, 0.9); }
.vortex-overlay.failed .vortex-status { color: #ff9aa8; }

/* ---------- Rewards window (shown once when the Void ends) ---------- */
.vortex-rewards { z-index: 65; }
.vortex-rewards .vortex-window { width: min(94vw, 460px); gap: 0.7rem; text-align: center; }
.vr-title { margin: 0; font-family: "Lilita One", sans-serif; font-size: 1.7rem; letter-spacing: 0.03em; color: #ffe08a; text-shadow: 0 0 16px rgba(255, 214, 120, 0.6); }
.vr-sub, .vr-note { margin: 0; color: #e6bfe1; font-size: 0.95rem; }
.vr-note { color: var(--muted); font-size: 0.85rem; }
.vr-card { display: flex; justify-content: center; margin: 0.2rem 0; }
.vr-packs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; width: 100%; }
.vr-pack { display: flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.4rem 0.7rem; border: 1px solid rgba(192, 118, 185, 0.4); border-radius: 10px; background: rgba(8, 3, 16, 0.55); font-size: 1.05rem; }
.vr-pack b { color: #ffe08a; }
.vr-chip { width: 1.1rem; height: 1.5rem; border-radius: 4px; box-shadow: 0 0 8px rgba(192, 118, 185, 0.6); }
.vr-ok { margin-top: 0.3rem; min-width: 8rem; }
