:root {
  --bg: #f4f8ff;
  --bg-2: #fff7fb;
  --card: rgba(255, 255, 255, 0.88);
  --card-solid: #ffffff;
  --text: #22314d;
  --muted: #687796;
  --primary: #6c63ff;
  --primary-dark: #4d45db;
  --accent: #22d3ee;
  --warm: #ffb86c;
  --success: #33c481;
  --danger: #ef5b74;
  --shadow: 0 24px 70px rgba(75, 92, 140, 0.18);
  --soft-shadow: 0 12px 30px rgba(75, 92, 140, 0.12);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(34, 211, 238, 0.28), transparent 34rem),
    radial-gradient(circle at top right, rgba(255, 184, 108, 0.28), transparent 32rem),
    linear-gradient(135deg, var(--bg), var(--bg-2));
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  background-image:
    radial-gradient(circle, rgba(108, 99, 255, 0.12) 1px, transparent 1px),
    radial-gradient(circle, rgba(34, 211, 238, 0.1) 1px, transparent 1px);
  background-position: 0 0, 22px 28px;
  background-size: 68px 68px, 86px 86px;
  animation: driftBackground 28s linear infinite;
}

button {
  font: inherit;
}

.background-orb {
  position: fixed;
  z-index: -2;
  width: 22rem;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(18px);
  opacity: 0.3;
  animation: floatOrb 12s ease-in-out infinite;
}

.orb-one {
  left: -8rem;
  top: 16rem;
  background: var(--accent);
}

.orb-two {
  right: -10rem;
  bottom: 6rem;
  background: var(--warm);
  animation-delay: -5s;
}

.page-shell {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 36px;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2.3rem, 6vw, 4.8rem);
  letter-spacing: -0.08em;
  line-height: 0.92;
}

h2 {
  font-size: 1.25rem;
  letter-spacing: -0.03em;
}

