* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", Arial, sans-serif;
  background: #18263d;
}

.game {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background: #18263d;
}

.scene-decor {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.game-purpose {
  position: absolute;
  top: 24px;
  left: 24px;
  max-width: 380px;
  padding: 18px 20px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.1));
  box-shadow: 0 20px 36px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(6px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.game-purpose.hidden {
  opacity: 0;
  transform: translateY(-12px);
  pointer-events: none;
}

.game-purpose-title {
  margin: 0 0 8px;
  font-size: 28px;
  color: #f8fafc;
}

.game-purpose-text {
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
  color: rgba(248, 250, 252, 0.95);
}

.tutorial-box {
  position: absolute;
  top: 150px;
  left: 24px;
  max-width: 380px;
  padding: 16px 18px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(6px);
}

.tutorial-title {
  margin: 0 0 10px;
  font-size: 22px;
  color: #f8fafc;
}

.tutorial-step {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.35;
  color: rgba(248, 250, 252, 0.95);
  background: rgba(15, 23, 42, 0.38);
}

.tutorial-step.done {
  background: rgba(34, 197, 94, 0.35);
}

.tutorial-box.hidden {
  display: none;
}

.decor {
  position: absolute;
}

.decor-cloud {
  width: 180px;
  height: 58px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.22));
  box-shadow: inset 0 -10px 14px rgba(148, 163, 184, 0.2), 0 10px 24px rgba(15, 23, 42, 0.08);
  filter: blur(0.4px);
  animation: cloud-drift 18s ease-in-out infinite alternate;
}

.decor-cloud::before,
.decor-cloud::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.28));
}

.decor-cloud::before {
  width: 64px;
  height: 64px;
  left: 24px;
  top: -22px;
}

.decor-cloud::after {
  width: 76px;
  height: 76px;
  right: 26px;
  top: -28px;
}

.decor-cloud-1 {
  top: 10%;
  left: 8%;
}

.decor-cloud-2 {
  top: 18%;
  right: 10%;
  transform: scale(0.9);
  animation-duration: 23s;
}

.decor-hill {
  bottom: -40px;
  width: 420px;
  height: 160px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.decor-hill-1 {
  left: -80px;
}

.decor-hill-2 {
  right: -60px;
  width: 360px;
  height: 140px;
}

.decor-star {
  width: 14px;
  height: 14px;
  clip-path: polygon(50% 0%, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
  background: rgba(255, 255, 255, 0.42);
  animation: star-twinkle 3.4s ease-in-out infinite;
}

.decor-star-1 {
  top: 24%;
  left: 22%;
}

.decor-star-2 {
  top: 30%;
  right: 26%;
  transform: scale(1.3);
  animation-delay: 1.1s;
}

.game::before,
.game::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.game::before {
  opacity: 0.5;
}

.game::after {
  opacity: 0;
}

.game.theme-1 {
  background: #18263d;
}

.game.theme-1::before {
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.12) 0 4px, transparent 5px),
    radial-gradient(circle at 70% 36%, rgba(147, 197, 253, 0.18) 0 3px, transparent 4px),
    radial-gradient(circle at 50% 80%, rgba(96, 165, 250, 0.12) 0 44px, transparent 45px),
    linear-gradient(135deg, rgba(255, 255, 255, 0.06), transparent 60%),
    linear-gradient(180deg, #1e3a5f 0%, #18263d 100%);
  background-size: 120px 120px, 160px 160px, auto, auto;
}

.game.theme-2 {
  background: #24433a;
}

.game.theme-2::before {
  background:
    radial-gradient(circle at 15% 25%, rgba(187, 247, 208, 0.12) 0 26px, transparent 27px),
    radial-gradient(circle at 75% 70%, rgba(134, 239, 172, 0.1) 0 22px, transparent 23px),
    radial-gradient(circle at 45% 60%, rgba(52, 211, 153, 0.14) 0 56px, transparent 57px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0 4px, transparent 4px 40px),
    linear-gradient(180deg, #2d6a4f 0%, #24433a 100%);
  background-size: auto, auto, auto, 40px 40px, auto;
}

.game.theme-3 {
  background: #d7c3a3;
}

.game.theme-3::before {
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 248, 220, 0.25) 0 18px, transparent 19px),
    linear-gradient(45deg, rgba(166, 124, 82, 0.08) 0 6px, transparent 6px 24px),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.08) 0 6px, transparent 6px 24px),
    radial-gradient(circle at 80% 28%, rgba(251, 191, 36, 0.18) 0 36px, transparent 37px),
    linear-gradient(180deg, #f4d6a0 0%, #d7c3a3 100%);
  background-size: auto, 24px 24px, 24px 24px, auto, auto;
}

.game.theme-4 {
  background: #2e3138;
}

.game.theme-4::before {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0 2px, transparent 2px 28px),
    linear-gradient(45deg, rgba(148, 163, 184, 0.08) 0 2px, transparent 2px 28px),
    radial-gradient(circle at 82% 22%, rgba(226, 232, 240, 0.14) 0 30px, transparent 31px),
    linear-gradient(180deg, #4b5563 0%, #2e3138 100%);
  background-size: 28px 28px, 28px 28px, auto, auto;
}

