:root {
  --bg-deep: #0a0e1a;
  --bg-panel: rgba(18, 24, 42, 0.85);
  --accent: #5eead4;
  --accent-dim: #2dd4bf;
  --gold: #fbbf24;
  --gold-glow: rgba(251, 191, 36, 0.45);
  --gem: #a78bfa;
  --danger: #f87171;
  --text: #e8edf5;
  --text-muted: #94a3b8;
  --rarity-common: #9ca3af;
  --rarity-rare: #38bdf8;
  --rarity-epic: #a78bfa;
  --rarity-legendary: #fbbf24;
  --rarity-mythical: #22d3ee;
  --rarity-mythical-glow: rgba(34, 211, 238, 0.55);
  --rarity-verdant: #10b981;
  --rarity-verdant-glow: rgba(16, 185, 129, 0.5);
  --font-ui: "Outfit", system-ui, sans-serif;
  --font-display: "Cinzel", Georgia, serif;
  --radius: 14px;
  --shadow-lg: 0 24px 80px rgba(0, 0, 0, 0.55);
  --glass: rgba(18, 26, 46, 0.72);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glow-teal: 0 0 40px rgba(45, 212, 191, 0.22);
  /* Заголовок меню и кнопки — одна палитра (бирюза / небо / индиго) */
  --menu-title-grad: linear-gradient(125deg, #f8fafc 0%, #a5f3fc 28%, var(--accent) 52%, #38bdf8 78%, #818cf8 100%);
  /* Тёмный вариант того же угла и оттенков, что у .title-main */
  --btn-surface-title: linear-gradient(
    125deg,
    #334155 0%,
    #155e75 20%,
    #0f766e 36%,
    #0369a1 52%,
    #4338ca 70%,
    #1e1b4b 86%,
    #020617 100%
  );
  --btn-surface-title-strong: linear-gradient(
    125deg,
    #475569 0%,
    #0e7490 18%,
    #0d9488 34%,
    #0284c7 50%,
    #4f46e5 68%,
    #312e81 85%,
    #020617 100%
  );
  --btn-surface-title-ghost: linear-gradient(
    125deg,
    rgba(51, 65, 85, 0.65) 0%,
    rgba(14, 116, 143, 0.42) 38%,
    rgba(67, 56, 202, 0.28) 62%,
    rgba(15, 23, 42, 0.94) 100%
  );
  /* Единая форма кнопок (трапеция / «техно») */
  --btn-clip-main: polygon(6% 0%, 100% 0%, 94% 100%, 0% 100%);
  --btn-clip-mirror: polygon(0% 0%, 94% 0%, 100% 100%, 4% 100%);
  --btn-clip-wide: polygon(4% 0%, 100% 0%, 96% 100%, 0% 100%);
  --btn-blue-top: #1d4ed8;
  --btn-blue-mid: #172554;
  --btn-black: #020617;
  /* Единый курсор игры: «эфирный прицел» (hotspot — центр 16×16) */
  --cursor-aether: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Ccircle cx='16' cy='16' r='10' fill='none' stroke='%232dd4bf' stroke-width='1.5' opacity='0.4'/%3E%3Ccircle cx='16' cy='16' r='6' fill='none' stroke='%235eead4' stroke-width='1.5'/%3E%3Cpath d='M16 5v5M16 22v5M5 16h5M22 16h5' stroke='%23a5f3fc' stroke-width='2' stroke-linecap='round'/%3E%3Ccircle cx='16' cy='16' r='2' fill='%23f0fdfa'/%3E%3C/svg%3E")
    16 16,
    auto;
  --cursor-aether-pointer: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Ccircle cx='16' cy='16' r='10' fill='none' stroke='%232dd4bf' stroke-width='1.5' opacity='0.4'/%3E%3Ccircle cx='16' cy='16' r='6' fill='none' stroke='%235eead4' stroke-width='1.5'/%3E%3Cpath d='M16 5v5M16 22v5M5 16h5M22 16h5' stroke='%23a5f3fc' stroke-width='2' stroke-linecap='round'/%3E%3Ccircle cx='16' cy='16' r='2' fill='%23f0fdfa'/%3E%3C/svg%3E")
    16 16,
    pointer;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  margin: 0;
  min-height: 100%;
  height: 100%;
  background-color: #020617;
  background-attachment: fixed;
  cursor: var(--cursor-aether);
}

body {
  margin: 0;
  min-height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-ui);
  color: var(--text);
  background-color: #020617;
  overflow-x: hidden;
  cursor: var(--cursor-aether);
}

/* Тот же курсор на всех экранах: меню, кейсы, коллекция, оверлеи */
button:not(:disabled),
.btn:not(:disabled),
.diff-chip,
.tower-btn:not(.locked),
a[href],
label[for],
select,
summary {
  cursor: var(--cursor-aether-pointer);
}

button:disabled,
.tower-btn.locked {
  cursor: not-allowed;
}

input[type="text"],
input[type="search"],
input[type="number"],
textarea {
  cursor: text;
}

body.is-loading {
  overflow: hidden;
}

/* ——— Кастомная загрузка ——— */
.app-loader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background:
    radial-gradient(ellipse 100% 80% at 50% -20%, rgba(56, 189, 248, 0.12), transparent 55%),
    radial-gradient(ellipse 90% 70% at 100% 100%, rgba(99, 102, 241, 0.1), transparent 50%),
    linear-gradient(180deg, #0a0f1a 0%, #020617 45%, #000 100%);
  transition:
    opacity 0.75s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0.75s step-end;
}

.app-loader--done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.app-loader__inner {
  text-align: center;
  max-width: 22rem;
  width: 100%;
}

.app-loader__rings {
  position: relative;
  width: 112px;
  height: 112px;
  margin: 0 auto 1.75rem;
}

.app-loader__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid transparent;
}

.app-loader__ring--a {
  border-top-color: rgba(56, 189, 248, 0.85);
  border-right-color: rgba(56, 189, 248, 0.15);
  animation: loaderSpin 4.2s linear infinite;
}

.app-loader__ring--b {
  inset: 10px;
  border-bottom-color: rgba(94, 234, 212, 0.75);
  border-left-color: rgba(94, 234, 212, 0.12);
  animation: loaderSpin 3.2s linear infinite reverse;
}

.app-loader__core {
  position: absolute;
  inset: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.35), rgba(56, 189, 248, 0.35) 38%, rgba(15, 23, 42, 0.95) 100%);
  box-shadow:
    0 0 40px rgba(56, 189, 248, 0.35),
    inset 0 0 20px rgba(0, 0, 0, 0.45);
  animation: loaderPulse 2.8s ease-in-out infinite;
}

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

@keyframes loaderPulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(0.94);
    opacity: 0.92;
  }
}

.app-loader__title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  letter-spacing: 0.14em;
  background: linear-gradient(125deg, #f8fafc 0%, #a5f3fc 35%, #5eead4 55%, #818cf8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 24px rgba(94, 234, 212, 0.35));
  margin-bottom: 0.35rem;
}

.app-loader__tag {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.85);
}

.app-loader__version {
  margin: 0 0 1.35rem;
  font-size: 0.65rem;
  letter-spacing: 0.32em;
  font-family: var(--font-ui);
  font-weight: 600;
  color: rgba(148, 163, 184, 0.7);
}

.app-loader__bar {
  height: 4px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  overflow: hidden;
  border: 1px solid rgba(56, 189, 248, 0.2);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.45);
}

@keyframes loaderBarFill {
  to {
    width: 100%;
  }
}

@keyframes loaderBarShimmer {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 200% 50%;
  }
}

.app-loader__progress {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #1e3a8a, #2563eb, #38bdf8, #5eead4);
  background-size: 200% 100%;
  animation:
    loaderBarFill 3.85s cubic-bezier(0.28, 0.85, 0.36, 1) forwards,
    loaderBarShimmer 2.6s ease-in-out infinite;
}

.app-loader__hint {
  margin: 1rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  min-height: 1.4em;
  transition: opacity 0.3s ease;
}

/* Вступление главного меню после загрузки */
#screen-menu.menu-intro .menu-brand,
#screen-menu.menu-intro .menu-buttons,
#screen-menu.menu-intro .menu-stats {
  opacity: 0;
  transform: translateY(36px);
  filter: blur(8px);
}

#screen-menu.menu-intro.menu-intro--play .menu-brand {
  animation: menuIntroBlock 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

#screen-menu.menu-intro.menu-intro--play .menu-buttons {
  animation: menuIntroBlock 0.85s cubic-bezier(0.16, 1, 0.3, 1) 0.14s forwards;
}

#screen-menu.menu-intro.menu-intro--play .menu-stats {
  animation: menuIntroBlock 0.85s cubic-bezier(0.16, 1, 0.3, 1) 0.32s forwards;
}

@keyframes menuIntroBlock {
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

body.app-ready #app {
  animation: appReveal 0.5s ease-out;
}

@keyframes appReveal {
  from {
    opacity: 0.96;
  }
  to {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-loader__ring--a,
  .app-loader__ring--b {
    animation-duration: 6s;
  }

  .app-loader__core {
    animation: none;
  }

  .app-loader__progress {
    animation: loaderBarFill 0.5s ease-out forwards;
  }

  #screen-menu.menu-intro .menu-brand,
  #screen-menu.menu-intro .menu-buttons,
  #screen-menu.menu-intro .menu-stats {
    filter: none;
    opacity: 1;
    transform: none;
  }

  #screen-menu.menu-intro.menu-intro--play .menu-brand,
  #screen-menu.menu-intro.menu-intro--play .menu-buttons,
  #screen-menu.menu-intro.menu-intro--play .menu-stats {
    animation: none;
  }
}