.eyebrow {
  color: var(--primary-dark);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.tagline {
  max-width: 680px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 1.02rem;
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(360px, 0.98fr);
  gap: 22px;
  align-items: start;
}

.panel {
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.play-card {
  position: sticky;
  top: 18px;
  display: grid;
  align-content: start;
  gap: 24px;
  min-height: 680px;
  padding: clamp(22px, 4vw, 34px);
  overflow: hidden;
}

.play-card::before {
  content: "";
  position: absolute;
  inset: auto -20% -36% -20%;
  height: 48%;
  background: radial-gradient(ellipse at center, rgba(108, 99, 255, 0.17), transparent 68%);
  pointer-events: none;
}

.energy-board {
  position: relative;
  text-align: center;
  z-index: 1;
}

.label,
.stat-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.energy-amount {
  margin-top: 4px;
  font-size: clamp(3rem, 10vw, 6.5rem);
  font-weight: 900;
  letter-spacing: -0.08em;
  line-height: 1;
  text-shadow: 0 10px 28px rgba(108, 99, 255, 0.18);
}

.rate-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.rate-row span,
.status-pill {
  border: 1px solid rgba(108, 99, 255, 0.12);
  border-radius: 999px;
  padding: 8px 13px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.66);
}

.rate-row strong,
.status-pill strong {
  color: var(--primary-dark);
}

.collector-wrap {
  display: grid;
  place-items: center;
  min-height: 320px;
  position: relative;
  z-index: 1;
}

.collector-button {
  display: grid;
  place-items: center;
  width: clamp(190px, 42vw, 290px);
  aspect-ratio: 1;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  position: relative;
  color: white;
  background:
    radial-gradient(circle at 35% 28%, #ffffff 0 5%, #b8f7ff 6% 14%, transparent 15%),
    radial-gradient(circle at center, #8af2ff 0 18%, #6c63ff 42%, #352f9b 74%);
  box-shadow:
    0 30px 70px rgba(108, 99, 255, 0.34),
    inset 0 -18px 40px rgba(36, 28, 128, 0.28),
    inset 0 16px 36px rgba(255, 255, 255, 0.48);
  transition: transform 150ms ease, filter 150ms ease, box-shadow 150ms ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.collector-button:hover {
  filter: brightness(1.05) saturate(1.07);
  transform: translateY(-2px) scale(1.015);
}

.collector-button:active,
.collector-button.pop {
  transform: translateY(2px) scale(0.94);
  box-shadow:
    0 18px 42px rgba(108, 99, 255, 0.3),
    inset 0 -12px 32px rgba(36, 28, 128, 0.32),
    inset 0 18px 40px rgba(255, 255, 255, 0.55);
}

.collector-button.pop .collector-ring {
  animation: ringPulse 360ms ease-out;
}

.collector-glow {
  position: absolute;
  inset: -22px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(34, 211, 238, 0), rgba(34, 211, 238, 0.45), rgba(255, 184, 108, 0.38), rgba(34, 211, 238, 0));
  filter: blur(12px);
  opacity: 0.82;
  animation: spin 8s linear infinite;
}

.collector-ring {
  position: absolute;
  inset: 10%;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  opacity: 0;
}

.collector-core {
  position: relative;
  z-index: 1;
  font-size: clamp(4rem, 13vw, 8rem);
  text-shadow: 0 0 28px rgba(255, 255, 255, 0.9);
  animation: breathe 2.6s ease-in-out infinite;
}

.float-layer,
.particle-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.float-text {
  position: absolute;
  left: 50%;
  top: 48%;
  color: var(--primary-dark);
  font-size: clamp(1rem, 2.8vw, 1.5rem);
  font-weight: 950;
  text-shadow: 0 2px 0 white, 0 10px 18px rgba(108, 99, 255, 0.22);
  animation: floatUp 1050ms cubic-bezier(0.18, 0.72, 0.28, 1) forwards;
}

.particle {
  position: absolute;
  width: var(--size);
  height: var(--size);
  left: var(--x);
  top: var(--y);
  border-radius: 50%;
  background: radial-gradient(circle, white 0 20%, var(--particle-color) 28% 100%);
  box-shadow: 0 0 18px var(--particle-color);
  animation: burst 620ms ease-out forwards;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  position: relative;
  z-index: 1;
}

.stat-card {
  border: 1px solid rgba(108, 99, 255, 0.1);
  border-radius: 18px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--soft-shadow);
}

.stat-card strong {
  display: block;
  margin-top: 7px;
  font-size: 1.22rem;
}

.full-stats {
  grid-template-columns: repeat(3, 1fr);
}

.side-stack {
  display: grid;
  gap: 18px;
}

.side-stack .panel {
  padding: 20px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.upgrades-list,
.achievements-list,
.quests-list,
.milestones-list {
  display: grid;
  gap: 12px;
}

.upgrade-card,
.achievement-card,
.quest-card,
.milestone-card {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(104, 119, 150, 0.14);
  border-radius: 18px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.72);
  transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.upgrade-card.affordable {
  border-color: rgba(51, 196, 129, 0.36);
}

.upgrade-card.expensive {
  opacity: 0.82;
}

.upgrade-card.purchased {
  animation: purchasedFlash 520ms ease-out;
}

.upgrade-top,
.achievement-card,
.quest-top,
.milestone-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.upgrade-name,
.achievement-name,
.quest-name,
.milestone-name {
  font-weight: 850;
}

.upgrade-description,
.achievement-description,
.quest-description,
.milestone-description,
.small-note {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.impact-line {
  color: var(--primary-dark);
  font-size: 0.88rem;
  font-weight: 850;
}

.level-pill {
  align-self: start;
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--primary-dark);
  background: rgba(108, 99, 255, 0.11);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.buy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cost {
  color: var(--text);
  font-weight: 850;
}

.buy-button,
.icon-button,
.danger-button,
.claim-button {
  border: 0;
  border-radius: 999px;
  padding: 11px 15px;
  cursor: pointer;
  font-weight: 850;
  transition: transform 140ms ease, box-shadow 140ms ease, opacity 140ms ease, filter 140ms ease;
}

.buy-button,
.icon-button,
.claim-button {
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 10px 22px rgba(108, 99, 255, 0.25);
}

.icon-button.secondary {
  color: var(--primary-dark);
  background: rgba(255, 255, 255, 0.78);
}

.buy-button:hover:not(:disabled),
.icon-button:hover,
.claim-button:hover:not(:disabled),
.danger-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

.buy-button:disabled,
.claim-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  box-shadow: none;
}

.claim-button {
  width: 100%;
  margin-top: 14px;
}

.danger-button {
  width: 100%;
  color: #8f2438;
  background: rgba(239, 91, 116, 0.12);
}

.compact-panel,
.daily-card {
  display: grid;
  gap: 10px;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(104, 119, 150, 0.14);
}

.progress-fill {
  display: block;
  height: 100%;
  width: var(--progress);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.quest-reward,
.milestone-bonus {
  color: var(--success);
  font-size: 0.86rem;
  font-weight: 850;
}

.milestone-card.unlocked {
  border-color: rgba(51, 196, 129, 0.36);
  background: rgba(235, 255, 246, 0.78);
}

.achievement-card.locked {
  opacity: 0.58;
}

.achievement-status {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: #c8d0e2;
  font-weight: 900;
}

.achievement-card.unlocked .achievement-status {
  background: linear-gradient(135deg, var(--success), var(--accent));
}

.toast-layer {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 10px;
  z-index: 10;
  pointer-events: none;
}

.toast {
  min-width: min(320px, calc(100vw - 36px));
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 18px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  animation: toastIn 240ms ease-out, toastOut 280ms ease-in 2.8s forwards;
}

.toast strong {
  display: block;
}

.toast span {
  color: var(--muted);
  font-size: 0.9rem;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(34, 49, 77, 0.34);
  backdrop-filter: blur(8px);
}

.modal-backdrop.hidden {
  display: none;
}

.modal-card {
  width: min(440px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 26px;
  padding: 26px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  animation: modalIn 220ms ease-out;
}

.modal-card h2 {
  margin-top: 6px;
  font-size: 1.8rem;
}

.modal-card p,
.modal-card li {
  color: var(--muted);
  line-height: 1.5;
}

.help-card ul {
  padding-left: 20px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

@keyframes floatUp {
  from {
    opacity: 0;
    transform: translate(-50%, 14px) scale(0.82);
  }
  12% { opacity: 1; }
  to {
    opacity: 0;
    transform: translate(calc(-50% + var(--drift)), -136px) scale(1.22);
  }
}

@keyframes burst {
  to {
    opacity: 0;
    transform: translate(var(--dx), var(--dy)) scale(0.25);
  }
}

@keyframes ringPulse {
  from { opacity: 0.8; transform: scale(0.72); }
  to { opacity: 0; transform: scale(1.5); }
}

@keyframes purchasedFlash {
  0% { transform: scale(1); }
  35% { transform: scale(1.015); border-color: rgba(51, 196, 129, 0.7); box-shadow: 0 14px 28px rgba(51, 196, 129, 0.18); }
  100% { transform: scale(1); }
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(18px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateY(12px) scale(0.98); }
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(18px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes driftBackground {
  to { background-position: 68px 68px, 108px 96px; }
}

@keyframes floatOrb {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(24px, -30px, 0) scale(1.08); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 920px) {
  .hero,
  .game-layout {
    grid-template-columns: 1fr;
  }

  .hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-actions {
    justify-content: flex-start;
  }

  .play-card {
    position: relative;
    top: auto;
    min-height: auto;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 20px, 1220px);
    padding-top: 16px;
  }

  .collector-wrap {
    min-height: 260px;
  }

  .stats-grid,
  .full-stats {
    grid-template-columns: 1fr 1fr;
  }

  .buy-row,
  .upgrade-top,
  .quest-top,
  .milestone-top {
    align-items: stretch;
    flex-direction: column;
  }

  .buy-button {
    width: 100%;
  }
}

@media (max-width: 430px) {
  .stats-grid,
  .full-stats {
    grid-template-columns: 1fr;
  }

  .side-stack .panel,
  .play-card {
    padding: 16px;
  }
}

/* Version 3 systems */
.compact-stats {
  grid-template-columns: repeat(3, 1fr);
}

.event-card,
.prestige-card {
  border-color: rgba(108, 99, 255, 0.18);
}

.event-summary {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
  border: 1px solid rgba(255, 184, 108, 0.24);
  border-radius: 18px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(255, 247, 251, 0.92), rgba(238, 251, 255, 0.78));
}

.event-summary strong {
  font-size: 1.05rem;
}

.event-summary span,
.achievement-summary {
  color: var(--muted);
  font-size: 0.9rem;
}

.event-tasks {
  margin-top: 12px;
}

.daily-task-card,
.event-task-card {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(104, 119, 150, 0.14);
  border-radius: 18px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.event-task-card {
  border-color: rgba(255, 184, 108, 0.36);
  background: rgba(255, 248, 238, 0.78);
}

.task-claim-button {
  justify-self: end;
}

.prestige-button {
  border: 0;
  border-radius: 999px;
  padding: 13px 18px;
  cursor: pointer;
  color: white;
  font-weight: 900;
  background: linear-gradient(135deg, #7c3aed, var(--primary), var(--accent));
  box-shadow: 0 14px 30px rgba(108, 99, 255, 0.28);
  transition: transform 140ms ease, box-shadow 140ms ease, opacity 140ms ease, filter 140ms ease;
}

.prestige-button:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.prestige-button:disabled {
  cursor: not-allowed;
  opacity: 0.54;
  box-shadow: none;
}

.prestige-progress {
  display: grid;
  gap: 8px;
}

.prestige-shop {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.prestige-shop-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(108, 99, 255, 0.16);
  border-radius: 18px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.collection-modal-card {
  width: min(840px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  overflow: auto;
}

.collection-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.collection-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 96px;
  border: 1px solid rgba(104, 119, 150, 0.14);
  border-radius: 20px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: var(--soft-shadow);
}

.collection-card.locked {
  opacity: 0.64;
  background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.66), rgba(255, 255, 255, 0.66) 10px, rgba(230, 235, 247, 0.54) 10px, rgba(230, 235, 247, 0.54) 20px);
}

.collection-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 18px;
  font-size: 1.65rem;
  background: linear-gradient(135deg, rgba(108, 99, 255, 0.14), rgba(34, 211, 238, 0.16));
}

.collection-card.locked .collection-icon {
  color: transparent;
  text-shadow: 0 0 0 rgba(104, 119, 150, 0.5);
  filter: grayscale(1);
}

.collection-name {
  font-weight: 900;
}

.rarity-common.unlocked {
  border-color: rgba(34, 211, 238, 0.26);
}

.rarity-rare.unlocked {
  border-color: rgba(108, 99, 255, 0.32);
}

.rarity-epic.unlocked {
  border-color: rgba(255, 184, 108, 0.54);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(255, 246, 232, 0.82));
}

.leaderboard-list {
  display: grid;
  gap: 10px;
}

.leaderboard-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(104, 119, 150, 0.14);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.72);
}

.leaderboard-row span {
  color: var(--muted);
  font-weight: 850;
}

.modal-actions {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.collector-button.prism-skin {
  background:
    radial-gradient(circle at 35% 28%, #ffffff 0 5%, #ffd6f6 6% 14%, transparent 15%),
    conic-gradient(from 45deg, #ff7ad9, #7c3aed, #22d3ee, #33c481, #ffb86c, #ff7ad9);
  box-shadow:
    0 30px 76px rgba(124, 58, 237, 0.36),
    inset 0 -18px 40px rgba(36, 28, 128, 0.24),
    inset 0 16px 36px rgba(255, 255, 255, 0.5);
}

@media (max-width: 760px) {
  .collection-grid {
    grid-template-columns: 1fr 1fr;
  }

  .prestige-shop-card,
  .leaderboard-row {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .prestige-shop-card .buy-button,
  .task-claim-button {
    width: 100%;
    justify-self: stretch;
  }
}

@media (max-width: 520px) {
  .collection-grid {
    grid-template-columns: 1fr;
  }
}

/* Version 4 polish, tabs, skins, daily challenge, event shop, sharing */
.tab-bar {
  position: sticky;
  top: 12px;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 22px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(10px);
}

.tab-button {
  border: 1px solid rgba(108, 99, 255, 0.16);
  border-radius: 999px;
  padding: 9px 12px;
  cursor: pointer;
  color: var(--muted);
  font-weight: 900;
  background: rgba(255, 255, 255, 0.74);
  transition: transform 140ms ease, background 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.tab-button:hover,
.tab-button.active {
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 10px 20px rgba(108, 99, 255, 0.22);
  transform: translateY(-1px);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: grid;
}

.compact-heading {
  margin-top: 18px;
}

.compact-heading h3 {
  margin: 0;
}

.daily-challenge-box,
.event-shop-box {
  margin-top: 14px;
  border-top: 1px dashed rgba(104, 119, 150, 0.22);
  padding-top: 8px;
}

.skins-grid,
.event-shop-list {
  display: grid;
  gap: 12px;
}

.skin-card,
.event-shop-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(104, 119, 150, 0.14);
  border-radius: 20px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: var(--soft-shadow);
}

.skin-card.locked {
  opacity: 0.62;
  filter: grayscale(0.6);
}

.skin-preview {
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  border-radius: 22px;
  color: #ffffff;
  font-size: 1.7rem;
  font-weight: 900;
  box-shadow: inset 0 -10px 22px rgba(0, 0, 0, 0.12), 0 12px 20px rgba(108, 99, 255, 0.16);
}

.rarity-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  margin-right: 4px;
  color: white;
  font-size: 0.72rem;
  font-weight: 950;
}

.rarity-common { background: rgba(34, 211, 238, 0.15); }
.rarity-rare { background: rgba(108, 99, 255, 0.15); }
.rarity-epic { background: rgba(255, 184, 108, 0.16); }
.rarity-legendary { background: rgba(255, 215, 88, 0.2); }
.rarity-badge.rarity-common { background: #22d3ee; }
.rarity-badge.rarity-rare { background: #6c63ff; }
.rarity-badge.rarity-epic { background: #c084fc; }
.rarity-badge.rarity-legendary { background: linear-gradient(135deg, #f59e0b, #facc15); }

.rarity-legendary.unlocked {
  border-color: rgba(245, 158, 11, 0.62);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(255, 248, 216, 0.88));
}

.collector-button.skin-default-core,
.skin-preview.skin-default-core {
  background: radial-gradient(circle at 35% 28%, #ffffff 0 8%, #9ff6ff 9% 18%, transparent 19%), linear-gradient(135deg, #6c63ff, #22d3ee);
}

.collector-button.skin-neon-orb,
.skin-preview.skin-neon-orb {
  background: radial-gradient(circle, #f0fdff 0 10%, #22d3ee 11% 34%, #111827 35% 100%);
  box-shadow: 0 0 34px rgba(34, 211, 238, 0.62), inset 0 0 28px rgba(255, 255, 255, 0.36);
}

.collector-button.skin-crystal-star,
.skin-preview.skin-crystal-star {
  background: conic-gradient(from 20deg, #e0f2fe, #a78bfa, #67e8f9, #ffffff, #e0f2fe);
}

.collector-button.skin-lucky-cat,
.skin-preview.skin-lucky-cat {
  background: radial-gradient(circle at 50% 28%, #fff7ed 0 24%, #fb7185 25% 42%, #f59e0b 43% 100%);
}

.collector-button.skin-space-gem,
.skin-preview.skin-space-gem {
  background: radial-gradient(circle at 30% 20%, #ffffff 0 6%, transparent 7%), linear-gradient(135deg, #111827, #4c1d95 52%, #22d3ee);
}

.collector-button.skin-golden-core,
.skin-preview.skin-golden-core {
  background: radial-gradient(circle at 35% 25%, #fffbe8 0 12%, #facc15 13% 38%, #f59e0b 39% 100%);
  box-shadow: 0 24px 70px rgba(245, 158, 11, 0.42), inset 0 16px 34px rgba(255, 255, 255, 0.45);
}

.glow-burst {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.9), rgba(51, 196, 129, 0.38) 42%, transparent 68%);
  animation: glowBurst 680ms ease-out forwards;
}

.celebration {
  position: absolute;
  left: 50%;
  top: 50%;
  pointer-events: none;
  color: #f59e0b;
  font-size: 1.15rem;
  font-weight: 900;
  text-shadow: 0 2px 10px rgba(255, 255, 255, 0.86);
  animation: celebratePop 850ms ease-out forwards;
}

.toast {
  border-color: rgba(108, 99, 255, 0.22);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.97), rgba(239, 253, 255, 0.94));
}

.share-fallback {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 12;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100vw - 36px));
  border: 1px solid rgba(108, 99, 255, 0.22);
  border-radius: 18px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.share-fallback.hidden {
  display: none;
}

.share-fallback textarea {
  min-height: 72px;
  resize: vertical;
  border: 1px solid rgba(104, 119, 150, 0.18);
  border-radius: 12px;
  padding: 10px;
  font: inherit;
}

@keyframes glowBurst {
  from { opacity: 0.85; transform: translate(-50%, -50%) scale(0.35); }
  to { opacity: 0; transform: translate(-50%, -50%) scale(1.55); }
}

@keyframes celebratePop {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.45); }
  18% { opacity: 1; }
  to { opacity: 0; transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) rotate(32deg) scale(1.28); }
}

@media (max-width: 760px) {
  .tab-bar {
    position: relative;
    top: auto;
  }

  .skin-card,
  .event-shop-card {
    grid-template-columns: 1fr;
  }

  .skin-card .buy-button,
  .event-shop-card .buy-button {
    width: 100%;
  }
}

/* Version 5 final polish: premium Neon Crystal Energy Core */
:root {
  --orb-a: #5ee7ff;
  --orb-b: #6c63ff;
  --orb-c: #b86cff;
  --orb-core: #effdff;
  --orb-warm: #ffcf6b;
}

.hero {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 30px;
  padding: clamp(18px, 3vw, 26px);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.84), rgba(238, 251, 255, 0.66)),
    radial-gradient(circle at 18% 12%, rgba(34, 211, 238, 0.2), transparent 28rem);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  right: -110px;
  top: -130px;
  width: 320px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(from 20deg, rgba(34, 211, 238, 0.18), rgba(108, 99, 255, 0.18), rgba(255, 184, 108, 0.18), rgba(34, 211, 238, 0.18));
  filter: blur(2px);
  pointer-events: none;
}

h1 {
  background: linear-gradient(135deg, #22314d, #4d45db 54%, #0ea5b9);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.panel {
  border-color: rgba(255, 255, 255, 0.88);
  box-shadow: 0 28px 80px rgba(75, 92, 140, 0.2), 0 1px 0 rgba(255, 255, 255, 0.72) inset;
}

.play-card {
  background:
    radial-gradient(circle at 50% 46%, rgba(34, 211, 238, 0.14), transparent 18rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 251, 255, 0.86));
}

.stat-card,
.upgrade-card,
.achievement-card,
.quest-card,
.milestone-card,
.daily-task-card,
.event-task-card,
.skin-card,
.event-shop-card,
.collection-card,
.prestige-shop-card,
.leaderboard-row {
  box-shadow: 0 14px 36px rgba(75, 92, 140, 0.11), inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.core-stage-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: -8px;
  position: relative;
  z-index: 3;
}

.core-stage-label,
.core-status-label {
  border: 1px solid rgba(108, 99, 255, 0.16);
  border-radius: 999px;
  padding: 7px 12px;
  color: var(--primary-dark);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--soft-shadow);
  font-size: 0.82rem;
  font-weight: 900;
}

.core-status-label {
  color: #0f8aa0;
}

.core-helper {
  max-width: 34rem;
  margin-top: -10px;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
  position: relative;
  z-index: 2;
}

.collector-button {
  width: clamp(220px, 43vw, 320px);
  overflow: visible;
  isolation: isolate;
  background:
    radial-gradient(circle at 35% 24%, rgba(255, 255, 255, 0.96) 0 5%, rgba(255, 255, 255, 0.38) 6% 13%, transparent 14%),
    radial-gradient(circle at 50% 48%, var(--orb-core) 0 10%, var(--orb-a) 11% 28%, var(--orb-b) 45%, #24206f 72%, #11184b 100%);
  box-shadow:
    0 0 34px rgba(34, 211, 238, 0.4),
    0 34px 90px rgba(108, 99, 255, 0.4),
    inset 0 -26px 44px rgba(17, 24, 75, 0.34),
    inset 0 18px 40px rgba(255, 255, 255, 0.62),
    inset 0 0 0 1px rgba(255, 255, 255, 0.48);
  animation: coreBreathe 3.2s ease-in-out infinite;
}

.collector-button::before,
.collector-button::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.collector-button::before {
  inset: -20%;
  z-index: -2;
  background: radial-gradient(circle, rgba(94, 231, 255, 0.46), transparent 64%);
  filter: blur(18px);
  opacity: 0.7;
  animation: haloBreathe 3.8s ease-in-out infinite;
}

.collector-button::after {
  inset: -5%;
  z-index: 3;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: radial-gradient(circle at 34% 24%, rgba(255, 255, 255, 0.34), transparent 18%, transparent 100%);
  mix-blend-mode: screen;
}

.collector-aura,
.collector-glow,
.collector-orbit,
.collector-ripple,
.collector-shell,
.collector-swirl,
.collector-particles,
.collector-highlight {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
}

.collector-aura {
  inset: -21%;
  z-index: -1;
  background: conic-gradient(from 0deg, transparent, rgba(94, 231, 255, 0.52), transparent 34%, rgba(184, 108, 255, 0.42), transparent 72%, rgba(255, 207, 107, 0.34), transparent);
  filter: blur(16px);
  opacity: 0.8;
  animation: spin 10s linear infinite;
}

.collector-glow {
  inset: 7%;
  z-index: 1;
  background:
    repeating-conic-gradient(from 12deg, rgba(255, 255, 255, 0.32) 0 4deg, transparent 4deg 22deg),
    radial-gradient(circle, transparent 50%, rgba(255, 255, 255, 0.22) 51% 53%, transparent 54%);
  mask: radial-gradient(circle, transparent 42%, #000 43% 62%, transparent 63%);
  opacity: 0.28;
  animation: spin 18s linear infinite reverse;
}

.collector-shell {
  inset: 10%;
  z-index: 2;
  border: 1px solid rgba(255, 255, 255, 0.46);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.28), transparent 32%, rgba(255, 255, 255, 0.14) 52%, transparent 74%),
    radial-gradient(circle at center, transparent 38%, rgba(255, 255, 255, 0.24) 39% 41%, transparent 42% 100%);
  box-shadow: inset 0 0 30px rgba(255, 255, 255, 0.22);
}

.collector-swirl {
  inset: 24%;
  z-index: 4;
  background: conic-gradient(from 0deg, transparent, rgba(255, 255, 255, 0.74), var(--orb-a), transparent 44%, var(--orb-c), transparent 72%);
  mask: radial-gradient(circle, transparent 0 38%, #000 42% 58%, transparent 62%);
  opacity: 0.42;
  animation: spin 6s linear infinite;
}

.collector-orbit {
  z-index: 5;
  border: 2px solid rgba(255, 255, 255, 0.36);
  opacity: 0;
}

.orbit-one {
  inset: -4%;
  transform: rotateX(64deg) rotateZ(18deg);
  box-shadow: 0 0 26px rgba(94, 231, 255, 0.55);
  animation: orbitWobble 7s ease-in-out infinite;
}

.orbit-two {
  inset: 13%;
  border-style: dashed;
  transform: rotateX(62deg) rotateZ(-42deg);
  animation: orbitWobble 8.5s ease-in-out infinite reverse;
}

.collector-highlight {
  inset: 12% 18% 52% 22%;
  z-index: 7;
  border-radius: 50% 50% 46% 46%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.22) 42%, transparent 72%);
  filter: blur(1px);
  opacity: 0.72;
  transform: rotate(-18deg);
}

.collector-core {
  z-index: 8;
  display: grid;
  width: 38%;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  font-size: clamp(2.8rem, 8vw, 5.8rem);
  background:
    radial-gradient(circle at 40% 34%, #ffffff, var(--orb-core) 22%, var(--orb-a) 54%, transparent 72%);
  box-shadow:
    0 0 24px rgba(255, 255, 255, 0.82),
    0 0 44px rgba(94, 231, 255, 0.62),
    inset 0 -8px 18px rgba(50, 45, 160, 0.18);
  text-shadow: 0 0 22px #ffffff, 0 0 30px var(--orb-a);
  animation: innerCorePulse 2.4s ease-in-out infinite;
}

.collector-particles {
  z-index: 6;
  opacity: 0.48;
}

.collector-particles i {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 12px var(--orb-a), 0 0 22px var(--orb-b);
  animation: internalFloat 4.5s ease-in-out infinite;
}

.collector-particles i:nth-child(1) { left: 30%; top: 34%; animation-delay: -0.2s; }
.collector-particles i:nth-child(2) { left: 62%; top: 28%; animation-delay: -1.1s; }
.collector-particles i:nth-child(3) { left: 70%; top: 56%; animation-delay: -2.2s; }
.collector-particles i:nth-child(4) { left: 36%; top: 68%; animation-delay: -3.1s; }
.collector-particles i:nth-child(5) { left: 48%; top: 22%; animation-delay: -1.8s; }
.collector-particles i:nth-child(6) { left: 22%; top: 52%; animation-delay: -2.7s; }

.collector-button.stage-1 { --stage-glow: 1; }
.collector-button.stage-2 { --stage-glow: 2; }
.collector-button.stage-3 { --stage-glow: 3; }
.collector-button.stage-4 { --stage-glow: 4; }
.collector-button.stage-5 { --stage-glow: 5; }
.collector-button.stage-2::before { opacity: 0.78; }
.collector-button.stage-3::before { opacity: 0.86; }
.collector-button.stage-4::before,
.collector-button.stage-5::before { opacity: 0.95; }
.collector-button.stage-3 .collector-glow,
.collector-button.stage-3 .collector-swirl { opacity: 0.38; }
.collector-button.stage-4 .collector-glow,
.collector-button.stage-5 .collector-glow,
.collector-button.stage-4 .collector-swirl,
.collector-button.stage-5 .collector-swirl { opacity: 0.54; }
.collector-button.stage-4 .collector-particles,
.collector-button.stage-5 .collector-particles { opacity: 0.84; }
.collector-button.stage-3 .orbit-one,
.collector-button.stage-4 .orbit-one,
.collector-button.stage-5 .orbit-one { opacity: 0.48; }
.collector-button.stage-4 .orbit-two,
.collector-button.stage-5 .orbit-two { opacity: 0.38; }
.collector-button.stage-5 .collector-aura { filter: blur(12px); opacity: 1; }

.collector-button.prestige-ready .orbit-one {
  border-color: rgba(250, 204, 21, 0.78);
  box-shadow: 0 0 28px rgba(245, 158, 11, 0.54);
  opacity: 0.75;
}

.collector-button.boost-active .collector-aura {
  animation-duration: 3.8s;
  opacity: 1;
}

.collector-button.celebrating .collector-particles i,
.collector-button.special-flash .collector-core {
  animation-duration: 0.8s;
}

.collector-button.pop {
  animation: coreClickBounce 240ms cubic-bezier(0.16, 0.9, 0.28, 1.35), coreBreathe 3.2s ease-in-out infinite 240ms;
  filter: brightness(1.12) saturate(1.16);
}

.collector-button.pop .collector-ripple {
  z-index: 9;
  border: 2px solid rgba(184, 247, 255, 0.92);
  animation: premiumRipple 520ms ease-out;
}

.collector-button.special-flash .collector-ripple {
  border-color: #ffdf78;
  box-shadow: 0 0 34px rgba(250, 204, 21, 0.72);
}

.collector-button.special-flash::before {
  background: radial-gradient(circle, rgba(255, 216, 112, 0.68), transparent 66%);
}

.float-text.lucky-float {
  color: #a16207;
  text-shadow: 0 2px 0 white, 0 0 24px rgba(250, 204, 21, 0.72);
}

.particle.ring-shard {
  border-radius: 999px;
}

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

.skin-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 0 0, rgba(255, 255, 255, 0.58), transparent 42%);
  pointer-events: none;
}

.skin-card.unlocked:hover {
  transform: translateY(-2px);
  border-color: rgba(108, 99, 255, 0.26);
}

.skin-card.locked {
  opacity: 1;
  filter: none;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.76), rgba(239, 246, 255, 0.72)),
    repeating-linear-gradient(135deg, rgba(108, 99, 255, 0.06) 0 8px, transparent 8px 16px);
}

.skin-card.locked .skin-preview {
  filter: saturate(0.82);
  opacity: 0.82;
}

.skin-preview {
  position: relative;
  overflow: hidden;
  border-radius: 50%;
}

.skin-preview::before,
.skin-preview::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.skin-preview::before {
  inset: 12%;
  border: 1px solid rgba(255, 255, 255, 0.58);
}

.skin-preview::after {
  left: 22%;
  top: 16%;
  width: 30%;
  height: 18%;
  background: rgba(255, 255, 255, 0.75);
  filter: blur(1px);
}

.skin-preview span {
  position: relative;
  z-index: 2;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.9);
}