.game.theme-5 {
  background: #584c8d;
}

.game.theme-5::before {
  background:
    radial-gradient(circle at 22% 26%, rgba(255, 255, 255, 0.12) 0 28px, transparent 29px),
    radial-gradient(circle at 80% 76%, rgba(167, 139, 250, 0.16) 0 34px, transparent 35px),
    linear-gradient(120deg, rgba(196, 181, 253, 0.1), transparent 60%),
    radial-gradient(circle at 44% 18%, rgba(158, 231, 255, 0.15) 0 20px, transparent 21px),
    linear-gradient(180deg, #7c5cff 0%, #584c8d 100%);
}

.game.theme-5::after {
  opacity: 0.45;
  background: linear-gradient(120deg, transparent 20%, rgba(158, 231, 255, 0.18) 45%, transparent 70%);
  background-size: 240% 240%;
  animation: premium-light 9s linear infinite;
}

.game.theme-6 {
  background: #ff7aa2;
}

.game.theme-6::before {
  background:
    radial-gradient(circle at 18% 22%, rgba(255, 245, 157, 0.24) 0 24px, transparent 25px),
    radial-gradient(circle at 78% 64%, rgba(255, 255, 255, 0.16) 0 34px, transparent 35px),
    radial-gradient(circle at 50% 46%, rgba(255, 173, 96, 0.18) 0 52px, transparent 53px),
    linear-gradient(45deg, rgba(255, 255, 255, 0.07) 0 8px, transparent 8px 32px),
    linear-gradient(180deg, #ff9b7a 0%, #ff7aa2 100%);
  background-size: auto, auto, auto, 32px 32px, auto;
}

.game.theme-7 {
  background: #2ecfd1;
}

.game.theme-7::before {
  background:
    radial-gradient(circle at 20% 24%, rgba(255, 255, 255, 0.18) 0 18px, transparent 19px),
    radial-gradient(circle at 70% 68%, rgba(103, 232, 249, 0.2) 0 46px, transparent 47px),
    linear-gradient(60deg, rgba(255, 255, 255, 0.08) 0 10px, transparent 10px 36px),
    linear-gradient(-60deg, rgba(14, 116, 144, 0.08) 0 10px, transparent 10px 36px),
    linear-gradient(180deg, #67e8f9 0%, #2ecfd1 100%);
  background-size: auto, auto, 36px 36px, 36px 36px, auto;
}

.shop-button {
  position: absolute;
  top: 24px;
  right: 24px;
  min-width: 188px;
  min-height: 68px;
  padding: 14px 18px;
  border: none;
  border-radius: 999px;
  font-size: 18px;
  font-weight: 700;
  color: #f8fafc;
  background: rgba(15, 23, 42, 0.86);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.12s ease, opacity 0.12s ease;
}

.shop-button.locked {
  padding-left: 62px;
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.92), rgba(15, 23, 42, 0.92));
}

.shop-button.unlocked {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.98), rgba(15, 23, 42, 0.94));
}

.shop-button-chain {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 40px;
  height: 18px;
  transform: translateY(-50%) rotate(-10deg);
  border-radius: 999px;
  border: 3px solid rgba(226, 232, 240, 0.95);
  box-shadow: 18px 0 0 -3px rgba(226, 232, 240, 0.95), 9px 10px 0 -3px rgba(203, 213, 225, 0.9);
}

.shop-button-lock {
  position: absolute;
  left: 40px;
  top: 50%;
  width: 22px;
  height: 20px;
  transform: translateY(-4px) rotate(4deg);
  border-radius: 5px;
  background: linear-gradient(180deg, #f8fafc, #cbd5e1);
  box-shadow: inset 0 -5px 0 rgba(148, 163, 184, 0.4), 0 4px 8px rgba(15, 23, 42, 0.18);
}

.shop-button-lock::before {
  content: '';
  position: absolute;
  left: 2px;
  bottom: 14px;
  width: 16px;
  height: 12px;
  border: 3px solid #f8fafc;
  border-bottom: none;
  border-radius: 10px 10px 0 0;
}

.shop-button.unlocked .shop-button-chain,
.shop-button.unlocked .shop-button-lock {
  display: none;
}

.shop-button-label {
  position: relative;
  z-index: 1;
}

.shop-button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: rgba(30, 41, 59, 0.95);
}

.shop-button:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.button-stage {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 320px;
  height: 320px;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 18px 38px rgba(0, 0, 0, 0.24));
}

.background-aura,
.button-aura {
  position: absolute;
  inset: -26px;
  border-radius: 50%;
  pointer-events: none;
}

.background-aura {
  filter: blur(36px);
  opacity: 0.55;
  animation: aura-pulse 4.8s ease-in-out infinite;
}

