/* =========================================================
   Путь Героя — тёмный фэнтези-кликер
   ========================================================= */

:root {
  --bg: #1a1a1a;
  --bg-deep: #0f0e0e;
  --panel: #211c1c;
  --panel-raised: #2a2222;
  --combat: #2d1f1f;
  --burgundy: #5c1f2a;
  --burgundy-bright: #8f2d3c;
  --gold: #ffd700;
  --gold-soft: #d9b45b;
  --gold-dim: #a98436;
  --text: #f1e8d7;
  --text-soft: #cbbba8;
  --muted: #9d8f82;
  --line: rgba(217, 180, 91, 0.16);
  --line-strong: rgba(255, 215, 0, 0.34);
  --hp: #c22f3e;
  --hp-bright: #e55360;
  --hp-deep: #3d1118;
  --success: #86b96c;
  --danger: #e15b62;
  --radius: 24px;
  --font-display: "Palatino Linotype", "Book Antiqua", Georgia, "Times New Roman", serif;
  --font-body: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --shadow-panel: 0 28px 80px rgba(0, 0, 0, 0.46);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  --zone-bg: #1a1a1a;
  --zone-glow-1: rgba(143, 45, 60, 0.28);
  --zone-glow-2: rgba(92, 31, 42, 0.22);
  --zone-glow-3: rgba(255, 215, 0, 0.055);
  --zone-accent: #d9b45b;
  --zone-accent-rgb: 217, 180, 91;
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  background-color: var(--zone-bg);
  background-image:
    radial-gradient(circle at 50% -20%, var(--zone-glow-1), transparent 42%),
    radial-gradient(circle at 4% 48%, var(--zone-glow-3), transparent 28%),
    radial-gradient(circle at 96% 82%, var(--zone-glow-2), transparent 32%);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  transition: background-color 0.9s ease;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body[data-zone="necropolis"] {
  --zone-bg: #141a18;
  --zone-glow-1: rgba(47, 95, 78, 0.25);
  --zone-glow-2: rgba(77, 101, 83, 0.2);
  --zone-glow-3: rgba(156, 191, 169, 0.045);
  --zone-accent: #9cbfa9;
  --zone-accent-rgb: 156, 191, 169;
}

body[data-zone="fire"] {
  --zone-bg: #211311;
  --zone-glow-1: rgba(164, 54, 27, 0.32);
  --zone-glow-2: rgba(111, 37, 20, 0.28);
  --zone-glow-3: rgba(255, 142, 72, 0.06);
  --zone-accent: #ff9a5c;
  --zone-accent-rgb: 255, 154, 92;
}

body[data-zone="forest"] {
  --zone-bg: #111810;
  --zone-glow-1: rgba(65, 110, 55, 0.24);
  --zone-glow-2: rgba(33, 71, 52, 0.26);
  --zone-glow-3: rgba(143, 189, 106, 0.05);
  --zone-accent: #9bc47b;
  --zone-accent-rgb: 155, 196, 123;
}

body[data-zone="ice"] {
  --zone-bg: #0f161c;
  --zone-glow-1: rgba(59, 111, 142, 0.26);
  --zone-glow-2: rgba(33, 73, 94, 0.28);
  --zone-glow-3: rgba(143, 199, 232, 0.05);
  --zone-accent: #91c9e8;
  --zone-accent-rgb: 145, 201, 232;
}

body[data-zone="abyss"] {
  --zone-bg: #15101c;
  --zone-glow-1: rgba(91, 55, 143, 0.28);
  --zone-glow-2: rgba(53, 35, 83, 0.28);
  --zone-glow-3: rgba(176, 140, 255, 0.05);
  --zone-accent: #b08cff;
  --zone-accent-rgb: 176, 140, 255;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.42));
}

::selection {
  color: #17110c;
  background: var(--gold);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

svg {
  display: block;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ---------- Фон ---------- */

.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.ambient-grid {
  position: absolute;
  inset: 0;
  opacity: 0.42;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.016) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.016) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 42%, black 10%, transparent 76%);
  mask-image: radial-gradient(ellipse at 50% 42%, black 10%, transparent 76%);
}

.ambient-orb {
  position: absolute;
  display: block;
  border-radius: 999px;
  filter: blur(80px);
  opacity: 0.42;
}

.ambient-orb--one {
  top: -190px;
  left: 8%;
  width: 520px;
  height: 520px;
  background: rgba(113, 27, 40, 0.36);
}

.ambient-orb--two {
  right: -170px;
  bottom: 6%;
  width: 500px;
  height: 500px;
  background: rgba(92, 31, 42, 0.22);
}

.ambient-orb--three {
  top: 46%;
  left: 44%;
  width: 340px;
  height: 340px;
  background: rgba(255, 215, 0, 0.035);
}

/* ---------- Каркас ---------- */

.app {
  position: relative;
  z-index: 1;
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
  padding: 24px 0 26px;
}

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

.topbar-right {
  display: flex;
  align-items: stretch;
  gap: 10px;
  min-width: 0;
  margin-left: auto;
}

.account-button {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
  min-width: 136px;
  padding: 8px 13px 8px 9px;
  border: 1px solid rgba(217, 180, 91, 0.2);
  border-radius: 15px;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.03), transparent 50%),
    linear-gradient(180deg, rgba(45, 36, 36, 0.88), rgba(24, 20, 20, 0.94));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.035),
    0 12px 28px rgba(0, 0, 0, 0.17);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.account-button:hover {
  border-color: rgba(255, 215, 0, 0.38);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 0 24px rgba(255, 215, 0, 0.06);
  transform: translateY(-1px);
}

.account-button.is-authed {
  border-color: rgba(255, 215, 0, 0.3);
}

.account-avatar {
  display: grid;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(255, 215, 0, 0.17);
  border-radius: 11px;
  color: var(--gold-dim);
  background: rgba(0, 0, 0, 0.22);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
}

.account-button.is-authed .account-avatar {
  color: #ffe9a4;
  background: rgba(92, 31, 42, 0.48);
  border-color: rgba(255, 215, 0, 0.32);
}

.account-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}

.account-label {
  max-width: 132px;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-button.is-authed .account-label {
  color: #f5e5bd;
}

.account-sub {
  color: var(--muted);
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  place-items: center;
  color: var(--gold);
  border: 1px solid rgba(255, 215, 0, 0.28);
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 215, 0, 0.12), transparent 64%),
    linear-gradient(145deg, rgba(92, 31, 42, 0.46), rgba(24, 20, 20, 0.9));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 10px 28px rgba(0, 0, 0, 0.3),
    0 0 26px rgba(255, 215, 0, 0.05);
}

.brand-mark svg {
  width: 34px;
  height: 34px;
  filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.32));
}

.brand-copy {
  min-width: 0;
}

.brand-title {
  margin: 0;
  color: #f8e7ae;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.015em;
  text-shadow: 0 2px 20px rgba(255, 215, 0, 0.11);
}

.brand-subtitle {
  margin: 6px 0 0;
  color: var(--gold-dim);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.28em;
  line-height: 1;
  text-transform: uppercase;
}

.resources {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.resource {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 174px;
  padding: 9px 16px 9px 11px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.035), transparent 42%),
    linear-gradient(180deg, rgba(45, 36, 36, 0.88), rgba(24, 20, 20, 0.93));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.035),
    0 12px 28px rgba(0, 0, 0, 0.17);
}

.resource::after {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 80px;
  height: 160%;
  transform: rotate(20deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.035), transparent);
  pointer-events: none;
}

.resource--gold {
  border-color: rgba(255, 215, 0, 0.26);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.045),
    0 0 26px rgba(255, 215, 0, 0.05);
}

.resource-icon {
  display: grid;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(255, 215, 0, 0.14);
  border-radius: 12px;
  color: var(--gold);
  background: rgba(0, 0, 0, 0.24);
}

.resource-icon svg {
  width: 21px;
  height: 21px;
  filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.22));
}

.coin {
  display: block;
  width: 23px;
  height: 23px;
  border: 1px solid rgba(255, 241, 158, 0.8);
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, #fff7c7 0 8%, #ffe15b 34%, #ffd700 56%, #b48416 100%);
  box-shadow:
    inset 0 0 0 3px rgba(112, 72, 0, 0.33),
    0 0 14px rgba(255, 215, 0, 0.34);
}

