:root {
  --bg: #0a0e1a;
  --panel: #151b2e;
  --accent: #ff8c42;
  --accent-strong: #ffb84d;
  --text: #f0f4f8;
  --muted: #9ca8ba;
  --grid-size: 14;
  /* Фиксированный логический размер тайла: 48px.
     Вся игра живёт в постоянной сетке и масштабируется только через transform: scale(),
     чтобы башни/враги не "улетали" при zoom/resize. */
  --tile-size: 48px;
  --glow-orange: rgba(255, 140, 66, 0.3);
  --glow-green: rgba(85, 225, 169, 0.3);
  --glow-blue: rgba(141, 224, 255, 0.3);
}

html, body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  width: 100%;
  height: 100%;
  background: var(--bg);
}

* {
  box-sizing: border-box;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  font-size: clamp(10px, 1.3vw, 24px);
}

body {
  font-family: 'Roboto', sans-serif;
  color: var(--text);
  position: fixed;
  touch-action: none;
}

#game-container {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  position: fixed;
  top: 0;
  left: 0;
  background: var(--bg);
}

#app {
  display: grid;
  grid-template-columns: minmax(150px, 22%) minmax(300px, 1fr) minmax(150px, 22%);
  width: 1400px;
  height: 800px;
  overflow: hidden;
  position: fixed;
  top: 50%;
  left: 50%;
  transform-origin: center center;
  will-change: transform;
}

.panel {
  background: linear-gradient(180deg, var(--panel) 0%, #0f1520 100%);
  padding: clamp(8px, 1.5vw, 20px);
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.5vw, 20px);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset -1px 0 20px rgba(0, 0, 0, 0.3);
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
}

.right-panel {
  border-right: none;
  border-left: 1px solid rgba(255, 255, 255, 0.05);
}

h1, h2, h3 {
  font-family: 'Russo One', sans-serif;
  margin: 0;
  letter-spacing: 1px;
}

h1 {
  font-size: clamp(0.9rem, 2.5vw, 1.8rem);
}

h2 {
  font-size: clamp(0.8rem, 2vw, 1.5rem);
}

h3 {
  font-size: clamp(0.75rem, 1.8vw, 1.2rem);
}

.stat-block {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 140, 66, 0.2);
  border-radius: 14px;
  padding: clamp(8px, 1.5vw, 16px);
  display: grid;
  gap: clamp(6px, 1.2vw, 14px);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3), 0 2px 12px rgba(255, 140, 66, 0.1);
}

.stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: clamp(0.7rem, 1.2vw, 0.95rem);
}

.stat strong {
  font-size: clamp(0.85rem, 1.5vw, 1.2rem);
  color: var(--accent-strong);
}

.controls button,
.audio-controls button,
.selection-actions button,
#restart-game,
#start-wave,
#upgrade-campfire {
  width: 100%;
  padding: clamp(6px, 1vw, 12px) clamp(8px, 1.5vw, 16px);
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 140, 66, 0.2), rgba(255, 184, 77, 0.15));
  border: 1px solid rgba(255, 140, 66, 0.3);
  color: var(--text);
  font-weight: 600;
  font-size: clamp(0.7rem, 1.2vw, 1rem);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

button:hover:not(:disabled) {
  transform: translateY(-2px);
  background: linear-gradient(135deg, rgba(255, 140, 66, 0.35), rgba(255, 184, 77, 0.25));
  box-shadow: 0 4px 12px rgba(255, 140, 66, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 140, 66, 0.5);
}

button:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3), inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

main {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-width: 0;
  padding: clamp(8px, 1vh, 16px);
}

#grid-wrapper {
  position: relative;
  width: calc(var(--tile-size) * var(--grid-size));
  height: calc(var(--tile-size) * var(--grid-height, var(--grid-size)));
  max-width: 100%;
  max-height: 100%;
  margin: auto;
  border-radius: 18px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

#grid {
  display: grid;
  grid-template-columns: repeat(var(--grid-size), var(--tile-size));
  grid-template-rows: repeat(var(--grid-height, var(--grid-size)), var(--tile-size));
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 30%, rgba(20, 40, 20, 0.3) 0, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(30, 20, 40, 0.2) 0, transparent 50%),
    linear-gradient(135deg, #0a0e1a 0%, #0f1419 50%, #0a0e1a 100%);
  position: relative;
  box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.tile {
  border: 1px solid rgba(255, 255, 255, 0.05);
  position: relative;
  background: rgba(30, 42, 71, 0.3);
}

.tile::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 6px;
  opacity: 0;
  transition: opacity 0.1s;
}

.tile.hover-valid::after {
  background: rgba(88, 255, 173, 0.18);
  opacity: 1;
}

.tile.hover-invalid::after {
  background: rgba(255, 96, 96, 0.25);
  opacity: 1;
}