.button-aura {
  inset: -10px;
  border: 3px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 24px rgba(255, 255, 255, 0.18), inset 0 0 24px rgba(255, 255, 255, 0.12);
  opacity: 0.9;
}

.background-aura.theme-1 { background: radial-gradient(circle, rgba(96, 165, 250, 0.55), transparent 65%); }
.background-aura.theme-2 { background: radial-gradient(circle, rgba(74, 222, 128, 0.52), transparent 65%); }
.background-aura.theme-3 { background: radial-gradient(circle, rgba(251, 191, 36, 0.5), transparent 65%); }
.background-aura.theme-4 { background: radial-gradient(circle, rgba(203, 213, 225, 0.4), transparent 65%); }
.background-aura.theme-5 { background: radial-gradient(circle, rgba(167, 139, 250, 0.62), transparent 65%); }
.background-aura.theme-6 { background: radial-gradient(circle, rgba(251, 113, 133, 0.58), transparent 65%); }
.background-aura.theme-7 { background: radial-gradient(circle, rgba(34, 211, 238, 0.56), transparent 65%); }

.button-aura.shape-circle { border-radius: 50%; }
.button-aura.shape-rounded { border-radius: 52px; }
.button-aura.shape-diamond { clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); border-radius: 0; }
.button-aura.shape-hex { clip-path: polygon(25% 6%, 75% 6%, 100% 50%, 75% 94%, 25% 94%, 0 50%); border-radius: 0; }
.button-aura.shape-pill { inset: 48px -10px; border-radius: 999px; }
.button-aura.shape-star { clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 92%, 50% 70%, 21% 92%, 32% 57%, 2% 35%, 39% 35%); border-radius: 0; }
.button-aura.shape-burst { clip-path: polygon(50% 0%, 63% 18%, 84% 10%, 82% 34%, 100% 50%, 82% 66%, 84% 90%, 63% 82%, 50% 100%, 37% 82%, 16% 90%, 18% 66%, 0% 50%, 18% 34%, 16% 10%, 37% 18%); border-radius: 0; }

.button-aura.theme-1 { box-shadow: 0 0 24px rgba(96, 165, 250, 0.36), inset 0 0 24px rgba(255, 255, 255, 0.12); }
.button-aura.theme-2 { box-shadow: 0 0 24px rgba(74, 222, 128, 0.34), inset 0 0 24px rgba(255, 255, 255, 0.12); }
.button-aura.theme-3 { box-shadow: 0 0 24px rgba(251, 191, 36, 0.34), inset 0 0 24px rgba(255, 255, 255, 0.12); }
.button-aura.theme-4 { box-shadow: 0 0 24px rgba(226, 232, 240, 0.28), inset 0 0 24px rgba(255, 255, 255, 0.12); }
.button-aura.theme-5 { box-shadow: 0 0 28px rgba(167, 139, 250, 0.42), inset 0 0 24px rgba(255, 255, 255, 0.14); }
.button-aura.theme-6 { box-shadow: 0 0 28px rgba(251, 113, 133, 0.42), inset 0 0 24px rgba(255, 255, 255, 0.14); }
.button-aura.theme-7 { box-shadow: 0 0 28px rgba(34, 211, 238, 0.42), inset 0 0 24px rgba(255, 255, 255, 0.14); }

