* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

body {
  background-color: #0d0d11;
  color: #e0e0e0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  overflow: hidden;
}

h1 {
  position: absolute;
  top: 10px;
  color: #00ffcc;
  text-shadow: 0 0 10px rgba(0, 255, 204, 0.5);
  font-size: 20px;
  z-index: 100;
}

#game-container {
  position: relative;
  width: 1536px;
  height: 864px;
}

canvas {
  background-color: #111;
  border: 2px solid #333;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
  cursor: crosshair;
}

/* HUD UI */
.hud-layer {
  position: absolute;
  pointer-events: none;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: 5;
}

#level-display {
  position: absolute;
  top: 15px;
  left: 20px;
  font-size: 20px;
  font-weight: bold;
  color: #ff00ff;
  text-shadow: 1px 1px 3px #000;
}

#timer {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 24px;
  font-weight: bold;
  color: #fff;
  text-shadow: 1px 1px 3px #000;
}

#ghost-count,
#coins-count {
  position: absolute;
  bottom: 15px;
  left: 15px;
  color: #ff4444;
  font-weight: bold;
  background: rgba(0, 0, 0, 0.5);
  padding: 5px 10px;
  border-radius: 4px;
}

#coins-count {
  left: 160px;
  color: #00ffcc;
}

#dash-cooldown {
  position: absolute;
  bottom: 15px;
  right: 15px;
  color: #00ffcc;
  font-weight: bold;
  background: rgba(0, 0, 0, 0.5);
  padding: 5px 10px;
  border-radius: 4px;
}

#xp-wrapper {
  position: absolute;
  bottom: 48px;
  right: 15px;
  width: 220px;
  text-align: right;
  pointer-events: none;
}

#xp-text {
  color: #fff;
  font-size: 12px;
  font-weight: bold;
  text-shadow: 1px 1px 3px #000;
  margin-bottom: 3px;
}

#xp-bar-bg {
  width: 100%;
  height: 8px;
  background: #333;
  border: 1px solid #000;
  border-radius: 4px;
  overflow: hidden;
}

#xp-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #00ffcc, #00aaff);
  transition: width 0.15s ease;
}

/* Health UI */
#health-bar {
  position: absolute;
  bottom: 80px;
  left: 15px;
  display: flex;
  gap: 5px;
}

.heart {
  width: 20px;
  height: 20px;
  background: #ff2222;
  clip-path: polygon(50% 100%,
      100% 70%,
      100% 30%,
      75% 0%,
      50% 20%,
      25% 0%,
      0% 30%,
      0% 70%);
  box-shadow: 0 0 5px red;
}

.heart.empty {
  background: #333;
  box-shadow: none;
}

.shield-icon {
  width: 20px;
  height: 20px;
  background: #00aaff;
  border-radius: 50%;
  box-shadow: 0 0 10px #00aaff;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
}

/* Boss HP */
#boss-ui {
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  display: none;
  font-family: inherit;
  transition: opacity 0.3s;
}

#boss-ui.boss-shaking {
  animation: hitShake 0.3s cubic-bezier(.36,.07,.19,.97) both;
}
@keyframes hitShake {
  10%, 90% { transform: translateX(translate(calc(-50% - 2px), 0)); }
  20%, 80% { transform: translateX(translate(calc(-50% + 4px), 0)); }
  30%, 50%, 70% { transform: translateX(translate(calc(-50% - 6px), 0)); }
  40%, 60% { transform: translateX(translate(calc(-50% + 6px), 0)); }
}

#boss-name-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 5px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--boss-name-color, #ff0055);
  text-shadow: 0 0 10px var(--boss-name-shadow, red);
}

#boss-hp-bg {
  position: relative;
  width: 100%;
  height: 18px;
  background: rgba(20, 20, 20, 0.8);
  border: 2px solid #555;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

#boss-hp-trail {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: white;
  transition: width 0.4s ease-out 0.1s;
  box-shadow: 0 0 10px white;
}

#boss-hp-fill {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, var(--boss-hp-start, #ff0000), var(--boss-hp-end, #ff0055));
  transition: width 0.05s linear;
}

#boss-hp-markers {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  display: flex;
  pointer-events: none;
}