.tile.path::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 6px;
  background: linear-gradient(135deg, #5a4a32, #3d2e1f, #4a3a28);
  box-shadow: 
    inset 0 0 20px rgba(0, 0, 0, 0.8), 
    0 2px 8px rgba(90, 73, 49, 0.4),
    inset 0 1px 0 rgba(139, 115, 85, 0.2);
  border: 1px solid rgba(139, 115, 85, 0.4);
  z-index: 0;
}

/* Плавная тропинка - убираем резкие границы между соседними клетками */
.tile.path {
  position: relative;
  z-index: 1;
}

.tile.buildable:hover:not(.occupied) {
  background: rgba(85, 225, 169, 0.2);
  box-shadow: inset 0 0 20px rgba(85, 225, 169, 0.15);
}

.tile.buildable.invalid:hover {
  background: rgba(255, 96, 96, 0.25);
  box-shadow: inset 0 0 20px rgba(255, 96, 96, 0.2);
}

.tower,
.farm,
.enemy,
.particle {
  position: absolute;
}

/* Башни - силуэты в стиле "99 ночей" */
.tower {
  position: absolute;
  width: calc(var(--tile-size) * 0.8);
  height: calc(var(--tile-size) * 0.8);
  transform: translate(-50%, -50%);
  pointer-events: auto;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.8));
  transition: transform 0.2s;
  z-index: 10;
}

.tower:hover {
  transform: translate(-50%, -50%) scale(1.1);
  filter: drop-shadow(0 6px 16px rgba(255, 140, 66, 0.6));
}

/* Башня-лучник */
.tower.tower-archer {
  width: calc(var(--tile-size) * 0.6);
  height: calc(var(--tile-size) * 0.9);
}

.tower.tower-archer::before {
  content: '';
  position: absolute;
  width: 50%;
  height: 80%;
  background: #4a3a2a;
  border-radius: 8px 8px 4px 4px;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 
    inset 0 0 15px rgba(0, 0, 0, 0.6),
    0 -5px 0 rgba(0, 0, 0, 0.4),
    0 0 10px rgba(100, 80, 60, 0.4);
  border: 2px solid rgba(80, 60, 40, 0.6);
}

.tower.tower-archer::after {
  content: '';
  position: absolute;
  width: 35%;
  height: 28%;
  background: #3a2a1a;
  border-radius: 50% 50% 40% 40%;
  top: 3%;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 
    inset 0 -5px 0 rgba(0, 0, 0, 0.5),
    0 0 8px rgba(100, 80, 60, 0.4);
  border: 2px solid rgba(60, 40, 20, 0.6);
}

.tower.tower-archer .tower-archer-figure {
  position: absolute;
  width: 25%;
  height: 55%;
  background: #2a1a0a;
  top: 18%;
  left: 50%;
  transform: translateX(-50%);
  clip-path: polygon(30% 0, 70% 0, 75% 100%, 25% 100%);
  box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.5);
}

.tower.tower-archer .tower-bow {
  position: absolute;
  width: 15%;
  height: 30%;
  border: 3px solid #4a3a2a;
  border-radius: 50% 0 0 50%;
  top: 35%;
  right: 10%;
  transform: rotate(-20deg);
  box-shadow: 0 0 5px rgba(100, 80, 60, 0.5);
}

/* Башня-камнемёт */
.tower.tower-catapult {
  width: calc(var(--tile-size) * 1.0);
  height: calc(var(--tile-size) * 0.7);
}

.tower.tower-catapult::before {
  content: '';
  position: absolute;
  width: 85%;
  height: 65%;
  background: #3a3a2a;
  border-radius: 10px;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 
    inset 0 0 20px rgba(0, 0, 0, 0.7),
    0 -10px 0 rgba(0, 0, 0, 0.5),
    0 0 15px rgba(100, 100, 80, 0.4);
  border: 2px solid rgba(80, 80, 60, 0.6);
}

.tower.tower-catapult::after {
  content: '';
  position: absolute;
  width: 45%;
  height: 28%;
  background: #2a2a1a;
  border-radius: 50%;
  top: 8%;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 
    inset 0 -8px 0 rgba(0, 0, 0, 0.6),
    0 0 10px rgba(100, 100, 80, 0.4);
  border: 2px solid rgba(60, 60, 40, 0.6);
}