.click-button {
  position: absolute;
  inset: 0;
  border: none;
  border-radius: 50%;
  font-size: 42px;
  font-weight: 700;
  text-transform: lowercase;
  letter-spacing: 1px;
  color: #ffffff;
  background: linear-gradient(180deg, #ff5a5a 0%, #dc2626 58%, #991b1b 100%);
  cursor: pointer;
  box-shadow: 0 22px 36px rgba(220, 38, 38, 0.3), inset 0 10px 14px rgba(255, 255, 255, 0.18), inset 0 -12px 18px rgba(127, 29, 29, 0.36);
  transition: transform 0.12s ease, background-color 0.12s ease, box-shadow 0.12s ease;
  will-change: transform;
}

.click-button.theme-1 {
  background: linear-gradient(180deg, #60a5fa 0%, #2563eb 60%, #1e3a8a 100%);
}

.click-button.theme-2 {
  background: linear-gradient(180deg, #4ade80 0%, #16a34a 60%, #166534 100%);
}

.click-button.theme-3 {
  color: #5b3416;
  background: linear-gradient(180deg, #fde68a 0%, #f59e0b 60%, #d97706 100%);
}

.click-button.theme-4 {
  background: linear-gradient(180deg, #cbd5e1 0%, #64748b 60%, #334155 100%);
}

.click-button.theme-5 {
  background: linear-gradient(180deg, #c084fc 0%, #7c3aed 60%, #4c1d95 100%);
}

.click-button.theme-6 {
  background: linear-gradient(180deg, #fb7185 0%, #f97316 60%, #ea580c 100%);
}

.click-button.theme-7 {
  background: linear-gradient(180deg, #67e8f9 0%, #06b6d4 60%, #0f766e 100%);
}

.click-button.shape-circle {
  border-radius: 50%;
}

.click-button.shape-rounded {
  border-radius: 42px;
}

.click-button.shape-diamond {
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  border-radius: 0;
}

.click-button.shape-hex {
  clip-path: polygon(25% 6%, 75% 6%, 100% 50%, 75% 94%, 25% 94%, 0 50%);
  border-radius: 0;
}

.click-button.shape-pill {
  inset: 58px 0;
  border-radius: 999px;
}

.click-button.shape-star {
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 92%, 50% 70%, 21% 92%, 32% 57%, 2% 35%, 39% 35%);
  border-radius: 0;
}

.click-button.shape-burst {
  clip-path: polygon(50% 0%, 63% 18%, 84% 10%, 82% 34%, 100% 50%, 82% 66%, 84% 90%, 63% 82%, 50% 100%, 37% 82%, 16% 90%, 18% 66%, 0% 50%, 18% 34%, 16% 10%, 37% 18%);
  border-radius: 0;
}

.button-label {
  display: inline-block;
}

.button-lid.shape-rounded,
.button-lid.shape-rounded .button-lid-rim,
.button-lid.shape-rounded .button-lid-core {
  border-radius: 52px;
}

.button-lid.shape-diamond,
.button-lid.shape-diamond .button-lid-rim,
.button-lid.shape-diamond .button-lid-core {
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  border-radius: 0;
}

.button-lid.shape-hex,
.button-lid.shape-hex .button-lid-rim,
.button-lid.shape-hex .button-lid-core {
  clip-path: polygon(25% 6%, 75% 6%, 100% 50%, 75% 94%, 25% 94%, 0 50%);
  border-radius: 0;
}

.button-lid.shape-pill,
.button-lid.shape-pill .button-lid-rim,
.button-lid.shape-pill .button-lid-core {
  inset: 50px -8px;
  border-radius: 999px;
}

.button-lid.shape-star,
.button-lid.shape-star .button-lid-rim,
.button-lid.shape-star .button-lid-core {
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 92%, 50% 70%, 21% 92%, 32% 57%, 2% 35%, 39% 35%);
  border-radius: 0;
}

.button-lid.shape-burst,
.button-lid.shape-burst .button-lid-rim,
.button-lid.shape-burst .button-lid-core {
  clip-path: polygon(50% 0%, 63% 18%, 84% 10%, 82% 34%, 100% 50%, 82% 66%, 84% 90%, 63% 82%, 50% 100%, 37% 82%, 16% 90%, 18% 66%, 0% 50%, 18% 34%, 16% 10%, 37% 18%);
  border-radius: 0;
}

.click-button:hover {
  background: linear-gradient(180deg, #ff6b6b 0%, #ef4444 58%, #b91c1c 100%);
}

.click-button:active {
  transform: scale(0.97);
  box-shadow: 0 12px 24px rgba(220, 38, 38, 0.22), inset 0 -8px 16px rgba(127, 29, 29, 0.3);
}

.click-button.pulse {
  animation: button-pulse 0.22s ease-out;
}

.button-lid {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0.12) 54%, rgba(255, 255, 255, 0.06) 100%);
  border: 1px solid rgba(255, 255, 255, 0.34);
  backdrop-filter: blur(8px);
  box-shadow: inset 0 12px 18px rgba(255, 255, 255, 0.18), inset 0 -14px 20px rgba(15, 23, 42, 0.16), 0 16px 32px rgba(15, 23, 42, 0.22);
  cursor: grab;
  user-select: none;
  z-index: 2;
  overflow: hidden;
}

.button-lid.dragging {
  cursor: grabbing;
}

.button-lid.opened {
  opacity: 0;
  pointer-events: none;
}

.button-lid-highlight {
  position: absolute;
  top: 24px;
  left: 42px;
  width: 160px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
  transform: rotate(-18deg);
}

.button-lid-rim {
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.18);
}

.button-lid-core {
  position: absolute;
  inset: 26px;
  border-radius: 50%;
  background: radial-gradient(circle at top, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.04));
}

.button-lid-reflection {
  position: absolute;
  right: 48px;
  top: 76px;
  width: 56px;
  height: 128px;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0));
  transform: rotate(18deg);
}

.button-lid-shadow {
  position: absolute;
  inset: auto 40px 34px 40px;
  height: 52px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.12);
  filter: blur(10px);
}

.button-lid-glow {
  position: absolute;
  inset: auto 58px 18px 58px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  filter: blur(8px);
}

.start-hint {
  position: absolute;
  left: 50%;
  top: calc(50% + 198px);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 16px;
  color: #f8fafc;
  background: rgba(15, 23, 42, 0.7);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.16);
  transition: opacity 0.24s ease-out, transform 0.24s ease-out;
}

.mouse-icon {
  position: relative;
  width: 30px;
  height: 42px;
  flex: 0 0 auto;
}

.mouse-icon-body {
  position: absolute;
  inset: 0;
  border: 2px solid rgba(248, 250, 252, 0.95);
  border-radius: 18px;
}