.bg-aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  background:
    radial-gradient(ellipse 140% 90% at 15% -10%, rgba(56, 189, 248, 0.22), transparent 55%),
    radial-gradient(ellipse 110% 70% at 92% 85%, rgba(94, 234, 212, 0.16), transparent 48%),
    radial-gradient(ellipse 90% 55% at 48% 42%, rgba(129, 140, 248, 0.12), transparent 58%),
    radial-gradient(ellipse 60% 40% at 70% 15%, rgba(244, 114, 182, 0.06), transparent 50%),
    var(--bg-deep);
  pointer-events: none;
  animation: auroraShift 28s ease-in-out infinite alternate;
}

@keyframes auroraShift {
  0% {
    filter: hue-rotate(0deg) saturate(1);
    transform: scale(1);
  }
  100% {
    filter: hue-rotate(12deg) saturate(1.08);
    transform: scale(1.02);
  }
}

/* Мягкие цветные облака, медленно перетекающие по экрану */
.bg-drift {
  position: fixed;
  inset: 0;
  z-index: 0;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  pointer-events: none;
  overflow: hidden;
}

.bg-drift::before,
.bg-drift::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(68px);
  opacity: 0.52;
  will-change: transform;
}

.bg-drift::before {
  width: min(125vmin, 760px);
  height: min(125vmin, 760px);
  left: -28%;
  top: -18%;
  background: radial-gradient(
    circle at 38% 42%,
    rgba(56, 189, 248, 0.55) 0%,
    rgba(99, 102, 241, 0.22) 48%,
    transparent 72%
  );
  animation: driftBlobA 28s ease-in-out infinite alternate;
}

.bg-drift::after {
  width: min(105vmin, 620px);
  height: min(105vmin, 620px);
  right: -22%;
  bottom: -12%;
  background: radial-gradient(
    circle at 55% 38%,
    rgba(45, 212, 191, 0.48) 0%,
    rgba(129, 140, 248, 0.22) 52%,
    transparent 74%
  );
  animation: driftBlobB 36s ease-in-out infinite alternate;
}

@keyframes driftBlobA {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(min(22vw, 200px), min(14vh, 120px)) scale(1.1);
  }
}

@keyframes driftBlobB {
  0% {
    transform: translate(0, 0) scale(1.06);
  }
  100% {
    transform: translate(max(-18vw, -160px), max(-12vh, -100px)) scale(1.12);
  }
}

/* Плитка «звёзд» с параллакс-дрейфом */
.bg-starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0.42;
  background-color: transparent;
  background-image:
    radial-gradient(1px 1px at 8% 12%, rgba(255, 255, 255, 0.65), transparent),
    radial-gradient(1px 1px at 42% 38%, rgba(226, 242, 255, 0.5), transparent),
    radial-gradient(1.2px 1.2px at 71% 22%, rgba(255, 255, 255, 0.55), transparent),
    radial-gradient(1px 1px at 18% 78%, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1px 1px at 88% 64%, rgba(200, 230, 255, 0.45), transparent),
    radial-gradient(1px 1px at 55% 91%, rgba(255, 255, 255, 0.38), transparent),
    radial-gradient(1.1px 1.1px at 33% 55%, rgba(255, 255, 255, 0.48), transparent),
    radial-gradient(1px 1px at 92% 18%, rgba(255, 255, 255, 0.42), transparent);
  background-size: 280px 280px;
  background-repeat: repeat;
  background-position: 0 0;
  animation: starfieldParallax 140s linear infinite, starTwinkle 9s ease-in-out infinite alternate;
}

@keyframes starfieldParallax {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 560px 420px;
  }
}

@keyframes starTwinkle {
  0% {
    opacity: 0.32;
  }
  100% {
    opacity: 0.52;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bg-aurora {
    animation: none;
  }

  .bg-drift::before,
  .bg-drift::after {
    animation: none;
    transform: none;
  }

  .bg-starfield {
    animation: none;
    opacity: 0.38;
  }
}

.bg-vignette {
  position: fixed;
  inset: 0;
  z-index: 0;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  pointer-events: none;
  background: radial-gradient(ellipse 85% 75% at 50% 45%, transparent 0%, rgba(0, 0, 0, 0.45) 100%);
  mix-blend-mode: multiply;
}

.film-grain {
  position: fixed;
  inset: 0;
  z-index: 0;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grainMove 0.5s steps(2) infinite;
}

@keyframes grainMove {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(-2%, -2%);
  }
}

.particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  pointer-events: none;
  opacity: 0.55;
}

.particles span {
  position: absolute;
  width: 3px;
  height: 3px;
  background: var(--accent);
  border-radius: 50%;
  animation: float 8s ease-in-out infinite;
  opacity: 0.55;
  box-shadow: 0 0 8px rgba(94, 234, 212, 0.65), 0 0 16px rgba(56, 189, 248, 0.25);
}

.particles span.particle--soft {
  width: 2px;
  height: 2px;
  opacity: 0.35;
  box-shadow: 0 0 6px rgba(165, 243, 252, 0.4);
  filter: blur(0.5px);
}

.particles span.particle--lg {
  width: 4px;
  height: 4px;
  box-shadow: 0 0 12px rgba(94, 234, 212, 0.8), 0 0 24px rgba(99, 102, 241, 0.35);
}

.particles span.particle--gem {
  background: var(--gem);
  box-shadow: 0 0 10px rgba(167, 139, 250, 0.85), 0 0 20px rgba(129, 140, 248, 0.35);
  animation-name: floatGem;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0) translateX(0) scale(1);
    opacity: 0.35;
  }
  50% {
    transform: translateY(-36px) translateX(14px) scale(1.1);
    opacity: 0.85;
  }
}

@keyframes floatGem {
  0%,
  100% {
    transform: translateY(0) translateX(0);
    opacity: 0.4;
  }
  50% {
    transform: translateY(-42px) translateX(-8px);
    opacity: 0.9;
  }
}

#app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(1rem, 4vw, 2.5rem);
  padding-bottom: max(clamp(1rem, 4vw, 2.5rem), env(safe-area-inset-bottom, 0px));
  isolation: isolate;
  box-sizing: border-box;
}

/* Экран игры: колонка на всю высоту, без «пустого» низа */
body.view-game {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

body.view-game #app {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
}

body.view-game .screen-game.screen-active {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
}

body.view-game .screen-game .game-hud {
  flex-shrink: 0;
}


body.view-game .screen-game .game-wrap {
  flex: 1 1 auto;
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 1rem;
  min-height: min(520px, calc(100dvh - 220px));
  padding: 0.5rem 0 0.25rem;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.35), rgba(15, 23, 42, 0.25));
  border-radius: 18px;
  border: 1px solid rgba(30, 58, 138, 0.25);
  box-sizing: border-box;
}

body.view-game .tower-panel {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  flex: 0 0 200px;
  width: 200px;
  min-width: 200px;
  max-width: 200px;
  max-height: min(560px, calc(100dvh - 200px));
  overflow: hidden;
}

body.view-game .canvas-frame {
  flex: 0 1 auto;
  min-width: 0;
}

body.view-game .tower-list {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.screen {
  display: none;
  max-width: 1100px;
  margin: 0 auto;
  animation: fadeIn 0.45s ease;
}

.screen-active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ——— Меню ——— */
.menu-brand {
  text-align: center;
  margin-top: clamp(2rem, 8vh, 5rem);
  margin-bottom: 2.5rem;
}

.menu-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.menu-logo__svg {
  width: clamp(72px, 20vw, 100px);
  height: auto;
  display: block;
  filter: drop-shadow(0 0 26px rgba(94, 234, 212, 0.38));
}

.app-version {
  text-align: center;
  margin: 1.4rem 0 0;
  padding: 0 1rem;
  font-size: 0.65rem;
  letter-spacing: 0.28em;
  font-family: var(--font-ui);
  font-weight: 600;
  color: rgba(148, 163, 184, 0.72);
}

.title-main {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 3.8rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  margin: 0;
  background: var(--menu-title-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 32px rgba(94, 234, 212, 0.45)) drop-shadow(0 4px 24px rgba(56, 189, 248, 0.25));
  animation: titleShine 6s ease-in-out infinite;
}

@keyframes titleShine {
  0%,
  100% {
    filter: drop-shadow(0 0 28px rgba(94, 234, 212, 0.4)) drop-shadow(0 4px 20px rgba(56, 189, 248, 0.2));
  }
  50% {
    filter: drop-shadow(0 0 48px rgba(94, 234, 212, 0.55)) drop-shadow(0 4px 32px rgba(129, 140, 248, 0.3));
  }
}

.subtitle {
  margin: 0.5rem 0 0;
  font-size: 1rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.difficulty-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  margin: 0 auto 1.35rem;
  max-width: 520px;
  padding: 0.35rem 0.25rem 0;
}

.difficulty-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  width: 100%;
  text-align: center;
  margin-bottom: 0.25rem;
}