.boss-hp-marker {
  height: 100%;
  border-right: 2px solid rgba(0,0,0,0.7);
  box-shadow: 1px 0 0 rgba(255,255,255,0.2) inset;
}

/* ===============================
   THEMES 
   =============================== */
.boss-theme-fire #boss-hp-bg {
  border-color: #ffaa00;
  box-shadow: 0 0 15px rgba(255, 68, 0, 0.5);
}
.boss-theme-fire #boss-hp-trail { background: #ffe600; }

.boss-theme-earth #boss-hp-bg {
  border-color: #a0522d;
  border-width: 3px;
  border-radius: 0;
}
.boss-theme-earth #boss-hp-trail { background: #deb887; }

.boss-theme-ice #boss-hp-bg {
  border-color: #00ffff;
  border-radius: 10px;
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.6);
}
.boss-theme-ice #boss-hp-trail { background: #ffffff; }

.boss-theme-wind #boss-hp-bg {
  border-color: #00ffcc;
  border-radius: 20px;
  border-style: dashed;
}
.boss-theme-wind #boss-hp-trail { background: #ccfff5; }

.boss-theme-thunder #boss-hp-bg {
  border-color: #ffff00;
  box-shadow: 0 0 20px rgba(255,255,0,0.8);
  border-style: double;
  border-width: 4px;
}
.boss-theme-thunder #boss-name {
  animation: flicker 2s infinite alternate;
}

.boss-theme-void #boss-hp-bg {
  border-radius: 50% / 10%;
  border-color: #5500aa;
  box-shadow: 0 0 20px #220044, 0 0 40px #5500aa inset;
  background: #1a0033;
}
.boss-theme-void #boss-hp-trail { background: #aa00ff; }

.boss-theme-omni #boss-hp-bg {
  border: 2px solid transparent;
  background-clip: padding-box;
  animation: rainbowBorder 3s linear infinite;
  box-shadow: 0 0 20px rgba(255,255,255,0.2);
}
@keyframes rainbowBorder {
  0% { border-color: red; } 33% { border-color: lime; } 66% { border-color: blue; } 100% { border-color: red; }
}

.boss-theme-glitch #boss-hp-bg {
  animation: glitch-box 0.2s steps(2, start) infinite;
  border: 1px solid #00ffff;
  box-shadow: 4px 4px 0 #ff00ff;
}
@keyframes glitch-box {
  0% { clip-path: inset(10% 0 30% 0); transform: translate(2px, -2px); }
  50% { clip-path: inset(50% 0 10% 0); transform: translate(-2px, 2px); }
  100% { clip-path: inset(0 0 0 0); transform: translate(0, 0); }
}

.shop-info {
  color: #fff;
  margin-bottom: 10px;
  font-size: 14px;
  text-align: center;
}

/* Screens */
.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.85);
  z-index: 10;
  backdrop-filter: blur(4px);
}

.hidden {
  display: none !important;
}

.panel {
  background: rgba(20, 20, 25, 0.95);
  padding: 30px;
  border-radius: 8px;
  border: 1px solid #444;
  text-align: center;
  max-width: 700px;
  /* Tăng từ 600px lên 700px */
  max-height: 90vh;
  /* Giới hạn chiều cao tránh lố màn hình */
  overflow-y: auto;
  /* Thêm thanh cuộn dọc nếu có quá nhiều item */
}

h2.title-main {
  font-size: 32px;
  margin-bottom: 10px;
  text-transform: uppercase;
}

h2.text-red {
  color: #ff4444;
}

h2.text-cyan {
  color: #00ffcc;
}

h2.text-gold {
  color: #ffd700;
}

p.desc {
  margin-bottom: 25px;
  color: #ccc;
  font-size: 15px;
  line-height: 1.5;
}

/* Cards */
.card-container {
  display: flex;
  flex-wrap: wrap;
  /* Rất quan trọng: cho phép rớt dòng khi không đủ chỗ */
  gap: 15px;
  justify-content: center;
  margin-bottom: 20px;
}

.card {
  background: #222;
  border: 2px solid #555;
  border-radius: 8px;
  padding: 15px 10px;
  width: 140px;
  /* Giảm từ 160px để hiển thị đẹp hơn */
  cursor: pointer;
  transition: 0.2s;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  /* Đẩy các nút MUA xuống đều nhau */
}