.tower.tower-catapult .tower-arm {
  position: absolute;
  width: 50%;
  height: 8px;
  background: #3a2a1a;
  top: 30%;
  left: 25%;
  transform-origin: left center;
  animation: catapultArm 2s ease-in-out infinite;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

@keyframes catapultArm {
  0%, 90% { transform: rotate(0deg); }
  5% { transform: rotate(-15deg); }
}

/* Магический тотем - базовый (фиолетовый) */
.tower.tower-magic {
  width: calc(var(--tile-size) * 0.6);
  height: calc(var(--tile-size) * 0.9);
}

.tower.tower-magic::before {
  content: '';
  position: absolute;
  width: 65%;
  height: 75%;
  background: radial-gradient(ellipse at center, rgba(180, 120, 220, 1), rgba(100, 50, 150, 1));
  border-radius: 50% 50% 30% 30%;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 
    0 0 25px rgba(180, 120, 220, 0.8),
    inset 0 0 25px rgba(0, 0, 0, 0.5),
    0 0 15px rgba(200, 150, 255, 0.6);
  border: 2px solid rgba(200, 150, 255, 0.5);
  animation: totemPulse 2s ease-in-out infinite;
}

.tower.tower-magic::after {
  content: '';
  position: absolute;
  width: 40%;
  height: 20%;
  background: radial-gradient(circle, rgba(200, 150, 255, 0.8), rgba(150, 100, 200, 0.9));
  border-radius: 50%;
  top: 5%;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 15px rgba(200, 150, 255, 0.8);
  animation: totemGlow 1.5s ease-in-out infinite;
}

/* Магический тотем - шок (зеленый) */
.tower.tower-magic-shock::before {
  background: radial-gradient(ellipse at center, rgba(100, 220, 150, 1), rgba(50, 150, 100, 1));
  box-shadow: 
    0 0 25px rgba(100, 220, 150, 0.8),
    inset 0 0 25px rgba(0, 0, 0, 0.5),
    0 0 15px rgba(120, 255, 180, 0.6);
  border-color: rgba(120, 255, 180, 0.5);
}

.tower.tower-magic-shock::after {
  background: radial-gradient(circle, rgba(120, 255, 180, 0.8), rgba(100, 220, 150, 0.9));
  box-shadow: 0 0 15px rgba(120, 255, 180, 0.8);
}

/* Магический тотем - лед (голубой) */
.tower.tower-magic-frost::before {
  background: radial-gradient(ellipse at center, rgba(120, 200, 255, 1), rgba(60, 140, 200, 1));
  box-shadow: 
    0 0 25px rgba(120, 200, 255, 0.8),
    inset 0 0 25px rgba(0, 0, 0, 0.5),
    0 0 15px rgba(150, 220, 255, 0.6);
  border-color: rgba(150, 220, 255, 0.5);
}

.tower.tower-magic-frost::after {
  background: radial-gradient(circle, rgba(150, 220, 255, 0.8), rgba(120, 200, 255, 0.9));
  box-shadow: 0 0 15px rgba(150, 220, 255, 0.8);
}

/* Магический тотем - огонь (оранжево-красный) */
.tower.tower-magic-flame::before {
  background: radial-gradient(ellipse at center, rgba(255, 150, 100, 1), rgba(200, 80, 50, 1));
  box-shadow: 
    0 0 25px rgba(255, 150, 100, 0.8),
    inset 0 0 25px rgba(0, 0, 0, 0.5),
    0 0 15px rgba(255, 180, 120, 0.6);
  border-color: rgba(255, 180, 120, 0.5);
}

.tower.tower-magic-flame::after {
  background: radial-gradient(circle, rgba(255, 180, 120, 0.8), rgba(255, 150, 100, 0.9));
  box-shadow: 0 0 15px rgba(255, 180, 120, 0.8);
}

/* Магический тотем - яд (зелено-желтый) */
.tower.tower-magic-poison::before {
  background: radial-gradient(ellipse at center, rgba(150, 220, 100, 1), rgba(100, 180, 60, 1));
  box-shadow: 
    0 0 25px rgba(150, 220, 100, 0.8),
    inset 0 0 25px rgba(0, 0, 0, 0.5),
    0 0 15px rgba(180, 255, 120, 0.6);
  border-color: rgba(180, 255, 120, 0.5);
}

.tower.tower-magic-poison::after {
  background: radial-gradient(circle, rgba(180, 255, 120, 0.8), rgba(150, 220, 100, 0.9));
  box-shadow: 0 0 15px rgba(180, 255, 120, 0.8);
}

@keyframes totemPulse {
  0%, 100% { transform: translateX(-50%) scaleY(1); }
  50% { transform: translateX(-50%) scaleY(1.05); }
}

@keyframes totemGlow {
  0%, 100% { opacity: 0.8; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.1); }
}

/* Ферма */
.tower.farm {
  width: calc(var(--tile-size) * 0.7);
  height: calc(var(--tile-size) * 0.7);
}

.tower.farm::before {
  content: '';
  position: absolute;
  width: 75%;
  height: 55%;
  background: #2a4a2a;
  border-radius: 10px 10px 6px 6px;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 
    inset 0 0 15px rgba(0, 0, 0, 0.5),
    0 0 12px rgba(100, 200, 100, 0.4);
  border: 2px solid rgba(80, 150, 80, 0.6);
}

.tower.farm::after {
  content: '';
  position: absolute;
  width: 55%;
  height: 45%;
  background: #3a5a3a;
  border-radius: 50% 50% 40% 40%;
  top: 8%;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 
    inset 0 -8px 0 rgba(0, 0, 0, 0.4),
    0 0 15px rgba(120, 220, 120, 0.5);
  border: 2px solid rgba(100, 180, 100, 0.6);
}