.coin::after {
  content: "✦";
  display: grid;
  height: 100%;
  place-items: center;
  color: rgba(98, 58, 0, 0.76);
  font-size: 9px;
}

.resource-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.resource-label {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.13em;
  line-height: 1.2;
  text-transform: uppercase;
  white-space: nowrap;
}

.resource-value {
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 25px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  line-height: 1.1;
  text-shadow: 0 0 18px rgba(255, 215, 0, 0.16);
  white-space: nowrap;
}

.resource--dps .resource-value {
  color: #f2e7d5;
  text-shadow: 0 0 18px rgba(255, 255, 255, 0.08);
}

.resource--diamonds {
  border-color: rgba(143, 216, 255, 0.24);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.045),
    0 0 26px rgba(98, 188, 235, 0.055);
}

.resource--diamonds .resource-icon {
  border-color: rgba(143, 216, 255, 0.17);
  background: rgba(26, 58, 76, 0.2);
}

.resource--diamonds .resource-value {
  color: #b9e9ff;
  text-shadow: 0 0 18px rgba(143, 216, 255, 0.24);
}

.diamond-gem {
  position: relative;
  display: block;
  width: 15px;
  height: 15px;
  transform: rotate(45deg);
  border: 1px solid rgba(206, 244, 255, 0.8);
  border-radius: 2px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), transparent 34%),
    linear-gradient(135deg, #bff3ff, #66c8f2 48%, #2a7ea8 100%);
  box-shadow:
    inset 0 0 0 3px rgba(15, 61, 85, 0.28),
    0 0 14px rgba(120, 214, 255, 0.45);
}

.diamond-gem::after {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 1px;
}

.resource-value.is-bump {
  animation: value-bump 0.34s cubic-bezier(0.2, 0.9, 0.3, 1.4);
}

/* ---------- Локация ---------- */

.location-bar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 14px;
  padding: 9px 14px 9px 10px;
  overflow: hidden;
  border: 1px solid rgba(var(--zone-accent-rgb), 0.2);
  border-radius: 14px;
  background:
    linear-gradient(90deg, rgba(var(--zone-accent-rgb), 0.08), transparent 46%),
    linear-gradient(180deg, rgba(42, 34, 34, 0.66), rgba(20, 17, 17, 0.72));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.035),
    0 12px 28px rgba(0, 0, 0, 0.16);
  transition: border-color 0.6s ease, background 0.6s ease;
}

.location-bar::after {
  content: "";
  position: absolute;
  top: 0;
  right: 18%;
  width: 150px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--zone-accent-rgb), 0.48), transparent);
}

.location-icon {
  display: grid;
  flex: 0 0 auto;
  width: 37px;
  height: 37px;
  place-items: center;
  color: var(--zone-accent);
  border: 1px solid rgba(var(--zone-accent-rgb), 0.25);
  border-radius: 10px;
  background: rgba(var(--zone-accent-rgb), 0.08);
  font-size: 18px;
  font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
  line-height: 1;
  text-shadow: 0 0 16px rgba(var(--zone-accent-rgb), 0.34);
}

.location-copy {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}

.location-kicker {
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.19em;
  line-height: 1.2;
  text-transform: uppercase;
}

.location-name {
  overflow: hidden;
  color: #f1e1be;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.location-range {
  flex: 0 0 auto;
  padding: 5px 9px;
  color: var(--zone-accent);
  border: 1px solid rgba(var(--zone-accent-rgb), 0.18);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.14);
  font-size: 8px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ---------- Панели и сетка ---------- */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 384px;
  gap: 20px;
  align-items: start;
}

.panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.025), transparent 32%),
    linear-gradient(180deg, rgba(40, 33, 33, 0.93), rgba(20, 17, 17, 0.97));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.035),
    var(--shadow-panel);
}

.panel::before {
  content: "";
  position: absolute;
  inset: 7px;
  z-index: 0;
  border: 1px solid rgba(255, 215, 0, 0.045);
  border-radius: calc(var(--radius) - 6px);
  pointer-events: none;
}

.arena {
  --accent: #8fbd6a;
  --accent-rgb: 143, 189, 106;
  padding: 24px 28px 24px;
  overflow: hidden;
}

.arena[data-monster="skeleton"] {
  --accent: #c8c1ac;
  --accent-rgb: 200, 193, 172;
}

.arena[data-monster="orc"] {
  --accent: #c56e51;
  --accent-rgb: 197, 110, 81;
}

.arena[data-monster="ogre"] {
  --accent: #b19b66;
  --accent-rgb: 177, 155, 102;
}

.arena[data-monster="dragon"] {
  --accent: #e45b4f;
  --accent-rgb: 228, 91, 79;
}

.arena::after {
  content: "";
  position: absolute;
  top: -120px;
  left: 50%;
  z-index: 0;
  width: 560px;
  height: 340px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(var(--accent-rgb), 0.1), transparent 68%);
  pointer-events: none;
  transition: background 0.4s ease;
}

.arena.is-boss-arena {
  border-color: rgba(228, 91, 79, 0.35);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.035),
    inset 0 0 70px rgba(92, 20, 27, 0.18),
    var(--shadow-panel);
}

.arena.is-boss-arena::after {
  background: radial-gradient(ellipse, rgba(194, 47, 62, 0.2), transparent 68%);
}

.arena.is-defeat {
  animation: defeat-flash 0.52s ease;
}

.arena.is-victory .stage-arch {
  animation: victory-glow 0.5s ease;
}

.arena-head {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--gold-dim);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.24em;
  line-height: 1.3;
  text-transform: uppercase;
}

.arena-title {
  margin: 0;
  color: var(--text-soft);
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 400;
  line-height: 1.2;
}

.arena-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 7px 11px;
  color: var(--text-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.18);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.13em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge--boss {
  color: #ffd1d1;
  border-color: rgba(228, 91, 79, 0.48);
  background: rgba(92, 20, 27, 0.55);
  box-shadow: 0 0 18px rgba(194, 47, 62, 0.18);
  animation: boss-badge-pulse 2.2s ease-in-out infinite;
}

/* ---------- Таймер босса ---------- */

.boss-panel {
  position: relative;
  z-index: 2;
  margin-top: 15px;
  padding: 10px 13px 12px;
  border: 1px solid rgba(228, 91, 79, 0.3);
  border-radius: 14px;
  background:
    linear-gradient(90deg, rgba(92, 20, 27, 0.42), rgba(45, 31, 31, 0.6)),
    rgba(0, 0, 0, 0.16);
  box-shadow: inset 0 0 30px rgba(92, 20, 27, 0.15);
}

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

.boss-panel__label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #e9b7b4;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--hp-bright);
  box-shadow: 0 0 10px rgba(229, 83, 96, 0.7);
  animation: live-pulse 1.4s ease-in-out infinite;
}

.boss-timer {
  color: #ffd5d2;
  font-family: var(--font-display);
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 0 18px rgba(229, 83, 96, 0.28);
}

.boss-timer-track {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(20, 8, 10, 0.76);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.6);
}

.boss-timer-fill {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7a1f29, #c22f3e 72%, #ff8b8b);
  box-shadow: 0 0 12px rgba(229, 83, 96, 0.5);
  transition: width 0.1s linear;
}

.boss-panel.is-urgent {
  border-color: rgba(229, 83, 96, 0.62);
  animation: urgent-panel 0.9s ease-in-out infinite;
}

.boss-panel.is-urgent .boss-timer {
  color: #ff8f8f;
  animation: urgent-timer 0.9s ease-in-out infinite;
}

.boss-panel.is-ready {
  border-color: rgba(255, 215, 0, 0.32);
  background:
    linear-gradient(90deg, rgba(92, 70, 20, 0.28), rgba(45, 31, 31, 0.6)),
    rgba(0, 0, 0, 0.16);
  box-shadow: inset 0 0 30px rgba(255, 215, 0, 0.075);
}

.boss-panel.is-ready .boss-panel__label,
.boss-panel.is-ready .boss-timer {
  color: #ffe28b;
}

.boss-panel.is-ready .boss-timer {
  animation: none;
}

