/* ============================================================
   КОСМИЧЕСКАЯ КОЛОНИЯ — полный CSS
   ============================================================ */

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

:root {
  --bg-deep: #05060f;
  --text: #e8ecff;
  --text-dim: #8a94c8;
  --accent: #7fffd4;
  --accent-2: #4fc3f7;
  --gold: #ffd54f;
  --orange: #ff9800;
  --pink: #ff6b9d;
  --red: #ff4757;
  --panel: rgba(255,255,255,0.04);
  --panel-border: rgba(120,150,255,0.15);
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Exo 2', -apple-system, "Segoe UI", Roboto, sans-serif;
  background: #05060f;
  color: var(--text);
  min-height: 100vh;
  user-select: none;
  position: relative;
}

#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ============================================================
   LAYOUT
   ============================================================ */
#app {
  position: relative;
  z-index: 1;
  max-width: 480px;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  padding: 8px 8px 80px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

#app::-webkit-scrollbar { width: 0; }

/* Header */
#app > header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(15, 20, 40, 0.8);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  margin-bottom: 6px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.stat { display: flex; align-items: center; gap: 6px; font-size: 18px; font-weight: 700; font-family: 'Russo One', sans-serif; }
.stat .icon { font-size: 20px; }
#ore { color: var(--accent); text-shadow: 0 0 12px rgba(127,255,212,0.5); }
#perSec { color: var(--accent-2); text-shadow: 0 0 12px rgba(79,195,247,0.4); }

/* Player row */
#app > .player-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(15, 20, 40, 0.7);
  border: 1px solid rgba(120,150,255,0.1);
  border-radius: 12px;
  margin-bottom: 10px;
  font-size: 14px;
  color: var(--text-dim);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
#player-name { font-weight: 700; color: var(--accent); font-family: 'Russo One', sans-serif; }
#edit-name-btn {
  background: transparent;
  border: 1px solid rgba(120,150,255,0.25);
  color: var(--text-dim);
  border-radius: 6px;
  padding: 2px 8px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
}
#edit-name-btn:hover { background: rgba(120,150,255,0.12); color: var(--accent); }

.star-badge {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: rgba(255,213,79,0.1);
  border: 1.5px solid rgba(255,213,79,0.35);
  border-radius: 10px;
  cursor: pointer;
  font-family: 'Russo One', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #ffd54f;
  transition: all 0.2s;
}
.star-badge:hover {
  background: rgba(255,213,79,0.2);
  border-color: #ffd54f;
  box-shadow: 0 0 16px rgba(255,213,79,0.5);
  
}
.star-badge.can-prestige { animation: starPulse 2s ease-in-out infinite; }
@keyframes starPulse {
  0%,100% { box-shadow: 0 0 12px rgba(255,213,79,0.4); }
  50% { box-shadow: 0 0 24px rgba(255,213,79,0.8); }
}

/* Notifications */
#notifications {
  position: fixed;
  top: 130px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: 456px;
  z-index: 100;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#notifications > * { pointer-events: auto; }

.artifact-notify {
  --rarity-color: #9e9e9e;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(15, 20, 40, 0.95);
  border: 1.5px solid var(--rarity-color);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5), 0 0 20px color-mix(in srgb, var(--rarity-color) 30%, transparent);
  opacity: 0;
  transform: translateX(-100%) scale(0.9);
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: auto;
  cursor: pointer;
  backdrop-filter: blur(10px);
}
.artifact-notify.visible { opacity: 1; transform: translateX(0) scale(1); }
.artifact-notify.removing { opacity: 0; transform: translateX(100%) scale(0.9); }
.artifact-notify-top { border-width: 2px; animation: notifyPulse 2s ease-in-out infinite; }
@keyframes notifyPulse {
  0%,100% { box-shadow: 0 4px 20px rgba(0,0,0,0.5), 0 0 30px color-mix(in srgb, var(--rarity-color) 40%, transparent); }
  50% { box-shadow: 0 4px 20px rgba(0,0,0,0.5), 0 0 50px color-mix(in srgb, var(--rarity-color) 70%, transparent); }
}
.notify-icon { font-size: 28px; flex-shrink: 0; }
.notify-body { flex: 1; min-width: 0; cursor: pointer; }
.notify-title { font-family: 'Russo One', sans-serif; font-size: 10px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 2px; }
.notify-name { font-family: 'Russo One', sans-serif; font-size: 12px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notify-bonus { font-size: 10px; color: var(--text-dim); }
.notify-close {
  width: 22px; height: 22px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: none;
  color: var(--text);
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.notify-close:hover { background: rgba(255,71,87,0.3); }

/* Main */
#app > main { text-align: center; margin-bottom: 12px; }
#asteroid-wrap {
  position: relative;
  width: 100%;
  height: 300px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
#asteroid-canvas {
  display: block;
  margin: 0 auto;
  cursor: pointer;
  touch-action: manipulation;
}
#click-fx { position: absolute; inset: 0; pointer-events: none; }

.float-text {
  position: fixed;
  font-weight: 800;
  font-family: 'Russo One', sans-serif;
  color: var(--accent);
  font-size: 24px;
  pointer-events: none;
  text-shadow: 0 0 10px rgba(127,255,212,1), 0 0 24px rgba(127,255,212,0.7), 0 2px 6px rgba(0,0,0,0.9);
  animation: floatUp 1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  z-index: 100;
}
@keyframes floatUp {
  0% { transform: translate(-50%, 0) scale(0.3); opacity: 0; }
  15% { transform: translate(-50%, -30px) scale(1.5); opacity: 1; }
  30% { transform: translate(-50%, -45px) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -110px) scale(0.9); opacity: 0; }
}