.enemy,
.particle {
  pointer-events: none;
}
.tower.selected::after {
  content: '';
  position: absolute;
  width: 140%;
  height: 140%;
  border: 2px solid var(--accent-strong);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(0.9); }
  50% { opacity: 0.2; transform: translate(-50%, -50%) scale(1.2); }
  100% { opacity: 0.1; transform: translate(-50%, -50%) scale(1.4); }
}

/* Враги - силуэты животных в стиле "99 ночей" */
.enemy {
  position: absolute;
  width: calc(var(--tile-size) * 0.6);
  height: calc(var(--tile-size) * 0.6);
  transform: translate(-50%, -50%);
  animation: enemyRun 0.6s ease-in-out infinite;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.9));
  z-index: 5;
}

/* Волк - вытянутый силуэт с четкими формами */
.enemy.enemy-wolf {
  width: calc(var(--tile-size) * 0.85);
  height: calc(var(--tile-size) * 0.55);
}

/* Тело волка */
.enemy.enemy-wolf::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 65%;
  background: #0f0f0f;
  border-radius: 45% 45% 35% 35%;
  top: 25%;
  left: 0;
  box-shadow: 
    inset 0 -8px 0 rgba(0, 0, 0, 0.7),
    inset 0 2px 0 rgba(50, 50, 50, 0.3);
}

/* Голова волка */
.enemy.enemy-wolf::after {
  content: '';
  position: absolute;
  width: 40%;
  height: 55%;
  background: #0f0f0f;
  border-radius: 50% 45% 50% 45%;
  top: 0;
  left: 3%;
  transform: rotate(-12deg);
  box-shadow: inset -3px 0 0 rgba(0, 0, 0, 0.5);
}

/* Морда волка */
.enemy.enemy-wolf .enemy-face {
  position: absolute;
  width: 28%;
  height: 35%;
  background: #050505;
  border-radius: 50% 50% 45% 45%;
  top: 12%;
  left: 6%;
  clip-path: polygon(0 0, 100% 0, 95% 75%, 50% 100%, 5% 75%);
}

/* Глаза волка - яркие и заметные */
.enemy.enemy-wolf .enemy-eyes {
  position: absolute;
  width: 10px;
  height: 10px;
  background: rgba(255, 80, 80, 1);
  border-radius: 50%;
  top: 18%;
  left: 10%;
  box-shadow: 
    0 0 12px rgba(255, 80, 80, 1),
    0 0 20px rgba(255, 80, 80, 0.6),
    18px 0 0 rgba(255, 80, 80, 1),
    18px 0 12px rgba(255, 80, 80, 1),
    18px 0 20px rgba(255, 80, 80, 0.6);
  animation: eyeGlow 2s ease-in-out infinite;
}

/* Уши волка */
.enemy.enemy-wolf .enemy-ears {
  position: absolute;
  width: 12px;
  height: 18px;
  background: #0a0a0a;
  border-radius: 50% 50% 0 50%;
  top: 2%;
  left: 8%;
  transform: rotate(-25deg);
  box-shadow: 
    20px 0 0 #0a0a0a,
    20px 0 2px rgba(0, 0, 0, 0.5);
}

@keyframes eyeGlow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.1); }
}

/* Лесной зверёк (лисёнок) - маленький и быстрый */
.enemy.enemy-fox {
  width: calc(var(--tile-size) * 0.45);
  height: calc(var(--tile-size) * 0.55);
}

/* Тело лисёнка */
.enemy.enemy-fox::before {
  content: '';
  position: absolute;
  width: 75%;
  height: 85%;
  background: #3a2515;
  border-radius: 50% 50% 45% 45%;
  top: 8%;
  left: 12%;
  box-shadow: 
    inset 0 -5px 0 rgba(0, 0, 0, 0.5),
    inset 0 2px 0 rgba(80, 60, 40, 0.3);
}

/* Голова лисёнка */
.enemy.enemy-fox::after {
  content: '';
  position: absolute;
  width: 45%;
  height: 40%;
  background: #3a2515;
  border-radius: 50% 45% 50% 45%;
  top: -2%;
  left: 18%;
  transform: rotate(-8deg);
  box-shadow: inset -2px 0 0 rgba(0, 0, 0, 0.4);
}

/* Хвост лисёнка */
.enemy.enemy-fox .enemy-tail {
  position: absolute;
  width: 25%;
  height: 40%;
  background: #4a2a1a;
  border-radius: 50% 0 0 50%;
  top: 30%;
  right: 5%;
  transform: rotate(15deg);
  box-shadow: inset -2px 0 0 rgba(0, 0, 0, 0.4);
}