.boss-panel.is-ready .boss-timer-fill {
  background: linear-gradient(90deg, #8e6b1e, #d9b45b 65%, #ffe58f);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.3);
}

.boss-start-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 10px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 215, 0, 0.38);
  border-radius: 11px;
  color: #ffedac;
  background:
    linear-gradient(180deg, rgba(100, 73, 22, 0.72), rgba(45, 31, 31, 0.9));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 22px rgba(255, 215, 0, 0.075);
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.boss-start-button:hover {
  border-color: rgba(255, 215, 0, 0.68);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    0 0 30px rgba(255, 215, 0, 0.14);
  transform: translateY(-1px);
}

.boss-start-button.is-prompt {
  animation: boss-button-prompt 0.48s ease 2;
}

.boss-start-button__icon {
  display: grid;
  flex: 0 0 auto;
  width: 29px;
  height: 29px;
  place-items: center;
  border: 1px solid rgba(255, 215, 0, 0.26);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
  color: var(--gold);
  font-size: 14px;
}

.boss-start-button__text {
  flex: 1 1 auto;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.09em;
  line-height: 1.2;
  text-transform: uppercase;
}

.boss-start-button__hint {
  flex: 0 0 auto;
  color: rgba(255, 226, 139, 0.6);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.monster-button.is-waiting::before {
  border-color: rgba(255, 215, 0, 0.34);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.35),
    0 0 55px rgba(255, 215, 0, 0.13);
}

/* ---------- Монстр ---------- */

.monster-heading {
  position: relative;
  z-index: 2;
  margin-top: 18px;
  text-align: center;
}

.monster-type {
  margin: 0;
  color: var(--accent);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.24em;
  line-height: 1.4;
  text-transform: uppercase;
  text-shadow: 0 0 18px rgba(var(--accent-rgb), 0.22);
}

.monster-name {
  margin: 2px 0 0;
  color: #f5e8cd;
  font-family: var(--font-display);
  font-size: clamp(38px, 5vw, 52px);
  font-weight: 700;
  letter-spacing: 0.015em;
  line-height: 1.08;
  text-shadow:
    0 3px 20px rgba(0, 0, 0, 0.7),
    0 0 32px rgba(var(--accent-rgb), 0.12);
}

.monster-name.is-boss {
  color: #ffd9c8;
  text-shadow:
    0 3px 20px rgba(0, 0, 0, 0.7),
    0 0 30px rgba(228, 91, 79, 0.28);
}

.monster-stage {
  position: relative;
  z-index: 1;
  display: grid;
  height: 348px;
  margin-top: -2px;
  overflow: visible;
  border: 1px solid rgba(var(--accent-rgb), 0.16);
  border-radius: 20px;
  background: #0b0a0a;
  place-items: center;
  box-shadow:
    inset 0 0 60px rgba(0, 0, 0, 0.4),
    0 18px 40px rgba(0, 0, 0, 0.16);
  isolation: isolate;
}

.battle-canvas-wrap {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  border-radius: inherit;
}

.battle-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.monster-hit-area {
  position: absolute;
  inset: 0;
  z-index: 4;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: inherit;
  outline: none;
  background: transparent;
  cursor: crosshair;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.monster-hit-area:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: -4px;
}

.monster-hit-area:active {
  cursor: crosshair;
}

.stage-arch {
  position: absolute;
  bottom: 6px;
  left: 50%;
  width: min(470px, 94%);
  height: 294px;
  transform: translateX(-50%);
  overflow: hidden;
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  border-radius: 50% 50% 20px 20px / 34% 34% 20px 20px;
  background:
    radial-gradient(ellipse at 50% 62%, rgba(var(--accent-rgb), 0.16), transparent 56%),
    radial-gradient(ellipse at 50% 100%, rgba(0, 0, 0, 0.78), transparent 65%),
    linear-gradient(180deg, rgba(45, 31, 31, 0.5), rgba(14, 12, 12, 0.9));
  box-shadow:
    inset 0 0 80px rgba(0, 0, 0, 0.56),
    inset 0 0 0 1px rgba(255, 255, 255, 0.018),
    0 30px 65px rgba(0, 0, 0, 0.3);
  transition: border-color 0.35s ease, background 0.35s ease;
}

.stage-arch::before {
  content: "";
  position: absolute;
  inset: 9px;
  border: 1px solid rgba(255, 215, 0, 0.055);
  border-radius: inherit;
}

.stage-arch::after {
  content: "";
  position: absolute;
  top: 8%;
  left: 50%;
  width: 58%;
  height: 45%;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(var(--accent-rgb), 0.14), transparent 70%);
  filter: blur(18px);
}

.stage-glow {
  position: absolute;
  inset: 16% 16% 6%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.19), transparent 66%);
  filter: blur(16px);
  animation: stage-glow 5s ease-in-out infinite;
}

.rune-ring {
  position: absolute;
  top: 47%;
  left: 50%;
  width: 270px;
  height: 270px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 215, 0, 0.1);
  border-radius: 50%;
  box-shadow:
    inset 0 0 50px rgba(var(--accent-rgb), 0.07),
    0 0 24px rgba(255, 215, 0, 0.025);
}

.rune-ring::before {
  content: "";
  position: absolute;
  inset: 15px;
  border: 1px dashed rgba(255, 215, 0, 0.15);
  border-radius: 50%;
  animation: rune-spin 70s linear infinite;
}

.rune-ring::after {
  content: "";
  position: absolute;
  inset: 38px;
  border: 1px solid rgba(var(--accent-rgb), 0.12);
  border-radius: 50%;
}

.ember {
  position: absolute;
  bottom: 30px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.8);
  opacity: 0;
  animation: ember-rise 7s linear infinite;
}

.ember--1 {
  left: 26%;
  animation-delay: 0.8s;
}

.ember--2 {
  left: 41%;
  animation-delay: 3.5s;
  animation-duration: 8.5s;
}

.ember--3 {
  left: 62%;
  animation-delay: 1.8s;
  animation-duration: 6.5s;
}

.ember--4 {
  left: 76%;
  animation-delay: 5.1s;
  animation-duration: 9s;
}

.stage-floor {
  position: absolute;
  bottom: 15px;
  left: 50%;
  z-index: 1;
  width: 330px;
  height: 36px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.82), transparent 68%);
  filter: blur(4px);
  pointer-events: none;
}

.monster-button {
  position: relative;
  z-index: 3;
  display: grid;
  width: 260px;
  height: 260px;
  margin-top: 2px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  outline: none;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  filter: drop-shadow(0 20px 28px rgba(0, 0, 0, 0.45));
}

.monster-button::before {
  content: "";
  position: absolute;
  inset: 10%;
  border: 1px solid rgba(255, 215, 0, 0.13);
  border-radius: 50%;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.35),
    0 0 42px rgba(var(--accent-rgb), 0.1);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.monster-button:hover::before {
  border-color: rgba(255, 215, 0, 0.27);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.35),
    0 0 55px rgba(var(--accent-rgb), 0.17);
}

.monster-aura {
  position: absolute;
  inset: 3%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.34), transparent 66%);
  filter: blur(12px);
  opacity: 0.68;
  animation: aura-breathe 4.2s ease-in-out infinite;
}

.monster-shadow {
  position: absolute;
  bottom: 24%;
  left: 50%;
  width: 140px;
  height: 24px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.8), transparent 70%);
  filter: blur(5px);
}

.monster-image {
  position: relative;
  z-index: 2;
  display: block;
  width: 230px;
  height: 230px;
  object-fit: contain;
  filter:
    drop-shadow(0 16px 18px rgba(0, 0, 0, 0.55))
    drop-shadow(0 0 24px rgba(var(--accent-rgb), 0.28));
  transform-origin: 50% 82%;
  animation: idle-bob 4.6s ease-in-out infinite;
  user-select: none;
  pointer-events: none;
  will-change: transform;
}

.monster-emoji {
  position: relative;
  z-index: 2;
  display: block;
  font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
  font-size: 150px;
  line-height: 1;
  filter:
    drop-shadow(0 16px 16px rgba(0, 0, 0, 0.4))
    drop-shadow(0 0 22px rgba(var(--accent-rgb), 0.15));
  transform-origin: 50% 82%;
  animation: idle-bob 4.6s ease-in-out infinite;
  will-change: transform;
}