.card:hover {
  border-color: #00ffcc;
  transform: translateY(-5px);
  background: #2a2a30;
}

.card h3 {
  color: #fff;
  font-size: 16px;
  margin-bottom: 10px;
}

.card p {
  color: #aaa;
  font-size: 13px;
  margin-bottom: 10px;
}

.card.gold:hover {
  border-color: #ffd700;
}

button {
  padding: 12px 24px;
  font-size: 16px;
  font-weight: bold;
  color: #0a0a0c;
  background: #00ffcc;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: 0.2s;
  text-transform: uppercase;
  margin: 5px;
  pointer-events: auto;
}

button:hover:not(:disabled) {
  background: #00e6b8;
  transform: scale(1.05);
}

button:active:not(:disabled) {
  transform: scale(0.95);
}

button:disabled {
  background: #555;
  color: #aaa;
  cursor: not-allowed;
  transform: none;
}

/* ===============================
   NEW MAIN MENU STYLES
   =============================== */
.main-menu-panel {
  max-width: 600px;
  background: rgba(10, 10, 15, 0.95);
  border: 1px solid rgba(0, 255, 204, 0.3);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 255, 204, 0.1) inset;
  backdrop-filter: blur(10px);
}

.menu-header {
  margin-bottom: 30px;
}

.glitch-text {
  position: relative;
  display: inline-block;
  font-size: 36px;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 0 15px rgba(0, 255, 204, 0.8);
}

.menu-btn-group {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.menu-btn-row {
  display: flex;
  gap: 15px;
  margin-top: 5px;
}

.menu-btn-epic {
  position: relative;
  width: 100%;
  padding: 15px 20px;
  background: linear-gradient(135deg, rgba(0, 255, 204, 0.1) 0%, rgba(0, 170, 255, 0.1) 100%);
  border: 1px solid rgba(0, 255, 204, 0.4);
  border-radius: 8px;
  color: #fff;
  text-transform: none;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.menu-btn-epic::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 50%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  transition: left 0.5s ease;
  transform: skewX(-20deg);
}

.menu-btn-epic:hover {
  transform: translateY(-3px) scale(1.02);
  background: linear-gradient(135deg, rgba(0, 255, 204, 0.2) 0%, rgba(0, 170, 255, 0.3) 100%);
  border-color: #00ffcc;
  box-shadow: 0 10px 25px rgba(0, 255, 204, 0.4), 0 0 15px rgba(0, 255, 204, 0.5) inset;
}

.menu-btn-epic:hover::before {
  left: 150%;
}

.menu-btn-epic .btn-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-left: 10px;
}

.menu-btn-epic .btn-icon {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 32px;
  opacity: 0.7;
  transition: 0.3s ease;
}

.menu-btn-epic:hover .btn-icon {
  transform: translateY(-50%) rotate(10deg) scale(1.2);
  opacity: 1;
}

.menu-btn-epic .btn-text {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #00ffcc;
  margin-bottom: 4px;
}

.menu-btn-epic .btn-subtext {
  font-size: 13px;
  color: #aaa;
  font-weight: 500;
}

.menu-btn-epic.btn-danger {
  background: linear-gradient(135deg, rgba(255, 68, 68, 0.1) 0%, rgba(255, 0, 85, 0.1) 100%);
  border-color: rgba(255, 68, 68, 0.4);
}

.menu-btn-epic.btn-danger .btn-text {
  color: #ff4444;
}

.menu-btn-epic.btn-danger:hover {
  background: linear-gradient(135deg, rgba(255, 68, 68, 0.2) 0%, rgba(255, 0, 85, 0.3) 100%);
  border-color: #ff4444;
  box-shadow: 0 10px 25px rgba(255, 68, 68, 0.4), 0 0 15px rgba(255, 68, 68, 0.5) inset;
}

.menu-btn-utility {
  flex: 1;
  background: rgba(30, 30, 40, 0.8);
  border: 1px solid #444;
  color: #fff;
  padding: 12px;
  font-size: 15px;
  font-weight: 700;
  border-radius: 6px;
  margin: 0;
}

.menu-btn-utility:hover {
  background: rgba(40, 40, 55, 0.9);
  border-color: #00aaff;
  color: #00aaff;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 170, 255, 0.3);
}