.enemy.enemy-fox .enemy-eyes {
  position: absolute;
  width: 6px;
  height: 6px;
  background: rgba(255, 180, 80, 1);
  border-radius: 50%;
  top: 22%;
  left: 28%;
  box-shadow: 
    0 0 10px rgba(255, 180, 80, 0.9),
    0 0 15px rgba(255, 180, 80, 0.5),
    14px 0 0 rgba(255, 180, 80, 1),
    14px 0 10px rgba(255, 180, 80, 0.9),
    14px 0 15px rgba(255, 180, 80, 0.5);
}

/* Духовная тень - плавный округлый силуэт */
.enemy.enemy-shadow {
  width: calc(var(--tile-size) * 0.55);
  height: calc(var(--tile-size) * 0.55);
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(120, 70, 180, 0.95), rgba(60, 30, 100, 1));
  box-shadow: 
    0 0 25px rgba(150, 100, 200, 0.8),
    inset 0 0 25px rgba(0, 0, 0, 0.5),
    0 0 15px rgba(180, 130, 220, 0.6);
  animation: shadowFloat 2s ease-in-out infinite;
  border: 2px solid rgba(180, 130, 220, 0.4);
}

.enemy.enemy-shadow .enemy-eyes {
  position: absolute;
  width: 8px;
  height: 8px;
  background: rgba(220, 180, 255, 1);
  border-radius: 50%;
  top: 32%;
  left: 28%;
  box-shadow: 
    0 0 15px rgba(220, 180, 255, 1),
    0 0 25px rgba(220, 180, 255, 0.6),
    22px 0 0 rgba(220, 180, 255, 1),
    22px 0 15px rgba(220, 180, 255, 1),
    22px 0 25px rgba(220, 180, 255, 0.6);
  animation: eyeBlink 3s ease-in-out infinite;
}

/* Босс - большой волк с золотым свечением */
.enemy.enemy-boss {
  width: calc(var(--tile-size) * 1.3);
  height: calc(var(--tile-size) * 0.85);
}

.enemy.enemy-boss::before {
  width: 100%;
  height: 70%;
  box-shadow: 
    inset 0 -10px 0 rgba(0, 0, 0, 0.7),
    0 0 40px rgba(255, 200, 0, 0.6),
    0 0 60px rgba(255, 180, 0, 0.4);
  border: 2px solid rgba(255, 200, 0, 0.3);
}

.enemy.enemy-boss::after {
  width: 45%;
  height: 60%;
  box-shadow: 
    inset -4px 0 0 rgba(0, 0, 0, 0.6),
    0 0 30px rgba(255, 200, 0, 0.5);
}

.enemy.enemy-boss .enemy-eyes {
  width: 14px;
  height: 14px;
  background: rgba(255, 120, 0, 1);
  box-shadow: 
    0 0 18px rgba(255, 120, 0, 1),
    0 0 30px rgba(255, 120, 0, 0.7),
    28px 0 0 rgba(255, 120, 0, 1),
    28px 0 18px rgba(255, 120, 0, 1),
    28px 0 30px rgba(255, 120, 0, 0.7);
  animation: bossEyeGlow 1.5s ease-in-out infinite;
}

@keyframes bossEyeGlow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.2); }
}

/* Анимации */
@keyframes enemyRun {
  0%, 100% { 
    transform: translate(-50%, -50%) translateY(0);
  }
  50% { 
    transform: translate(-50%, -50%) translateY(-3px);
  }
}

@keyframes shadowFloat {
  0%, 100% { 
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.8;
  }
  50% { 
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 1;
  }
}

@keyframes eyeBlink {
  0%, 90%, 100% { opacity: 1; }
  95% { opacity: 0.3; }
}

.enemy.flying {
  box-shadow: 0 4px 16px rgba(117, 181, 250, 0.7);
}

.enemy.boss {
  width: calc(var(--tile-size) * 0.7);
  height: calc(var(--tile-size) * 0.7);
  border: 2px solid #ffeb3b;
}

.range-indicator {
  position: absolute;
  border: 2px dashed rgba(255, 140, 66, 0.4);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 20px rgba(255, 140, 66, 0.2), inset 0 0 20px rgba(255, 140, 66, 0.1);
  background: radial-gradient(circle, rgba(255, 140, 66, 0.05), transparent 70%);
}

#campfire-glow {
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 200, 100, 0.7), rgba(255, 180, 80, 0.4), rgba(255, 140, 66, 0.2), transparent 75%);
  mix-blend-mode: screen;
  pointer-events: none;
  filter: blur(10px);
  animation: campfireBreathing 2.5s ease-in-out infinite;
  z-index: 1;
}

@keyframes campfireBreathing {
  0%, 100% { 
    opacity: 0.85; 
    transform: scale(1);
  }
  25% { 
    opacity: 0.95; 
    transform: scale(1.05);
  }
  50% { 
    opacity: 1; 
    transform: scale(1.12);
  }
  75% { 
    opacity: 0.95; 
    transform: scale(1.05);
  }
}