.monster-button.is-boss {
  filter:
    drop-shadow(0 22px 30px rgba(0, 0, 0, 0.5))
    drop-shadow(0 0 28px rgba(194, 47, 62, 0.18));
}

.monster-button.is-boss::before {
  border-color: rgba(228, 91, 79, 0.27);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.35),
    0 0 60px rgba(194, 47, 62, 0.16);
}

.monster-button.is-boss .monster-emoji {
  font-size: 160px;
  animation-duration: 3.7s;
}

.monster-button.is-boss .monster-image {
  width: 238px;
  height: 238px;
  filter:
    drop-shadow(0 18px 20px rgba(0, 0, 0, 0.6))
    drop-shadow(0 0 30px rgba(228, 91, 79, 0.42));
  animation-duration: 3.7s;
}

.monster-button.is-hit {
  animation: monster-hit 0.22s ease;
}

.monster-button.is-spawning .monster-emoji,
.monster-button.is-spawning .monster-image {
  animation: monster-spawn 0.42s cubic-bezier(0.18, 0.9, 0.26, 1.2);
}

.monster-button:active {
  transform: scale(0.985);
}

/* ---------- Всплывающий урон ---------- */

.damage-layer {
  position: absolute;
  inset: 0;
  z-index: 5;
  overflow: visible;
  pointer-events: none;
}

.damage-number {
  --drift: 0px;
  position: absolute;
  z-index: 2;
  color: #ffffff;
  font-family: var(--font-display);
  font-size: clamp(26px, 4.2vw, 38px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-shadow:
    0 0 9px rgba(229, 83, 96, 0.9),
    0 2px 2px rgba(0, 0, 0, 0.9),
    0 0 25px rgba(194, 47, 62, 0.45);
  white-space: nowrap;
  pointer-events: none;
  animation: damage-float 0.9s cubic-bezier(0.16, 0.82, 0.25, 1) forwards;
  will-change: transform, opacity;
}

.damage-number--boss {
  color: #ffd7d7;
  text-shadow:
    0 0 10px rgba(229, 83, 96, 1),
    0 2px 2px rgba(0, 0, 0, 0.9),
    0 0 28px rgba(194, 47, 62, 0.55);
}

.damage-number--gold {
  color: var(--gold);
  font-size: clamp(22px, 3.5vw, 30px);
  text-shadow:
    0 0 10px rgba(255, 215, 0, 0.6),
    0 2px 2px rgba(0, 0, 0, 0.9);
  animation-name: gold-float;
  animation-duration: 1.15s;
}

.damage-number--crit {
  color: var(--gold);
  font-size: clamp(31px, 5.2vw, 48px);
  letter-spacing: 0.01em;
  text-shadow:
    0 0 10px rgba(255, 215, 0, 0.95),
    0 2px 3px rgba(0, 0, 0, 0.95),
    0 0 28px rgba(255, 150, 25, 0.55);
  animation-name: crit-float;
  animation-duration: 1.05s;
}

/* ---------- Здоровье ---------- */

.health-card {
  position: relative;
  z-index: 2;
  padding: 13px 17px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(45, 31, 31, 0.52), rgba(15, 13, 13, 0.52));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.health-copy {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.health-label {
  color: var(--text-soft);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.015em;
}

.health-numbers {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
}

.health-numbers strong {
  color: #ffd7d7;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
}

.health-divider {
  padding: 0 4px;
  color: rgba(255, 255, 255, 0.2);
}

.health-track {
  position: relative;
  height: 15px;
  overflow: hidden;
  border: 1px solid rgba(229, 83, 96, 0.18);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.38), rgba(61, 17, 24, 0.62)),
    var(--hp-deep);
  box-shadow:
    inset 0 2px 5px rgba(0, 0, 0, 0.45),
    0 0 16px rgba(194, 47, 62, 0.06);
}

.health-fill {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent 40%),
    linear-gradient(90deg, #741922, var(--hp) 56%, var(--hp-bright));
  box-shadow:
    0 0 14px rgba(194, 47, 62, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  transition: width 0.16s linear;
}

.health-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: repeating-linear-gradient(
    115deg,
    transparent 0 11px,
    rgba(255, 255, 255, 0.045) 11px 13px
  );
  opacity: 0.65;
}

.health-gloss {
  position: absolute;
  top: 2px;
  right: 10px;
  left: 10px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.13), transparent);
  pointer-events: none;
}

.health-track.is-low {
  border-color: rgba(255, 120, 120, 0.45);
}

.health-track.is-low .health-fill {
  animation: low-health-pulse 0.95s ease-in-out infinite;
}

.health-track.is-boss {
  height: 18px;
  border-color: rgba(255, 215, 0, 0.2);
}

.health-track.is-boss .health-fill {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent 42%),
    linear-gradient(90deg, #7c1b25, #d5434f 58%, #ff9b7a);
  box-shadow:
    0 0 20px rgba(229, 83, 96, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.combat-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 18px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
}

.combat-meta__item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.combat-meta__item strong {
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.mini-icon {
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1;
}

.mini-icon--gold {
  color: var(--gold-soft);
}

.mini-icon--crit {
  color: var(--gold);
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

.combat-meta__hint {
  margin-left: auto;
  color: rgba(157, 143, 130, 0.68);
  font-size: 10px;
  letter-spacing: 0.03em;
}

/* ---------- Улучшения ---------- */

.upgrades {
  padding: 21px;
  overflow: hidden;
}

.upgrades-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.upgrades-title {
  margin: 0;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
}

.power-badge {
  flex: 0 0 auto;
  margin-top: 1px;
  padding: 6px 9px;
  color: var(--gold-dim);
  border: 1px solid rgba(255, 215, 0, 0.13);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.17);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.09em;
  line-height: 1.2;
  text-transform: uppercase;
  white-space: nowrap;
}

.tabs {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  margin-top: 18px;
  padding: 4px;
  border: 1px solid rgba(255, 215, 0, 0.09);
  border-radius: 13px;
  background: rgba(0, 0, 0, 0.21);
}

.tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 10px;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.tab:hover {
  color: var(--text-soft);
}

.tab.is-active {
  color: #ffe9a0;
  background:
    linear-gradient(180deg, rgba(92, 31, 42, 0.72), rgba(45, 31, 31, 0.84));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 4px 12px rgba(0, 0, 0, 0.2);
}

.tab-icon {
  color: var(--gold-dim);
  font-size: 12px;
}

.tab.is-active .tab-icon {
  color: var(--gold);
}

.tab-panel {
  position: relative;
  z-index: 1;
  margin-top: 13px;
}

.upgrade-list {
  display: grid;
  gap: 9px;
}

.upgrade-card {
  position: relative;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  padding: 11px;
  overflow: hidden;
  border: 1px solid rgba(217, 180, 91, 0.12);
  border-radius: 15px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.028), transparent 52%),
    rgba(24, 20, 20, 0.55);
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    transform 0.2s ease;
}

.upgrade-card::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 70px;
  height: 70px;
  background: radial-gradient(circle at 100% 0, rgba(255, 215, 0, 0.05), transparent 70%);
  pointer-events: none;
}

.upgrade-card:hover {
  border-color: rgba(255, 215, 0, 0.22);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.04), transparent 52%),
    rgba(31, 25, 25, 0.72);
  transform: translateY(-1px);
}

.upgrade-card.is-bought {
  animation: card-bought 0.45s ease;
}

.upgrade-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(255, 215, 0, 0.11);
  border-radius: 12px;
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 215, 0, 0.08), transparent 66%),
    rgba(0, 0, 0, 0.21);
  font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
  font-size: 23px;
  line-height: 1;
}

.upgrade-copy {
  min-width: 0;
}

.upgrade-title-row {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  min-width: 0;
}

.upgrade-name {
  min-width: 0;
  margin: 0;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.2;
  overflow-wrap: break-word;
}

.upgrade-level {
  flex: 0 0 auto;
  padding: 3px 5px;
  border: 1px solid rgba(217, 180, 91, 0.12);
  border-radius: 5px;
  color: var(--gold-dim);
  background: rgba(0, 0, 0, 0.18);
  font-size: 8px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
  white-space: nowrap;
}