.menu-btn-logout {
  background: transparent;
  border: 1px solid #ff4444;
  color: #ff4444;
  padding: 8px 20px;
  font-size: 13px;
  margin-top: 25px;
  border-radius: 4px;
  transition: 0.2s;
  width: auto;
}

.menu-btn-logout:hover {
  background: rgba(255, 68, 68, 0.15);
  color: #ff6666;
  border-color: #ff6666;
  box-shadow: 0 0 10px rgba(255, 68, 68, 0.3);
}

.btn-restart {
  background: transparent;
  border: 2px solid #00ffcc;
  justify-content: center;
  margin-top: 15px;
  padding: 12px;
  font-size: 18px;
  font-weight: 900;
  color: #00ffcc;
}

/* ===============================
   END MAIN MENU STYLES
   =============================== */

.auth-input {
  width: 100%;
  padding: 12px 15px;
  margin-bottom: 15px;
  background: #1a1a24;
  border: 1px solid #444;
  border-radius: 4px;
  color: #fff;
  font-size: 16px;
  font-family: inherit;
  transition: 0.3s;
}

.auth-input:focus {
  outline: none;
  border-color: #00ffcc;
  box-shadow: 0 0 8px rgba(0, 255, 204, 0.3);
}

.auth-input::placeholder {
  color: #666;
}

.char-skills {
  font-size: 11px;
  color: #bbb;
  margin: 10px 0;
  text-align: left;
  background: rgba(0, 0, 0, 0.4);
  padding: 8px;
  border-radius: 4px;
  line-height: 1.4;
  height: 80px;
  overflow-y: auto;
}

.char-skills b {
  color: #00ffcc;
}

.stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
  background: #1a1a24;
  padding: 12px 15px;
  border-radius: 8px;
  border: 1px solid #333;
}

.stat-info {
  width: 90px;
  font-weight: bold;
  color: #fff;
  font-size: 14px;
}

.stat-info span {
  display: block;
  font-size: 11px;
  color: #888;
  font-weight: normal;
  margin-top: 3px;
}

.stat-bar-container {
  flex-grow: 1;
  height: 16px;
  background: #0d0d11;
  border: 1px solid #444;
  border-radius: 4px;
  margin: 0 15px;
  display: flex;
  overflow: hidden;
}

.stat-bar-segment {
  flex: 1;
  border-right: 1px solid #222;
  transition: 0.3s;
}

.stat-bar-segment:last-child {
  border-right: none;
}

.stat-bar-segment.filled {
  background: linear-gradient(90deg, #00ffcc, #00aaff);
  box-shadow: 0 0 5px rgba(0, 255, 204, 0.5);
}

.btn-stat-upg {
  width: 110px;
  padding: 8px 10px;
  font-size: 12px;
  margin: 0;
}

#skill-bar {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 15px;
  z-index: 5;
  pointer-events: none;
}

#skills-ui {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 15px;
}

.skill-slot {
  position: relative;
  width: 50px;
  height: 50px;
  background: #1a1a24;
  border: 2px solid #444;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
}

.skill-slot.ready {
  border-color: #00ffcc;
  box-shadow: 0 0 10px rgba(0, 255, 204, 0.4);
}

.skill-slot.active {
  border-color: #ff00ff;
  box-shadow: 0 0 15px rgba(255, 0, 255, 0.6);
}

.skill-key {
  font-size: 20px;
  font-weight: bold;
  color: #fff;
  z-index: 2;
}

.skill-cd-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 0%;
  /* Sẽ được JS điều khiển từ 0 đến 100% */
  background: rgba(0, 0, 0, 0.75);
  z-index: 1;
}

.skill-cd-text {
  position: absolute;
  font-size: 16px;
  font-weight: bold;
  color: #ff4444;
  z-index: 3;
  text-shadow: 1px 1px 2px #000;
}

.upgrade-count-text {
  font-size: 14px;
  margin-top: 6px;
  opacity: 0.8;
}

.upgrade-progress-bar {
  width: 100%;
  height: 6px;
  background: #333;
  border-radius: 4px;
  margin-top: 4px;
  overflow: hidden;
}

.upgrade-progress-fill {
  height: 100%;
  background: #00ffcc;
  transition: width 0.2s;
}

/* 🔥 EVOLVE FLASH */
.evolve-flash {
  animation: flash 0.3s ease;
}