#phase-banner {
  position: fixed;
  top: clamp(16px, 2vh, 32px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 10, 10, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: clamp(8px, 1.5vw, 12px) clamp(16px, 3vw, 24px);
  border-radius: 999px;
  font-weight: 600;
  font-size: clamp(0.7rem, 1.5vw, 1rem);
  letter-spacing: 2px;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
  z-index: 100;
  white-space: nowrap;
}

#phase-banner.visible {
  opacity: 1;
}

#effects-layer,
#mini-map {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 12px;
}

#effects-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#build-menu {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(6px, 1.2vw, 12px);
}

.build-card {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: clamp(6px, 1.2vw, 12px);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: clamp(4px, 1vw, 8px);
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.build-card:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 140, 66, 0.3);
}

.build-card.active {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(255, 140, 66, 0.15), rgba(255, 184, 77, 0.1));
  box-shadow: 0 0 16px rgba(255, 140, 66, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.build-card h4 {
  margin: 0;
  font-size: clamp(0.7rem, 1.2vw, 0.95rem);
}

.build-card span {
  font-size: clamp(0.6rem, 1vw, 0.8rem);
  color: var(--muted);
}

#selection-panel {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  border-radius: 14px;
  padding: clamp(8px, 1.5vw, 16px);
  border: 1px solid rgba(255, 140, 66, 0.2);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2), 0 2px 12px rgba(255, 140, 66, 0.1);
}

#mini-map {
  width: 100%;
  height: auto;
  border: 2px solid rgba(255, 140, 66, 0.3);
  border-radius: 8px;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(255, 140, 66, 0.1);
  background: #0f1724;
}

.wave-summary {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  border-radius: 14px;
  padding: 16px;
  border: 1px solid rgba(255, 140, 66, 0.2);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2), 0 2px 12px rgba(255, 140, 66, 0.1);
}

.wave-summary ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
}

.wave-summary li {
  font-size: 0.85rem;
  color: var(--muted);
}

.wave-stats {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 10px;
}

.wave-stats h4 {
  margin: 0 0 6px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent-strong);
}

.wave-stats p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text);
}

#tooltip {
  position: fixed;
  background: rgba(0, 0, 0, 0.85);
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.8rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.modal {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.9));
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: linear-gradient(135deg, var(--panel) 0%, #0f1520 100%);
  padding: clamp(16px, 3vw, 40px);
  border-radius: clamp(12px, 2vw, 24px);
  width: min(420px, 95vw);
  max-width: 95vw;
  max-height: 95vh;
  overflow-y: auto;
  text-align: center;
  border: 2px solid rgba(255, 140, 66, 0.3);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  font-size: clamp(0.8rem, 1.2vw, 1rem);
}

/* Модальное окно улучшения костра */
#campfire-upgrade-info {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 24px 0;
  text-align: left;
}

.upgrade-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: clamp(8px, 1.2vw, 12px);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  border: 1px solid rgba(255, 140, 66, 0.2);
  font-size: clamp(0.75rem, 1.1vw, 0.95rem);
}

.upgrade-stat span:first-child {
  color: var(--muted);
}

.upgrade-stat span:last-child {
  color: var(--accent-strong);
  font-weight: 700;
}

.upgrade-cost {
  text-align: center;
  padding: clamp(10px, 1.5vw, 16px);
  background: rgba(255, 140, 66, 0.1);
  border-radius: 8px;
  border: 2px solid rgba(255, 140, 66, 0.3);
  font-size: clamp(0.9rem, 1.5vw, 1.2rem);
  font-weight: 700;
  color: var(--accent-strong);
}

.upgrade-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.upgrade-actions button {
  flex: 1;
  padding: clamp(10px, 1.5vw, 14px) clamp(16px, 2.5vw, 24px);
  font-size: clamp(0.8rem, 1.2vw, 1rem);
  font-weight: 700;
  border-radius: 12px;
  border: 2px solid;
  cursor: pointer;
  transition: all 0.2s;
}

#campfire-upgrade-confirm {
  background: linear-gradient(135deg, rgba(85, 225, 169, 0.3), rgba(120, 255, 200, 0.2));
  border-color: rgba(85, 225, 169, 0.6);
  color: var(--text);
}

#campfire-upgrade-confirm:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(85, 225, 169, 0.5), rgba(120, 255, 200, 0.4));
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(85, 225, 169, 0.4);
}

#campfire-upgrade-confirm:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#campfire-upgrade-cancel {
  background: linear-gradient(135deg, rgba(255, 96, 96, 0.2), rgba(255, 140, 140, 0.1));
  border-color: rgba(255, 96, 96, 0.4);
  color: var(--text);
}

#campfire-upgrade-cancel:hover {
  background: linear-gradient(135deg, rgba(255, 96, 96, 0.4), rgba(255, 140, 140, 0.3));
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 96, 96, 0.3);
}