.diff-grid {
  display: grid;
  gap: 0.35rem;
  margin: 0 auto 1.25rem;
  max-width: 520px;
}

.diff-grid__row {
  margin-bottom: 0;
  padding-top: 0.2rem;
}

@media (min-width: 480px) {
  .difficulty-label {
    width: 100%;
    margin-bottom: 0.25rem;
    margin-right: 0;
  }
}

.diff-chip {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.56rem 1rem;
  border: none;
  clip-path: var(--btn-clip-wide);
  background: var(--btn-surface-title);
  color: #e0f2fe;
  min-width: 10.25rem;
  text-align: center;
  box-shadow:
    0 3px 0 #000,
    0 6px 20px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(165, 243, 252, 0.2);
  transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.25s ease, color 0.2s ease;
}

.diff-chip:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px rgba(56, 189, 248, 0.8),
    0 4px 0 #000,
    0 12px 30px rgba(56, 189, 248, 0.22);
}

.diff-chip--mode {
  min-width: 11.5rem;
}

@media (max-width: 420px) {
  .diff-chip,
  .diff-chip--mode {
    min-width: 100%;
  }
}

.diff-chip:hover {
  color: #f8fafc;
  filter: brightness(1.12);
  transform: translateY(-2px);
  box-shadow:
    0 5px 0 #000,
    0 12px 28px rgba(56, 189, 248, 0.28),
    inset 0 1px 0 rgba(186, 230, 253, 0.35);
}

.diff-chip--active {
  background: var(--btn-surface-title-strong);
  color: #f8fafc;
  box-shadow:
    0 0 0 1px rgba(129, 140, 248, 0.45),
    0 4px 0 #020617,
    0 10px 32px rgba(14, 165, 233, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.menu-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  max-width: 320px;
  margin: 0 auto 2.5rem;
}

.menu-stats {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.stat-pill {
  padding: 0.55rem 1.1rem;
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.88), rgba(15, 23, 42, 0.75));
  border: 1px solid rgba(94, 234, 212, 0.28);
  border-radius: 999px;
  font-size: 0.9rem;
  backdrop-filter: blur(16px) saturate(1.2);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35), var(--glow-teal), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.stat-pill-gem {
  border-color: rgba(167, 139, 250, 0.35);
}

.stat-label {
  color: var(--text-muted);
  margin-right: 0.35rem;
}

.btn {
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 600;
  padding: 0.88rem 1.85rem;
  border: none;
  border-radius: 0;
  letter-spacing: 0.04em;
  position: relative;
  clip-path: var(--btn-clip-main);
  color: #f0fdfa;
  background: var(--btn-surface-title);
  box-shadow:
    0 4px 0 #000,
    0 10px 28px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(165, 243, 252, 0.22);
  transition: transform 0.2s ease, box-shadow 0.24s ease, filter 0.2s ease;
}

.btn:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px rgba(56, 189, 248, 0.75),
    0 4px 0 #000,
    0 12px 32px rgba(94, 234, 212, 0.28);
}

.btn:active:not(:disabled) {
  transform: translateY(2px);
}

.btn.btn-ghost.btn-compact,
.screen-header .btn-compact {
  clip-path: var(--btn-clip-mirror);
}

.menu-buttons .btn-primary,
.menu-buttons .btn-secondary,
.menu-buttons .btn-ghost {
  width: 100%;
}

.btn-primary {
  background: var(--btn-surface-title-strong);
  color: #f8fafc;
  box-shadow:
    0 4px 0 #000,
    0 10px 32px rgba(14, 165, 233, 0.28),
    inset 0 1px 0 rgba(186, 230, 253, 0.28);
}

.btn-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.1) saturate(1.05);
  box-shadow:
    0 7px 0 #000,
    0 16px 44px rgba(56, 189, 248, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.btn-secondary {
  background: var(--btn-surface-title);
  color: #e0f2fe;
  box-shadow:
    0 4px 0 #000,
    0 10px 28px rgba(6, 182, 212, 0.22),
    inset 0 1px 0 rgba(165, 243, 252, 0.2);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
  box-shadow:
    0 7px 0 #000,
    0 14px 40px rgba(99, 102, 241, 0.28),
    inset 0 1px 0 rgba(191, 219, 254, 0.22);
}

.btn-ghost {
  background: var(--btn-surface-title-ghost);
  color: #a5f3fc;
  border: none;
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.32),
    0 4px 0 rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(165, 243, 252, 0.1);
  backdrop-filter: blur(12px);
}

.btn-ghost:hover {
  color: #f0fdfa;
  filter: brightness(1.12);
  box-shadow:
    0 0 0 1px rgba(129, 140, 248, 0.5),
    0 6px 0 rgba(0, 0, 0, 0.45),
    0 12px 28px rgba(56, 189, 248, 0.22),
    inset 0 1px 0 rgba(186, 230, 253, 0.14);
}

.btn-compact {
  padding: 0.55rem 1.15rem;
  font-size: 0.9rem;
  width: auto;
}

.btn-block {
  width: 100%;
  display: block;
}

/* Сундуки: та же трапеция и чёрно-синяя база; редкость — тонкое свечение и акцент */
.btn-chest {
  padding: 0.72rem 1.35rem;
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: 0;
  clip-path: var(--btn-clip-wide);
}

.btn-chest-bronze {
  background: var(--btn-surface-title);
  color: #ecfeff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  box-shadow:
    0 4px 0 #000,
    0 0 0 1px rgba(45, 212, 191, 0.5),
    0 10px 28px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(45, 212, 191, 0.22);
}

.btn-chest-bronze:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
  box-shadow:
    0 6px 0 #000,
    0 0 0 1px rgba(45, 212, 191, 0.72),
    0 14px 36px rgba(45, 212, 191, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.btn-chest-silver {
  background: var(--btn-surface-title-strong);
  color: #f0f9ff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  box-shadow:
    0 4px 0 #000,
    0 0 0 1px rgba(129, 140, 248, 0.55),
    0 10px 28px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(165, 180, 252, 0.2);
}

.btn-chest-silver:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow:
    0 6px 0 #000,
    0 0 0 1px rgba(165, 180, 252, 0.75),
    0 14px 40px rgba(99, 102, 241, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-chest-gold {
  background: var(--btn-surface-title-strong);
  color: #fffbeb;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  box-shadow:
    0 4px 0 #000,
    0 0 0 1px rgba(251, 191, 36, 0.55),
    0 10px 28px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(251, 191, 36, 0.18);
}

.btn-chest-gold:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow:
    0 6px 0 #000,
    0 0 0 1px rgba(251, 191, 36, 0.78),
    0 14px 40px rgba(251, 191, 36, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.btn-chest-diamond {
  background: linear-gradient(125deg, #0e7490, #312e81, #0e7490);
  color: #ecfeff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  box-shadow:
    0 4px 0 #000,
    0 0 0 1px rgba(34, 211, 238, 0.55),
    0 10px 28px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(103, 232, 249, 0.22);
}

.btn-chest-diamond:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
  box-shadow:
    0 6px 0 #000,
    0 0 0 1px rgba(103, 232, 249, 0.75),
    0 14px 40px rgba(34, 211, 238, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.btn-chest-emerald {
  background: linear-gradient(125deg, #047857, #14532d, #047857);
  color: #ecfdf5;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  box-shadow:
    0 4px 0 #000,
    0 0 0 1px rgba(52, 211, 153, 0.55),
    0 10px 28px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(167, 243, 208, 0.2);
}

.btn-chest-emerald:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
  box-shadow:
    0 6px 0 #000,
    0 0 0 1px rgba(110, 231, 183, 0.75),
    0 14px 40px rgba(16, 185, 129, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.btn-chest-trial {
  background: var(--btn-surface-title);
  color: #ecfdf5;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  box-shadow:
    0 4px 0 #000,
    0 0 0 1px rgba(34, 197, 94, 0.48),
    0 10px 28px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(74, 222, 128, 0.18);
}

.btn-chest-trial:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
  box-shadow:
    0 6px 0 #000,
    0 0 0 1px rgba(74, 222, 128, 0.65),
    0 14px 36px rgba(34, 197, 94, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.overlay-card .btn-primary {
  width: 100%;
  margin-top: 0.5rem;
}

.screen-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.screen-header h2 {
  font-family: var(--font-display);
  font-weight: 700;
  margin: 0;
  font-size: 1.55rem;
  letter-spacing: 0.04em;
  background: linear-gradient(90deg, #f1f5f9, #a5f3fc 50%, #e2e8f0);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 12px rgba(56, 189, 248, 0.2));
}

.screen-header .btn-compact {
  flex-shrink: 0;
}

.case-reveal #reveal-close {
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
}

/* ——— Кейсы / сундуки ——— */
.screen-cases-header {
  align-items: flex-start;
  flex-wrap: wrap;
}

.screen-cases-title h2 {
  margin: 0 0 0.25rem;
}

.screen-cases-sub {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 400;
}

.cases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(272px, 1fr));
  gap: 1.75rem;
}

.case-card {
  position: relative;
  text-align: center;
  padding: 2.5rem 1.5rem 1.5rem;
  border-radius: 18px;
  backdrop-filter: blur(20px);
  transition: transform 0.32s ease, box-shadow 0.32s ease, border-color 0.32s ease;
}

.case-card--bronze {
  background: linear-gradient(160deg, rgba(41, 37, 36, 0.92) 0%, rgba(15, 23, 42, 0.94) 55%, rgba(2, 6, 23, 0.96) 100%);
  border: 1px solid rgba(45, 212, 191, 0.22);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.4) inset,
    0 14px 44px rgba(0, 0, 0, 0.48),
    0 0 60px rgba(45, 212, 191, 0.08);
}

.case-card--silver {
  background: linear-gradient(160deg, rgba(30, 41, 59, 0.95) 0%, rgba(23, 37, 84, 0.55) 42%, rgba(15, 23, 42, 0.96) 100%);
  border: 1px solid rgba(129, 140, 248, 0.28);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.38) inset,
    0 14px 44px rgba(0, 0, 0, 0.48),
    0 0 70px rgba(99, 102, 241, 0.12);
}

.case-card--gold {
  background: linear-gradient(160deg, rgba(69, 26, 3, 0.55) 0%, rgba(30, 20, 15, 0.92) 40%, rgba(15, 23, 42, 0.96) 100%);
  border: 1px solid rgba(251, 191, 36, 0.35);
  box-shadow:
    0 0 0 1px rgba(253, 224, 71, 0.08) inset,
    0 14px 44px rgba(0, 0, 0, 0.48),
    0 0 72px rgba(251, 191, 36, 0.14);
}

.case-card:hover {
  transform: translateY(-8px);
}

.case-card--bronze:hover {
  border-color: rgba(45, 212, 191, 0.4);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.4) inset,
    0 20px 56px rgba(0, 0, 0, 0.42),
    0 0 52px rgba(45, 212, 191, 0.2);
}

.case-card--silver:hover {
  border-color: rgba(165, 180, 252, 0.45);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.4) inset,
    0 20px 56px rgba(0, 0, 0, 0.42),
    0 0 56px rgba(129, 140, 248, 0.28);
}

.case-card--gold:hover {
  border-color: rgba(253, 224, 71, 0.5);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.4) inset,
    0 20px 56px rgba(0, 0, 0, 0.42),
    0 0 60px rgba(251, 191, 36, 0.28);
}

.case-card--diamond {
  background: linear-gradient(160deg, rgba(14, 116, 144, 0.35) 0%, rgba(15, 23, 42, 0.94) 45%, rgba(2, 6, 23, 0.98) 100%);
  border: 1px solid rgba(34, 211, 238, 0.38);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.4) inset,
    0 14px 44px rgba(0, 0, 0, 0.48),
    0 0 80px rgba(34, 211, 238, 0.16);
}