@keyframes flash {
  0% {
    transform: scale(1);
    background: white;
  }

  50% {
    transform: scale(1.1);
    background: #00ffcc;
  }

  100% {
    transform: scale(1);
  }
}

/* 🔥 EVOLVED CARD */
.evolved-card {
  border: 2px solid gold;
  box-shadow: 0 0 20px gold;
}

/* TEXT */
.evolved-text {
  color: gold;
  font-weight: bold;
  margin-top: 5px;
}

.phase-transition {
  animation: bossFlash 0.3s ease;
}

@keyframes bossFlash {
  0% {
    filter: brightness(1);
  }

  50% {
    filter: brightness(2);
  }

  100% {
    filter: brightness(1);
  }
}

/* ========================================
   SPINNER / ROULETTE
   ======================================== */

#spinner-viewport {
  position: relative;
  width: 600px;
  height: 100px;
  margin: 20px auto;
  overflow: hidden;
  border: 2px solid #444;
  border-radius: 10px;
  background: #0d0d11;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.8);
}

#spinner-pointer {
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 104px;
  background: linear-gradient(180deg, #ff0055, #ff4444);
  z-index: 10;
  box-shadow: 0 0 10px #ff0055, 0 0 20px rgba(255, 0, 85, 0.5);
}

#spinner-pointer::before {
  content: "▼";
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  color: #ff0055;
  font-size: 16px;
  text-shadow: 0 0 8px #ff0055;
}

#spinner-pointer::after {
  content: "▲";
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
  color: #ff0055;
  font-size: 16px;
  text-shadow: 0 0 8px #ff0055;
}

#spinner-strip {
  display: flex;
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  will-change: transform;
}

.spinner-item {
  width: 120px;
  min-width: 120px;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-right: 1px solid #333;
  padding: 5px;
  transition: background 0.3s;
}

.spinner-item-common {
  background: rgba(74, 222, 128, 0.08);
  border-bottom: 3px solid #22c55e;
}

.spinner-item-rare {
  background: rgba(96, 165, 250, 0.08);
  border-bottom: 3px solid #3b82f6;
}

.spinner-item-legendary {
  background: rgba(192, 132, 252, 0.08);
  border-bottom: 3px solid #a855f7;
}

.spinner-item-name {
  font-size: 14px;
  font-weight: bold;
  color: #fff;
  text-align: center;
  margin-bottom: 4px;
}

.spinner-item-rarity {
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
}

.spinner-winner {
  animation: winnerFlash 0.5s ease 3;
  box-shadow: inset 0 0 30px rgba(255, 215, 0, 0.4);
}

@keyframes winnerFlash {
  0% {
    background: rgba(255, 215, 0, 0.1);
  }

  50% {
    background: rgba(255, 215, 0, 0.4);
  }

  100% {
    background: rgba(255, 215, 0, 0.1);
  }
}

.spinner-result {
  min-height: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: 15px;
}

/* ========================================
   SCROLL CARDS IN SHOP
   ======================================== */

.scroll-card {
  position: relative;
  overflow: hidden;
}

.scroll-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.scroll-common::before {
  background: linear-gradient(90deg, transparent, #4ade80, transparent);
}

.scroll-rare::before {
  background: linear-gradient(90deg, transparent, #60a5fa, transparent);
}

.scroll-legendary::before {
  background: linear-gradient(90deg, transparent, #c084fc, transparent);
}

.scroll-common {
  border-color: #22c55e44;
}

.scroll-common:hover {
  border-color: #22c55e;
  box-shadow: 0 0 15px rgba(34, 197, 94, 0.3);
}

.scroll-rare {
  border-color: #3b82f644;
}

.scroll-rare:hover {
  border-color: #3b82f6;
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
}

.scroll-legendary {
  border-color: #a855f744;
  animation: legendaryPulse 2s ease-in-out infinite;
}

.scroll-legendary:hover {
  border-color: #a855f7;
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.4);
}

@keyframes legendaryPulse {

  0%,
  100% {
    box-shadow: 0 0 5px rgba(168, 85, 247, 0.2);
  }

  50% {
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.4);
  }
}

.scroll-icon {
  font-size: 28px;
  margin-bottom: 5px;
}

/* Gacha result colors (reused) */
.gacha-common {
  color: #4ade80;
  text-shadow: 0 0 10px rgba(74, 222, 128, 0.5);
}

.gacha-rare {
  color: #60a5fa;
  text-shadow: 0 0 15px rgba(96, 165, 250, 0.5);
}

/* Fragment Toast Notification */
.fragment-toast {
  position: absolute;
  top: 50px;
  right: 20px;
  background: rgba(0, 255, 204, 0.15);
  backdrop-filter: blur(10px);
  border: 2px solid #00ffcc;
  border-radius: 12px;
  padding: 15px 25px;
  z-index: 1000;
  display: flex;
  align-items: center;
  box-shadow: 0 0 20px rgba(0, 255, 204, 0.3);
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform: translateX(120%);
  pointer-events: none;
}

.fragment-toast.show {
  transform: translateX(0);
}

.fragment-toast-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

#fragment-toast-icon {
  font-size: 24px;
}