.mouse-icon-button {
  position: absolute;
  top: 5px;
  left: 5px;
  width: 9px;
  height: 12px;
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.95);
}

.mouse-icon-arrow {
  position: absolute;
  left: 50%;
  top: -22px;
  width: 2px;
  height: 18px;
  background: rgba(147, 197, 253, 0.95);
  transform: translateX(-50%);
}

.mouse-icon-arrow::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  width: 10px;
  height: 10px;
  border-top: 2px solid rgba(147, 197, 253, 0.95);
  border-left: 2px solid rgba(147, 197, 253, 0.95);
  transform: translateX(-50%) rotate(45deg);
}

.start-hint-text {
  line-height: 1.2;
}

.hud {
  position: absolute;
  right: 24px;
  bottom: 24px;
  display: grid;
  gap: 12px;
}

.boss-panel {
  position: absolute;
  left: 24px;
  bottom: 24px;
  width: min(360px, calc(100% - 48px));
  padding: 18px 20px;
  border-radius: 24px;
  color: #f8fafc;
  background: rgba(15, 23, 42, 0.72);
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(6px);
}

.boss-panel.boss-waiting {
  opacity: 0.86;
}

.boss-panel.boss-victory-common {
  animation: boss-win-common 1.2s ease;
}

.boss-panel.boss-victory-rare {
  animation: boss-win-rare 1.2s ease;
}

.boss-panel.boss-victory-epic {
  animation: boss-win-epic 1.2s ease;
}

.boss-visual {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}

.boss-cube {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  transform: rotate(12deg);
  box-shadow: inset 0 10px 16px rgba(255, 255, 255, 0.22), 0 14px 22px rgba(15, 23, 42, 0.24);
  animation: cube-hover 2.4s ease-in-out infinite;
}

.boss-cube.waiting {
  opacity: 0.35;
  animation: none;
}

.boss-rarity-common {
  background: linear-gradient(180deg, #60a5fa, #2563eb);
}

.boss-rarity-rare {
  background: linear-gradient(180deg, #fbbf24, #f97316);
}

.boss-rarity-epic {
  background: linear-gradient(180deg, #c084fc, #7c3aed);
}

.bonus-panel {
  position: absolute;
  right: 24px;
  top: 104px;
  width: min(360px, calc(100% - 48px));
  padding: 18px 20px;
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.72);
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(6px);
}

.bonus-title {
  margin: 0 0 10px;
  font-size: 22px;
  color: #f8fafc;
}

.bonus-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bonus-chip {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: #e0f2fe;
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(125, 211, 252, 0.2);
}

.boss-title {
  margin: 0 0 8px;
  font-size: 24px;
}

.boss-text {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.4;
  color: rgba(248, 250, 252, 0.92);
}

.boss-bar {
  height: 16px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.16);
}

.boss-bar-fill {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #f59e0b, #fb7185, #60a5fa);
  transition: width 0.18s ease-out;
}

.boss-meta {
  margin-top: 10px;
  font-size: 14px;
  font-weight: 700;
  color: #fde68a;
}

.score,
.diamonds {
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 24px;
  font-weight: 700;
  color: #e2e8f0;
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.94), rgba(15, 23, 42, 0.88));
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.2);
}

.diamonds {
  color: #bfdbfe;
}