.particle { position: fixed; border-radius: 50%; pointer-events: none; animation: particleFly 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards; z-index: 99; }
@keyframes particleFly {
  0% { transform: translate(0,0) scale(1); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(0); opacity: 0; }
}
.shard { position: fixed; pointer-events: none; animation: shardFly 1s cubic-bezier(0.22, 1, 0.36, 1) forwards; z-index: 99; }
@keyframes shardFly {
  0% { transform: translate(0,0) rotate(0deg) scale(1); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(0.3); opacity: 0; }
}
.impact-flash { position: fixed; width: 0; height: 0; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,0.95) 0%, rgba(127,255,212,0.7) 25%, rgba(127,255,212,0) 70%); transform: translate(-50%,-50%); pointer-events: none; z-index: 98; animation: impactFlash 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
@keyframes impactFlash {
  0% { width: 0; height: 0; opacity: 1; }
  40% { width: 130px; height: 130px; opacity: 0.9; }
  100% { width: 180px; height: 180px; opacity: 0; }
}
.shockwave { position: fixed; width: 0; height: 0; border-radius: 50%; border: 3px solid rgba(127,255,212,0.95); box-shadow: 0 0 24px rgba(127,255,212,0.7); transform: translate(-50%,-50%); pointer-events: none; z-index: 98; animation: shockwave 0.65s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
@keyframes shockwave {
  0% { width: 0; height: 0; opacity: 1; border-width: 5px; }
  100% { width: 240px; height: 240px; opacity: 0; border-width: 1px; }
}

/* Ad btn */
.ad-btn {
  margin-top: 8px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 700;
  font-family: 'Russo One', sans-serif;
  color: #05060f;
  background: linear-gradient(135deg, #7fffd4, #4fc3f7);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(79,195,247,0.4);
}
.ad-btn:disabled { opacity: 0.5; cursor: not-allowed; background: #555; color: #ccc; box-shadow: none; }

/* ============================================================
   TABS + контент
   ============================================================ */
#app > #daily-btn { margin-bottom: 10px; }
.daily-btn {
  display: block;
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #ff6b9d, #ff4757);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 800;
  font-family: 'Russo One', sans-serif;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(255,71,87,0.4);
  animation: dailyPulse 2s ease-in-out infinite;
}
@keyframes dailyPulse {
  0%,100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

#app > #tabs {
  background: rgba(15, 20, 40, 0.5);
  border: 1px solid rgba(120,150,255,0.12);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 12px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
#tabs > .tab-content { padding: 14px; }
#tabs > .tab-content.hidden { display: none !important; }

.sub {
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
  font-family: 'Russo One', sans-serif;
}

/* ============================================================
   BOTTOM NAV
   ============================================================ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  padding: 6px 6px calc(8px + env(safe-area-inset-bottom, 0));
  background: rgba(10, 14, 30, 0.95);
  border-top: 1px solid rgba(120,150,255,0.2);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 -8px 32px rgba(0,0,0,0.6);
  z-index: 200;
}
.bottom-nav .tab-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 4px;
  background: transparent;
  border: none;
  border-radius: 10px;
  color: #6a75a0;
  font-size: 20px;
  cursor: pointer;
  position: relative;
  transition: color 0.2s, background 0.2s;
  min-height: 52px;
}
.bottom-nav .tab-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 24px;
  height: 3px;
  background: var(--accent);
  border-radius: 0 0 4px 4px;
  box-shadow: 0 0 12px rgba(127,255,212,0.8);
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.bottom-nav .tab-btn.active { color: var(--accent); background: rgba(127,255,212,0.08); }
.bottom-nav .tab-btn.active::before { transform: translateX(-50%) scaleX(1); }

/* ============================================================
   BUILDINGS
   ============================================================ */
.building {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  margin-bottom: 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(120,150,255,0.08);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.building:hover:not(.locked) {
  background: rgba(120,150,255,0.1);
  border-color: rgba(127,255,212,0.4);
  box-shadow: 0 4px 20px rgba(127,255,212,0.15);
}
.building.locked {
  opacity: 0.4;
  cursor: not-allowed !important;
  pointer-events: none !important;
  filter: grayscale(0.4);
}
.building.bought { opacity: 0.7; background: rgba(127,255,212,0.06); cursor: default; }
.building .b-icon { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.building .b-icon svg { width: 40px; height: 40px; }
.building .b-info { flex: 1; text-align: left; min-width: 0; }
.building .b-name { font-weight: 700; font-size: 14px; margin-bottom: 2px; }
.building .b-count { font-size: 12px; color: var(--accent); font-family: 'Russo One', sans-serif; background: rgba(127,255,212,0.12); padding: 1px 8px; border-radius: 6px; margin-left: 4px; }
.building .b-desc { font-size: 12px; color: var(--text-dim); }

.b-price-col { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex-shrink: 0; }
.b-cost { font-size: 13px; font-weight: 800; font-family: 'Russo One', sans-serif; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.b-ore-check { font-size: 10px; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Buy multiplier */
.buy-multiplier-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0 12px;
  border-bottom: 1px solid rgba(120,150,255,0.1);
  margin-bottom: 12px;
}
.buy-label { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; margin-right: 4px; font-family: 'Russo One', sans-serif; }
.buy-mult-btn {
  flex: 1;
  padding: 8px 4px;
  background: rgba(255,255,255,0.04);
  border: 1.5px solid rgba(120,150,255,0.2);
  border-radius: 8px;
  color: var(--text-dim);
  font-family: 'Russo One', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.buy-mult-btn.active { background: rgba(127,255,212,0.15); border-color: var(--accent); color: var(--accent); box-shadow: 0 0 12px rgba(127,255,212,0.3); }

/* ============================================================
   ПОДТАБЫ АРТЕФАКТОВ
   ============================================================ */
.artifact-subtabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 6px;
  background: rgba(0,0,0,0.25);
  border-radius: 12px;
  margin-bottom: 14px;
}
.artifact-subtab {
  padding: 10px 4px;
  background: rgba(255,255,255,0.03);
  border: 1.5px solid transparent;
  border-radius: 9px;
  color: var(--text-dim);
  font-family: 'Russo One', sans-serif;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.15s;
}
.artifact-subtab:hover { color: var(--accent); background: rgba(120,150,255,0.08); }
.artifact-subtab.active {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(127,255,212,0.1);
  text-shadow: 0 0 10px rgba(127,255,212,0.5);
  box-shadow: 0 0 12px rgba(127,255,212,0.2);
}
.artifact-subpanel.hidden { display: none !important; }

/* ============================================================
   КРАФТ
   ============================================================ */
.craft-box { background: rgba(120,150,255,0.05); border: 1px solid rgba(120,150,255,0.2); border-radius: 12px; padding: 12px; margin-bottom: 14px; }
.craft-rarity-tabs { display: flex; gap: 4px; margin-bottom: 12px; overflow-x: auto; padding-bottom: 4px; }
.craft-rarity-btn { flex: 0 0 auto; min-width: 48px; padding: 6px 8px; background: rgba(255,255,255,0.04); border: 1.5px solid transparent; border-radius: 10px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; transition: all 0.15s; }
.craft-rarity-btn.active { background: rgba(120,150,255,0.15); transform: scale(1.05); }
.craft-rarity-btn small { font-size: 10px; color: var(--text-dim); font-weight: 700; }
.craft-actions { display: flex; flex-direction: column; gap: 8px; }
.craft-card { padding: 12px; background: rgba(255,255,255,0.03); border: 1px solid rgba(120,150,255,0.12); border-radius: 10px; }
.craft-title { font-family: 'Russo One', sans-serif; font-size: 12px; color: var(--text); margin-bottom: 6px; }
.craft-desc { font-size: 12px; color: var(--text-dim); margin-bottom: 8px; }
.craft-progress { position: relative; height: 18px; background: rgba(0,0,0,0.4); border-radius: 9px; overflow: hidden; margin-bottom: 8px; }
.craft-progress-bar { height: 100%; border-radius: 9px; transition: width 0.3s; }
.craft-progress-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.8); }
.craft-btn { width: 100%; padding: 10px; background: linear-gradient(135deg, #7fffd4, #4fc3f7); color: #05060f; border: none; border-radius: 10px; font-family: 'Russo One', sans-serif; font-size: 13px; font-weight: 700; cursor: pointer; }
.craft-btn:disabled { opacity: 0.4; cursor: not-allowed; background: #444; color: #999; }
.craft-btn-risky { background: linear-gradient(135deg, #ff6b9d, #ff4757); color: #fff; }
.craft-btn-enhance { background: linear-gradient(135deg, #ffd54f, #ff9800); color: #05060f; }

/* ============================================================
   МАГАЗИН
   ============================================================ */
.artifact-shop-box { background: rgba(255,213,79,0.05); border: 1px solid rgba(255,213,79,0.25); border-radius: 12px; padding: 12px; margin-bottom: 14px; }
.artifact-shop-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.shop-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; background: rgba(255,255,255,0.03); border-radius: 10px; border: 1px solid rgba(120,150,255,0.1); }
.shop-rarity { font-size: 13px; font-weight: 700; font-family: 'Russo One', sans-serif; }
.shop-buy-btn { padding: 6px 12px; background: transparent; border: 1.5px solid rgba(120,150,255,0.3); border-radius: 8px; font-family: 'Russo One', sans-serif; font-size: 12px; font-weight: 700; cursor: pointer; color: var(--text-dim); transition: all 0.2s; }
.shop-buy-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.shop-buy-btn:hover:not(:disabled) { transform: translateY(-1px); }

/* ============================================================
   СЛОТЫ + ИНВЕНТАРЬ
   ============================================================ */
.artifacts-slots { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 12px; }
.artifact-slot { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border: 2px solid rgba(120,150,255,0.2); border-radius: 10px; background: rgba(255,255,255,0.03); font-size: 22px; cursor: pointer; transition: all 0.2s; color: #8a94c8; }
.artifact-slot.empty { color: #4a5570; cursor: default; }
.artifact-slot.locked { color: #4a5570; cursor: not-allowed; background: rgba(0,0,0,0.3); }
.artifact-slot:not(.empty):not(.locked):hover { transform: scale(1.05); }

.artifacts-buy-slot { width: 100%; padding: 10px; background: linear-gradient(135deg, #ffd54f, #ff9800); color: #05060f; border: none; border-radius: 10px; font-weight: 700; font-family: 'Russo One', sans-serif; font-size: 13px; cursor: pointer; margin-bottom: 12px; }
.artifacts-buy-slot:disabled { opacity: 0.4; cursor: not-allowed; background: #444; color: #999; }

.artifacts-summary { padding: 10px; background: rgba(127,255,212,0.05); border: 1px solid rgba(127,255,212,0.2); border-radius: 10px; margin-bottom: 8px; }
.artifact-bonus-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 13px; border-bottom: 1px solid rgba(127,255,212,0.08); }
.artifact-bonus-row:last-child { border-bottom: none; }
.artifact-bonus-row b { color: var(--accent); font-family: 'Russo One', sans-serif; }

.artifacts-filter { display: flex; gap: 4px; margin-bottom: 10px; overflow-x: auto; }
.filter-btn { padding: 6px 10px; border-radius: 8px; background: rgba(255,255,255,0.04); border: 1px solid rgba(120,150,255,0.15); color: var(--text-dim); font-size: 14px; cursor: pointer; white-space: nowrap; }
.filter-btn.active { background: rgba(127,255,212,0.15); border-color: var(--accent); color: var(--accent); }

.artifacts-inventory { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; max-height: 360px; overflow-y: auto; padding: 4px; }
.artifact-inv-item { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border: 2px solid rgba(120,150,255,0.2); border-radius: 10px; background: rgba(255,255,255,0.03); cursor: pointer; position: relative; transition: all 0.15s; }
.artifact-inv-item:hover { transform: scale(1.08); }
.artifact-inv-item:active { transform: scale(0.92); }
.inv-icon { font-size: 22px; }
.inv-count { position: absolute; bottom: 2px; right: 4px; font-size: 10px; font-weight: 800; color: #fff; background: rgba(0,0,0,0.7); padding: 1px 4px; border-radius: 4px; }

.artifact-detail { padding: 10px 0; margin: 10px 0; border-top: 1px solid rgba(120,150,255,0.15); border-bottom: 1px solid rgba(120,150,255,0.15); }
.art-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13px; color: var(--text-dim); }
.art-row b { color: var(--text); }

/* ============================================================
   МОДАЛКИ
   ============================================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(5, 6, 15, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn 0.2s ease;
}
.modal.hidden { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-box {
  background: linear-gradient(180deg, rgba(30, 35, 65, 0.95), rgba(13, 16, 36, 0.95));
  border: 1px solid rgba(120,150,255,0.3);
  border-radius: 18px;
  padding: 22px;
  width: 100%;
  max-width: 380px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8), 0 0 80px rgba(79,195,247,0.15);
  animation: modalIn 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
}
@keyframes modalIn {
  from { transform: scale(0.9) translateY(20px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}
.modal-box h3 { font-size: 18px; color: var(--text); margin-bottom: 14px; text-align: center; font-family: 'Russo One', sans-serif; }
.modal-box input { width: 100%; padding: 12px 14px; background: rgba(255,255,255,0.05); border: 1px solid rgba(120,150,255,0.3); border-radius: 10px; color: var(--text); font-size: 16px; font-family: inherit; outline: none; }
.modal-box input:focus { border-color: var(--accent); box-shadow: 0 0 20px rgba(127,255,212,0.25); }
.modal-actions { margin-top: 16px; display: flex; gap: 8px; }
.modal-actions button { flex: 1; padding: 12px; border: none; border-radius: 10px; font-size: 14px; font-weight: 700; font-family: 'Russo One', sans-serif; cursor: pointer; }
.modal-actions .primary { background: linear-gradient(135deg, #7fffd4, #4fc3f7); color: #05060f; }

.modal-close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: none;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
.modal-close-btn:hover { background: rgba(255,71,87,0.3); transform: rotate(90deg); }

/* Престиж модалка */
.prestige-modal-box { text-align: center; border: 2px solid rgba(255,213,79,0.4); }
.prestige-modal-box h3 { color: #ffd54f; font-size: 22px; }
.prestige-gain-big { font-family: 'Russo One', sans-serif; font-size: 36px; color: var(--accent); text-shadow: 0 0 24px rgba(127,255,212,0.8); margin: 12px 0; }
.prestige-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 14px; color: var(--text-dim); border-bottom: 1px solid rgba(255,213,79,0.1); }
.prestige-row b { color: #ffd54f; font-family: 'Russo One', sans-serif; }
.prestige-warning { font-size: 12px; color: var(--pink); margin-top: 14px; padding: 10px; background: rgba(255,71,87,0.08); border: 1px solid rgba(255,71,87,0.25); border-radius: 10px; }

/* Дроп артефакта */
.artifact-drop {
  --rarity-color: #9e9e9e;
  text-align: center;
  border: 2px solid var(--rarity-color);
  box-shadow: 0 0 40px var(--rarity-color), 0 0 80px color-mix(in srgb, var(--rarity-color) 50%, transparent);
  animation: dropModalIn 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes dropModalIn {
  0% { transform: scale(0.5) rotate(-5deg); opacity: 0; }
  60% { transform: scale(1.05) rotate(1deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
.drop-header { font-family: 'Russo One', sans-serif; font-size: 18px; margin-bottom: 16px; letter-spacing: 1px; animation: headerPulse 1.5s ease-in-out infinite; }
@keyframes headerPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.drop-artifact-wrap { position: relative; width: 140px; height: 140px; margin: 0 auto 16px; display: flex; align-items: center; justify-content: center; }
.drop-aura { position: absolute; inset: -20px; border-radius: 50%; background: radial-gradient(circle, var(--rarity-color) 0%, transparent 60%); opacity: 0.4; animation: auraPulse 2s ease-in-out infinite; }
@keyframes auraPulse { 0%,100% { transform: scale(1); opacity: 0.4; } 50% { transform: scale(1.2); opacity: 0.7; } }
.drop-icon { position: relative; z-index: 2; font-size: 80px; animation: iconDrop 0.8s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes iconDrop { 0% { transform: scale(0) rotate(-360deg); opacity: 0; } 60% { transform: scale(1.3) rotate(20deg); opacity: 1; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
.drop-particles { position: absolute; inset: 0; pointer-events: none; }
.drop-particle { position: absolute; top: 50%; left: 50%; width: 6px; height: 6px; border-radius: 50%; animation: dropParticleFly 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
@keyframes dropParticleFly {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
  40% { transform: translate(calc(-50% + var(--dx) * 0.6), calc(-50% + var(--dy) * 0.6)) scale(1.2); opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0); opacity: 0; }
}
.drop-name { font-family: 'Russo One', sans-serif; font-size: 18px; margin-bottom: 4px; }
.drop-rarity { font-size: 12px; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 14px; }
.drop-bonus { text-align: center; font-size: 15px; color: var(--text-dim); margin-bottom: 20px; }
.drop-bonus b { font-family: 'Russo One', sans-serif; font-size: 17px; }
.drop-actions { display: flex; flex-direction: column; gap: 8px; }
.drop-btn { padding: 12px; border: none; border-radius: 12px; font-family: 'Russo One', sans-serif; font-size: 13px; font-weight: 700; cursor: pointer; }
.drop-btn.equip { background: linear-gradient(135deg, #7fffd4, #4fc3f7); color: #05060f; }
.drop-btn.sell { background: rgba(255,71,87,0.2); color: var(--pink); border: 1px solid rgba(255,107,157,0.4); }
.drop-btn.inv { background: rgba(120,150,255,0.15); color: #a8b8ff; border: 1px solid rgba(120,150,255,0.3); }

/* Офлайн */
.offline-box { text-align: center; border: 2px solid rgba(127,255,212,0.4); }
.offline-header { font-family: 'Russo One', sans-serif; font-size: 17px; color: var(--accent); margin-bottom: 18px; letter-spacing: 1px; }
.offline-time-row { font-size: 14px; color: var(--text-dim); margin-bottom: 14px; }
.offline-time-row b { color: var(--text); font-family: 'Russo One', sans-serif; }
.offline-ore-card { padding: 16px; background: rgba(127,255,212,0.08); border: 1px solid rgba(127,255,212,0.25); border-radius: 12px; margin-bottom: 8px; }
.offline-label { font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.offline-ore-value { font-family: 'Russo One', sans-serif; font-size: 32px; color: var(--accent); text-shadow: 0 0 20px rgba(127,255,212,0.8); }
.offline-artifacts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 10px; }
.offline-artifact { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border: 2px solid rgba(120,150,255,0.3); border-radius: 10px; background: rgba(255,255,255,0.05); font-size: 22px; cursor: pointer; }
.offline-artifact:hover { transform: scale(1.15); }

/* Ежедневки */
.daily-rewards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 16px; }
.daily-cell { padding: 10px 4px; border-radius: 10px; text-align: center; background: rgba(255,255,255,0.04); border: 1px solid rgba(120,150,255,0.12); font-size: 11px; color: var(--text-dim); }
.daily-cell.claimed { background: rgba(127,255,212,0.12); border-color: rgba(127,255,212,0.4); color: var(--accent); }
.daily-cell.today { background: rgba(255,71,87,0.18); border-color: var(--red); color: #fff; animation: dailyPulse 1.5s ease-in-out infinite; }
.daily-cell .d-day { font-weight: 700; font-size: 12px; margin-bottom: 3px; }
.daily-cell .d-val { font-weight: 800; font-family: 'Russo One', sans-serif; }

/* Лидерборд */
#leaderboard { background: rgba(15, 20, 40, 0.5); border: 1px solid rgba(120,150,255,0.12); border-radius: 16px; padding: 14px; backdrop-filter: blur(10px); }
#leaderboard h2 { font-size: 14px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 10px; font-family: 'Russo One', sans-serif; }
#top-list { list-style: none; padding: 0; }
#top-list li { display: flex; justify-content: space-between; align-items: center; padding: 8px 6px; font-size: 14px; border-bottom: 1px solid rgba(120,150,255,0.06); }
#top-list li:last-child { border-bottom: none; }
#top-list .rank { color: var(--accent); font-weight: 800; font-family: 'Russo One', sans-serif; width: 28px; }
#top-list li:nth-child(1) .rank { color: var(--gold); }
#top-list li:nth-child(2) .rank { color: #c0c0c0; }
#top-list li:nth-child(3) .rank { color: #cd7f32; }
#top-list .name { flex: 1; margin-left: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#top-list .score { color: var(--accent-2); font-weight: 700; font-family: 'Russo One', sans-serif; }

/* ============================================================
   АДАПТАЦИЯ
   ============================================================ */
@media (max-width: 400px) {
  #asteroid-wrap { height: 250px; }
  .bottom-nav .tab-btn { font-size: 18px; min-height: 44px; }
  .stat { font-size: 16px; }
  #notifications { top: 110px; }
}

@media (max-height: 700px) {
  #asteroid-wrap { height: 220px; }
  #notifications { top: 100px; }
}

body.screen-shake { animation: screenShake 0.6s ease-in-out; }
@keyframes screenShake {
  0%,100% { transform: translate(0,0); }
  20% { transform: translate(6px, -3px); }
  40% { transform: translate(5px, 4px); }
  60% { transform: translate(4px, -2px); }
  80% { transform: translate(3px, -3px); }
}

/* ============================================================
   ДОСТИЖЕНИЯ
   ============================================================ */
.achievements-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: rgba(255,213,79,0.06);
  border: 1px solid rgba(255,213,79,0.25);
  border-radius: 14px;
  margin-bottom: 14px;
}
.ach-progress-ring {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: conic-gradient(#ffd54f var(--progress, 0%), rgba(255,213,79,0.15) 0%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}
.ach-progress-ring::before {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: #0a0e1f;
}
.ach-progress-ring span {
  position: relative;
  font-family: 'Russo One', sans-serif;
  font-size: 18px;
  color: #ffd54f;
  font-weight: 800;
}
.ach-progress-ring small {
  position: relative;
  font-size: 9px;
  color: var(--text-dim);
}
.ach-bonus-info {
  flex: 1;
  font-size: 13px;
  color: var(--text);
}
.ach-bonus-info b { font-family: 'Russo One', sans-serif; }

.achievement-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  margin-bottom: 6px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(120,150,255,0.08);
  transition: all 0.2s;
}
.achievement-card.done {
  background: rgba(127,255,212,0.06);
  border-color: rgba(127,255,212,0.3);
  box-shadow: 0 0 12px rgba(127,255,212,0.1);
}
.ach-icon {
  font-size: 26px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.achievement-card:not(.done) .ach-icon {
  opacity: 0.4;
  filter: grayscale(1);
}
.ach-info { flex: 1; min-width: 0; }
.ach-name {
  font-family: 'Russo One', sans-serif;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 2px;
}
.achievement-card.done .ach-name { color: var(--accent); }
.ach-desc {
  font-size: 11px;
  color: var(--text-dim);
}
.ach-check {
  color: var(--accent);
  font-size: 20px;
  font-weight: 800;
  flex-shrink: 0;
}

/* Уведомление */
.achievement-notify {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(255,213,79,0.15), rgba(255,152,0,0.1));
  border: 1.5px solid #ffd54f;
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5), 0 0 30px rgba(255,213,79,0.5);
  opacity: 0;
  transform: translateX(-100%) scale(0.9);
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  backdrop-filter: blur(10px);
}
.achievement-notify.visible { opacity: 1; transform: translateX(0) scale(1); }
.achievement-notify.removing { opacity: 0; transform: translateX(100%) scale(0.9); }
.ach-notify-icon { font-size: 32px; flex-shrink: 0; animation: trophyBounce 1s ease infinite; }
@keyframes trophyBounce {
  0%,100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-4px) rotate(-5deg); }
}
.ach-notify-body { flex: 1; min-width: 0; }
.ach-notify-title {
  font-family: 'Russo One', sans-serif;
  font-size: 10px;
  color: #ffd54f;
  letter-spacing: 1px;
  margin-bottom: 2px;
  text-shadow: 0 0 10px rgba(255,213,79,0.6);
}
.ach-notify-name {
  font-family: 'Russo One', sans-serif;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 2px;
}
.ach-notify-desc { font-size: 11px; color: var(--text-dim); }

/* ============================================================
   СКИНЫ АСТЕРОИДА
   ============================================================ */
.skins-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: rgba(127,255,212,0.06);
  border: 1px solid rgba(127,255,212,0.25);
  border-radius: 12px;
  margin-bottom: 14px;
  font-family: 'Russo One', sans-serif;
  font-size: 13px;
  color: var(--text);
}
.skins-stars {
  color: var(--gold);
  font-size: 15px;
  text-shadow: 0 0 12px rgba(255,213,79,0.5);
}

.skins-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (min-width: 400px) {
  .skins-grid { grid-template-columns: repeat(3, 1fr); }
}

.skin-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 8px;
  background: rgba(255,255,255,0.03);
  border: 1.5px solid rgba(120,150,255,0.12);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}
.skin-card:hover {
  border-color: rgba(120,150,255,0.4);
  background: rgba(120,150,255,0.06);
  transform: translateY(-2px);
}
.skin-card.owned {
  border-color: rgba(127,255,212,0.35);
  background: rgba(127,255,212,0.05);
}
.skin-card.active {
  border-color: var(--accent);
  background: rgba(127,255,212,0.12);
  box-shadow: 0 0 20px rgba(127,255,212,0.35);
}
.skin-card.active::after {
  content: '✓';
  position: absolute;
  top: 6px;
  right: 8px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #05060f;
  border-radius: 50%;
  font-weight: 800;
  font-size: 12px;
}

.skin-preview {
  width: 80px;
  height: 80px;
  display: block;
}

.skin-info {
  text-align: center;
  width: 100%;
}
.skin-name {
  font-family: 'Russo One', sans-serif;
  font-size: 12px;
  color: var(--text);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.skin-desc {
  font-size: 10px;
  color: var(--text-dim);
  margin-bottom: 6px;
  min-height: 24px;
  line-height: 1.2;
}
.skin-price {
  font-family: 'Russo One', sans-serif;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-block;
}
.skin-price.owned-price { color: var(--accent); background: rgba(127,255,212,0.15); }
.skin-price.can-buy { color: var(--gold); background: rgba(255,213,79,0.15); }
.skin-price.cant-buy { color: var(--red); background: rgba(255,71,87,0.12); }

/* ============================================================
   ЛОТЕРЕЯ
   ============================================================ */
.artifact-subtabs {
  grid-template-columns: repeat(5, 1fr) !important;
}

.lottery-tickets {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lottery-ticket {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: rgba(255,255,255,0.03);
  border: 2px solid;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s;
}
.lottery-ticket:hover:not(.locked) {
  transform: translateX(4px);
  box-shadow: 0 4px 20px rgba(127,255,212,0.15);
}
.lottery-ticket.locked {
  opacity: 0.4;
  cursor: not-allowed;
}
.lt-icon {
  font-size: 32px;
  flex-shrink: 0;
}
.lt-info {
  flex: 1;
}
.lt-name {
  font-family: 'Russo One', sans-serif;
  font-size: 14px;
  margin-bottom: 4px;
}
.lt-price {
  font-size: 12px;
  color: var(--accent);
  font-family: 'Russo One', sans-serif;
}
.lt-spin {
  padding: 8px 14px;
  background: rgba(127,255,212,0.12);
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: var(--accent);
  font-family: 'Russo One', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.lottery-win {
  margin-top: 14px;
  padding: 20px;
  background: linear-gradient(135deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  border: 2px solid;
  border-radius: 14px;
  text-align: center;
  opacity: 0;
  transform: scale(0.9);
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.lottery-win.visible {
  opacity: 1;
  transform: scale(1);
}
.lw-icon {
  font-size: 48px;
  margin-bottom: 8px;
  animation: lwBounce 0.6s ease;
}
@keyframes lwBounce {
  0% { transform: scale(0) rotate(-180deg); }
  60% { transform: scale(1.2) rotate(20deg); }
  100% { transform: scale(1) rotate(0); }
}
.lw-label {
  font-family: 'Russo One', sans-serif;
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.lw-detail {
  font-family: 'Russo One', sans-serif;
  font-size: 18px;
  font-weight: 800;
}

/* ============================================================
   ИССЛЕДОВАНИЯ
   ============================================================ */
#tab-research { padding: 14px; }

.lab-build-box {
  text-align: center;
  padding: 30px 20px;
  background: rgba(179,136,255,0.05);
  border: 1px solid rgba(179,136,255,0.25);
  border-radius: 16px;
}
.lab-icon {
  font-size: 60px;
  margin-bottom: 12px;
}
.lab-build-box h3 {
  font-family: 'Russo One', sans-serif;
  font-size: 20px;
  color: #b388ff;
  margin-bottom: 10px;
}
.lab-build-box p {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 8px;
  line-height: 1.4;
}
.lab-build-btn {
  margin-top: 16px;
  padding: 14px 24px;
  background: linear-gradient(135deg, #b388ff, #7c4dff);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-family: 'Russo One', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(124,77,255,0.4);
}
.lab-build-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #444;
  color: #999;
  box-shadow: none;
}

.research-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: rgba(179,136,255,0.08);
  border: 1px solid rgba(179,136,255,0.25);
  border-radius: 12px;
  margin-bottom: 14px;
  font-family: 'Russo One', sans-serif;
  font-size: 13px;
}
.research-points {
  color: #b388ff;
  font-size: 15px;
  text-shadow: 0 0 12px rgba(179,136,255,0.6);
}

.research-tree {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.research-branch {
  background: rgba(255,255,255,0.03);
  border-radius: 12px;
  overflow: hidden;
}

.rb-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-left: 3px solid;
  background: rgba(255,255,255,0.02);
}
.rb-icon { font-size: 22px; flex-shrink: 0; }
.rb-info { flex: 1; min-width: 0; }
.rb-name { font-family: 'Russo One', sans-serif; font-size: 13px; margin-bottom: 2px; }
.rb-desc { font-size: 11px; color: var(--text-dim); }
.rb-level {
  font-family: 'Russo One', sans-serif;
  font-size: 12px;
  color: var(--text-dim);
  background: rgba(0,0,0,0.3);
  padding: 3px 8px;
  border-radius: 6px;
}

.rb-levels {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 8px;
}
.rb-level-card {
  padding: 8px 4px;
  border-radius: 8px;
  text-align: center;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(120,150,255,0.1);
  font-size: 10px;
  cursor: pointer;
  transition: all 0.15s;
}
.rb-level-card.bought {
  background: rgba(127,255,212,0.12);
  border-color: rgba(127,255,212,0.4);
  color: var(--accent);
}
.rb-level-card.can-buy {
  background: rgba(179,136,255,0.15);
  border-color: #b388ff;
  color: #fff;
  box-shadow: 0 0 12px rgba(179,136,255,0.3);
}
.rb-level-card.can-buy:hover {
  transform: scale(1.05);
}
.rb-level-card.locked, .rb-level-card.future {
  opacity: 0.4;
  cursor: not-allowed;
}
.rbl-num {
  font-family: 'Russo One', sans-serif;
  font-weight: 700;
  margin-bottom: 2px;
}
.rbl-desc {
  font-size: 9px;
  line-height: 1.1;
  margin-bottom: 4px;
  min-height: 22px;
}
.rbl-cost {
  font-size: 10px;
  font-weight: 700;
  font-family: 'Russo One', sans-serif;
}

/* Bottom-nav теперь 6 иконок */
.bottom-nav {
  grid-template-columns: repeat(6, 1fr) !important;
}
.bottom-nav .tab-btn {
  font-size: 18px !important;
  min-height: 46px !important;
  padding: 8px 2px !important;
}

/* ============================================================
   УРОВНИ И ОПЫТ
   ============================================================ */
.level-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(15, 20, 40, 0.7);
  border: 1px solid rgba(120,150,255,0.12);
  border-radius: 12px;
  margin-bottom: 10px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.level-badge {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7fffd4, #4fc3f7);
  color: #05060f;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Russo One', sans-serif;
  font-size: 16px;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 0 16px rgba(127,255,212,0.5);
  text-shadow: 0 1px 0 rgba(255,255,255,0.3);
}

.level-info {
  flex: 1;
  min-width: 0;
}

.level-progress {
  height: 8px;
  background: rgba(0,0,0,0.4);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 3px;
  position: relative;
}

.level-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #7fffd4, #4fc3f7);
  border-radius: 4px;
  transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 0 8px rgba(127,255,212,0.7);
  position: relative;
}

.level-progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: levelShine 2s ease-in-out infinite;
}

@keyframes levelShine {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.level-text {
  font-size: 11px;
  color: var(--text-dim);
  font-family: 'Russo One', sans-serif;
  font-variant-numeric: tabular-nums;
}

/* Уведомление о новом уровне */
.level-up-notify {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(127,255,212,0.15), rgba(79,195,247,0.1));
  border: 1.5px solid #7fffd4;
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5), 0 0 30px rgba(127,255,212,0.5);
  opacity: 0;
  transform: translateX(-100%) scale(0.9);
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  backdrop-filter: blur(10px);
}
.level-up-notify.visible {
  opacity: 1;
  transform: translateX(0) scale(1);
}
.level-up-notify.removing {
  opacity: 0;
  transform: translateX(100%) scale(0.9);
}

.lvl-notify-icon {
  font-size: 32px;
  flex-shrink: 0;
  animation: lvlBounce 1s ease infinite;
}
@keyframes lvlBounce {
  0%,100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-4px) scale(1.1); }
}

.lvl-notify-body {
  flex: 1;
  min-width: 0;
}
.lvl-notify-title {
  font-family: 'Russo One', sans-serif;
  font-size: 10px;
  color: #7fffd4;
  letter-spacing: 1px;
  margin-bottom: 2px;
}
.lvl-notify-level {
  font-family: 'Russo One', sans-serif;
  font-size: 16px;
  color: var(--text);
  margin-bottom: 4px;
}
.lvl-notify-reward {
  font-size: 12px;
  color: #ffd54f;
  font-family: 'Russo One', sans-serif;
}

/* ============================================================
   TOP HUD — объединённая шапка
   ============================================================ */




/* Ряд 1 — ресурсы */






/* Ряд 2 — игрок */





/* Ряд 3 — уровень */





@keyframes levelShine {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}


/* Star badge — компактный */


/* Убираем старые стили header и player-row чтобы не конфликтовали */
#app > header { display: none !important; }
#app > .player-row { display: none !important; }
#app > .level-bar { display: none !important; }

/* ============================================================
   TOP HUD — тонкая версия (2 ряда)
   ============================================================ */
.top-hud {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 12px;
  background: rgba(15, 20, 40, 0.85);
  border: 1px solid rgba(120,150,255,0.18);
  border-radius: 14px;
  margin-bottom: 8px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.hud-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 20px;
}

/* Верхний ряд: ресурсы + звёзды */
.hud-top {
  justify-content: space-between;
}
.hud-top .stat {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 15px;
  font-weight: 700;
  font-family: 'Russo One', sans-serif;
  letter-spacing: 0.3px;
}
.hud-top .stat .icon { font-size: 14px; }
.hud-top #ore { color: var(--accent); text-shadow: 0 0 10px rgba(127,255,212,0.4); }
.hud-top #perSec { color: var(--accent-2); text-shadow: 0 0 10px rgba(79,195,247,0.3); }

.hud-top .star-badge {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  background: rgba(255,213,79,0.1);
  border: 1px solid rgba(255,213,79,0.35);
  border-radius: 8px;
  cursor: pointer;
  font-family: 'Russo One', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: #ffd54f;
  transition: all 0.15s;
}
.hud-top .star-badge:hover {
  background: rgba(255,213,79,0.2);
  border-color: #ffd54f;
  box-shadow: 0 0 10px rgba(255,213,79,0.5);
}
.hud-top .star-badge.can-prestige {
  animation: starPulse 2s ease-in-out infinite;
}

/* Нижний ряд: имя + уровень + XP */
.hud-bottom {
  gap: 6px;
  padding-top: 2px;
}
.hud-bottom #player-name {
  font-family: 'Russo One', sans-serif;
  font-weight: 700;
  font-size: 12px;
  color: var(--accent);
  flex-shrink: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hud-bottom #edit-name-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  padding: 0 2px;
  cursor: pointer;
  font-size: 10px;
  opacity: 0.7;
  transition: opacity 0.15s;
}
.hud-bottom #edit-name-btn:hover { opacity: 1; }

.hud-bottom .level-badge {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7fffd4, #4fc3f7);
  color: #05060f;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Russo One', sans-serif;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 0 8px rgba(127,255,212,0.4);
}

.hud-bottom .level-progress {
  flex: 1;
  height: 6px;
  background: rgba(0,0,0,0.4);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
  min-width: 40px;
}
.hud-bottom .level-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #7fffd4, #4fc3f7);
  border-radius: 3px;
  transition: width 0.3s ease;
  box-shadow: 0 0 6px rgba(127,255,212,0.6);
}

.hud-bottom .level-text {
  font-size: 9px;
  color: var(--text-dim);
  font-family: 'Russo One', sans-serif;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Скрываем старые */
#app > header,
#app > .player-row,
#app > .level-bar {
  display: none !important;
}

@media (max-width: 400px) {
  .top-hud { padding: 6px 10px; }
  .hud-top .stat { font-size: 13px; }
  .hud-top .stat .icon { font-size: 12px; }
  .hud-top .star-badge { font-size: 10px; padding: 2px 6px; }
  .hud-bottom #player-name { font-size: 11px; }
  .hud-bottom .level-badge { width: 20px; height: 20px; font-size: 10px; }
  .hud-bottom .level-text { font-size: 8px; }
}

/* ============================================================
   ЭТАП 1 — Кнопки в шапке, настройки, история
   ============================================================ */

/* Кнопки-иконки в шапке */
.hud-icon-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(120,150,255,0.2);
  border-radius: 8px;
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  position: relative;
  transition: all 0.15s;
  flex-shrink: 0;
}
.hud-icon-btn:hover {
  background: rgba(120,150,255,0.15);
  border-color: var(--accent);
}

.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  background: #ff4757;
  color: #fff;
  border-radius: 8px;
  font-size: 9px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: 0 0 8px rgba(255,71,87,0.8);
  animation: notifPulse 1.5s ease-in-out infinite;
}
@keyframes notifPulse {
  0%,100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* ---------- МОДАЛКА НАСТРОЕК ---------- */
.settings-box {
  max-width: 400px;
}
.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(120,150,255,0.1);
}
.settings-label {
  font-size: 13px;
  color: var(--text);
  font-family: 'Russo One', sans-serif;
}
.settings-toggle {
  padding: 6px 14px;
  background: rgba(127,255,212,0.15);
  border: 1.5px solid var(--accent);
  color: var(--accent);
  border-radius: 8px;
  font-family: 'Russo One', sans-serif;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  min-width: 80px;
}
.settings-toggle:hover {
  background: rgba(127,255,212,0.25);
}

.settings-slider {
  flex: 1;
  max-width: 150px;
  accent-color: var(--accent);
}

.settings-section-title {
  font-family: 'Russo One', sans-serif;
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 16px 0 8px;
}

.settings-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.settings-btn {
  flex: 1;
  padding: 10px;
  background: rgba(255,255,255,0.05);
  border: 1.5px solid rgba(120,150,255,0.25);
  border-radius: 10px;
  color: var(--text);
  font-family: 'Russo One', sans-serif;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.settings-btn:hover {
  background: rgba(120,150,255,0.15);
  border-color: var(--accent);
}
.settings-btn.danger {
  color: #ff6b9d;
  border-color: rgba(255,107,157,0.4);
  background: rgba(255,71,87,0.08);
}
.settings-btn.danger:hover {
  background: rgba(255,71,87,0.2);
  border-color: #ff4757;
}

.settings-info {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(120,150,255,0.1);
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
}
.settings-info .mono {
  font-family: monospace;
  font-size: 10px;
  color: var(--accent);
  word-break: break-all;
}

/* ---------- МОДАЛКА ИСТОРИИ ---------- */
.history-box {
  max-width: 420px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}
.history-list {
  flex: 1;
  overflow-y: auto;
  max-height: 60vh;
  margin: 0 -8px;
  padding: 0 8px;
}
.history-item {
  display: grid;
  grid-template-columns: 44px 28px 1fr;
  gap: 8px;
  padding: 8px 4px;
  font-size: 12px;
  align-items: center;
  border-bottom: 1px solid rgba(120,150,255,0.06);
}
.history-item:last-child { border-bottom: none; }
.history-time {
  color: var(--text-dim);
  font-family: monospace;
  font-size: 10px;
}
.history-icon {
  font-size: 16px;
  text-align: center;
}
.history-text {
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Настройки — на узких экранах */
@media (max-width: 400px) {
  .settings-label { font-size: 12px; }
  .settings-toggle { font-size: 11px; padding: 5px 10px; min-width: 65px; }
  .hud-icon-btn { font-size: 16px; padding: 4px; }
}

/* ============================================================
   МОБИЛЬНЫЕ ФИКСЫ — кнопки кликаются с первого тапа
   ============================================================ */

/* Все кнопки — быстрый отклик на touch */
button,
.tab-btn,
.tab-content button,
.hud-icon-btn,
.star-badge,
.building,
.artifact-slot,
.artifact-inv-item,
.artifact-subtab,
.filter-btn,
.shop-buy-btn,
.craft-btn,
.buy-mult-btn,
.drop-btn,
.daily-btn,
.prestige-btn,
.ad-btn,
.settings-btn,
.settings-toggle {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

/* Убираем :hover на мобилках — чтобы не залипал */
@media (hover: none) {
  button:hover,
  .tab-btn:hover,
  .hud-icon-btn:hover,
  .star-badge:hover,
  .building:hover:not(.locked),
  .artifact-slot:not(.empty):not(.locked):hover,
  .artifact-inv-item:hover,
  .artifact-subtab:hover,
  .filter-btn:hover {
    background: inherit;
    transform: none;
    box-shadow: none;
    border-color: inherit;
  }
}

/* Увеличиваем минимальный размер кликабельных элементов */
.hud-icon-btn {
  min-width: 40px;
  min-height: 40px;
  padding: 8px 10px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px !important;
}

/* Звёзды — тоже увеличиваем */
.star-badge {
  min-height: 36px;
}

/* Отключаем hover у модалок на мобилках */
@media (hover: none) {
  .modal-close-btn:hover {
    transform: none;
    background: rgba(255,255,255,0.08);
  }
}

/* На мобильных — чуть больше отступы для кнопок */
@media (max-width: 500px) {
  .hud-icon-btn {
    min-width: 42px;
    min-height: 42px;
    padding: 10px !important;
  }
}

/* ============================================================
   ФИНАЛЬНЫЕ СТИЛИ КНОПОК — ЗОНА ТАПА = ВИЗУАЛ
   ============================================================ */

.hud-icon-btn {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  min-height: 38px !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 18px !important;
  line-height: 1 !important;
  box-sizing: border-box !important;
  transform: none !important;
  transition: background 0.15s, border-color 0.15s !important;
}
.hud-icon-btn:hover {
  transform: none !important;
}

.star-badge {
  padding: 6px 12px !important;
  height: 36px !important;
  min-height: 36px !important;
  max-height: 36px !important;
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  box-sizing: border-box !important;
  transform: none !important;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s !important;
}
.star-badge:hover,
.star-badge:active {
  transform: none !important;
}

.bottom-nav .tab-btn {
  padding: 0 !important;
  height: 48px !important;
  min-height: 48px !important;
  max-height: 48px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 20px !important;
  line-height: 1 !important;
  box-sizing: border-box !important;
  transform: none !important;
  transition: color 0.15s, background 0.15s !important;
}
.bottom-nav .tab-btn:hover,
.bottom-nav .tab-btn:active {
  transform: none !important;
}

/* На мобильных — компактнее, но тоже квадратные */
@media (max-width: 500px) {
  .hud-icon-btn {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    font-size: 16px !important;
  }
  .star-badge {
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    font-size: 11px !important;
    padding: 4px 10px !important;
  }
  .bottom-nav .tab-btn {
    height: 44px !important;
    min-height: 44px !important;
    font-size: 18px !important;
  }
}

/* Убираем любые псевдо-элементы, сдвигающие зону тапа */
.hud-icon-btn::before,
.hud-icon-btn::after,
.star-badge::before,
.star-badge::after,
.bottom-nav .tab-btn::after {
  display: none !important;
}

/* Полоска активной вкладки — оставляем, но она не мешает тапу */
.bottom-nav .tab-btn::before {
  pointer-events: none !important;
}

/* Критично: гарантируем что между кнопками нет невидимых пробелов */
.hud-top {
  gap: 6px !important;
}

/* ============================================================
   АВАРИЙНЫЙ ФИКС — кнопки максимально простые
   ============================================================ */

.hud-icon-btn {
  all: unset !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 40px !important;
  height: 40px !important;
  background: rgba(255,255,255,0.1) !important;
  border: 1px solid rgba(120,150,255,0.3) !important;
  border-radius: 8px !important;
  color: #e8ecff !important;
  font-size: 20px !important;
  cursor: pointer !important;
  -webkit-tap-highlight-color: rgba(127,255,212,0.3) !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  touch-action: manipulation !important;
}

.hud-icon-btn:active {
  background: rgba(127,255,212,0.3) !important;
  transform: scale(0.95) !important;
}

.star-badge {
  all: unset !important;
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  padding: 8px 12px !important;
  background: rgba(255,213,79,0.15) !important;
  border: 1.5px solid rgba(255,213,79,0.4) !important;
  border-radius: 10px !important;
  color: #ffd54f !important;
  font-family: 'Russo One', sans-serif !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  -webkit-tap-highlight-color: rgba(255,213,79,0.3) !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  touch-action: manipulation !important;
}

.star-badge:active {
  background: rgba(255,213,79,0.3) !important;
  transform: scale(0.97) !important;
}

/* ============================================================
   ЕЖЕДНЕВНЫЕ ЗАДАНИЯ
   ============================================================ */
#tab-quests { padding: 14px; }

.quests-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: rgba(255,213,79,0.06);
  border: 1px solid rgba(255,213,79,0.25);
  border-radius: 12px;
  margin-bottom: 14px;
}
.quests-title {
  font-family: 'Russo One', sans-serif;
  font-size: 14px;
  color: #ffd54f;
}
.quests-date {
  font-size: 11px;
  color: var(--text-dim);
  font-family: monospace;
}

.quest-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(255,255,255,0.03);
  border: 1.5px solid rgba(120,150,255,0.12);
  border-radius: 12px;
  margin-bottom: 8px;
  transition: all 0.2s;
}
.quest-card.ready {
  border-color: rgba(255,213,79,0.5);
  background: rgba(255,213,79,0.06);
  animation: questReadyPulse 2s ease-in-out infinite;
}
@keyframes questReadyPulse {
  0%,100% { box-shadow: 0 0 12px rgba(255,213,79,0.2); }
  50% { box-shadow: 0 0 24px rgba(255,213,79,0.5); }
}
.quest-card.claimed {
  opacity: 0.6;
  border-color: rgba(127,255,212,0.4);
  background: rgba(127,255,212,0.06);
}

.quest-icon {
  font-size: 28px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.quest-name {
  font-family: 'Russo One', sans-serif;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 2px;
}
.quest-desc {
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.quest-progress {
  position: relative;
  height: 16px;
  background: rgba(0,0,0,0.35);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 6px;
}
.quest-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #7fffd4, #4fc3f7);
  border-radius: 8px;
  transition: width 0.4s;
  box-shadow: 0 0 8px rgba(127,255,212,0.5);
}
.quest-card.ready .quest-progress-bar {
  background: linear-gradient(90deg, #ffd54f, #ff9800);
  box-shadow: 0 0 12px rgba(255,213,79,0.7);
}
.quest-progress-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
  font-family: 'Russo One', sans-serif;
}
.quest-reward {
  font-size: 11px;
  color: var(--text-dim);
  font-family: 'Russo One', sans-serif;
}

.quest-claim-btn {
  padding: 8px 14px;
  background: linear-gradient(135deg, #ffd54f, #ff9800);
  color: #05060f;
  border: none;
  border-radius: 10px;
  font-family: 'Russo One', sans-serif;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(255,213,79,0.4);
  transition: all 0.15s;
}
.quest-claim-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255,213,79,0.6);
}
.quest-check {
  color: var(--accent);
  font-size: 24px;
  font-weight: 800;
  flex-shrink: 0;
}

/* Bottom-nav теперь 7 иконок */
.bottom-nav {
  grid-template-columns: repeat(7, 1fr) !important;
}
.bottom-nav .tab-btn {
  font-size: 16px !important;
  min-height: 46px !important;
  padding: 4px !important;
}
@media (max-width: 500px) {
  .bottom-nav .tab-btn {
    font-size: 15px !important;
    min-height: 42px !important;
  }
}

/* ============================================================
   БАННЕР СОБЫТИЯ
   ============================================================ */
.event-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  margin-bottom: 8px;
  border: 1.5px solid;
  backdrop-filter: blur(10px);
  animation: eventPulse 2s ease-in-out infinite;
  position: relative;
  z-index: 5;
}
.event-banner.hidden { display: none; }

.event-banner.event-meteor {
  background: linear-gradient(135deg, rgba(255,87,34,0.25), rgba(255,152,0,0.15));
  border-color: #ff5722;
  box-shadow: 0 0 24px rgba(255,87,34,0.5);
}
.event-banner.event-storm {
  background: linear-gradient(135deg, rgba(179,136,255,0.3), rgba(124,77,255,0.2));
  border-color: #b388ff;
  box-shadow: 0 0 30px rgba(179,136,255,0.6);
}
.event-banner.event-gift {
  background: linear-gradient(135deg, rgba(255,213,79,0.25), rgba(255,152,0,0.15));
  border-color: #ffd54f;
  box-shadow: 0 0 24px rgba(255,213,79,0.5);
}

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

.event-icon {
  font-size: 28px;
  animation: eventIconBounce 1.5s ease-in-out infinite;
}
@keyframes eventIconBounce {
  0%,100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-3px) rotate(5deg); }
}

.event-info { flex: 1; min-width: 0; }
.event-name {
  font-family: 'Russo One', sans-serif;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 2px;
}
.event-timer {
  font-family: 'Russo One', sans-serif;
  font-size: 11px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.event-mult {
  font-family: 'Russo One', sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: #ffd54f;
  text-shadow: 0 0 16px rgba(255,213,79,0.8);
  animation: multGlow 1s ease-in-out infinite;
}
@keyframes multGlow {
  0%,100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.event-banner.event-meteor .event-mult {
  color: #ffb74d;
  text-shadow: 0 0 20px rgba(255,87,34,0.9);
}
.event-banner.event-storm .event-mult {
  color: #e1bee7;
  text-shadow: 0 0 24px rgba(179,136,255,1);
}

/* Canvas событий — поверх фона, под UI */
#events-canvas {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

/* Во время шторма — лёгкая тряска фона */
body.event-storm-active #bg-canvas {
  animation: stormShake 0.15s infinite;
}
@keyframes stormShake {
  0%,100% { transform: translate(0,0); }
  25% { transform: translate(-1px, 1px); }
  50% { transform: translate(1px, -1px); }
  75% { transform: translate(1px, 1px); }
}

/* ============================================================
   МОДАЛКА ПОДАРКА ДНЯ
   ============================================================ */
.gift-modal-box {
  text-align: center;
  padding: 30px 24px;
  background: linear-gradient(180deg, rgba(30, 35, 65, 0.98), rgba(13, 16, 36, 0.98));
  border: 2px solid #ffd54f;
  box-shadow:
    0 0 60px rgba(255,213,79,0.6),
    0 0 120px rgba(255,152,0,0.4),
    inset 0 0 40px rgba(255,213,79,0.15);
  animation: giftModalIn 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  overflow: hidden;
}
@keyframes giftModalIn {
  0% { transform: scale(0.5) rotate(-5deg); opacity: 0; }
  60% { transform: scale(1.05) rotate(2deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

.gift-stars {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 20px;
  animation: starsFloat 2s ease-in-out infinite;
  opacity: 0.7;
}
@keyframes starsFloat {
  0%,100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-6px); }
}

.gift-icon {
  font-size: 100px;
  margin: 10px 0 16px;
  animation: giftBounce 1.5s ease-in-out infinite;
  filter: drop-shadow(0 0 30px rgba(255,213,79,0.9));
}
@keyframes giftBounce {
  0%,100% { transform: scale(1) rotate(-3deg); }
  50% { transform: scale(1.1) rotate(3deg); }
}

.gift-title {
  font-family: 'Russo One', sans-serif;
  font-size: 26px;
  color: #ffd54f;
  letter-spacing: 2px;
  margin-bottom: 8px;
  text-shadow: 0 0 20px rgba(255,213,79,0.9);
  animation: giftTitlePulse 1.5s ease-in-out infinite;
}
@keyframes giftTitlePulse {
  0%,100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.gift-desc {
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 20px;
}

.gift-reward {
  font-family: 'Russo One', sans-serif;
  font-size: 36px;
  color: #7fffd4;
  text-shadow: 0 0 24px rgba(127,255,212,0.9), 0 0 48px rgba(127,255,212,0.5);
  margin-bottom: 4px;
  animation: rewardGlow 2s ease-in-out infinite;
}
@keyframes rewardGlow {
  0%,100% { filter: brightness(1); }
  50% { filter: brightness(1.3); }
}

.gift-duration {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 24px;
}

.gift-claim-btn {
  width: 100%;
  padding: 18px;
  background: linear-gradient(135deg, #ffd54f, #ff9800);
  color: #05060f;
  border: none;
  border-radius: 14px;
  font-family: 'Russo One', sans-serif;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow:
    0 8px 30px rgba(255,152,0,0.6),
    inset 0 1px 0 rgba(255,255,255,0.4);
  transition: all 0.2s;
  animation: claimBtnPulse 1.5s ease-in-out infinite;
}
@keyframes claimBtnPulse {
  0%,100% { transform: scale(1); box-shadow: 0 8px 30px rgba(255,152,0,0.6); }
  50% { transform: scale(1.03); box-shadow: 0 12px 40px rgba(255,152,0,0.9); }
}
.gift-claim-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 40px rgba(255,152,0,1);
}
.gift-claim-btn:active {
  transform: scale(0.98);
}

/* Фейерверк */
.firework-particle {
  position: fixed;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  animation: fireworkFly 1.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes fireworkFly {
  0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  70% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.8); opacity: 0.9; }
  100% { transform: translate(calc(-50% + var(--dx) * 1.2), calc(-50% + var(--dy) * 1.2)) scale(0); opacity: 0; }
}

/* ============================================================
   ГРАФИК ДОХОДА
   ============================================================ */
.hud-chart {
  position: relative;
  width: 100%;
  height: 40px;
  margin-top: 4px;
  padding: 0;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(120,150,255,0.1);
  transition: all 0.2s;
}
.hud-chart:hover {
  border-color: rgba(127,255,212,0.4);
  background: rgba(127,255,212,0.05);
  box-shadow: 0 0 12px rgba(127,255,212,0.2);
}
#income-chart {
  width: 100%;
  height: 100%;
  display: block;
}

/* Большая модалка */
.chart-modal-box {
  max-width: 640px;
  width: 95%;
}
#income-chart-big {
  width: 100%;
  height: auto;
  display: block;
  margin: 14px 0;
  background: rgba(0,0,0,0.3);
  border-radius: 10px;
  padding: 8px;
}

.chart-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 10px;
}
.chart-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(127,255,212,0.06);
  border: 1px solid rgba(127,255,212,0.2);
  border-radius: 10px;
  font-size: 12px;
}
.chart-stat span {
  color: var(--text-dim);
  font-family: 'Russo One', sans-serif;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.chart-stat b {
  color: var(--accent);
  font-family: 'Russo One', sans-serif;
  font-size: 14px;
  text-shadow: 0 0 10px rgba(127,255,212,0.5);
}

@media (max-width: 500px) {
  .hud-chart { height: 34px; }
  .chart-stats { grid-template-columns: 1fr; }
}

/* ============================================================
   МЕНЕДЖЕРЫ
   ============================================================ */
#tab-managers { padding: 14px; }

.managers-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: rgba(79,195,247,0.06);
  border: 1px solid rgba(79,195,247,0.25);
  border-radius: 12px;
  margin-bottom: 14px;
  gap: 10px;
}
.managers-title {
  font-family: 'Russo One', sans-serif;
  font-size: 14px;
  color: #4fc3f7;
}
.hire-all-btn {
  padding: 8px 14px;
  background: linear-gradient(135deg, #7fffd4, #4fc3f7);
  color: #05060f;
  border: none;
  border-radius: 10px;
  font-family: 'Russo One', sans-serif;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(79,195,247,0.4);
  transition: all 0.15s;
}
.hire-all-btn:hover {
  transform: translateY(-2px);
}

.manager-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(255,255,255,0.03);
  border: 1.5px solid rgba(120,150,255,0.12);
  border-radius: 12px;
  margin-bottom: 8px;
  transition: all 0.2s;
}
.manager-card.hired {
  border-color: rgba(127,255,212,0.4);
  background: rgba(127,255,212,0.06);
  box-shadow: 0 0 16px rgba(127,255,212,0.15);
}

.manager-icon {
  font-size: 32px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.manager-body { flex: 1; min-width: 0; }
.manager-name {
  font-family: 'Russo One', sans-serif;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 3px;
}
.manager-desc {
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 3px;
}
.manager-info {
  font-size: 10px;
  color: var(--accent);
  font-family: 'Russo One', sans-serif;
}

.manager-action { flex-shrink: 0; }

.hire-btn {
  padding: 8px 12px;
  background: linear-gradient(135deg, #ffd54f, #ff9800);
  color: #05060f;
  border: none;
  border-radius: 10px;
  font-family: 'Russo One', sans-serif;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(255,152,0,0.4);
  transition: all 0.15s;
  touch-action: manipulation;
}
.hire-btn:hover:not(.disabled) {
  transform: translateY(-2px);
}
.hire-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #444;
  color: #999;
  box-shadow: none;
}

.manager-status {
  font-family: 'Russo One', sans-serif;
  font-size: 12px;
  color: var(--accent);
  padding: 6px 12px;
  background: rgba(127,255,212,0.12);
  border: 1px solid rgba(127,255,212,0.3);
  border-radius: 8px;
  white-space: nowrap;
}

/* Bottom-nav теперь 8 иконок */
.bottom-nav {
  grid-template-columns: repeat(8, 1fr) !important;
}
.bottom-nav .tab-btn {
  font-size: 14px !important;
  min-height: 44px !important;
  padding: 2px !important;
}
@media (max-width: 500px) {
  .bottom-nav .tab-btn {
    font-size: 13px !important;
    min-height: 40px !important;
  }
}

/* ============================================================
   ЭКСПЕДИЦИИ
   ============================================================ */
#tab-expeditions { padding: 14px; }

.expeditions-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: rgba(179,136,255,0.06);
  border: 1px solid rgba(179,136,255,0.25);
  border-radius: 12px;
  margin-bottom: 14px;
  gap: 10px;
}
.expeditions-title {
  font-family: 'Russo One', sans-serif;
  font-size: 14px;
  color: #b388ff;
}
.expeditions-info {
  font-size: 11px;
  color: var(--text-dim);
}

.exp-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: rgba(255,255,255,0.03);
  border: 1.5px solid;
  border-radius: 14px;
  margin-bottom: 10px;
  transition: all 0.2s;
}

.exp-icon {
  font-size: 36px;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  animation: expFloat 3s ease-in-out infinite;
}
@keyframes expFloat {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.exp-body { flex: 1; min-width: 0; }
.exp-name {
  font-family: 'Russo One', sans-serif;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 3px;
}
.exp-duration {
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.exp-time {
  font-family: 'Russo One', sans-serif;
  font-size: 12px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.exp-time.active {
  color: #ffd54f;
  animation: expTimePulse 1s ease-in-out infinite;
}
@keyframes expTimePulse {
  0%,100% { opacity: 1; }
  50% { opacity: 0.6; }
}
.exp-time.ready {
  color: var(--accent);
  text-shadow: 0 0 12px rgba(127,255,212,0.6);
}

.exp-action { flex-shrink: 0; }

.exp-btn {
  padding: 10px 16px;
  border: none;
  border-radius: 10px;
  font-family: 'Russo One', sans-serif;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
  touch-action: manipulation;
  min-width: 100px;
}
.exp-btn.start {
  background: linear-gradient(135deg, #7fffd4, #4fc3f7);
  color: #05060f;
  box-shadow: 0 4px 14px rgba(79,195,247,0.4);
}
.exp-btn.start:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(79,195,247,0.6);
}
.exp-btn.waiting {
  background: rgba(255,255,255,0.05);
  color: var(--text-dim);
  cursor: not-allowed;
  border: 1px solid rgba(120,150,255,0.2);
}
.exp-btn.claim {
  background: linear-gradient(135deg, #ffd54f, #ff9800);
  color: #05060f;
  box-shadow: 0 4px 14px rgba(255,152,0,0.5);
  animation: claimBtnPulse 1.5s ease-in-out infinite;
}
.exp-btn.claim:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255,152,0,0.8);
}

/* Bottom-nav теперь 9 иконок */
.bottom-nav {
  grid-template-columns: repeat(9, 1fr) !important;
}
.bottom-nav .tab-btn {
  font-size: 13px !important;
  min-height: 42px !important;
  padding: 2px !important;
}
@media (max-width: 500px) {
  .bottom-nav .tab-btn {
    font-size: 12px !important;
    min-height: 38px !important;
  }
  .exp-btn { min-width: 80px; font-size: 11px; padding: 8px 12px; }
}

/* ============================================================
   AD MANAGER — заглушка рекламы
   ============================================================ */
.ad-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 15, 0.95);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  animation: adFadeIn 0.3s ease;
}
@keyframes adFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.ad-simulate-box {
  text-align: center;
  padding: 40px 30px;
  background: linear-gradient(180deg, rgba(30, 35, 65, 0.95), rgba(13, 16, 36, 0.95));
  border: 2px solid rgba(120,150,255,0.3);
  border-radius: 20px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 0 60px rgba(79,195,247,0.3);
}

.ad-spinner {
  font-size: 80px;
  margin-bottom: 20px;
  animation: adPulse 1.5s ease-in-out infinite;
}
@keyframes adPulse {
  0%,100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.ad-text {
  font-family: 'Russo One', sans-serif;
  font-size: 18px;
  color: var(--accent);
  margin-bottom: 16px;
  letter-spacing: 1px;
}

.ad-timer {
  font-family: 'Russo One', sans-serif;
  font-size: 56px;
  color: #ffd54f;
  text-shadow: 0 0 30px rgba(255,213,79,0.8);
  margin-bottom: 20px;
  animation: adTimerPulse 1s ease-in-out infinite;
}
@keyframes adTimerPulse {
  0%,100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.ad-hint {
  font-size: 11px;
  color: var(--text-dim);
  font-style: italic;
}

/* Уведомления AdManager */
.notify-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  padding: 14px 20px;
  background: rgba(15, 20, 40, 0.95);
  border: 1.5px solid #ffd54f;
  border-radius: 12px;
  color: #e8ecff;
  font-family: 'Russo One', sans-serif;
  font-size: 13px;
  z-index: 99998;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5), 0 0 30px rgba(255,213,79,0.3);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}
.notify-toast.visible {
  transform: translateX(-50%) translateY(0);
}
.notify-toast.warn {
  border-color: #ff9800;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5), 0 0 30px rgba(255,152,0,0.4);
}
.notify-toast.success {
  border-color: #7fffd4;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5), 0 0 30px rgba(127,255,212,0.4);
}