#fragment-toast-text {
  color: #fff;
  font-weight: bold;
  font-size: 16px;
  letter-spacing: 1px;
}

.gacha-legendary {
  color: #c084fc;
  text-shadow: 0 0 20px #a855f7, 0 0 40px #a855f7;
  animation: glowPulse 1s infinite alternate;
}

@keyframes glowPulse {
  from {
    text-shadow: 0 0 10px #a855f7;
  }

  to {
    text-shadow: 0 0 30px #ff00ff;
  }
}

/* ========================================
   MYTHICAL RARITY - RAINBOW HOLOGRAPHIC
   ======================================== */

@keyframes mythicalRainbow {
  0% {
    border-color: #ff0055;
    box-shadow: 0 0 15px #ff0055;
  }

  16% {
    border-color: #ff8800;
    box-shadow: 0 0 15px #ff8800;
  }

  33% {
    border-color: #ffdd00;
    box-shadow: 0 0 15px #ffdd00;
  }

  50% {
    border-color: #00ff88;
    box-shadow: 0 0 15px #00ff88;
  }

  66% {
    border-color: #0088ff;
    box-shadow: 0 0 15px #0088ff;
  }

  83% {
    border-color: #aa00ff;
    box-shadow: 0 0 15px #aa00ff;
  }

  100% {
    border-color: #ff0055;
    box-shadow: 0 0 15px #ff0055;
  }
}

@keyframes mythicalTextGlow {
  0% {
    color: #ff0055;
    text-shadow: 0 0 10px #ff0055;
  }

  16% {
    color: #ff8800;
    text-shadow: 0 0 10px #ff8800;
  }

  33% {
    color: #ffdd00;
    text-shadow: 0 0 10px #ffdd00;
  }

  50% {
    color: #00ff88;
    text-shadow: 0 0 10px #00ff88;
  }

  66% {
    color: #0088ff;
    text-shadow: 0 0 10px #0088ff;
  }

  83% {
    color: #aa00ff;
    text-shadow: 0 0 10px #aa00ff;
  }

  100% {
    color: #ff0055;
    text-shadow: 0 0 10px #ff0055;
  }
}

@keyframes mythicalShimmer {
  0% {
    background-position: -200% center;
  }

  100% {
    background-position: 200% center;
  }
}

.spinner-item-mythical {
  background: linear-gradient(135deg, rgba(255, 0, 85, 0.15), rgba(170, 0, 255, 0.15), rgba(0, 136, 255, 0.15));
  border-bottom: 3px solid;
  animation: mythicalRainbow 3s linear infinite;
}

.gacha-mythical {
  animation: mythicalTextGlow 2s linear infinite;
  font-weight: bold;
}

.scroll-mythical {
  animation: mythicalRainbow 3s linear infinite;
}

.scroll-mythical:hover {
  box-shadow: 0 0 25px rgba(255, 0, 85, 0.5), 0 0 25px rgba(0, 136, 255, 0.3);
}