.case-card--diamond:hover {
  border-color: rgba(103, 232, 249, 0.55);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.4) inset,
    0 20px 56px rgba(0, 0, 0, 0.42),
    0 0 72px rgba(34, 211, 238, 0.32);
}

.case-card--emerald {
  background: linear-gradient(160deg, rgba(6, 78, 59, 0.45) 0%, rgba(15, 23, 42, 0.94) 48%, rgba(2, 6, 23, 0.98) 100%);
  border: 1px solid rgba(52, 211, 153, 0.4);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.4) inset,
    0 14px 44px rgba(0, 0, 0, 0.48),
    0 0 72px rgba(16, 185, 129, 0.14);
}

.case-card--emerald:hover {
  border-color: rgba(110, 231, 183, 0.55);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.4) inset,
    0 20px 56px rgba(0, 0, 0, 0.42),
    0 0 64px rgba(16, 185, 129, 0.28);
}

.case-tier-badge {
  position: absolute;
  top: 0.85rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 0.32rem 0.95rem;
  border-radius: 999px;
  white-space: nowrap;
}

.case-tier-badge--bronze {
  color: #ccfbf1;
  background: linear-gradient(90deg, rgba(15, 118, 110, 0.65), rgba(6, 95, 70, 0.85));
  border: 1px solid rgba(45, 212, 191, 0.45);
  box-shadow: 0 4px 16px rgba(45, 212, 191, 0.15);
}

.case-tier-badge--silver {
  color: #e0e7ff;
  background: linear-gradient(90deg, rgba(67, 56, 202, 0.55), rgba(30, 27, 75, 0.9));
  border: 1px solid rgba(165, 180, 252, 0.5);
  box-shadow: 0 4px 18px rgba(99, 102, 241, 0.2);
}

.case-tier-badge--gold {
  color: #fffbeb;
  background: linear-gradient(90deg, rgba(180, 83, 9, 0.75), rgba(120, 53, 15, 0.95));
  border: 1px solid rgba(253, 224, 71, 0.55);
  box-shadow: 0 4px 20px rgba(251, 191, 36, 0.25);
}

.case-tier-badge--diamond {
  color: #ecfeff;
  background: linear-gradient(90deg, rgba(8, 145, 178, 0.75), rgba(30, 27, 75, 0.92));
  border: 1px solid rgba(103, 232, 249, 0.55);
  box-shadow: 0 4px 22px rgba(34, 211, 238, 0.28);
}

.case-tier-badge--emerald {
  color: #ecfdf5;
  background: linear-gradient(90deg, rgba(5, 150, 105, 0.8), rgba(20, 83, 45, 0.92));
  border: 1px solid rgba(110, 231, 183, 0.55);
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.25);
}

.case-visual-wrap {
  position: relative;
  margin: 0 0 1.15rem;
  padding: 0.55rem;
  border-radius: 16px;
  overflow: visible;
}

.case-card--bronze .case-visual-wrap {
  background: radial-gradient(ellipse 90% 80% at 50% 100%, rgba(45, 212, 191, 0.12), transparent 55%);
}

.case-card--silver .case-visual-wrap {
  background: radial-gradient(ellipse 90% 80% at 50% 100%, rgba(129, 140, 248, 0.14), transparent 55%);
}

.case-card--gold .case-visual-wrap {
  background: radial-gradient(ellipse 90% 80% at 50% 100%, rgba(251, 191, 36, 0.16), transparent 55%);
}

.case-card--diamond .case-visual-wrap {
  background: radial-gradient(ellipse 90% 80% at 50% 100%, rgba(34, 211, 238, 0.2), transparent 55%);
}

.case-card--emerald .case-visual-wrap {
  background: radial-gradient(ellipse 90% 80% at 50% 100%, rgba(16, 185, 129, 0.22), transparent 55%);
}

.case-visual-glow {
  position: absolute;
  inset: -25%;
  border-radius: 24px;
  pointer-events: none;
  opacity: 0.75;
  animation: caseGlowPulse 4s ease-in-out infinite;
}

.case-visual-glow--bronze {
  background: radial-gradient(ellipse 50% 45% at 50% 45%, rgba(45, 212, 191, 0.25), transparent 70%);
}

.case-visual-glow--silver {
  background: radial-gradient(ellipse 50% 45% at 50% 45%, rgba(129, 140, 248, 0.3), transparent 70%);
}

.case-visual-glow--gold {
  background: radial-gradient(ellipse 50% 45% at 50% 45%, rgba(251, 191, 36, 0.28), transparent 70%);
}

.case-visual-glow--diamond {
  background:
    radial-gradient(ellipse 45% 40% at 50% 45%, rgba(255, 255, 255, 0.22), transparent 65%),
    radial-gradient(ellipse 50% 45% at 50% 45%, rgba(34, 211, 238, 0.35), transparent 70%);
}

.case-visual-glow--emerald {
  background:
    radial-gradient(ellipse 45% 40% at 50% 45%, rgba(255, 255, 255, 0.18), transparent 65%),
    radial-gradient(ellipse 50% 45% at 50% 45%, rgba(16, 185, 129, 0.38), transparent 70%);
}


@keyframes caseGlowPulse {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(1);
  }
  50% {
    opacity: 0.95;
    transform: scale(1.03);
  }
}

.case-visual {
  height: 148px;
  border-radius: 14px;
  position: relative;
  overflow: hidden;
  box-shadow:
    inset 0 3px 16px rgba(0, 0, 0, 0.45),
    0 10px 28px rgba(0, 0, 0, 0.35);
  animation: caseChestFloat 5s ease-in-out infinite;
  z-index: 1;
}

@keyframes caseChestFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

.case-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(125deg, transparent 30%, rgba(255, 255, 255, 0.14) 48%, transparent 62%);
  animation: chest-shimmer 4.5s ease-in-out infinite;
  pointer-events: none;
  z-index: 3;
}

@keyframes chest-shimmer {
  0%,
  100% {
    opacity: 0.35;
    transform: translateX(-30%) skewX(-12deg);
  }
  50% {
    opacity: 0.88;
    transform: translateX(40%) skewX(-12deg);
  }
}

.case-chest-lid {
  display: block;
  position: absolute;
  top: 8%;
  left: 8%;
  right: 8%;
  height: 40%;
  border-radius: 12px 12px 5px 5px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.32) 0%, rgba(255, 255, 255, 0.06) 55%, rgba(0, 0, 0, 0.12) 100%);
  box-shadow:
    0 3px 10px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  pointer-events: none;
  z-index: 2;
}

.case-chest-band {
  display: block;
  position: absolute;
  top: 52%;
  left: 10%;
  right: 10%;
  height: 9px;
  border-radius: 4px;
  pointer-events: none;
  z-index: 2;
}