.upgrade-effect {
  margin: 3px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upgrade-total {
  margin: 2px 0 0;
  color: rgba(217, 180, 91, 0.68);
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}

.buy-button {
  position: relative;
  z-index: 1;
  display: grid;
  min-width: 82px;
  padding: 7px 8px;
  place-items: center;
  gap: 2px;
  border: 1px solid rgba(255, 215, 0, 0.25);
  border-radius: 9px;
  color: #ffe9a6;
  background:
    linear-gradient(180deg, rgba(92, 31, 42, 0.72), rgba(45, 31, 31, 0.86));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
  cursor: pointer;
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    opacity 0.16s ease;
}

.buy-button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(255, 215, 0, 0.48);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 0 18px rgba(255, 215, 0, 0.08);
}

.buy-button:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}

.buy-button:disabled {
  color: rgba(203, 187, 168, 0.4);
  border-color: rgba(255, 255, 255, 0.065);
  background: rgba(0, 0, 0, 0.15);
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.78;
}

.buy-label {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.buy-price {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  line-height: 1;
}

.buy-button:disabled .buy-price {
  color: rgba(203, 187, 168, 0.4);
}

.price-coin {
  display: inline-block;
  width: 8px;
  height: 8px;
  border: 1px solid rgba(255, 241, 158, 0.7);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff4ad, #ffd700 60%, #a9780f);
  box-shadow: 0 0 5px rgba(255, 215, 0, 0.25);
}

.buy-button:disabled .price-coin {
  filter: grayscale(1);
  opacity: 0.5;
}

.upgrades-note {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 15px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 215, 0, 0.08);
  color: rgba(157, 143, 130, 0.72);
  font-size: 9.5px;
  line-height: 1.45;
}

.note-rune {
  flex: 0 0 auto;
  color: var(--gold-dim);
  font-size: 12px;
  line-height: 1.2;
}

.upgrades-note p {
  margin: 0;
}

/* ---------- Герой и экипировка ---------- */

.hero-panel {
  margin-top: 20px;
  padding: 21px 24px 18px;
  overflow: hidden;
}

.hero-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.hero-profile {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.hero-portrait {
  display: grid;
  flex: 0 0 auto;
  width: 92px;
  height: 92px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 215, 0, 0.24);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 215, 0, 0.12), transparent 62%),
    linear-gradient(145deg, rgba(92, 31, 42, 0.38), rgba(16, 13, 13, 0.94));
  box-shadow:
    inset 0 0 35px rgba(255, 215, 0, 0.04),
    0 0 30px rgba(255, 215, 0, 0.055);
}

.hero-portrait img {
  width: 76px;
  height: 76px;
  object-fit: contain;
  filter:
    drop-shadow(0 8px 12px rgba(0, 0, 0, 0.5))
    drop-shadow(0 0 16px rgba(255, 215, 0, 0.16));
}

.hero-copy {
  min-width: 0;
}

.hero-name {
  margin: 0;
  color: #f3e4c4;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.05;
}

.hero-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.06em;
}

.hero-subtitle span {
  color: var(--gold-dim);
  font-variant-numeric: tabular-nums;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  min-width: 120px;
  padding: 8px 12px;
  border: 1px solid rgba(217, 180, 91, 0.12);
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.16);
}

.hero-stat span {
  color: var(--muted);
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  line-height: 1.2;
  text-transform: uppercase;
  white-space: nowrap;
}

.hero-stat strong {
  margin-top: 2px;
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 19px;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  text-shadow: 0 0 14px rgba(255, 215, 0, 0.13);
}

.hero-stat:nth-child(2) strong {
  color: #b9e9ff;
  text-shadow: 0 0 14px rgba(143, 216, 255, 0.16);
}

.equipment-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 9px;
  margin-top: 17px;
}

.equipment-slot {
  --quality: #c6c1b5;
  --quality-rgb: 198, 193, 181;
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  min-height: 82px;
  padding: 11px 9px;
  overflow: hidden;
  border: 1px solid rgba(var(--quality-rgb), 0.35);
  border-radius: 13px;
  background:
    linear-gradient(135deg, rgba(var(--quality-rgb), 0.09), transparent 58%),
    rgba(22, 18, 18, 0.65);
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    transform 0.2s ease;
}

.equipment-slot::after {
  content: "";
  position: absolute;
  right: -24px;
  bottom: -30px;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--quality-rgb), 0.13), transparent 70%);
  pointer-events: none;
}

.equipment-slot.is-empty {
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.1);
  opacity: 0.7;
}

.equipment-slot.quality-common {
  --quality: #c6c1b5;
  --quality-rgb: 198, 193, 181;
}

.equipment-slot.quality-rare {
  --quality: #7cb5ff;
  --quality-rgb: 124, 181, 255;
}

.equipment-slot.quality-epic {
  --quality: #c78bff;
  --quality-rgb: 199, 139, 255;
}

.equipment-slot.quality-mythic {
  --quality: #ff8b6b;
  --quality-rgb: 255, 139, 107;
}

.equipment-slot.quality-legendary {
  --quality: #ffd700;
  --quality-rgb: 255, 215, 0;
  box-shadow: inset 0 0 24px rgba(255, 215, 0, 0.045);
}

.equipment-slot__icon {
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(var(--quality-rgb), 0.22);
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.2);
  color: var(--quality);
  font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
  font-size: 17px;
  line-height: 1;
}

.equipment-slot__copy {
  min-width: 0;
}

.equipment-slot__name {
  display: block;
  color: var(--muted);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1.2;
  text-transform: uppercase;
  white-space: nowrap;
}