.menu-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, rgba(10, 14, 26, 0.95), rgba(5, 8, 15, 0.98));
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 5;
}

.menu-overlay.hidden {
  display: none;
}

.menu-content {
  background: linear-gradient(135deg, var(--panel) 0%, #0f1520 100%);
  padding: clamp(20px, 3vw, 40px);
  border-radius: clamp(12px, 2vw, 24px);
  border: 2px solid rgba(255, 140, 66, 0.3);
  width: min(900px, 95vw);
  max-width: 95vw;
  max-height: 95vh;
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 2vw, 24px);
  text-align: center;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  overflow: hidden;
  font-size: clamp(0.8rem, 1.2vw, 1rem);
}

.map-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  min-height: 200px;
  max-height: 60vh;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px;
  padding-bottom: calc((100% - 32px) * 2.27 / 10); /* Отступ размером в 2.27 карточки по ширине (3.4 / 1.5) для возможности долистать до конца */
}

.map-list::-webkit-scrollbar {
  width: 8px;
}

.map-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.map-list::-webkit-scrollbar-thumb {
  background: rgba(255, 140, 66, 0.5);
  border-radius: 4px;
}

.map-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 140, 66, 0.7);
}

.map-card {
  border-radius: 16px;
  padding: 18px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.2s ease;
  min-width: 0;
  width: 100%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.map-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 140, 66, 0.5);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  box-shadow: 0 8px 20px rgba(255, 140, 66, 0.3);
}

.map-card.selected {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(255, 140, 66, 0.2), rgba(255, 184, 77, 0.15));
  box-shadow: 0 0 24px rgba(255, 140, 66, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.map-card h4 {
  margin: 0;
  font-size: 1.1rem;
}

.map-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.map-thumbnail {
  width: 100%;
  height: 140px;
  border-radius: 12px;
  margin-bottom: 10px;
  border: 2px solid rgba(255, 140, 66, 0.2);
  background: #0f1724;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(255, 140, 66, 0.1);
}

.map-play-button {
  width: 100%;
  margin-top: 10px;
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 700;
  border: 2px solid rgba(255, 140, 66, 0.4);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(255, 140, 66, 0.3), rgba(255, 184, 77, 0.2));
  box-shadow: 0 4px 16px rgba(255, 140, 66, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
}

.map-play-button:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, rgba(255, 140, 66, 0.45), rgba(255, 184, 77, 0.3));
  box-shadow: 0 6px 20px rgba(255, 140, 66, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 140, 66, 0.6);
}

.map-play-button:active {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(255, 140, 66, 0.4), inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

#start-game {
  align-self: center;
  min-width: 220px;
  padding: 14px 32px;
  font-size: 1.1rem;
  font-weight: 700;
  border: 2px solid rgba(255, 140, 66, 0.4);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 140, 66, 0.3), rgba(255, 184, 77, 0.2));
  box-shadow: 0 4px 16px rgba(255, 140, 66, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
}

#start-game:hover:not(:disabled) {
  transform: translateY(-3px);
  background: linear-gradient(135deg, rgba(255, 140, 66, 0.45), rgba(255, 184, 77, 0.3));
  box-shadow: 0 6px 20px rgba(255, 140, 66, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 140, 66, 0.6);
}

#start-game:active:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(255, 140, 66, 0.4), inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

#start-game:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.camera-shake {
  animation: shake 0.3s ease;
}

@keyframes shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-4px); }
  100% { transform: translateX(0); }
}

/* Атмосферные эффекты */
.fog-layer {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(100, 120, 150, 0.15) 0%, transparent 70%);
  pointer-events: none;
  animation: fogDrift 20s ease-in-out infinite;
  z-index: 0;
}

@keyframes fogDrift {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.15; }
  33% { transform: translate(2%, -1%) scale(1.05); opacity: 0.2; }
  66% { transform: translate(-2%, 1%) scale(0.95); opacity: 0.15; }
}

.ambient-particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
  transition: opacity 0.3s ease;
}

.ambient-particle.pollen {
  animation: floatPollen 8s ease-in-out infinite;
}

.ambient-particle.firefly {
  animation: floatFirefly 6s ease-in-out infinite;
}

.ambient-particle.spark {
  animation: floatSpark 10s ease-in-out infinite;
}

@keyframes floatPollen {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.4; }
  50% { transform: translate(10px, -15px) scale(1.1); opacity: 0.7; }
}

@keyframes floatFirefly {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.6; }
  25% { transform: translate(8px, -10px) scale(1.2); opacity: 0.9; }
  50% { transform: translate(15px, -5px) scale(1); opacity: 0.7; }
  75% { transform: translate(8px, 5px) scale(1.1); opacity: 0.8; }
}

@keyframes floatSpark {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.3; }
  50% { transform: translate(-8px, 12px) scale(1.15); opacity: 0.6; }
}

.magic-beam {
  position: absolute;
  pointer-events: none;
  z-index: 3;
  border-radius: 2px;
  animation: beamFade 0.15s ease-out;
}