.case-common .case-chest-band {
  background: linear-gradient(90deg, transparent, rgba(214, 211, 209, 0.55), rgba(120, 113, 108, 0.9), rgba(214, 211, 209, 0.55), transparent);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.case-rare .case-chest-band {
  background: linear-gradient(90deg, transparent, rgba(186, 230, 253, 0.5), rgba(56, 189, 248, 0.85), rgba(186, 230, 253, 0.5), transparent);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
}

.case-legendary .case-chest-band {
  background: linear-gradient(90deg, transparent, rgba(253, 224, 71, 0.65), rgba(245, 158, 11, 0.95), rgba(253, 224, 71, 0.65), transparent);
  box-shadow: 0 0 16px rgba(251, 191, 36, 0.45);
}

.case-diamond .case-chest-band {
  background: linear-gradient(90deg, transparent, rgba(207, 250, 254, 0.55), rgba(34, 211, 238, 0.95), rgba(167, 139, 250, 0.75), rgba(207, 250, 254, 0.55), transparent);
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.55);
}

/* Алмазный сундук: отдельные акценты крышки/корпуса, запасной фон (если градиент не подгрузился) */
.case-diamond .case-chest-lid {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55) 0%, rgba(186, 230, 253, 0.35) 45%, rgba(14, 116, 144, 0.25) 100%);
  box-shadow:
    0 4px 14px rgba(34, 211, 238, 0.45),
    inset 0 2px 0 rgba(255, 255, 255, 0.5);
}

.case-chest-lock {
  display: block;
  position: absolute;
  bottom: 22%;
  left: 50%;
  width: 30px;
  height: 30px;
  margin-left: -15px;
  border-radius: 6px;
  pointer-events: none;
  z-index: 4;
}

.case-chest-lock::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 11px;
  height: 11px;
  margin: -5.5px 0 0 -5.5px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.75);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.15);
}