.scroll-mythical::before {
  background: linear-gradient(90deg, #ff0055, #ff8800, #ffdd00, #00ff88, #0088ff, #aa00ff, #ff0055);
  background-size: 200% 100%;
  animation: mythicalShimmer 2s linear infinite;
}

.rarity-mythical {
  animation: mythicalTextGlow 2.5s linear infinite;
  font-weight: bold;
}

/* Boss Arena */
.boss-arena-card {
  background: #1a1a24;
  border: 2px solid #444;
  border-radius: 10px;
  padding: 15px;
  width: 140px;
  cursor: pointer;
  transition: all 0.3s;
  text-align: center;
}

.boss-arena-card:hover {
  border-color: #ff4444;
  transform: translateY(-5px);
  box-shadow: 0 5px 20px rgba(255, 68, 68, 0.3);
}

.boss-arena-icon {
  font-size: 36px;
  margin-bottom: 8px;
}

.boss-arena-name {
  font-size: 14px;
  font-weight: bold;
  color: #fff;
  margin-bottom: 5px;
}

.boss-arena-drop {
  font-size: 11px;
  color: #aaa;
}

.boss-arena-reward {
  font-size: 11px;
  color: #ffd700;
  margin-top: 5px;
}

/* ========================================
   BOSS FRAGMENT EXCHANGE
   ======================================== */

.fragment-section {
  width: 100%;
  margin-top: 20px;
  padding: 15px;
  background: rgba(255, 215, 0, 0.05);
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: 10px;
}

.fragment-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 10px;
}

.fragment-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  border-radius: 8px;
  min-width: 90px;
  transition: all 0.3s;
}

.fragment-owned {
  background: rgba(255, 215, 0, 0.15);
  border: 1px solid #ffd700;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.fragment-locked {
  background: rgba(100, 100, 100, 0.15);
  border: 1px solid #444;
  opacity: 0.5;
}

.fragment-icon {
  font-size: 24px;
}

.fragment-name {
  font-size: 11px;
  color: #ddd;
  font-weight: bold;
}

.fragment-check {
  font-size: 12px;
}
/* ===============================
   PREMIUM CARDS (MAP & BOSS)
   =============================== */

.premium-card-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  padding: 10px;
}

.premium-card {
  position: relative;
  width: 250px;
  padding: 20px 15px;
  background: rgba(15, 15, 20, 0.9) !important;
  border-radius: 12px;
  border: 2px solid var(--theme-color, #444);
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 0 15px rgba(0,0,0,0.8), inset 0 0 15px transparent;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.premium-card::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: conic-gradient(transparent, var(--theme-color, #fff), transparent 30%);
  animation: rotateAura 4s linear infinite;
  opacity: 0.2;
  z-index: 0;
  border-radius: 50%;
}

.premium-card::after {
  content: '';
  position: absolute;
  inset: 2px;
  background: inherit;
  border-radius: 10px;
  z-index: 0;
}

@keyframes rotateAura {
  100% { transform: rotate(360deg); }
}

.premium-card:hover {
  transform: translateY(-10px) scale(1.05);
  box-shadow: 0 15px 30px rgba(0,0,0,0.9), inset 0 0 25px var(--theme-color, transparent), 0 0 30px var(--theme-color, transparent);
}

.premium-card:hover::before {
  opacity: 0.8;
  animation-duration: 2s;
}

.premium-card > div {
  position: relative;
  z-index: 1;
}

.premium-card-icon {
  font-size: 48px;
  margin-bottom: 15px;
  filter: drop-shadow(0 0 10px var(--theme-color, #fff));
  transition: 0.3s;
}

.premium-card:hover .premium-card-icon {
  transform: scale(1.2);
}

.premium-card-title {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--theme-color, #fff);
  margin-bottom: 8px;
}

.premium-card-subtitle {
  font-size: 13px;
  color: #bbb;
  margin-bottom: 10px;
}

.premium-card-drop {
  margin-top: 10px;
  font-size: 14px;
  color: var(--theme-color, #fff);
  font-weight: bold;
  background: rgba(0,0,0,0.5);
  padding: 5px 10px;
  border-radius: 4px;
}

.premium-card-reward {
  margin-top: 10px;
  font-size: 14px;
  color: #ffd700;
}

.premium-card.locked {
  filter: grayscale(100%);
  opacity: 0.6;
  cursor: not-allowed;
  --theme-color: #555 !important;
}

.premium-card.locked:hover {
  transform: none;
  box-shadow: none;
}
.premium-card.locked::before {
  display: none;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #0d0d11;
  border-left: 1px solid #222;
}

::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #00ffcc;
}