.equipment-slot__item {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: #f1e3c7;
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.equipment-slot.is-empty .equipment-slot__item {
  color: rgba(157, 143, 130, 0.72);
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 500;
}

.equipment-slot__bonus {
  display: block;
  margin-top: 2px;
  color: var(--quality);
  font-size: 8.5px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.equipment-slot__quality {
  position: absolute;
  top: 7px;
  right: 7px;
  color: var(--quality);
  font-size: 6.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
}

.hero-bottom {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-top: 13px;
  padding-top: 11px;
  border-top: 1px solid rgba(255, 215, 0, 0.07);
}

.hero-hint {
  max-width: 57ch;
  margin: 0;
  color: rgba(157, 143, 130, 0.72);
  font-size: 9.5px;
  line-height: 1.45;
}

.drop-rates {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.drop-rate {
  padding: 3px 6px;
  border: 1px solid rgba(var(--quality-rgb, 198, 193, 181), 0.24);
  border-radius: 999px;
  color: var(--quality, #c6c1b5);
  background: rgba(0, 0, 0, 0.13);
  font-size: 7px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.2;
  white-space: nowrap;
}

.drop-rate.quality-common {
  --quality: #c6c1b5;
  --quality-rgb: 198, 193, 181;
}

.drop-rate.quality-rare {
  --quality: #7cb5ff;
  --quality-rgb: 124, 181, 255;
}

.drop-rate.quality-epic {
  --quality: #c78bff;
  --quality-rgb: 199, 139, 255;
}

.drop-rate.quality-mythic {
  --quality: #ff8b6b;
  --quality-rgb: 255, 139, 107;
}

.drop-rate.quality-legendary {
  --quality: #ffd700;
  --quality-rgb: 255, 215, 0;
}

.drop-rate--diamond {
  --quality: #b9e9ff;
  --quality-rgb: 185, 233, 255;
}

/* ---------- Футер ---------- */

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 17px;
  padding: 0 3px;
  color: rgba(157, 143, 130, 0.72);
  font-size: 10.5px;
}

.save-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.save-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px rgba(134, 185, 108, 0.45);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.save-dot.is-saved {
  background: var(--gold);
  box-shadow: 0 0 9px rgba(255, 215, 0, 0.45);
}

.save-dot.is-error {
  background: var(--danger);
  box-shadow: 0 0 9px rgba(225, 91, 98, 0.5);
}

.art-credit {
  color: rgba(157, 143, 130, 0.5);
  font-size: 9.5px;
  text-align: center;
  text-decoration: none;
  transition: color 0.2s ease;
}

.art-credit:hover {
  color: var(--gold-dim);
}

.reset-button {
  padding: 5px 0;
  border: 0;
  color: rgba(157, 143, 130, 0.7);
  background: transparent;
  font-size: 10.5px;
  text-decoration: underline;
  text-decoration-color: rgba(157, 143, 130, 0.25);
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color 0.2s ease;
}

.reset-button:hover {
  color: var(--text-soft);
}

/* ---------- Тосты ---------- */

.toast-container {
  position: fixed;
  right: 22px;
  bottom: max(22px, env(safe-area-inset-bottom));
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(360px, calc(100vw - 28px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: 11px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.035), transparent 55%),
    rgba(33, 27, 27, 0.97);
  box-shadow:
    0 16px 38px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.035);
  color: var(--text-soft);
  font-size: 11.5px;
  line-height: 1.45;
  animation: toast-in 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

.toast.is-leaving {
  animation: toast-out 0.24s ease forwards;
}

.toast--success {
  border-left-color: var(--success);
}

.toast--danger {
  border-left-color: var(--danger);
}

.toast__icon {
  display: grid;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  place-items: center;
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: 50%;
  color: var(--gold);
  background: rgba(0, 0, 0, 0.17);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.toast--success .toast__icon {
  color: var(--success);
  border-color: rgba(134, 185, 108, 0.25);
}

.toast--danger .toast__icon {
  color: var(--danger);
  border-color: rgba(225, 91, 98, 0.25);
}

.toast__text {
  min-width: 0;
}

/* ---------- Диалог сброса ---------- */

.reset-dialog {
  width: min(430px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid rgba(255, 215, 0, 0.22);
  border-radius: 21px;
  color: var(--text);
  background:
    radial-gradient(circle at 50% 0, rgba(92, 31, 42, 0.34), transparent 52%),
    linear-gradient(180deg, #2b2222, #171313);
  box-shadow:
    0 35px 100px rgba(0, 0, 0, 0.66),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.reset-dialog::backdrop {
  background: rgba(6, 5, 5, 0.76);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.reset-dialog__body {
  padding: 28px;
  text-align: center;
}

.reset-dialog__rune {
  display: grid;
  width: 48px;
  height: 48px;
  margin: 0 auto 13px;
  place-items: center;
  border: 1px solid rgba(225, 91, 98, 0.22);
  border-radius: 50%;
  color: var(--danger);
  background: rgba(92, 20, 27, 0.28);
  font-size: 20px;
  box-shadow: 0 0 24px rgba(225, 91, 98, 0.1);
}

.reset-dialog h2 {
  margin: 0 0 8px;
  color: #f7e6c7;
  font-family: var(--font-display);
  font-size: 27px;
  line-height: 1.1;
}

.reset-dialog p {
  max-width: 32ch;
  margin: 0 auto;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.reset-dialog__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 21px;
}

.button {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.025);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.button:hover {
  border-color: rgba(255, 215, 0, 0.3);
  color: var(--text);
}

.button--ghost {
  background: rgba(0, 0, 0, 0.13);
}

.button--danger {
  color: #ffe0e0;
  border-color: rgba(225, 91, 98, 0.35);
  background: linear-gradient(180deg, rgba(126, 32, 43, 0.74), rgba(77, 22, 29, 0.8));
}

.button--danger:hover {
  border-color: rgba(225, 91, 98, 0.65);
  background: linear-gradient(180deg, rgba(146, 37, 50, 0.84), rgba(90, 25, 34, 0.86));
}

/* ---------- Аккаунт ---------- */

.auth-dialog {
  width: min(470px, calc(100vw - 32px));
  max-height: min(88vh, 760px);
  padding: 0;
  overflow: auto;
  border: 1px solid rgba(255, 215, 0, 0.22);
  border-radius: 22px;
  color: var(--text);
  background:
    radial-gradient(circle at 50% 0, rgba(92, 31, 42, 0.34), transparent 50%),
    linear-gradient(180deg, #2b2222, #171313);
  box-shadow:
    0 36px 100px rgba(0, 0, 0, 0.68),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.auth-dialog::backdrop {
  background: rgba(6, 5, 5, 0.78);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.auth-card {
  position: relative;
  padding: 28px;
}

.auth-close {
  position: absolute;
  top: 11px;
  right: 12px;
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.15);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.auth-close:hover {
  color: var(--text);
  border-color: rgba(255, 215, 0, 0.3);
}

.auth-title {
  margin: 0;
  color: #f7e7c7;
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 1.1;
}

.auth-lead {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 18px 0 14px;
  padding: 4px;
  border: 1px solid rgba(255, 215, 0, 0.1);
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.2);
}

.auth-tab {
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.auth-tab:hover {
  color: var(--text-soft);
}

.auth-tab.is-active {
  color: #ffe9a0;
  background: linear-gradient(180deg, rgba(92, 31, 42, 0.72), rgba(45, 31, 31, 0.84));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.auth-form {
  display: grid;
  gap: 0;
}

.auth-form label {
  display: block;
  margin: 10px 0 5px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1.2;
  text-transform: uppercase;
}

.auth-form input {
  width: 100%;
  padding: 10px 11px;
  border: 1px solid rgba(217, 180, 91, 0.17);
  border-radius: 9px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.22);
  font: inherit;
  font-size: 13px;
  outline: none;
}

.auth-form input:focus {
  border-color: rgba(255, 215, 0, 0.55);
  box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.07);
}

.auth-error {
  margin: 10px 0 0;
  padding: 8px 10px;
  border: 1px solid rgba(225, 91, 98, 0.3);
  border-radius: 8px;
  color: #ffd7d7;
  background: rgba(92, 20, 27, 0.32);
  font-size: 11px;
  line-height: 1.4;
}

.auth-submit {
  width: 100%;
  margin-top: 14px;
  padding: 11px 14px;
  border: 1px solid rgba(255, 215, 0, 0.35);
  border-radius: 10px;
  color: #ffe9a7;
  background: linear-gradient(180deg, rgba(92, 31, 42, 0.86), rgba(45, 31, 31, 0.94));
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-submit:hover:not(:disabled) {
  border-color: rgba(255, 215, 0, 0.65);
  box-shadow: 0 0 22px rgba(255, 215, 0, 0.08);
}

.auth-submit:disabled {
  opacity: 0.55;
  cursor: wait;
}

.auth-submit--ghost {
  width: auto;
  min-width: 100px;
  margin-top: 0;
  color: var(--text-soft);
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.16);
}

.auth-note {
  margin: 13px 0 0;
  color: rgba(157, 143, 130, 0.7);
  font-size: 9.5px;
  line-height: 1.45;
}

.auth-user-head {
  display: flex;
  align-items: center;
  gap: 13px;
  padding-right: 26px;
}

.auth-user-avatar {
  display: grid;
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  place-items: center;
  border: 1px solid rgba(255, 215, 0, 0.26);
  border-radius: 16px;
  color: #f6dda5;
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 215, 0, 0.12), transparent 65%),
    rgba(92, 31, 42, 0.38);
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  text-transform: uppercase;
}

.auth-user-email {
  margin: 4px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-sync {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 20px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(134, 185, 108, 0.16);
  border-radius: 9px;
  color: var(--text-soft);
  background: rgba(0, 0, 0, 0.13);
  font-size: 10.5px;
}

.auth-sync-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px rgba(134, 185, 108, 0.45);
}

.auth-sync.is-error {
  border-color: rgba(225, 91, 98, 0.25);
}

.auth-sync.is-error .auth-sync-dot {
  background: var(--danger);
  box-shadow: 0 0 8px rgba(225, 91, 98, 0.45);
}

.auth-sync.is-saving .auth-sync-dot {
  background: var(--gold);
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
  animation: live-pulse 1s ease-in-out infinite;
}

.auth-user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.auth-admin-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  padding: 10px 13px;
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 9px;
  color: #ffe9a7;
  background: rgba(92, 31, 42, 0.48);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}

.auth-admin-link:hover {
  border-color: rgba(255, 215, 0, 0.55);
}

.noscript {
  position: fixed;
  inset: auto 16px 16px;
  z-index: 100;
  padding: 16px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: var(--text);
  background: var(--panel);
  text-align: center;
}

/* ---------- Анимации ---------- */

@keyframes idle-bob {
  0%,
  100% {
    transform: translateY(0) rotate(-0.8deg);
  }
  50% {
    transform: translateY(-8px) rotate(0.8deg);
  }
}

@keyframes aura-breathe {
  0%,
  100% {
    transform: scale(0.94);
    opacity: 0.48;
  }
  50% {
    transform: scale(1.06);
    opacity: 0.74;
  }
}

@keyframes stage-glow {
  0%,
  100% {
    opacity: 0.5;
    transform: scale(0.98);
  }
  50% {
    opacity: 0.85;
    transform: scale(1.03);
  }
}

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

@keyframes ember-rise {
  0% {
    transform: translate3d(0, 0, 0) scale(0.5);
    opacity: 0;
  }
  12% {
    opacity: 0.85;
  }
  70% {
    opacity: 0.48;
  }
  100% {
    transform: translate3d(12px, -190px, 0) scale(0);
    opacity: 0;
  }
}

@keyframes boss-badge-pulse {
  0%,
  100% {
    box-shadow: 0 0 14px rgba(194, 47, 62, 0.13);
  }
  50% {
    box-shadow: 0 0 24px rgba(194, 47, 62, 0.3);
  }
}

@keyframes live-pulse {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

@keyframes urgent-panel {
  0%,
  100% {
    box-shadow: inset 0 0 30px rgba(92, 20, 27, 0.15);
  }
  50% {
    box-shadow: inset 0 0 42px rgba(194, 47, 62, 0.28);
  }
}

@keyframes urgent-timer {
  0%,
  100% {
    opacity: 0.72;
  }
  50% {
    opacity: 1;
  }
}

@keyframes boss-button-prompt {
  0%,
  100% {
    border-color: rgba(255, 215, 0, 0.38);
    box-shadow: 0 0 22px rgba(255, 215, 0, 0.075);
  }
  50% {
    border-color: rgba(255, 215, 0, 0.82);
    box-shadow:
      0 0 34px rgba(255, 215, 0, 0.24),
      inset 0 0 24px rgba(255, 215, 0, 0.08);
  }
}

@keyframes monster-hit {
  0% {
    transform: translate3d(0, 0, 0) rotate(0);
  }
  18% {
    transform: translate3d(-5px, 2px, 0) rotate(-1.6deg);
  }
  38% {
    transform: translate3d(5px, -2px, 0) rotate(1.4deg);
  }
  58% {
    transform: translate3d(-3px, 1px, 0) rotate(-0.9deg);
  }
  78% {
    transform: translate3d(2px, 0, 0) rotate(0.5deg);
  }
  100% {
    transform: translate3d(0, 0, 0) rotate(0);
  }
}

@keyframes monster-spawn {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(0.72);
    filter: blur(5px) drop-shadow(0 16px 16px rgba(0, 0, 0, 0.4));
  }
  65% {
    opacity: 1;
    transform: translateY(-3px) scale(1.04);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: drop-shadow(0 16px 16px rgba(0, 0, 0, 0.4)) drop-shadow(0 0 22px rgba(var(--accent-rgb), 0.15));
  }
}

@keyframes damage-float {
  0% {
    opacity: 0;
    transform: translate(-50%, -25%) scale(0.55) rotate(-4deg);
  }
  16% {
    opacity: 1;
    transform: translate(-50%, -80%) scale(1.12) rotate(2deg);
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--drift)), -170px) scale(0.86) rotate(-3deg);
  }
}

@keyframes gold-float {
  0% {
    opacity: 0;
    transform: translate(-50%, 5%) scale(0.65);
  }
  18% {
    opacity: 1;
    transform: translate(-50%, -25%) scale(1.04);
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--drift)), -120px) scale(0.9);
  }
}

@keyframes crit-float {
  0% {
    opacity: 0;
    transform: translate(-50%, -20%) scale(0.45) rotate(-6deg);
  }
  15% {
    opacity: 1;
    transform: translate(-50%, -85%) scale(1.25) rotate(3deg);
  }
  34% {
    opacity: 1;
    transform: translate(-50%, -105%) scale(1.08) rotate(1deg);
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--drift)), -195px) scale(0.92) rotate(-3deg);
  }
}