.case-chest-lock--bronze {
  background: linear-gradient(145deg, #5eead4, #0f766e, #134e4a);
  box-shadow:
    0 3px 10px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.case-chest-lock--silver {
  background: linear-gradient(145deg, #e2e8f0, #64748b, #475569);
  box-shadow:
    0 3px 10px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.case-chest-lock--gold {
  background: linear-gradient(145deg, #fde68a, #d97706, #92400e);
  box-shadow:
    0 3px 12px rgba(180, 83, 9, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.case-chest-lock--diamond {
  background: linear-gradient(145deg, #ecfeff, #22d3ee, #7c3aed, #0e7490);
  box-shadow:
    0 3px 16px rgba(34, 211, 238, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.case-chest-lock--emerald {
  background: linear-gradient(145deg, #d1fae5, #10b981, #065f46, #022c22);
  box-shadow:
    0 3px 16px rgba(16, 185, 129, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.case-emerald .case-chest-band {
  background: linear-gradient(90deg, transparent, rgba(167, 243, 208, 0.55), rgba(16, 185, 129, 0.95), rgba(52, 211, 153, 0.75), transparent);
  box-shadow: 0 0 18px rgba(16, 185, 129, 0.45);
}

.case-emerald .case-chest-lid {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.45) 0%, rgba(167, 243, 208, 0.35) 45%, rgba(6, 95, 70, 0.35) 100%);
  box-shadow:
    0 4px 12px rgba(16, 185, 129, 0.4),
    inset 0 2px 0 rgba(255, 255, 255, 0.45);
}

.case-common {
  background: linear-gradient(168deg, #a8a29e 0%, #57534e 28%, #292524 62%, #0c0a09 100%);
  border: 1px solid rgba(168, 162, 158, 0.4);
}

.case-common::after {
  content: "";
  position: absolute;
  inset: 13%;
  border: 2px solid rgba(214, 211, 209, 0.5);
  border-radius: 11px;
  box-shadow:
    0 0 24px rgba(120, 113, 108, 0.35),
    inset 0 0 20px rgba(0, 0, 0, 0.2);
  pointer-events: none;
  z-index: 1;
}

.case-rare {
  background: linear-gradient(168deg, #94a3b8 0%, #475569 32%, #1e293b 65%, #020617 100%);
  border: 1px solid rgba(56, 189, 248, 0.42);
}

.case-rare::after {
  content: "";
  position: absolute;
  inset: 11%;
  border: 2px solid rgba(125, 211, 252, 0.6);
  border-radius: 12px;
  box-shadow:
    0 0 32px rgba(56, 189, 248, 0.4),
    inset 0 0 24px rgba(56, 189, 248, 0.08);
  pointer-events: none;
  z-index: 1;
}

.case-legendary {
  background: linear-gradient(168deg, #fbbf24 0%, #b45309 28%, #7c2d12 58%, #1c1917 100%);
  border: 1px solid rgba(253, 224, 71, 0.5);
}

.case-legendary::after {
  content: "";
  position: absolute;
  inset: 10%;
  border: 2px solid rgba(253, 224, 71, 0.7);
  border-radius: 12px;
  box-shadow:
    0 0 36px var(--gold-glow),
    inset 0 0 28px rgba(251, 191, 36, 0.12);
  pointer-events: none;
  z-index: 1;
}

.case-diamond {
  /* Сплошной подложки хватит, если градиенты отключены системой */
  background-color: #0c4a6e;
  background-image:
    linear-gradient(140deg, rgba(255, 255, 255, 0.35) 0%, transparent 42%),
    linear-gradient(220deg, rgba(167, 139, 250, 0.35) 0%, transparent 45%),
    linear-gradient(168deg, #e0f2fe 0%, #22d3ee 16%, #6366f1 40%, #0f172a 70%, #020617 100%);
  border: 2px solid rgba(165, 243, 252, 0.75);
  box-shadow:
    inset 0 3px 16px rgba(0, 0, 0, 0.45),
    0 10px 28px rgba(0, 0, 0, 0.35),
    0 0 28px rgba(34, 211, 238, 0.35);
}

.case-diamond::after {
  content: "";
  position: absolute;
  inset: 9%;
  border: 2px solid rgba(103, 232, 249, 0.75);
  border-radius: 12px;
  box-shadow:
    0 0 42px var(--rarity-mythical-glow),
    inset 0 0 32px rgba(34, 211, 238, 0.2);
  pointer-events: none;
  z-index: 1;
}

/* «Огранка» в центре — заметный алмазный ромб (перекрывает общий shimmer .case-visual::before) */
.case-diamond::before {
  content: "";
  position: absolute;
  inset: auto;
  left: 50%;
  top: 56%;
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  transform: rotate(45deg);
  border-radius: 4px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.55), rgba(34, 211, 238, 0.5), rgba(124, 58, 237, 0.45));
  box-shadow:
    0 0 20px rgba(255, 255, 255, 0.45),
    inset 0 0 12px rgba(255, 255, 255, 0.35);
  animation: none;
  pointer-events: none;
  z-index: 2;
}

.case-emerald {
  background-color: #064e3b;
  background-image:
    linear-gradient(130deg, rgba(255, 255, 255, 0.28) 0%, transparent 40%),
    linear-gradient(210deg, rgba(52, 211, 153, 0.35) 0%, transparent 42%),
    linear-gradient(168deg, #a7f3d0 0%, #10b981 18%, #047857 42%, #0f172a 72%, #020617 100%);
  border: 2px solid rgba(110, 231, 183, 0.65);
  box-shadow:
    inset 0 3px 16px rgba(0, 0, 0, 0.45),
    0 10px 28px rgba(0, 0, 0, 0.35),
    0 0 26px rgba(16, 185, 129, 0.32);
}

.case-emerald::after {
  content: "";
  position: absolute;
  inset: 9%;
  border: 2px solid rgba(167, 243, 208, 0.65);
  border-radius: 12px;
  box-shadow:
    0 0 36px var(--rarity-verdant-glow),
    inset 0 0 28px rgba(16, 185, 129, 0.18);
  pointer-events: none;
  z-index: 1;
}

.case-emerald::before {
  content: "";
  position: absolute;
  inset: auto;
  left: 50%;
  top: 56%;
  width: 32px;
  height: 40px;
  margin: -20px 0 0 -16px;
  transform: rotate(30deg) skewY(-18deg);
  border-radius: 3px 8px 3px 8px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.5), rgba(16, 185, 129, 0.75), rgba(5, 150, 105, 0.9));
  box-shadow:
    0 0 18px rgba(167, 243, 208, 0.55),
    inset 0 0 10px rgba(255, 255, 255, 0.35);
  animation: none;
  pointer-events: none;
  z-index: 2;
}

.case-title {
  margin: 0 0 0.45rem;
  font-size: 1.22rem;
  font-family: var(--font-display);
  letter-spacing: 0.05em;
}

.case-title--bronze {
  background: linear-gradient(90deg, #ccfbf1, #99f6e4, #ccfbf1);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 10px rgba(45, 212, 191, 0.25));
}

.case-title--silver {
  background: linear-gradient(90deg, #e0e7ff, #c7d2fe, #a5b4fc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 12px rgba(129, 140, 248, 0.3));
}

.case-title--gold {
  background: linear-gradient(90deg, #fef3c7, #fde68a, #fbbf24, #fef3c7);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 14px rgba(251, 191, 36, 0.35));
  animation: caseTitleGold 6s linear infinite;
}

@keyframes caseTitleGold {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 200% 50%;
  }
}

.case-title--diamond {
  background: linear-gradient(90deg, #ecfeff, #67e8f9, #a5b4fc, #ecfeff);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 14px rgba(34, 211, 238, 0.45));
  animation: caseTitleDiamond 5s linear infinite;
}

@keyframes caseTitleDiamond {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 200% 50%;
  }
}

.case-title--emerald {
  background: linear-gradient(90deg, #d1fae5, #6ee7b7, #34d399, #d1fae5);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 14px rgba(16, 185, 129, 0.45));
  animation: caseTitleEmerald 5.5s linear infinite;
}

@keyframes caseTitleEmerald {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 200% 50%;
  }
}

.case-card h3:not(.case-title) {
  margin: 0 0 0.45rem;
  font-size: 1.2rem;
  font-family: var(--font-display);
  letter-spacing: 0.04em;
}

.case-desc {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.45;
  margin: 0 0 1rem;
  min-height: 2.75rem;
}

.case-price {
  margin: 0 0 1.15rem;
  font-size: 1.12rem;
  font-weight: 600;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  display: inline-block;
  border: 1px solid transparent;
}

.case-card--bronze .case-price {
  color: #99f6e4;
  background: rgba(15, 118, 110, 0.22);
  border-color: rgba(45, 212, 191, 0.28);
}

.case-card--silver .case-price {
  color: #c7d2fe;
  background: rgba(67, 56, 202, 0.2);
  border-color: rgba(165, 180, 252, 0.3);
}

.case-card--gold .case-price {
  color: var(--gold);
  background: rgba(120, 53, 15, 0.35);
  border-color: rgba(251, 191, 36, 0.35);
}

.case-card--diamond .case-price {
  color: #a5f3fc;
  background: rgba(8, 47, 73, 0.45);
  border-color: rgba(34, 211, 238, 0.4);
}

.case-card--emerald .case-price {
  color: #a7f3d0;
  background: rgba(6, 78, 59, 0.45);
  border-color: rgba(52, 211, 153, 0.42);
}

.case-card--bronze .case-price .currency-gold {
  color: var(--gold);
}

.case-card--silver .case-price .currency-gem,
.case-card--gold .case-price .currency-gem,
.case-card--diamond .case-price .currency-gem,
.case-card--emerald .case-price .currency-gem {
  color: var(--gem);
}

.currency-gem {
  color: var(--gem);
}

/* (Пасхальные стили удалены) */

/* ——— Коллекция ——— */
.collection-tabs,
.quests-tabs {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  margin: 0.5rem 0 1.25rem;
  flex-wrap: wrap;
}

.collection-tab {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.6rem 1.1rem;
  border: 1px solid rgba(56, 189, 248, 0.28);
  background: rgba(2, 6, 23, 0.35);
  color: rgba(226, 232, 240, 0.88);
  clip-path: var(--btn-clip-wide);
  transition: transform 0.18s ease, border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.collection-tab:hover {
  transform: translateY(-2px);
  border-color: rgba(94, 234, 212, 0.45);
  box-shadow: 0 10px 28px rgba(56, 189, 248, 0.16);
}

.collection-tab.is-active {
  background: linear-gradient(125deg, rgba(56, 189, 248, 0.22), rgba(94, 234, 212, 0.14), rgba(129, 140, 248, 0.16));
  border-color: rgba(165, 243, 252, 0.55);
  color: #f8fafc;
  box-shadow:
    0 0 0 1px rgba(129, 140, 248, 0.35),
    0 12px 32px rgba(14, 165, 233, 0.22);
}

.collection-panel.hidden,
.quests-panel.hidden {
  display: none;
}

.collection-section-title {
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #a5f3fc;
  margin: 2rem 0 0.75rem;
}

#screen-collection .collection-section-title:first-of-type {
  margin-top: 0.35rem;
}

.collection-section-title--enemies {
  margin-top: 2.25rem;
}

.collection-section-sub {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ——— Квесты ——— */
#screen-quests .screen-header {
  align-items: flex-start;
  flex-wrap: wrap;
}

.screen-quests-title {
  flex: 1;
  min-width: 200px;
}

.screen-quests-title h2 {
  margin: 0 0 0.25rem;
}

.screen-quests-sub {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 400;
}

.quests-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 720px;
  margin: 0 auto;
}

.quest-card {
  padding: 1.1rem 1.25rem;
  border-radius: 14px;
  background: linear-gradient(155deg, rgba(30, 41, 59, 0.72), rgba(15, 23, 42, 0.88));
  border: 1px solid rgba(56, 189, 248, 0.14);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  transition: border-color 0.22s ease, box-shadow 0.22s ease;
}

.quest-card:hover {
  border-color: rgba(94, 234, 212, 0.22);
}

.quest-card--done {
  border-color: rgba(52, 211, 153, 0.32);
  box-shadow:
    0 8px 28px rgba(0, 0, 0, 0.35),
    0 0 24px rgba(52, 211, 153, 0.08);
}

.quest-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.45rem;
}

.quest-title {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #f1f5f9;
}

.quest-badge {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.28);
  color: rgba(186, 230, 253, 0.92);
  background: rgba(2, 6, 23, 0.45);
}

.quest-badge--done {
  border-color: rgba(52, 211, 153, 0.45);
  color: #a7f3d0;
  background: rgba(6, 78, 59, 0.35);
}

.quest-desc {
  margin: 0 0 0.85rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.quest-reward {
  margin: 0 0 0.55rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: rgba(186, 230, 253, 0.88);
}

.quest-reward-gold {
  color: var(--gold);
  font-weight: 700;
}

.quest-reward-gem {
  color: var(--gem);
  font-weight: 700;
}

.quest-reward-status {
  display: block;
  margin: 0 0 0.75rem;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  color: rgba(148, 163, 184, 0.88);
}

.quest-reward-status--claimed {
  color: #6ee7b7;
}

.quest-progress {
  height: 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.92);
  overflow: hidden;
  border: 1px solid rgba(56, 189, 248, 0.12);
}

.quest-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #38bdf8, #818cf8);
  transition: width 0.35s ease;
}

.quest-card--done .quest-progress-fill {
  background: linear-gradient(90deg, #34d399, #5eead4);
}

.quest-progress-label {
  margin: 0.4rem 0 0;
  font-size: 0.78rem;
  color: rgba(148, 163, 184, 0.95);
  text-align: right;
}

.collection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
}

.collection-enemies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(288px, 1fr));
  gap: 1rem;
}

.enemy-slot {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem 1.15rem;
  border-radius: 14px;
  background: linear-gradient(155deg, rgba(30, 41, 59, 0.72), rgba(15, 23, 42, 0.88));
  border: 1px solid rgba(56, 189, 248, 0.14);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.enemy-slot:hover {
  border-color: rgba(94, 234, 212, 0.28);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4), 0 0 28px rgba(56, 189, 248, 0.06);
}

.enemy-icon {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.75), var(--enemy-c) 44%, #0f172a 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.enemy-body {
  min-width: 0;
  flex: 1;
}

.enemy-name {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  margin-bottom: 0.35rem;
}

.enemy-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0 0 0.65rem;
}

.enemy-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: #94a3b8;
}

.enemy-stat {
  padding: 0.22rem 0.5rem;
  border-radius: 6px;
  background: rgba(2, 6, 23, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.15);
}

.hero-slot {
  aspect-ratio: 3/4;
  border-radius: 14px;
  background: linear-gradient(165deg, rgba(40, 52, 78, 0.55), rgba(15, 23, 42, 0.75));
  border: 2px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 0.5rem;
  position: relative;
  transition: transform 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.hero-slot.owned {
  border-color: rgba(94, 234, 212, 0.42);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35), 0 0 24px rgba(45, 212, 191, 0.08);
}

.hero-slot.owned:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4), 0 0 32px rgba(45, 212, 191, 0.15);
}

.hero-slot.locked {
  opacity: 0.45;
  filter: grayscale(0.9);
}

.hero-slot .mini-portrait {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.85;
}

.hero-slot.locked .mini-portrait {
  opacity: 0.25;
}

.hero-slot .slot-name {
  position: relative;
  z-index: 1;
  font-size: 0.72rem;
  text-align: center;
  line-height: 1.2;
  text-shadow: 0 2px 8px #000;
}

.rarity-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 0.65rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  z-index: 2;
  text-transform: uppercase;
}

.rarity-common {
  background: rgba(156, 163, 175, 0.4);
}
.rarity-rare {
  background: rgba(56, 189, 248, 0.45);
}
.rarity-epic {
  background: rgba(167, 139, 250, 0.45);
}
.rarity-legendary {
  background: rgba(251, 191, 36, 0.45);
  color: #1c1917;
}
.rarity-mythical {
  background: linear-gradient(125deg, rgba(34, 211, 238, 0.55), rgba(167, 139, 250, 0.5));
  color: #0f172a;
  font-weight: 800;
  box-shadow: 0 0 18px var(--rarity-mythical-glow);
}
.rarity-verdant {
  background: linear-gradient(125deg, rgba(16, 185, 129, 0.6), rgba(52, 211, 153, 0.45), rgba(5, 150, 105, 0.55));
  color: #022c22;
  font-weight: 800;
  box-shadow: 0 0 18px var(--rarity-verdant-glow);
}

/* ——— Игра ——— */
.screen-game {
  max-width: 1280px;
}

.game-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding: 0.65rem 1rem;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.65), rgba(15, 23, 42, 0.35));
  border-radius: 14px;
  border: 1px solid rgba(94, 234, 212, 0.12);
  backdrop-filter: blur(14px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.hud-wave-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.hud-mods {
  position: fixed;
  left: 50%;
  top: 84px;
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  justify-content: center;
  width: min(860px, calc(100vw - 2rem));
  pointer-events: auto;
  z-index: 80;
}

.hud-mods.hidden {
  display: none;
}

@media (max-width: 680px) {
  .hud-mods {
    top: 126px;
  }
}

.mod-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(240, 253, 250, 0.92);
  background: linear-gradient(125deg, rgba(56, 189, 248, 0.18), rgba(129, 140, 248, 0.14), rgba(94, 234, 212, 0.12));
  border: 1px solid rgba(165, 243, 252, 0.25);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
  max-width: 100%;
  cursor: help;
}