.floating-points {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.upgrade-effects {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

.upgrade-particle {
  position: absolute;
  animation: upgrade-float 0.85s ease-out forwards;
  will-change: transform, opacity;
}

.upgrade-particle.impulse {
  width: 18px;
  height: 18px;
  background: #fde68a;
  clip-path: polygon(50% 0%, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
  box-shadow: 0 0 12px rgba(253, 230, 138, 0.8);
}

.upgrade-particle.ruby {
  width: 16px;
  height: 16px;
  background: linear-gradient(180deg, #fb7185, #b91c1c);
  transform: rotate(45deg);
  border-radius: 2px;
  box-shadow: 0 0 12px rgba(220, 38, 38, 0.55);
}

.upgrade-particle.diamond {
  width: 28px;
  height: 28px;
  background: linear-gradient(180deg, #dbeafe, #60a5fa);
  clip-path: polygon(50% 0, 82% 28%, 68% 100%, 32% 100%, 18% 28%);
  box-shadow: 0 0 16px rgba(96, 165, 250, 0.75);
}

.upgrade-particle.background-night {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #bfdbfe;
}

.upgrade-particle.background-leaf {
  width: 18px;
  height: 12px;
  border-radius: 0 100% 0 100%;
  background: linear-gradient(180deg, #86efac, #22c55e);
}

.upgrade-particle.background-sand {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fcd34d;
}

.upgrade-particle.background-spark {
  width: 14px;
  height: 14px;
  background: #cbd5e1;
  clip-path: polygon(50% 0%, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
}

.upgrade-particle.background-aurora {
  width: 24px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #a78bfa, #67e8f9);
}

.upgrade-particle.background-candy {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(180deg, #fb7185, #fbbf24);
}

.upgrade-particle.background-lagoon {
  width: 18px;
  height: 18px;
  border-radius: 50% 50% 50% 0;
  background: linear-gradient(180deg, #67e8f9, #06b6d4);
  transform: rotate(-45deg);
}

.toast-stack {
  position: absolute;
  left: 24px;
  bottom: 24px;
  display: grid;
  gap: 10px;
  z-index: 4;
  pointer-events: none;
}

.toast {
  min-width: 240px;
  max-width: 320px;
  padding: 14px 16px;
  border-radius: 18px;
  color: #f8fafc;
  background: rgba(15, 23, 42, 0.92);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.22);
  animation: toast-in-out 3s ease forwards;
}

.toast-title {
  display: block;
  margin-bottom: 4px;
  font-size: 16px;
  font-weight: 700;
}

.toast-text {
  display: block;
  font-size: 14px;
  line-height: 1.35;
  color: #cbd5e1;
}

.gain {
  position: absolute;
  font-size: 30px;
  font-weight: 700;
  color: #fecaca;
  text-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  animation: float-up 0.7s ease-out forwards;
  will-change: transform, opacity;
}

.gain-diamond {
  color: #93c5fd;
}

.shop-modal {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(2, 6, 23, 0.58);
  z-index: 2;
  backdrop-filter: blur(4px);
}

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

.shop-modal.opening {
  animation: shop-fade-in 0.2s ease-out;
}

.fortune-modal,
.jackpot-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 5;
}

.fortune-modal {
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(6px);
}

.jackpot-overlay {
  background: rgba(8, 15, 35, 0.78);
}

.fortune-modal.hidden,
.jackpot-overlay.hidden {
  display: none;
}

.fortune-card,
.jackpot-card {
  position: relative;
  width: min(520px, 100%);
  padding: 28px;
  border-radius: 28px;
  text-align: center;
  background: rgba(248, 250, 252, 0.97);
  box-shadow: 0 22px 44px rgba(15, 23, 42, 0.28);
}

.fortune-title,
.jackpot-title {
  margin: 0 0 10px;
  font-size: 32px;
  font-weight: 700;
  color: #0f172a;
}

.fortune-text,
.jackpot-text {
  margin: 0 0 20px;
  font-size: 16px;
  line-height: 1.4;
  color: #475569;
}

.fortune-wheel-wrap {
  position: relative;
  width: 280px;
  height: 280px;
  margin: 0 auto 20px;
}

.fortune-pointer {
  position: absolute;
  left: 50%;
  top: -8px;
  z-index: 1;
  width: 0;
  height: 0;
  border-left: 16px solid transparent;
  border-right: 16px solid transparent;
  border-top: 28px solid #dc2626;
  transform: translateX(-50%);
}

.fortune-wheel {
  --wheel-rotation: 0deg;
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 10px solid #f8fafc;
  background: conic-gradient(#f59e0b 0deg 60deg, #60a5fa 60deg 120deg, #34d399 120deg 180deg, #f472b6 180deg 240deg, #a78bfa 240deg 300deg, #fb7185 300deg 360deg);
  box-shadow: 0 18px 32px rgba(15, 23, 42, 0.2);
  transform: rotate(var(--wheel-rotation));
}

.fortune-wheel.spinning {
  transition: transform 3.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.fortune-wheel-label {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  justify-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  transform-origin: center;
}

.fortune-wheel-label span {
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
}

.fortune-wheel-icon {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 6px 12px rgba(15, 23, 42, 0.14);
}

.fortune-wheel-label-1 { transform: translate(-50%, -50%) rotate(0deg) translateY(-108px) rotate(0deg); }
.fortune-wheel-label-2 { transform: translate(-50%, -50%) rotate(60deg) translateY(-108px) rotate(-60deg); }
.fortune-wheel-label-3 { transform: translate(-50%, -50%) rotate(120deg) translateY(-108px) rotate(-120deg); }
.fortune-wheel-label-4 { transform: translate(-50%, -50%) rotate(180deg) translateY(-108px) rotate(-180deg); }
.fortune-wheel-label-5 { transform: translate(-50%, -50%) rotate(240deg) translateY(-108px) rotate(-240deg); }
.fortune-wheel-label-6 { transform: translate(-50%, -50%) rotate(300deg) translateY(-108px) rotate(-300deg); }

.fortune-spin-button {
  padding: 14px 22px;
  border: none;
  border-radius: 999px;
  font-size: 17px;
  font-weight: 700;
  color: #f8fafc;
  background: linear-gradient(180deg, #2563eb, #1d4ed8);
  cursor: pointer;
}

.fortune-spin-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.fortune-result {
  min-height: 44px;
  margin: 16px 0 0;
  font-size: 15px;
  line-height: 1.4;
  color: #334155;
}

.jackpot-card {
  overflow: hidden;
  background: linear-gradient(180deg, #fff7ed, #fef3c7);
}

.jackpot-image {
  width: min(240px, 100%);
  margin-bottom: 12px;
}

.jackpot-fireworks {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.firework {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  box-shadow:
    0 -36px 0 0 currentColor,
    0 36px 0 0 currentColor,
    36px 0 0 0 currentColor,
    -36px 0 0 0 currentColor,
    26px 26px 0 0 currentColor,
    -26px -26px 0 0 currentColor,
    26px -26px 0 0 currentColor,
    -26px 26px 0 0 currentColor;
  animation: firework-burst 1.2s ease-out forwards;
}

.shop-card {
  position: relative;
  width: min(640px, 100%);
  padding: 28px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(241, 245, 249, 0.96));
  box-shadow: 0 24px 44px rgba(15, 23, 42, 0.26);
  transform-origin: center top;
}

.shop-modal.opening .shop-card {
  animation: shop-card-open 0.24s ease-out;
}

.shop-close {
  position: absolute;
  top: 18px;
  right: 18px;
  padding: 10px 14px;
  border: none;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  color: #f8fafc;
  background: #0f172a;
  cursor: pointer;
}

.shop-title {
  margin: 0 0 10px;
  font-size: 30px;
  font-weight: 700;
  color: #0f172a;
}

.shop-text {
  margin: 0 0 20px;
  font-size: 18px;
  color: #475569;
}

.shop-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.shop-tab {
  padding: 10px 14px;
  border: none;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  background: #e2e8f0;
  cursor: pointer;
}

.shop-tab.active {
  color: #f8fafc;
  background: #0f172a;
}

.shop-panel.hidden {
  display: none;
}

.shop-panel {
  max-height: min(62vh, 620px);
  overflow: hidden;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.shop-scrollable {
  max-height: min(54vh, 520px);
  padding-right: 8px;
  overflow-y: auto;
  align-content: start;
  scrollbar-width: auto;
  scrollbar-color: #2563eb #cbd5e1;
  cursor: grab;
}

.shop-scrollable.dragging {
  cursor: grabbing;
  user-select: none;
}

.shop-scrollable::-webkit-scrollbar {
  width: 14px;
}

.shop-scrollable::-webkit-scrollbar-track {
  border-radius: 999px;
  background: #cbd5e1;
}

.shop-scrollable::-webkit-scrollbar-thumb {
  border: 3px solid #cbd5e1;
  border-radius: 999px;
  background: linear-gradient(180deg, #60a5fa, #2563eb);
}

.shop-grid-shapes {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.shop-item {
  display: grid;
  justify-items: start;
  gap: 10px;
  min-height: 220px;
  padding: 16px;
  border: 2px solid transparent;
  border-radius: 24px;
  text-align: left;
  color: #0f172a;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.12);
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease, filter 0.14s ease;
}

.shop-item:hover {
  transform: translateY(-3px) scale(1.01);
  filter: brightness(1.04);
}

.shop-item:active {
  transform: scale(0.98);
}

.shop-item.owned,
.shop-item.selected,
.shop-item.bought {
  border-color: #2563eb;
}

.shop-item.locked {
  opacity: 0.7;
}

.shop-preview {
  width: 100%;
  height: 118px;
  object-fit: cover;
  border-radius: 18px;
  background: #cbd5e1;
}

.shop-item-title {
  font-size: 20px;
  font-weight: 700;
}

.shop-item-price {
  font-size: 16px;
  font-weight: 700;
  color: #475569;
}

.shop-item-description {
  font-size: 14px;
  line-height: 1.4;
  color: #334155;
}

.shop-item-state {
  margin-top: auto;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: #f8fafc;
  background: #0f172a;
}

.diamond-price {
  display: flex;
  gap: 4px;
  align-items: center;
  min-height: 24px;
}

.price-diamond {
  width: 18px;
  height: 18px;
}

.exchange-card {
  padding: 18px;
  border-radius: 24px;
  background: linear-gradient(180deg, #ecfeff, #dbeafe);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 14px 28px rgba(15, 23, 42, 0.1);
}

.exchange-title {
  margin: 0 0 8px;
  font-size: 24px;
  color: #0f172a;
}

.exchange-text {
  margin: 0 0 14px;
  line-height: 1.4;
  color: #334155;
}

.exchange-button {
  padding: 14px 18px;
  border: none;
  border-radius: 18px;
  font-size: 16px;
  font-weight: 700;
  color: #f8fafc;
  background: linear-gradient(180deg, #0ea5e9, #2563eb);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.22);
  cursor: pointer;
}

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.inventory-card {
  padding: 16px;
  border-radius: 22px;
  background: linear-gradient(180deg, #ffffff, #f1f5f9);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.1);
}

.inventory-title {
  margin: 0 0 10px;
  font-size: 20px;
  color: #0f172a;
}

.inventory-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.inventory-chip {
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  background: #dbeafe;
}

.inventory-chip.active {
  color: #f8fafc;
  background: #2563eb;
}

.inventory-chip.mastery {
  background: #ede9fe;
}

.inventory-chip.empty {
  background: #e2e8f0;
  color: #475569;
}

.achievements-list {
  display: grid;
  gap: 14px;
}

.stats-list {
  display: grid;
  gap: 14px;
}

.reset-progress-button {
  margin-top: 18px;
  padding: 14px 18px;
  border: none;
  border-radius: 18px;
  font-size: 16px;
  font-weight: 700;
  color: #f8fafc;
  background: linear-gradient(180deg, #dc2626, #b91c1c);
  box-shadow: 0 14px 26px rgba(220, 38, 38, 0.22);
  cursor: pointer;
}

.reset-progress-text {
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.4;
  color: #475569;
}

.stat-item {
  padding: 16px 18px;
  border-radius: 20px;
  background: #e2e8f0;
}

.stat-title {
  display: block;
  margin-bottom: 6px;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}

.stat-value {
  display: block;
  font-size: 24px;
  font-weight: 700;
  color: #1d4ed8;
}

.achievement-item {
  padding: 16px 18px;
  border-radius: 20px;
  background: #e2e8f0;
  border: 2px solid transparent;
}

.achievement-item.unlocked {
  border-color: #2563eb;
  background: #dbeafe;
}

.achievement-rarity {
  display: inline-block;
  margin-bottom: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #f8fafc;
}

.rarity-common {
  background: #64748b;
}

.rarity-rare {
  background: #2563eb;
}

.rarity-epic {
  background: #7c3aed;
}

.rarity-legendary {
  background: #d97706;
}

.achievement-title {
  display: block;
  margin-bottom: 6px;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}

.achievement-description {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 1.4;
  color: #334155;
}

.achievement-state {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: #f8fafc;
  background: #0f172a;
}

.achievement-reward {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #1d4ed8;
}

@keyframes float-up {
  from {
    opacity: 0;
    transform: translate(-50%, 8px) scale(0.92);
  }

  20% {
    opacity: 1;
  }

  to {
    opacity: 0;
    transform: translate(-50%, -58px) scale(1);
  }
}

@keyframes button-pulse {
  0% {
    transform: scale(1);
  }

  40% {
    transform: scale(1.05);
  }

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

@keyframes premium-light {
  0% {
    background-position: 0% 0%;
  }

  100% {
    background-position: 180% 0%;
  }
}

@keyframes cloud-drift {
  from {
    transform: translateX(-10px);
  }

  to {
    transform: translateX(16px);
  }
}

@keyframes star-twinkle {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.9);
  }

  50% {
    opacity: 0.9;
    transform: scale(1.15);
  }
}

@keyframes shop-fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes shop-card-open {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-in-out {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }

  10%,
  80% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  100% {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
}

@keyframes firework-burst {
  from {
    opacity: 0;
    transform: scale(0.2);
  }

  20% {
    opacity: 1;
  }

  to {
    opacity: 0;
    transform: scale(1.1);
  }
}

@keyframes cube-hover {
  0%,
  100% {
    transform: rotate(12deg) translateY(0);
  }

  50% {
    transform: rotate(-8deg) translateY(-6px);
  }
}

@keyframes boss-win-common {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.22); }
}

@keyframes boss-win-rare {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); box-shadow: 0 0 0 5px rgba(251, 191, 36, 0.28); }
}

@keyframes boss-win-epic {
  0%, 100% { transform: scale(1) rotate(0deg); }
  35% { transform: scale(1.04) rotate(-1deg); }
  70% { transform: scale(1.04) rotate(1deg); }
}

@keyframes upgrade-float {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
  }

  20% {
    opacity: 1;
  }

  to {
    opacity: 0;
    transform: translate(calc(-50% + var(--move-x, 0px)), calc(-50% + var(--move-y, -60px))) scale(1.15);
  }
}

@keyframes aura-pulse {
  0%,
  100% {
    transform: scale(0.98);
    opacity: 0.45;
  }

  50% {
    transform: scale(1.05);
    opacity: 0.72;
  }
}

@media (max-width: 640px) {
  .game-purpose {
    top: 16px;
    left: 16px;
    right: 16px;
    max-width: none;
  }

  .tutorial-box {
    top: 178px;
    left: 16px;
    right: 16px;
    max-width: none;
  }

  .boss-panel {
    left: 16px;
    bottom: 16px;
    width: calc(100% - 32px);
  }

  .bonus-panel {
    left: 16px;
    right: 16px;
    top: auto;
    bottom: 188px;
    width: auto;
  }

  .inventory-grid {
    grid-template-columns: 1fr;
  }

  .button-stage {
    width: 260px;
    height: 260px;
  }

  .click-button {
    font-size: 34px;
  }

  .score {
    font-size: 20px;
  }

  .hud {
    right: 16px;
    bottom: 16px;
  }

  .toast-stack {
    left: 16px;
    bottom: 16px;
  }

  .shop-button {
    top: 16px;
    right: 16px;
    font-size: 16px;
    min-width: 170px;
  }

  .start-hint {
    top: calc(50% + 164px);
    width: calc(100% - 32px);
    justify-content: center;
    font-size: 16px;
  }

  .shop-grid {
    grid-template-columns: 1fr;
  }
}