@keyframes victory-glow {
  0%,
  100% {
    box-shadow:
      inset 0 0 80px rgba(0, 0, 0, 0.56),
      0 30px 65px rgba(0, 0, 0, 0.3);
  }
  35% {
    box-shadow:
      inset 0 0 80px rgba(255, 215, 0, 0.08),
      0 0 55px rgba(255, 215, 0, 0.13),
      0 30px 65px rgba(0, 0, 0, 0.3);
  }
}

@keyframes defeat-flash {
  0%,
  100% {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.035),
      var(--shadow-panel);
  }
  35% {
    box-shadow:
      inset 0 0 90px rgba(194, 47, 62, 0.3),
      0 0 40px rgba(194, 47, 62, 0.12),
      var(--shadow-panel);
  }
}

@keyframes card-bought {
  0%,
  100% {
    border-color: rgba(217, 180, 91, 0.12);
  }
  35% {
    border-color: rgba(255, 215, 0, 0.48);
    background: rgba(92, 31, 42, 0.32);
    box-shadow: 0 0 22px rgba(255, 215, 0, 0.08);
  }
}

@keyframes value-bump {
  0%,
  100% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.12);
    color: #fff4b0;
  }
}

@keyframes low-health-pulse {
  0%,
  100% {
    filter: brightness(0.9);
  }
  50% {
    filter: brightness(1.22);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(8px) scale(0.97);
  }
}

/* ---------- Адаптивность ---------- */

@media (min-width: 981px) and (min-height: 800px) {
  .upgrades {
    position: sticky;
    top: 22px;
  }
}

@media (max-width: 1120px) {
  .layout {
    grid-template-columns: minmax(0, 1fr) 354px;
  }

  .arena {
    padding-right: 22px;
    padding-left: 22px;
  }

  .resource {
    min-width: 160px;
  }
}

@media (max-width: 980px) {
  .app {
    width: min(760px, calc(100% - 36px));
  }

  .topbar {
    flex-wrap: wrap;
    gap: 15px;
  }

  .topbar-right {
    width: 100%;
    flex-wrap: wrap;
  }

  .account-button {
    margin-left: auto;
  }

  .resources {
    width: 100%;
  }

  .resource {
    flex: 1 1 0;
    min-width: 0;
  }

  .layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .upgrades {
    position: relative;
    top: auto;
  }

  .hero-top {
    flex-wrap: wrap;
    gap: 14px;
  }

  .hero-stats {
    width: 100%;
    justify-content: flex-start;
  }

  .equipment-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .monster-stage {
    height: 336px;
  }

  .upgrade-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #artifactsList {
    grid-template-columns: 1fr;
  }

  .upgrade-card {
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: start;
  }

  .upgrade-icon {
    width: 42px;
    height: 42px;
    font-size: 21px;
  }

  .buy-button {
    grid-column: 1 / -1;
    grid-template-columns: 1fr auto;
    width: 100%;
    min-width: 0;
    margin-top: 3px;
    padding: 8px 10px;
  }

  .upgrade-name {
    white-space: normal;
  }

  .upgrade-effect {
    white-space: normal;
  }}

@media (max-width: 760px) {
  .app {
    width: calc(100% - 28px);
    padding-top: 16px;
  }

  .hero-panel {
    margin-top: 16px;
    padding: 18px;
    border-radius: 20px;
  }

  .hero-portrait {
    width: 78px;
    height: 78px;
  }

  .hero-portrait img {
    width: 64px;
    height: 64px;
  }

  .hero-name {
    font-size: 26px;
  }

  .hero-stat {
    flex: 1 1 0;
    min-width: 0;
  }

  .topbar {
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 16px;
  }

  .resources {
    width: 100%;
  }

  .resource {
    flex: 1 1 0;
    min-width: 0;
  }

  .arena {
    padding: 19px 17px 17px;
    border-radius: 20px;
  }

  .arena::before {
    inset: 5px;
    border-radius: 16px;
  }

  .arena-title {
    font-size: 19px;
  }

  .monster-heading {
    margin-top: 14px;
  }

  .monster-name {
    font-size: clamp(34px, 8vw, 43px);
  }

  .monster-stage {
    height: 320px;
  }

  .stage-arch {
    width: min(430px, 98%);
    height: 278px;
  }

  .rune-ring {
    width: 240px;
    height: 240px;
  }

  .monster-button {
    width: 226px;
    height: 226px;
  }

  .monster-emoji {
    font-size: 130px;
  }

  .monster-image {
    width: 200px;
    height: 200px;
  }

  .monster-button.is-boss .monster-emoji {
    font-size: 138px;
  }

  .monster-button.is-boss .monster-image {
    width: 208px;
    height: 208px;
  }

  .location-bar {
    margin-bottom: 12px;
    padding: 8px 12px 8px 9px;
  }

  .location-name {
    font-size: 16.5px;
  }

  .health-card {
    padding: 12px 13px 11px;
  }

  .combat-meta__hint {
    display: none;
  }

  .upgrades {
    padding: 18px;
    border-radius: 20px;
  }

  .upgrade-list {
    grid-template-columns: 1fr;
  }

  .upgrade-card {
    grid-template-columns: 46px minmax(0, 1fr) auto;
    align-items: center;
  }

  .upgrade-icon {
    width: 46px;
    height: 46px;
  }

  .buy-button {
    grid-column: auto;
    display: grid;
    grid-template-columns: 1fr;
    width: auto;
    min-width: 80px;
    margin-top: 0;
  }

  .upgrade-name {
    white-space: normal;
  }

  .upgrade-effect {
    white-space: nowrap;
  }

  .footer {
    padding: 0 2px;
  }
}