.mod-pill.mod-pill--empty {
  opacity: 0.65;
  background: rgba(2, 6, 23, 0.25);
  border-color: rgba(148, 163, 184, 0.18);
  color: rgba(203, 213, 225, 0.92);
  cursor: default;
}

.mod-pill .mod-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.85), rgba(94, 234, 212, 0.75), rgba(99, 102, 241, 0.55));
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.25);
  flex: 0 0 auto;
}

.mod-pill .mod-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 16rem;
}

/* Игровой HUD: та же палитра, что у заголовка меню */
.btn-game {
  position: relative;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  color: #f0fdfa;
  border: none;
  clip-path: var(--btn-clip-main);
  background: var(--btn-surface-title-strong);
  box-shadow:
    0 4px 0 #020617,
    0 10px 28px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(165, 243, 252, 0.22);
  transition: transform 0.22s ease, filter 0.22s ease, box-shadow 0.28s ease;
}

.btn-game:hover {
  transform: translateY(-3px) scale(1.03);
  filter: brightness(1.1) saturate(1.08);
  box-shadow:
    0 7px 0 #020617,
    0 16px 40px rgba(56, 189, 248, 0.32),
    inset 0 1px 0 rgba(186, 230, 253, 0.32);
}

.btn-game:active {
  transform: translateY(1px) scale(0.98);
}

.btn-game-nav {
  clip-path: var(--btn-clip-mirror);
  font-weight: 600;
}

.btn-game-auto.is-on {
  background: var(--btn-surface-title-strong);
  color: #f0f9ff;
  box-shadow:
    0 0 0 1px rgba(129, 140, 248, 0.5),
    0 8px 32px rgba(14, 165, 233, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.game-hud--styled {
  border-color: rgba(30, 64, 175, 0.22);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.5), rgba(15, 23, 42, 0.25));
}

.hud-center {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  font-size: 0.95rem;
}

.hud-item {
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}

.hud-item strong {
  color: var(--accent);
  font-weight: 700;
}

.hud-gems strong {
  color: var(--gem);
}

.game-wrap {
  display: flex;
  gap: 1rem;
  flex-wrap: nowrap;
  align-items: flex-start;
  justify-content: flex-start;
}

/* Фон как у клеток поля в td.js (шахматка 40px), если под канвасом есть поле рамки — не градиент, а плитка */
.canvas-frame {
  position: relative;
  border-radius: 16px;
  padding: 3px;
  background-color: rgb(20, 28, 48);
  background-image:
    linear-gradient(45deg, rgba(30, 42, 68, 0.97) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(30, 42, 68, 0.97) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(24, 34, 56, 0.98) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(16, 24, 42, 0.99) 75%);
  background-size: 40px 40px;
  background-position: 0 0, 0 20px, 20px -20px, -20px 0px;
  box-shadow:
    var(--shadow-lg),
    0 0 0 1px rgba(0, 0, 0, 0.4) inset,
    0 0 60px rgba(45, 212, 191, 0.12),
    0 0 100px rgba(99, 102, 241, 0.08);
  max-width: 100%;
}

.canvas-frame-glow {
  position: absolute;
  inset: -20%;
  border-radius: 24px;
  background: radial-gradient(ellipse 70% 60% at 50% 50%, rgba(94, 234, 212, 0.15), transparent 70%);
  pointer-events: none;
  z-index: 0;
  animation: framePulse 4s ease-in-out infinite;
}

@keyframes framePulse {
  0%,
  100% {
    opacity: 0.7;
  }
  50% {
    opacity: 1;
  }
}

#game-canvas {
  position: relative;
  z-index: 1;
  display: block;
  border-radius: 13px;
  max-width: 100%;
  height: auto;
  background: #070b14;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5) inset;
}

.tower-panel {
  width: 200px;
  min-width: 180px;
  background: linear-gradient(165deg, rgba(30, 41, 59, 0.92) 0%, rgba(15, 23, 42, 0.88) 100%);
  border-radius: 16px;
  padding: 1.1rem;
  border: 1px solid rgba(94, 234, 212, 0.2);
  backdrop-filter: blur(18px) saturate(1.15);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(0, 0, 0, 0.25) inset,
    0 0 36px rgba(45, 212, 191, 0.06);
}

.panel-title {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tower-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tower-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.85rem;
  clip-path: var(--btn-clip-main);
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: var(--btn-surface-title-ghost);
  color: #e0f2fe;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 600;
  text-align: left;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(165, 243, 252, 0.12);
  transition: transform 0.2s ease, border-color 0.22s ease, box-shadow 0.25s ease, background 0.22s ease, filter 0.2s ease;
}

.tower-btn:hover {
  border-color: rgba(129, 140, 248, 0.55);
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow: 0 10px 32px rgba(56, 189, 248, 0.2), inset 0 1px 0 rgba(186, 230, 253, 0.2);
}

.tower-btn.selected {
  border-color: rgba(165, 243, 252, 0.65);
  background: var(--btn-surface-title);
  box-shadow: 0 0 0 1px rgba(129, 140, 248, 0.35), 0 10px 36px rgba(14, 165, 233, 0.22);
}

.tower-mech {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.68rem;
  font-weight: 500;
  color: rgba(147, 197, 253, 0.9);
  line-height: 1.35;
}

.tower-btn .tower-rarity-pill {
  display: inline-block;
  vertical-align: middle;
  margin: 0 0.2rem 0.15rem 0;
  font-size: 0.58rem;
  padding: 0.12rem 0.38rem;
  letter-spacing: 0.06em;
}

.tower-stats-hint {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.65rem;
  font-weight: 600;
  color: rgba(167, 243, 252, 0.82);
  letter-spacing: 0.04em;
}

.tower-btn.locked {
  opacity: 0.5;
}

.tower-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  flex-shrink: 0;
}

.panel-hint {
  margin: 1rem 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.game-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: radial-gradient(ellipse 80% 70% at 50% 45%, rgba(15, 23, 42, 0.75), rgba(2, 6, 23, 0.92));
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(12px) saturate(1.1);
}

.game-overlay.hidden {
  display: none;
}

.overlay-card {
  text-align: center;
  padding: 2.25rem 2.75rem;
  background: linear-gradient(165deg, rgba(36, 48, 72, 0.95), rgba(15, 23, 42, 0.92));
  border-radius: 20px;
  border: 1px solid rgba(94, 234, 212, 0.32);
  max-width: 380px;
  box-shadow: var(--shadow-lg), 0 0 80px rgba(45, 212, 191, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.overlay-card h2 {
  font-family: var(--font-display);
  margin-top: 0;
}

/* ——— Выбор сложности перед игрой ——— */
.difficulty-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background:
    radial-gradient(ellipse 100% 80% at 50% 20%, rgba(56, 189, 248, 0.08), transparent 50%),
    radial-gradient(ellipse 70% 50% at 80% 90%, rgba(124, 58, 237, 0.12), transparent 55%),
    linear-gradient(165deg, rgba(3, 7, 18, 0.92) 0%, rgba(15, 23, 42, 0.88) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(16px) saturate(1.15);
}

.difficulty-overlay.hidden {
  display: none;
}

.difficulty-modal {
  position: relative;
  max-width: 460px;
  width: 100%;
  padding: 0 0 1.75rem;
  border-radius: 22px;
  background: linear-gradient(165deg, rgba(22, 32, 52, 0.97) 0%, rgba(12, 18, 35, 0.98) 45%, rgba(8, 12, 28, 0.99) 100%);
  border: 1px solid rgba(94, 234, 212, 0.22);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.5) inset,
    0 24px 64px rgba(0, 0, 0, 0.55),
    0 0 100px rgba(45, 212, 191, 0.1),
    0 0 140px rgba(99, 102, 241, 0.08);
  overflow: hidden;
}

.difficulty-modal-glow {
  position: absolute;
  inset: -40% -20% auto -20%;
  height: 70%;
  background: radial-gradient(ellipse 60% 50% at 50% 0%, rgba(94, 234, 212, 0.18), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.difficulty-modal-head,
.difficulty-modal-desc,
.difficulty-modal .difficulty-bar,
.difficulty-modal-actions {
  position: relative;
  z-index: 1;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.difficulty-modal-head {
  text-align: center;
  padding-top: 1.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  margin-bottom: 1.1rem;
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.35), transparent);
}

.difficulty-modal-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 0.65rem;
  filter: drop-shadow(0 8px 24px rgba(94, 234, 212, 0.35));
}

.difficulty-modal-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(165, 243, 252, 0.75);
}