.collector-button.skin-default-core,
.skin-preview.skin-default-core { --orb-a: #5ee7ff; --orb-b: #6c63ff; --orb-c: #9b8cff; --orb-core: #effdff; --orb-warm: #8eeaff; }
.collector-button.skin-neon-orb,
.skin-preview.skin-neon-orb { --orb-a: #22d3ee; --orb-b: #7c3aed; --orb-c: #f472b6; --orb-core: #f0fdff; --orb-warm: #c084fc; }
.collector-button.skin-crystal-star,
.skin-preview.skin-crystal-star { --orb-a: #a7f3ff; --orb-b: #a78bfa; --orb-c: #ffffff; --orb-core: #ffffff; --orb-warm: #d8b4fe; }
.collector-button.skin-lucky-cat,
.skin-preview.skin-lucky-cat { --orb-a: #fb7185; --orb-b: #f59e0b; --orb-c: #f9a8d4; --orb-core: #fff7ed; --orb-warm: #facc15; }
.collector-button.skin-space-gem,
.skin-preview.skin-space-gem { --orb-a: #38bdf8; --orb-b: #312e81; --orb-c: #9333ea; --orb-core: #e0f2fe; --orb-warm: #818cf8; }
.collector-button.skin-golden-core,
.skin-preview.skin-golden-core { --orb-a: #facc15; --orb-b: #f59e0b; --orb-c: #fff7ad; --orb-core: #fffbe8; --orb-warm: #fb923c; }

.collector-button.skin-default-core,
.collector-button.skin-neon-orb,
.collector-button.skin-crystal-star,
.collector-button.skin-lucky-cat,
.collector-button.skin-space-gem,
.collector-button.skin-golden-core {
  background:
    radial-gradient(circle at 35% 24%, rgba(255, 255, 255, 0.96) 0 5%, rgba(255, 255, 255, 0.38) 6% 13%, transparent 14%),
    radial-gradient(circle at 50% 48%, var(--orb-core) 0 10%, var(--orb-a) 11% 28%, var(--orb-b) 45%, var(--orb-b) 72%, #11184b 100%);
}

.skin-preview.skin-default-core,
.skin-preview.skin-neon-orb,
.skin-preview.skin-crystal-star,
.skin-preview.skin-lucky-cat,
.skin-preview.skin-space-gem,
.skin-preview.skin-golden-core {
  background:
    radial-gradient(circle at 34% 24%, rgba(255, 255, 255, 0.96) 0 10%, transparent 11%),
    radial-gradient(circle, var(--orb-core) 0 16%, var(--orb-a) 17% 36%, var(--orb-b) 58%, var(--orb-c) 100%);
  box-shadow: 0 0 28px rgba(94, 231, 255, 0.42), inset 0 12px 22px rgba(255, 255, 255, 0.34), inset 0 -14px 22px rgba(17, 24, 75, 0.18);
}

@keyframes coreBreathe {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-2px) scale(1.025); }
}

@keyframes haloBreathe {
  0%, 100% { opacity: 0.55; transform: scale(0.98); }
  50% { opacity: 0.95; transform: scale(1.06); }
}

@keyframes innerCorePulse {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.08); filter: brightness(1.14); }
}

@keyframes internalFloat {
  0%, 100% { transform: translate3d(0, 0, 0) scale(0.9); opacity: 0.54; }
  50% { transform: translate3d(10px, -16px, 0) scale(1.2); opacity: 1; }
}

@keyframes orbitWobble {
  0%, 100% { rotate: 0deg; }
  50% { rotate: 12deg; }
}

@keyframes coreClickBounce {
  0% { transform: scale(1); }
  42% { transform: translateY(3px) scale(0.9); }
  72% { transform: translateY(-3px) scale(1.06); }
  100% { transform: translateY(0) scale(1); }
}

@keyframes premiumRipple {
  from { opacity: 0.9; transform: scale(0.58); }
  to { opacity: 0; transform: scale(1.42); }
}

@media (max-width: 640px) {
  .collector-button {
    width: clamp(205px, 72vw, 270px);
  }

  .core-helper {
    font-size: 0.84rem;
  }

  .hero-actions {
    width: 100%;
  }

  .hero-actions .icon-button {
    flex: 1 1 145px;
  }
}

.collector-button.reward-ready .collector-particles i {
  background: #fff7ad;
  box-shadow: 0 0 12px #facc15, 0 0 22px rgba(34, 211, 238, 0.75);
}

.collector-button.reward-ready .orbit-two {
  border-color: rgba(250, 204, 21, 0.42);
  opacity: 0.46;
}