@media (max-width: 560px) {
  .app {
    width: calc(100% - 22px);
    padding-top: 12px;
  }

  .brand {
    gap: 10px;
  }

  .brand-mark {
    width: 47px;
    height: 47px;
    border-radius: 13px;
  }

  .brand-mark svg {
    width: 29px;
    height: 29px;
  }

  .brand-title {
    font-size: 25px;
  }

  .brand-subtitle {
    margin-top: 5px;
    font-size: 8px;
    letter-spacing: 0.2em;
  }

  .resource {
    gap: 8px;
    padding: 8px 10px 8px 8px;
  }

  .resource-icon {
    width: 33px;
    height: 33px;
    border-radius: 10px;
  }

  .coin {
    width: 20px;
    height: 20px;
  }

  .resource-icon svg {
    width: 18px;
    height: 18px;
  }

  .resource-label {
    font-size: 7.5px;
    letter-spacing: 0.08em;
  }

  .resource-value {
    font-size: 21px;
  }

  .hero-panel {
    padding: 15px;
  }

  .account-button {
    width: 100%;
    justify-content: center;
  }

  .account-label {
    max-width: none;
  }

  .auth-card {
    padding: 22px 18px;
  }

  .auth-title {
    font-size: 25px;
  }

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

  .hero-stat {
    min-width: 0;
  }

  .hero-stat:last-child {
    grid-column: 1 / -1;
  }

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

  .equipment-slot {
    min-height: 78px;
    padding: 9px 8px;
  }

  .hero-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .hero-hint {
    max-width: none;
  }

  .drop-rates {
    justify-content: flex-start;
  }

  .boss-start-button__hint {
    display: none;
  }

  .arena {
    padding: 16px 13px 14px;
  }

  .arena-head {
    gap: 10px;
  }

  .eyebrow {
    font-size: 8px;
    letter-spacing: 0.18em;
  }

  .arena-title {
    font-size: 17px;
  }

  .badge {
    padding: 6px 9px;
    font-size: 8px;
  }

  .boss-timer {
    font-size: 19px;
  }

  .monster-name {
    font-size: 34px;
  }

  .monster-stage {
    height: 286px;
  }

  .stage-arch {
    height: 245px;
    border-radius: 50% 50% 15px 15px / 36% 36% 15px 15px;
  }

  .rune-ring {
    width: 205px;
    height: 205px;
  }

  .monster-button {
    width: 198px;
    height: 198px;
  }

  .monster-emoji {
    font-size: 112px;
  }

  .monster-image {
    width: 174px;
    height: 174px;
  }

  .monster-button.is-boss .monster-emoji {
    font-size: 120px;
  }

  .monster-button.is-boss .monster-image {
    width: 182px;
    height: 182px;
  }

  .location-bar {
    gap: 8px;
    margin-bottom: 10px;
    padding: 8px 10px 8px 8px;
  }

  .location-icon {
    width: 32px;
    height: 32px;
    font-size: 15px;
  }

  .location-name {
    font-size: 15px;
  }

  .location-range {
    padding: 4px 7px;
    font-size: 7px;
  }

  .tab {
    gap: 5px;
    padding: 8px 5px;
    font-size: 10px;
  }

  .monster-shadow {
    width: 110px;
    height: 18px;
  }

  .stage-floor {
    width: 260px;
  }

  .health-card {
    padding: 11px 11px 10px;
  }

  .health-label {
    font-size: 13px;
  }

  .health-numbers strong {
    font-size: 16px;
  }

  .health-track {
    height: 13px;
  }

  .health-track.is-boss {
    height: 15px;
  }

  .combat-meta {
    gap: 6px 13px;
    font-size: 10px;
  }

  .upgrades {
    padding: 15px;
  }

  .upgrades-title {
    font-size: 25px;
  }

  .tabs {
    margin-top: 14px;
  }

  .upgrade-card {
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 9px;
    padding: 9px;
  }

  .upgrade-icon {
    width: 42px;
    height: 42px;
    font-size: 21px;
  }

  .upgrade-name {
    font-size: 13px;
  }

  .upgrade-effect {
    font-size: 9.5px;
  }

  .buy-button {
    min-width: 74px;
    padding: 7px 6px;
  }

  .buy-label {
    font-size: 7px;
  }

  .buy-price {
    font-size: 11px;
  }

  .footer {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 16px;
    margin-top: 13px;
  }

  .toast-container {
    right: 14px;
    bottom: max(14px, env(safe-area-inset-bottom));
  }

  .reset-dialog__body {
    padding: 24px 20px;
  }

  .reset-dialog h2 {
    font-size: 24px;
  }
}

@media (max-width: 390px) {
  .resource-label {
    letter-spacing: 0.04em;
  }

  .resource-value {
    font-size: 19px;
  }

  .resource-icon {
    width: 30px;
    height: 30px;
  }

  .resource {
    gap: 6px;
    padding: 7px 7px 7px 6px;
  }

  .diamond-gem {
    width: 12px;
    height: 12px;
  }

  .hero-panel {
    padding: 13px;
  }

  .hero-portrait {
    width: 68px;
    height: 68px;
  }

  .hero-portrait img {
    width: 56px;
    height: 56px;
  }

  .hero-name {
    font-size: 23px;
  }

  .hero-stat {
    padding: 7px 9px;
  }

  .hero-stat strong {
    font-size: 17px;
  }

  .equipment-slot {
    min-height: 74px;
    gap: 7px;
    padding: 8px 7px;
  }

  .equipment-slot__icon {
    width: 30px;
    height: 30px;
    font-size: 15px;
  }

  .equipment-slot__item {
    font-size: 11.5px;
  }

  .equipment-slot__quality {
    font-size: 6px;
  }

  .monster-name {
    font-size: 31px;
  }

  .monster-stage {
    height: 264px;
  }

  .stage-arch {
    height: 228px;
  }

  .monster-button {
    width: 182px;
    height: 182px;
  }

  .monster-emoji {
    font-size: 102px;
  }

  .monster-image {
    width: 156px;
    height: 156px;
  }

  .monster-button.is-boss .monster-emoji {
    font-size: 110px;
  }

  .monster-button.is-boss .monster-image {
    width: 164px;
    height: 164px;
  }

  .location-kicker {
    font-size: 7.5px;
  }

  .location-name {
    font-size: 14px;
  }

  .location-range {
    padding: 4px 6px;
    font-size: 6.5px;
  }

  .tab {
    gap: 4px;
    padding: 8px 4px;
    font-size: 9px;
  }

  .tab-icon {
    font-size: 10px;
  }

  .upgrade-card {
    grid-template-columns: 38px minmax(0, 1fr) auto;
  }

  .upgrade-icon {
    width: 38px;
    height: 38px;
    font-size: 19px;
  }

  .upgrade-name {
    font-size: 12.5px;
  }

  .buy-button {
    min-width: 68px;
  }
}

/* ---------- Уважение к настройкам движения ---------- */

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

  .monster-emoji,
  .monster-image,
  .monster-aura,
  .stage-glow,
  .ember {
    animation: none !important;
  }
}