.difficulty-modal-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.55rem;
  letter-spacing: 0.06em;
  background: linear-gradient(90deg, #ccfbf1, #a5b4fc, #e9d5ff);
  background-size: 160% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 14px rgba(56, 189, 248, 0.25));
}

.difficulty-modal-desc {
  margin: 0 0 1.35rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: rgba(203, 213, 225, 0.88);
}

.difficulty-modal .difficulty-bar {
  margin-bottom: 1.6rem;
  padding-top: 0.25rem;
}

.difficulty-modal .difficulty-label {
  color: rgba(148, 163, 184, 0.95);
  margin-bottom: 0.45rem;
}

.difficulty-modal .diff-chip {
  box-shadow:
    0 3px 0 rgba(0, 0, 0, 0.45),
    0 8px 24px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition:
    transform 0.2s ease,
    box-shadow 0.25s ease,
    border-color 0.2s ease;
}

.difficulty-modal .diff-chip--easy.diff-chip--active {
  box-shadow:
    0 0 0 1px rgba(52, 211, 153, 0.5),
    0 4px 0 #020617,
    0 12px 32px rgba(16, 185, 129, 0.25);
}

.difficulty-modal .diff-chip--normal.diff-chip--active {
  box-shadow:
    0 0 0 1px rgba(129, 140, 248, 0.55),
    0 4px 0 #020617,
    0 12px 32px rgba(99, 102, 241, 0.28);
}

.difficulty-modal .diff-chip--hard.diff-chip--active {
  box-shadow:
    0 0 0 1px rgba(248, 113, 113, 0.45),
    0 4px 0 #020617,
    0 12px 36px rgba(220, 38, 38, 0.22);
}

.difficulty-modal .diff-chip--impossible {
  background: linear-gradient(125deg, rgba(220, 38, 38, 0.28), rgba(124, 58, 237, 0.2), rgba(15, 23, 42, 0.92));
  border: 1px solid rgba(248, 113, 113, 0.26);
}

.difficulty-modal .diff-chip--impossible.diff-chip--active {
  box-shadow:
    0 0 0 1px rgba(248, 113, 113, 0.58),
    0 4px 0 #020617,
    0 14px 42px rgba(220, 38, 38, 0.3);
}

.difficulty-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  justify-content: center;
  padding-top: 0.25rem;
}

.btn-diff-outline {
  min-width: 8.5rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.6);
  color: #e2e8f0;
}

.btn-diff-outline:hover {
  border-color: rgba(94, 234, 212, 0.45);
  background: rgba(30, 41, 59, 0.75);
}

.btn-diff-primary {
  min-width: 11rem;
  box-shadow:
    0 4px 0 #0c4a6e,
    0 14px 36px rgba(14, 165, 233, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-diff-primary:hover {
  filter: brightness(1.08);
  box-shadow:
    0 6px 0 #0c4a6e,
    0 18px 44px rgba(56, 189, 248, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

/* ——— Оверлей кейса ——— */
.case-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: radial-gradient(ellipse 90% 80% at 50% 40%, rgba(30, 27, 75, 0.55), rgba(3, 7, 18, 0.94));
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(14px) saturate(1.2);
}

.case-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 35%, rgba(99, 102, 241, 0.2), transparent 55%);
  pointer-events: none;
}

.case-overlay.hidden {
  display: none;
}

.case-reveal {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem;
  max-width: 420px;
}

/* ——— Промокоды ——— */
.promo-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: radial-gradient(ellipse 90% 80% at 50% 40%, rgba(15, 23, 42, 0.55), rgba(3, 7, 18, 0.92));
  backdrop-filter: blur(14px) saturate(1.15);
}

.promo-overlay.hidden {
  display: none;
}

.promo-modal {
  width: min(520px, 100%);
  background: linear-gradient(165deg, rgba(30, 41, 59, 0.82) 0%, rgba(15, 23, 42, 0.92) 100%);
  border: 1px solid rgba(94, 234, 212, 0.16);
  box-shadow: var(--shadow-lg), 0 0 44px rgba(56, 189, 248, 0.08);
  clip-path: var(--btn-clip-wide);
  padding: 1.35rem 1.35rem 1.2rem;
}

.promo-head h2 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  letter-spacing: 0.06em;
}

.promo-sub {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.promo-label {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  margin: 0 0 0.35rem;
}

.promo-input {
  width: 100%;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(2, 6, 23, 0.55);
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.promo-input:focus {
  border-color: rgba(94, 234, 212, 0.45);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.promo-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.promo-actions .btn {
  flex: 1 1 180px;
}

.promo-status {
  margin: 0.9rem 0 0;
  min-height: 1.35em;
  color: rgba(226, 232, 240, 0.92);
  font-size: 0.92rem;
}

.case-box-3d {
  width: 140px;
  height: 100px;
  margin: 0 auto 2rem;
  position: relative;
  transform-style: preserve-3d;
  animation: caseShake 0.6s ease-in-out 3;
}

@keyframes caseShake {
  0%,
  100% {
    transform: rotateY(0deg) translateY(0);
  }
  25% {
    transform: rotateY(-8deg) translateY(-4px);
  }
  75% {
    transform: rotateY(8deg) translateY(4px);
  }
}

.case-box-3d.opening {
  animation: caseOpen 1.2s ease forwards;
}

@keyframes caseOpen {
  0% {
    transform: scale(1) rotateY(0);
    opacity: 1;
  }
  40% {
    transform: scale(1.15) rotateY(180deg);
  }
  100% {
    transform: scale(0) rotateY(360deg);
    opacity: 0;
  }
}

.case-face {
  position: absolute;
  border-radius: 8px;
}

.case-face-front {
  inset: 0;
  background: linear-gradient(145deg, #818cf8 0%, #6366f1 40%, #312e81 100%);
  border: 2px solid rgba(255, 255, 255, 0.28);
  box-shadow:
    0 12px 48px rgba(99, 102, 241, 0.5),
    0 0 40px rgba(129, 140, 248, 0.25),
    inset 0 2px 0 rgba(255, 255, 255, 0.2),
    inset 0 -8px 24px rgba(0, 0, 0, 0.25);
}

.case-face-top {
  bottom: 100%;
  left: 10%;
  right: 10%;
  height: 24px;
  background: linear-gradient(180deg, #818cf8, #4338ca);
  transform-origin: bottom;
  transform: rotateX(-25deg);
}

.reveal-card-wrap {
  perspective: 1000px;
}

.reveal-card-wrap.hidden {
  display: none;
}

.reveal-card-wrap:not(.hidden) {
  display: block;
  animation: cardPop 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cardPop {
  from {
    opacity: 0;
    transform: scale(0.3) rotateY(-40deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotateY(0);
  }
}

.hero-card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 3px solid var(--rarity-rare);
  box-shadow: 0 0 40px rgba(56, 189, 248, 0.35);
}

.hero-card.legendary {
  border-color: var(--rarity-legendary);
  box-shadow: 0 0 50px var(--gold-glow);
}

.hero-card.mythical {
  border-color: var(--rarity-mythical);
  box-shadow:
    0 0 56px var(--rarity-mythical-glow),
    0 0 28px rgba(167, 139, 250, 0.35);
}

.hero-card.verdant {
  border-color: var(--rarity-verdant);
  box-shadow:
    0 0 52px var(--rarity-verdant-glow),
    0 0 24px rgba(52, 211, 153, 0.35);
}

.hero-card.epic {
  border-color: var(--rarity-epic);
  box-shadow: 0 0 45px rgba(167, 139, 250, 0.4);
}

.hero-card.rare {
  border-color: var(--rarity-rare);
  box-shadow: 0 0 38px rgba(56, 189, 248, 0.35);
}

.hero-card.common {
  border-color: var(--rarity-common);
}

.hero-card-glow {
  position: absolute;
  inset: -50%;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.12), transparent 45%),
    radial-gradient(circle, rgba(94, 234, 212, 0.3), rgba(99, 102, 241, 0.12) 50%, transparent 70%);
  pointer-events: none;
  animation: pulseGlow 2.4s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%,
  100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}

.hero-portrait {
  height: 188px;
  background-size: cover;
  background-position: center;
  position: relative;
  box-shadow: inset 0 -24px 48px rgba(15, 23, 42, 0.75);
}

.hero-portrait::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(15, 23, 42, 0.5) 100%);
  pointer-events: none;
}

.hero-card-info {
  padding: 1rem 1.1rem 1.25rem;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.3), #0f172a);
  text-align: left;
}

.hero-card-info h3 {
  margin: 0.25rem 0 0.15rem;
  font-size: 1.35rem;
}

.hero-card-info p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.hero-rarity {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
}

.reveal-status {
  color: var(--text-muted);
  min-height: 1.5rem;
}

.reveal-status.error {
  color: var(--danger);
}

.hidden {
  display: none !important;
}

@media (max-width: 900px) {
  .game-wrap {
    flex-direction: column;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: center;
  }

  .tower-panel {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .tower-list {
    flex-direction: row;
    flex-wrap: wrap;
  }
}