@keyframes beamFade {
  0% { opacity: 1; transform: scaleY(1); }
  100% { opacity: 0; transform: scaleY(0.5); }
}

/* Снаряды */
.arrow-projectile,
.stone-projectile,
.magic-projectile {
  position: absolute;
  pointer-events: none;
  z-index: 4;
}

.arrow-projectile {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}

.stone-projectile {
  animation: stoneSpin 0.2s linear infinite;
}

@keyframes stoneSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.magic-projectile {
  animation: magicFloat 0.15s ease-out;
}

@keyframes magicFloat {
  0% { transform: scale(0.5); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1); opacity: 0.9; }
}

.spark {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 3;
  animation: sparkPop 0.4s ease-out;
}

@keyframes sparkPop {
  0% { 
    transform: scale(0) translate(0, 0);
    opacity: 1;
  }
  50% {
    transform: scale(1.5) translate(5px, -5px);
    opacity: 0.8;
  }
  100% {
    transform: scale(0.5) translate(10px, -10px);
    opacity: 0;
  }
}

.wind-effect {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(200, 220, 255, 0.1) 50%, transparent 100%);
  pointer-events: none;
  z-index: 1;
  animation: windBlow 2s ease-out;
  transform: translateX(-100%);
}

@keyframes windBlow {
  0% { transform: translateX(-100%); opacity: 0; }
  50% { opacity: 0.3; }
  100% { transform: translateX(100%); opacity: 0; }
}

/* Подсветка тропинки */
.tile.path {
  position: relative;
}

.tile.path::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255, 200, 100, 0.2), transparent 70%);
  pointer-events: none;
  animation: pathGlow 3s ease-in-out infinite;
  z-index: 0;
}

@keyframes pathGlow {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 0.35; }
}

/* Улучшенные кнопки с мягким свечением */
.controls button:hover:not(:disabled),
.audio-controls button:hover:not(:disabled),
.selection-actions button:hover:not(:disabled),
#restart-game:hover:not(:disabled),
#start-wave:hover:not(:disabled),
#upgrade-campfire:hover:not(:disabled) {
  box-shadow: 0 4px 16px rgba(255, 140, 66, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 0 20px rgba(255, 140, 66, 0.3);
}

/* Звёзды на небе */
#grid::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    radial-gradient(2px 2px at 20% 30%, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1px 1px at 60% 70%, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(1.5px 1.5px at 80% 20%, rgba(255, 255, 255, 0.35), transparent),
    radial-gradient(1px 1px at 40% 80%, rgba(255, 255, 255, 0.3), transparent);
  background-size: 200% 200%;
  animation: starTwinkle 8s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes starTwinkle {
  0%, 100% { opacity: 0.6; transform: translate(0, 0); }
  50% { opacity: 1; transform: translate(-2%, -1%); }
}

/* Окно рекламы */
.ad-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.ad-overlay.hidden {
  display: none;
}

.ad-countdown {
  text-align: center;
  color: var(--text);
}

#ad-countdown-text {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  text-shadow: 0 0 20px rgba(255, 140, 66, 0.5);
}

/* Окно паузы */
.pause-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
  backdrop-filter: blur(5px);
  animation: fadeIn 0.3s ease;
}

.pause-overlay.hidden {
  display: none;
}

.resume-button {
  padding: 20px 40px;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  background: linear-gradient(135deg, rgba(255, 140, 66, 0.3), rgba(255, 184, 77, 0.2));
  border: 2px solid rgba(255, 140, 66, 0.5);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(255, 140, 66, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  animation: pulseButton 2s ease-in-out infinite;
}

.resume-button:hover {
  transform: scale(1.1);
  background: linear-gradient(135deg, rgba(255, 140, 66, 0.5), rgba(255, 184, 77, 0.4));
  box-shadow: 0 6px 30px rgba(255, 140, 66, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.resume-button:active {
  transform: scale(0.95);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pulseButton {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Запрет выделения текста */
input, textarea {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

/* Запрет контекстного меню */
body {
  -webkit-touch-callout: none;
}

/* Масштабирование теперь обрабатывается через JavaScript */
/* Все элементы масштабируются пропорционально через transform: scale() */

/* Media Queries для адаптивности */
/* Media queries больше не нужны для масштабирования #app, 
   так как используется transform: scale() на весь контейнер */

/* Обеспечиваем видимость правой панели на всех разрешениях */
.right-panel {
  min-width: 0;
  flex-shrink: 0;
}

.left-panel {
  min-width: 0;
  flex-shrink: 0;
}

/* Улучшаем прокрутку для панелей */
.panel::-webkit-scrollbar {
  width: 6px;
}

.panel::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

.panel::-webkit-scrollbar-thumb {
  background: rgba(255, 140, 66, 0.5);
  border-radius: 3px;
}

.panel::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 140, 66, 0.7);
}

