@import url("https://fonts.googleapis.com/css2?family=Turret+Road:wght@200;300;400;500;700;800&display=swap");

/* ------ Color and Font Variables ------ */
:root {
  --color-background: #181c1d; /* Dark background */
  --color-foreground: #23272a; /* Slightly lighter for header */
  --color-text: #f3f3f3; /* Main text color */
  --color-header-btn: #3498db; /* Blue button */
  --color-header-btn-hover: #217dbb;
  --color-black-pill: #18191a;
  --font-family: "Turret Road", Arial, sans-serif;
}

/* ------ Reset ------ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  /* Cool animated gradient and glow background */
  background: linear-gradient(120deg, #191c28 0%, #232b40 35%, #21364d 100%);
  color: var(--color-text);
  font-family: var(--font-family);
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}
body::before {
  /* Soft moving background light overlays */
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.45;
  background:
    radial-gradient(circle at 25% 30%, #6a7aec33 0 30%, transparent 80%),
    radial-gradient(circle at 80% 85%, #9dfbff22 0 22%, transparent 80%),
    radial-gradient(circle at 70% 5%, #eea6e822 0 20%, transparent 80%),
    radial-gradient(circle at 10% 80%, #00ffd644 0 25%, transparent 80%);
  animation: movebg 14s linear infinite alternate;
}
@keyframes movebg {
  0% {
    background-position:
      0 0,
      60vw 100vh,
      80vw 0,
      0 80vh;
  }
  100% {
    background-position:
      60vw 100vh,
      0 0,
      0 80vh,
      80vw 0;
  }
}

/* ------ Header (Top Bar) ------ */
.site-header {
  width: 100vw;
  background: var(--color-foreground);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.header-content {
  width: 100vw;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 4vw 18px 4vw;
  box-sizing: border-box;
}

/* ------ User Profile (Left) ------ */
.profile {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Avatar with animated gold glow */
.avatar {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #000;
  color: #fff;
  font-size: 2rem;
  font-weight: bold;
  box-shadow:
    0 0 0 3px gold,
    0 0 16px 4px #ffe47fff,
    0 0 32px #a1c8ffd9 inset;
  animation: avatar-glow 3.3s ease-in-out infinite alternate;
}
@keyframes avatar-glow {
  0% {
    box-shadow:
      0 0 0 2px gold,
      0 0 12px 2px #fffa8d80,
      0 0 32px #a1c8ff55 inset;
  }
  100% {
    box-shadow:
      0 0 0 4px gold,
      0 0 36px 8px #ffe47fff,
      0 0 64px #a1c8ffd9 inset;
  }
}

.profile-info h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 3px;
  font-family: var(--font-family);
}
.level-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

#userLevel {
  font-size: 16px;
  font-weight: 100;
  color: var(--color-text);
}

/* Progress bar with glow effect */
.level-bar {
  width: 80px;
  height: 14px;
  margin: 0 0.5em;
  border-radius: 7px;
  appearance: none;
  background: #2f2f2f;
  border: none;
  box-shadow: 0 0 10px #b0ffe922 inset;
}
.level-bar::-webkit-progress-bar {
  background: #2f2f2f;
  border-radius: 7px;
}
.level-bar::-webkit-progress-value {
  background: linear-gradient(90deg, #4caf50 65%, gold);
  border-radius: 7px;
  box-shadow:
    0 0 10px #fffad633,
    0 0 12px #b7ffc244 inset;
}
.level-bar::-moz-progress-bar {
  background: linear-gradient(90deg, #4caf50 65%, gold);
  border-radius: 7px;
}

.progress-label {
  font-size: 1em;
  font-weight: 600;
  background: #444;
  color: #fff;
  border-radius: 7px;
  padding: 0 0.5em;
  min-width: 32px;
  text-align: center;
  display: inline-block;
  letter-spacing: 0.02em;
  box-shadow: 0 1px 8px #fff45222;
}

/* ------ Header Actions (Right) ------ */
.header-actions {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  width: 100%;
}

.header-title {
  flex: 1;
  display: flex;
  justify-content: center;
}

.header-title h1 {
  font-family: "Turret Road", "Orbitron", Arial, sans-serif;
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-align: center;
  background: linear-gradient(
    90deg,
    #b3e7ff 20%,
    #75ffe7 45%,
    #e4f674 65%,
    #f2aaff 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 20px #75ffe566);
  text-shadow: 0 0 18px #fff3;
  animation: title-glow 3s infinite alternate;
}
@keyframes title-glow {
  0% {
    filter: drop-shadow(0 2px 10px #b7fffb80);
  }
  100% {
    filter: drop-shadow(0 2px 24px #b7fffbf5);
  }
}

/* Gradient animated buttons */
.header-btn {
  padding: 12px 22px;
  font-size: 17px;
  background: linear-gradient(100deg, #399bfc 10%, #55e6b5 80%);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  box-shadow: 0 1.5px 18px #8cfff933;
  position: relative;
  overflow: hidden;
  transition:
    box-shadow 0.15s,
    background 0.19s,
    transform 0.14s;
}
.header-btn::after {
  /* Light sweep effect */
  content: "";
  position: absolute;
  left: -45%;
  top: 0;
  width: 30%;
  height: 100%;
  background: linear-gradient(110deg, #fff9 0%, #fff4 50%, transparent 100%);
  transform: skewX(-20deg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.header-btn:hover::after {
  opacity: 0.8;
  animation: btn-shine 1.2s linear 1;
}
@keyframes btn-shine {
  0% {
    left: -50%;
    opacity: 0.1;
  }
  20% {
    opacity: 0.8;
  }
  100% {
    left: 110%;
    opacity: 0;
  }
}
.header-btn:hover {
  background: var(--color-header-btn-hover);
}
.header-btn:active {
  transform: scale(0.97);
}
.header-btn:focus {
  outline: 2.5px solid #1ec7fa88;
}

.stats-list {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  list-style: none;
  background: var(--color-black-pill);
  border-radius: 1.3rem;
  padding: 0.35rem 1.1rem;
  align-items: center;
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.13);
  margin: 0;
}

.stats-list li {
  display: flex;
  align-items: center;
  gap: 0.4em;
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  font-family: "Turret Road", "Orbitron", Arial, sans-serif;
}

.stat-icon.gems {
  color: #c500ff;
  font-size: 1.17rem;
}

.stat-icon.packs {
  color: #ff3333;
  font-size: 1.17rem;
}

/* ------ Main Content ------ */
main {
  width: 100vw;
  min-height: calc(100vh - 72px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: transparent;
}

/* ------ Pack Section (Card Area) ------ */
.pack-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  margin-top: 6vh;
}

/* Main card with animated glow and soft gradient */
.pack-card {
  width: 260px;
  height: 360px;
  border-radius: 24px;
  background: linear-gradient(135deg, #222832 0%, #6a7aec 100%);
  position: relative;
  box-shadow:
    0 8px 40px 0 #89baff3c,
    0 2px 20px #3ff6e738 inset;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    transform 0.22s cubic-bezier(0.6, 2.1, 0.7, 1),
    box-shadow 0.18s;
  border: none;
  margin-bottom: 0;
  animation: float-card 3s ease-in-out infinite alternate;
}
@keyframes float-card {
  0% {
    transform: scale(1) translateY(0);
  }
  100% {
    transform: scale(1.028) translateY(-7px);
  }
}
.pack-card:hover,
.pack-card:focus {
  box-shadow:
    0 16px 48px #49faffcc,
    0 0 60px #32c9fa99 inset;
  outline: 3px solid #a7eaff;
}

/* Card inner animated glow */
.pack-glow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 220px;
  height: 220px;
  transform: translate(-50%, -50%);
  background: radial-gradient(
    circle,
    #d5e1ff 0%,
    #5c73ec22 80%,
    transparent 100%
  );
  filter: blur(16px);
  z-index: 1;
  pointer-events: none;
  opacity: 0.85;
  animation: card-glow 3s ease-in-out infinite alternate;
}
@keyframes card-glow {
  0% {
    opacity: 0.7;
    filter: blur(10px);
  }
  100% {
    opacity: 1;
    filter: blur(20px);
  }
}

.pack-corner {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #aaf6ffb7;
  box-shadow: 0 0 12px 4px #8cf3ffd6;
  z-index: 2;
  opacity: 0.7;
}

.pack-corner.top-left {
  left: 11px;
  top: 11px;
}
.pack-corner.top-right {
  right: 11px;
  top: 11px;
}
.pack-corner.bottom-left {
  left: 11px;
  bottom: 11px;
}
.pack-corner.bottom-right {
  right: 11px;
  bottom: 11px;
}

/* Icon and title with gentle animation */
.pack-icon {
  width: 78px;
  height: 78px;
  z-index: 3;
  filter: drop-shadow(0 4px 8px #a1bcff90);
  margin-bottom: 18px;
  margin-top: 16px;
  animation: icon-pulse 2.2s ease-in-out infinite alternate;
}
@keyframes icon-pulse {
  0% {
    transform: scale(1) rotate(-5deg);
  }
  100% {
    transform: scale(1.05) rotate(3deg);
  }
}

.pack-title {
  font-size: 2.1rem;
  font-family: "Turret Road", "Orbitron", Arial, sans-serif;
  font-weight: 800;
  background: linear-gradient(92deg, #fff, #fffdd0 37%, #efb773 80%, #fff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.02em;
  z-index: 3;
  text-shadow: 0 2px 14px #23203a99;
}

.pack-subtext {
  font-size: 1.1rem;
  margin-top: 12px;
  color: #ffec97;
  text-shadow: 0 1.5px 6px #312;
  z-index: 3;
  font-family: "Turret Road", Arial, sans-serif;
}

/* Responsive for mobile */
@media (max-width: 700px) {
  .header-content {
    flex-direction: column;
    gap: 18px;
  }
  .pack-card {
    width: 95vw;
    height: 52vw;
    min-width: 170px;
    min-height: 230px;
  }
  .pack-bar {
    width: 70vw;
  }
}

/* ------ Pack Footer & Progress ------ */
.pack-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.packs-counter {
  display: flex;
  align-items: center;
  gap: 0.6em;
  font-weight: 600;
  font-size: 1.15rem;
  color: #fff;
  background: var(--color-black-pill);
  border-radius: 15px;
  padding: 0.36em 1.6em;
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.13);
}
.packs-counter .stat-icon.packs {
  color: #ff3333;
}
.pack-progress-group {
  display: flex;
  align-items: center;
  gap: 0.8em;
  width: 100%;
  justify-content: center;
}
.pack-bar {
  width: 210px;
  height: 18px;
  border-radius: 9px;
  appearance: none;
  background: #2f2f2f;
  border: none;
  box-shadow: 0 0 10px #b0ffe922 inset;
}
.pack-bar::-webkit-progress-bar {
  background: #2f2f2f;
  border-radius: 9px;
}
.pack-bar::-webkit-progress-value {
  background: linear-gradient(90deg, #6ece91 40%, #f4d35e 90%, #222 100%);
  border-radius: 9px;
  box-shadow:
    0 0 10px #fffad633,
    0 0 12px #b7ffc244 inset;
}
.pack-bar::-moz-progress-bar {
  background: linear-gradient(90deg, #6ece91 40%, #f4d35e 90%, #222 100%);
  border-radius: 9px;
}
.pack-progress-group .progress-label {
  min-width: 38px;
  background: #444;
  color: #fff;
  border-radius: 7px;
  text-align: center;
  font-size: 1em;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: 0 1px 8px #fff45222;
}
.pack-time {
  font-size: 15px;
  color: #888;
  letter-spacing: 0.04em;
  margin-top: 4px;
  width: 100%;
  text-align: center;
}

/* Modal (Register Account) */
.modal-overlay {
  display: none;
  position: fixed;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.35);
  justify-content: center;
  align-items: center;
  z-index: 999;
}
.modal {
  background: linear-gradient(118deg, #23272a 60%, #2e3148 100%);
  color: #fff;
  border-radius: 16px;
  padding: 1em 2.6em 2.2em 2.6em;
  box-shadow:
    0 12px 40px #49aaff24,
    0 2px 24px #9aecff36 inset;
  border: 1.5px solid #52e7ff50;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 290px;
  min-height: 230px;
  position: relative;
  overflow: visible;
}
.modal h2 {
  font-size: 2.2em;
  font-family: "Turret Road", Arial, sans-serif;
  letter-spacing: 0.02em;
  font-weight: 700;
  margin-bottom: 28px;
  margin-top: 5px;
  text-align: center;
  padding-right: 0;
}
.modal input[type="text"] {
  padding: 0.68em 1em;
  font-size: 1.18em;
  margin-top: 0;
  margin-bottom: 18px;
  border-radius: 9px;
  border: 2.2px solid #81c9fa;
  background: #fff;
  color: #222;
  box-shadow: 0 1.5px 8px #b3f4fc22;
  transition: border-color 0.16s;
  outline: none;
  width: 96%;
}
.modal input[type="text"]:focus {
  border-color: #53c7ff;
  box-shadow: 0 0 0 2px #53c7ff22;
}
.form-tip {
  color: #aaa;
  font-size: 0.98em;
  margin-bottom: 18px;
  margin-top: -14px;
  text-align: left;
  width: 97%;
  letter-spacing: 0.01em;
}

/* Modal button with gradient & shine */
.modal button {
  margin-top: 1.4em;
  padding: 0.7em 2em;
  font-size: 1.16em;
  background: linear-gradient(100deg, #399bfc 10%, #55e6b5 80%);
  color: #fff;
  border: none;
  border-radius: 9px;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 8px #38c7fa16;
  position: relative;
  overflow: hidden;
  transition:
    background 0.16s,
    box-shadow 0.13s,
    transform 0.13s;
}
.modal button::after {
  /* Button shine animation */
  content: "";
  position: absolute;
  left: -45%;
  top: 0;
  width: 30%;
  height: 100%;
  background: linear-gradient(110deg, #fff9 0%, #fff4 50%, transparent 100%);
  transform: skewX(-20deg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.modal button:hover::after {
  opacity: 0.8;
  animation: btn-shine 1.2s linear 1;
}
.modal button:hover,
.modal button:focus {
  background: #217dbb;
}
.modal button:active {
  transform: scale(0.97);
}
.modal button:focus {
  outline: 2.5px solid #1ec7fa88;
}

/* Animated modal close button ("esc") */
.modal-close {
  position: absolute;
  top: -35px;
  right: -150px;
  width: 48px;
  height: 48px;
  background: linear-gradient(98deg, #399bfc 20%, #56ffd2 80%);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 1.45em;
  cursor: pointer;
  box-shadow: 0 2px 12px #77d2ff44;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  transform: translate(0, 0);
  animation: esc-glow 2.2s ease-in-out infinite alternate;
}
@keyframes esc-glow {
  0% {
    box-shadow: 0 2px 12px #77d2ff44;
  }
  100% {
    box-shadow: 0 8px 22px #65e9f978;
  }
}
.modal-close:hover {
  background: #1b7fba;
  color: #fff;
}

/* ------ Responsive ------ */
@media (max-width: 700px) {
  .header-content {
    flex-direction: column;
    gap: 18px;
  }
  .pack-card {
    width: 95vw;
    height: 52vw;
    min-width: 170px;
    min-height: 230px;
  }
  .pack-bar {
    width: 70vw;
  }
}

/* ------ Particle explosion effect for open pack ------ */
.particle-explosion {
  pointer-events: none;
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  z-index: 5;
}
.particle {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  opacity: 0.7;
  background: linear-gradient(
    120deg,
    #fff97e,
    #7ecbff,
    #f9a8ff,
    #75ffe0,
    #fc7a7a
  );
  box-shadow: 0 0 10px #fff9;
  pointer-events: none;
  animation: particle-explode 0.9s cubic-bezier(0.25, 1.6, 0.54, 1) forwards;
}
@keyframes particle-explode {
  0% {
    transform: scale(1) translate(0, 0);
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: scale(0.6) translate(var(--dx), var(--dy));
    opacity: 0;
  }
}

/* ------ Notice pop UI, soft shadow and gradient ------ */
.custom-notice {
  display: none;
  position: fixed;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(100deg, #282e3f 65%, #37fff2 180%);
  color: #fff;
  padding: 16px 32px;
  border-radius: 10px;
  box-shadow: 0 8px 36px #4eaaff22;
  font-size: 1.15em;
  z-index: 9999;
  opacity: 0.96;
  transition: opacity 0.3s;
  letter-spacing: 0.03em;
}
