/* css/style.css */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-tertiary: #1a1a2e;
  --bg-card: #16162a;
  --bg-card-hover: #1e1e3a;
  --bg-input: #1a1a30;
  --text-primary: #ffffff;
  --text-secondary: #a0a0c0;
  --text-muted: #606080;
  --accent: #ff9800;
  --accent-hover: #ffa726;
  --accent-glow: rgba(255, 152, 0, 0.3);
  --success: #4caf50;
  --error: #f44336;
  --warning: #ff9800;
  --info: #2196f3;
  --border: rgba(255, 255, 255, 0.06);
  --border-light: rgba(255, 255, 255, 0.1);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 48px rgba(0, 0, 0, 0.6);
  --radius: 12px;
  --radius-lg: 20px;
  --radius-full: 50px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  --rarity-common: #9e9e9e;
  --rarity-uncommon: #4caf50;
  --rarity-rare: #2196f3;
  --rarity-epic: #9c27b0;
  --rarity-legendary: #ff9800;
  --rarity-mythic: #f44336;
  --rarity-divine: #ffeb3b;
  --rarity-cosmic: #e040fb;

  --sidebar-width: 240px;
  --brand-bar-height: 36px;
  --top-bar-height: 70px;
  --mobile-nav-height: 64px;
  --ad-banner-height: 100px;
}

html, body {
  font-size: 16px;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  position: fixed;
  width: 100%;
  height: 100%;
  overscroll-behavior: none;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 30%, rgba(255, 152, 0, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(156, 39, 176, 0.05) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

.hidden { display: none !important; }
.screen {
  height: 100vh;
  overflow: hidden;
}

/* ===== LOADER ===== */
.loader {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: opacity 0.5s, visibility 0.5s;
}
.loader.fade-out {
  opacity: 0;
  visibility: hidden;
}
.loader-content { text-align: center; }
.loader-mango {
  font-size: 100px;
  animation: loaderBounce 1s ease-in-out infinite;
  filter: drop-shadow(0 10px 30px rgba(255, 152, 0, 0.5));
}
.loader-text {
  font-size: 36px;
  font-weight: 800;
  margin-top: 16px;
  background: linear-gradient(135deg, var(--accent), #ff6d00);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.loader-bar {
  width: 300px;
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  margin: 24px auto 0;
  overflow: hidden;
}
.loader-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #ff6d00);
  border-radius: 3px;
  animation: loaderFill 2s ease forwards;
}
@keyframes loaderBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-20px) scale(1.1); }
}
@keyframes loaderFill {
  from { width: 0; }
  to { width: 100%; }
}

/* ===== AUTH SCREEN ===== */
.auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, #1a1a2e 0%, var(--bg-primary) 70%);
  padding: 20px;
  overflow-y: auto;
}
.auth-container {
  width: 100%;
  max-width: 460px;
  padding: 50px 40px;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.auth-logo {
  font-size: 80px;
  margin-bottom: 12px;
  animation: loaderBounce 2s ease-in-out infinite;
}
.auth-title {
  font-size: 40px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent), #ff6d00, #ffab40);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.auth-subtitle {
  color: var(--text-secondary);
  margin: 12px 0 30px;
  font-size: 15px;
}
.auth-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  padding: 4px;
}
.auth-tab {
  flex: 1;
  padding: 12px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  transition: var(--transition);
  font-family: inherit;
}
.auth-tab.active {
  background: var(--accent);
  color: var(--bg-primary);
}
.input-group {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 16px;
  margin-bottom: 14px;
  transition: var(--transition);
}
.input-group:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.input-group .material-icons-round {
  color: var(--text-muted);
  font-size: 20px;
  margin-right: 12px;
}
.input-group input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  padding: 16px 0;
  font-size: 14px;
  outline: none;
  font-family: inherit;
}
.input-group input::placeholder { color: var(--text-muted); }

.auth-error {
  background: rgba(244, 67, 54, 0.1);
  border: 1px solid rgba(244, 67, 54, 0.3);
  color: var(--error);
  padding: 12px;
  border-radius: var(--radius);
  margin-top: 14px;
  font-size: 13px;
}

.auth-footer {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.auth-footer-text {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.auth-footer-text strong { color: var(--text-secondary); }
.auth-footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.auth-footer-links span {
  color: var(--text-muted);
  font-size: 11px;
  opacity: 0.5;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #ff6d00);
  color: #000;
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px var(--accent-glow);
}
.btn-primary:active { transform: translateY(0) scale(0.98); }
.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}
.btn-secondary:hover:not(:disabled) { background: var(--bg-card-hover); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover:not(:disabled) { background: #45a049; }
.btn-danger { background: var(--error); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #d32f2f; }
.btn-full { width: 100%; padding: 14px 24px; font-size: 15px; }
.btn-sm { padding: 8px 16px; font-size: 12px; }
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}
.btn-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}
.btn-icon:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  transform: translateY(-2px);
}
.btn-icon.music-on {
  background: var(--accent);
  color: var(--bg-primary);
}

/* ===== BRAND BAR ===== */
.brand-bar {
  grid-area: brand;
  height: var(--brand-bar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: linear-gradient(90deg, var(--bg-primary), var(--bg-secondary), var(--bg-primary));
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  z-index: 110;
}
.brand-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-logo {
  font-size: 18px;
  filter: drop-shadow(0 0 6px rgba(255, 152, 0, 0.4));
}
.brand-title {
  font-size: 12px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), #ff6d00);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.5px;
  line-height: 1.2;
}
.brand-copyright {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.2;
}
.brand-right {
  display: flex;
  align-items: center;
  gap: 4px;
}
.footer-link {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 4px;
  transition: var(--transition);
}
.footer-link:hover {
  color: var(--accent);
  background: rgba(255, 152, 0, 0.08);
}
.footer-separator {
  color: var(--text-muted);
  font-size: 10px;
  opacity: 0.4;
}

/* ===== ОСНОВНАЯ СТРУКТУРА (ПК) ===== */
.game-screen {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: var(--brand-bar-height) var(--top-bar-height) 1fr;
  grid-template-areas:
    "brand brand"
    "topbar topbar"
    "sidebar main";
  height: 100vh;
  overflow: hidden;
}

/* Мобильная навигация скрыта на ПК */
.mobile-nav {
  display: none;
}

/* ===== TOP BAR ===== */
.top-bar {
  grid-area: topbar;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}
.top-bar-left, .top-bar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.user-avatar {
  font-size: 32px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border-radius: 12px;
}
.user-info-text {
  display: flex;
  flex-direction: column;
}
.user-name {
  font-weight: 700;
  font-size: 15px;
}
.user-level {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
}
.score-display {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-card));
  padding: 10px 24px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-light);
}
.score-icon { font-size: 24px; }
.score-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 20px var(--accent-glow);
}
.global-counter {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  padding: 8px 14px;
  border-radius: var(--radius);
  font-weight: 600;
}
.global-counter .material-icons-round { font-size: 18px; color: var(--info); }

/* ===== SIDEBAR (ПК) ===== */
.sidebar {
  grid-area: sidebar;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  overflow-x: hidden;
}
.sidebar-section-title {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 12px 16px 8px;
  font-weight: 700;
}
.nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 12px 16px;
  border-radius: var(--radius);
  transition: var(--transition);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  width: 100%;
  position: relative;
}
.nav-btn .material-icons-round { font-size: 22px; }
.nav-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}
.nav-btn.active {
  background: linear-gradient(135deg, rgba(255, 152, 0, 0.15), rgba(255, 109, 0, 0.05));
  color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
}
.nav-btn .nav-text { flex: 1; }
.notification-dot {
  position: relative;
}
.notification-dot::after {
  content: '';
  position: absolute;
  top: 12px;
  right: 12px;
  width: 8px;
  height: 8px;
  background: var(--error);
  border-radius: 50%;
  display: none;
  animation: pulse 2s infinite;
}
.notification-dot.has-notification::after { display: block; }

/* ===== MAIN AREA ===== */
.main-area {
  grid-area: main;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* ===== STATS BAR ===== */
.stats-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  flex-shrink: 0;
}
.stat-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
}
.stat-box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
}
.stat-box-header .label {
  display: flex;
  align-items: center;
  gap: 6px;
}
.stat-box-header .value {
  color: var(--text-primary);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.stat-bar-container {
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
}
.stat-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}
.energy-fill {
  background: linear-gradient(90deg, #ff9800, #ffeb3b);
  box-shadow: 0 0 10px rgba(255, 152, 0, 0.5);
}
.level-fill {
  background: linear-gradient(90deg, #9c27b0, #e040fb);
  box-shadow: 0 0 10px rgba(156, 39, 176, 0.4);
}

/* ===== GAME AREA ===== */
.game-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 40px;
  position: relative;
  overflow: hidden;
}
.mango-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 340px;
  height: 340px;
}
.mango-glow {
  position: absolute;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  filter: blur(40px);
  animation: glowPulse 3s ease-in-out infinite;
}
@keyframes glowPulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.2); opacity: 0.8; }
}
.mango-button {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  z-index: 2;
  transition: transform 0.1s ease;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  background: none;
  border: none;
}
.mango-button:hover { transform: scale(1.05); }
.mango-button:active { transform: scale(0.92); }
.mango-button.clicked {
  animation: mangoClick 0.15s ease;
}
@keyframes mangoClick {
  0% { transform: scale(1); }
  50% { transform: scale(0.85); }
  100% { transform: scale(1); }
}
.mango-emoji {
  font-size: 150px;
  filter: drop-shadow(0 15px 40px rgba(255, 152, 0, 0.4));
  transition: filter 0.3s;
}
.mango-button:hover .mango-emoji {
  filter: drop-shadow(0 15px 50px rgba(255, 152, 0, 0.6));
}

.click-particles {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}
.click-particle {
  position: absolute;
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
  pointer-events: none;
  animation: particleFloat 1s ease-out forwards;
  text-shadow: 0 0 10px var(--accent-glow);
  z-index: 20;
  white-space: nowrap;
}
.click-particle.crit {
  font-size: 32px;
  color: #ff1744;
  text-shadow: 0 0 25px rgba(255, 23, 68, 0.8);
}
@keyframes particleFloat {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-150px) scale(0.5); }
}

.click-info {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
  font-size: 14px;
  color: var(--text-secondary);
  flex-wrap: wrap;
  justify-content: center;
}
.click-info span {
  background: var(--bg-card);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  font-weight: 600;
}

/* ===== AD BANNER ===== */
.ad-banner {
  flex-shrink: 0;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--ad-banner-height);
}
.ad-placeholder {
  width: 100%;
  max-width: 728px;
  height: 90px;
  background: var(--bg-tertiary);
  border: 2px dashed var(--border-light);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 13px;
  gap: 4px;
}
.ad-placeholder .material-icons-round {
  font-size: 28px;
  margin-bottom: 4px;
}
.ad-placeholder small {
  font-size: 10px;
  opacity: 0.6;
}

/* ===== PANELS ===== */
.panel {
  position: fixed;
  top: calc(var(--brand-bar-height) + var(--top-bar-height));
  left: var(--sidebar-width);
  right: 0;
  bottom: 0;
  background: var(--bg-primary);
  z-index: 50;
  display: flex;
  flex-direction: column;
  animation: panelFadeIn 0.3s ease;
  overflow: hidden;
}
@keyframes panelFadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.panel-header h2 {
  font-size: 24px;
  font-weight: 800;
}
.btn-close-panel {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border: none;
  border-radius: 10px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}
.btn-close-panel:hover {
  background: var(--error);
  color: #fff;
  transform: rotate(90deg);
}
.panel-tabs {
  display: flex;
  gap: 8px;
  padding: 16px 32px;
  overflow-x: auto;
  overflow-y: hidden;
  flex-shrink: 0;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  scrollbar-width: thin;
}
.panel-tab {
  padding: 10px 20px;
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 13px;
  transition: var(--transition);
  white-space: nowrap;
  font-family: inherit;
}
.panel-tab:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}
.panel-tab.active {
  background: var(--accent);
  color: var(--bg-primary);
  border-color: var(--accent);
}
.panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
}

/* ===== ITEM CARDS ===== */
.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.item-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.item-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-light);
  box-shadow: var(--shadow);
  background: var(--bg-card-hover);
}
.item-card.owned {
  border-color: var(--success);
  background: rgba(76, 175, 80, 0.05);
}
.item-card.equipped {
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}
.item-card-rarity {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}
.item-card-emoji {
  font-size: 56px;
  text-align: center;
  margin: 12px 0;
}
.item-card-name {
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 6px;
  line-height: 1.2;
}
.item-card-rarity-text {
  font-size: 10px;
  text-align: center;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}
.item-card-desc {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 10px;
  line-height: 1.4;
  min-height: 30px;
}
.item-card-price {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  padding: 8px;
  background: rgba(255, 152, 0, 0.08);
  border-radius: 8px;
}
.item-card-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 700;
  z-index: 2;
}
.badge-owned { background: var(--success); color: #fff; }
.badge-equipped { background: var(--accent); color: #000; }
.item-card-qty {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 11px;
  font-weight: 700;
  background: var(--bg-tertiary);
  padding: 3px 8px;
  border-radius: 6px;
  color: var(--text-secondary);
  z-index: 2;
}

/* RARITY */
.rarity-common .item-card-rarity { background: var(--rarity-common); }
.rarity-common .item-card-rarity-text { color: var(--rarity-common); }
.rarity-uncommon .item-card-rarity { background: var(--rarity-uncommon); }
.rarity-uncommon .item-card-rarity-text { color: var(--rarity-uncommon); }
.rarity-rare .item-card-rarity { background: var(--rarity-rare); }
.rarity-rare .item-card-rarity-text { color: var(--rarity-rare); }
.rarity-epic .item-card-rarity { background: var(--rarity-epic); }
.rarity-epic .item-card-rarity-text { color: var(--rarity-epic); }
.rarity-legendary .item-card-rarity {
  background: linear-gradient(90deg, #ff9800, #ffeb3b, #ff9800);
  background-size: 200% 100%;
  animation: shimmer 2s linear infinite;
}
.rarity-legendary .item-card-rarity-text { color: var(--rarity-legendary); }
.rarity-mythic .item-card-rarity {
  background: linear-gradient(90deg, #f44336, #ff1744, #f44336);
  background-size: 200% 100%;
  animation: shimmer 1.5s linear infinite;
}
.rarity-mythic .item-card-rarity-text { color: var(--rarity-mythic); }
.rarity-divine .item-card-rarity {
  background: linear-gradient(90deg, #ffeb3b, #fff176, #ffeb3b);
  background-size: 200% 100%;
  animation: shimmer 1s linear infinite;
}
.rarity-divine .item-card-rarity-text { color: var(--rarity-divine); }
.rarity-cosmic .item-card-rarity {
  background: linear-gradient(90deg, #e040fb, #7c4dff, #00bcd4, #e040fb);
  background-size: 300% 100%;
  animation: shimmer 1s linear infinite;
}
.rarity-cosmic .item-card-rarity-text { color: var(--rarity-cosmic); }
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.badge-3d-indicator {
  display: inline-block;
  font-size: 10px;
  background: linear-gradient(135deg, #2196f3, #00bcd4);
  color: #fff;
  padding: 3px 7px;
  border-radius: 5px;
  font-weight: 700;
  position: absolute;
  bottom: 10px;
  right: 10px;
  z-index: 2;
}

/* CRAFTING */
.recipe-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
}
.recipe-card:hover { border-color: var(--border-light); }
.recipe-left { display: flex; flex-direction: column; gap: 12px; }
.recipe-header {
  display: flex;
  align-items: center;
  gap: 14px;
}
.recipe-result-emoji { font-size: 48px; }
.recipe-result-info h4 { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.recipe-ingredients {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.recipe-ingredient {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-tertiary);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
}
.recipe-ingredient.has { border: 1px solid var(--success); color: var(--success); }
.recipe-ingredient.missing { border: 1px solid var(--error); color: var(--error); }
.recipe-right {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
}
.recipe-cost {
  font-size: 14px;
  color: var(--accent);
  font-weight: 700;
}

/* TRADING */
.trade-listing {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.trade-listing:hover {
  border-color: var(--border-light);
  background: var(--bg-card-hover);
}
.trade-item-info {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
}
.trade-item-emoji { font-size: 44px; }
.trade-item-name { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.trade-item-seller { font-size: 12px; color: var(--text-muted); }
.trade-item-price {
  font-size: 18px;
  font-weight: 800;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 6px;
}
.trade-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }

/* REWARDS */
.reward-section { margin-bottom: 32px; }
.reward-section h3 {
  font-size: 18px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}
.daily-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
}
.daily-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 10px;
  text-align: center;
  transition: var(--transition);
}
.daily-box.claimed {
  background: rgba(76, 175, 80, 0.1);
  border-color: var(--success);
}
.daily-box.available {
  border-color: var(--accent);
  box-shadow: 0 0 15px var(--accent-glow);
  cursor: pointer;
  animation: pulse 2s infinite;
}
.daily-box.available:hover {
  transform: translateY(-4px) scale(1.02);
}
.daily-box.locked { opacity: 0.5; }
.daily-box-day {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
}
.daily-box-emoji { font-size: 32px; margin: 8px 0; }
.daily-box-reward { font-size: 12px; color: var(--accent); font-weight: 700; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 15px var(--accent-glow); }
  50% { box-shadow: 0 0 30px var(--accent-glow); }
}
.weekly-drop-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
  text-align: center;
}
.weekly-drop-timer {
  font-size: 36px;
  font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  margin: 16px 0;
  text-shadow: 0 0 20px var(--accent-glow);
}

/* MODAL */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  backdrop-filter: blur(8px);
  animation: fadeIn 0.2s ease;
  padding: 20px;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.modal {
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}
@keyframes modalIn {
  from { transform: scale(0.9) translateY(20px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-header h3 { font-size: 18px; font-weight: 700; }
.btn-close-modal {
  width: 32px;
  height: 32px;
  background: var(--bg-tertiary);
  border: none;
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-close-modal:hover { background: var(--error); color: #fff; }
.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}
.modal-footer {
  padding: 18px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-shrink: 0;
}

/* NOTIFICATIONS */
.notifications {
  position: fixed;
  top: calc(var(--brand-bar-height) + 20px);
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 400px;
  pointer-events: none;
}
.notification {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  animation: notifIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  font-size: 14px;
  pointer-events: auto;
}
.notification.success { border-left: 4px solid var(--success); }
.notification.error { border-left: 4px solid var(--error); }
.notification.info { border-left: 4px solid var(--info); }
.notification.warning { border-left: 4px solid var(--warning); }
@keyframes notifIn {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.notification.fade-out {
  animation: notifOut 0.3s ease forwards;
}
@keyframes notifOut {
  to { transform: translateX(120%); opacity: 0; }
}

/* DROP REVEAL */
.drop-reveal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(15px);
}
.drop-reveal-content {
  text-align: center;
  position: relative;
  padding: 40px;
}
.drop-reveal-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 400px;
  height: 400px;
  border-radius: 50%;
  filter: blur(80px);
  animation: dropGlow 2s ease-in-out infinite;
}
@keyframes dropGlow {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.3); }
}
.drop-reveal-emoji {
  font-size: 160px;
  animation: dropReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  z-index: 1;
}
@keyframes dropReveal {
  0% { transform: scale(0) rotate(-180deg); opacity: 0; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
.drop-reveal-name {
  font-size: 32px;
  font-weight: 800;
  margin-top: 20px;
  position: relative;
  z-index: 1;
}
.drop-reveal-rarity {
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 3px;
  margin: 12px 0 30px;
  position: relative;
  z-index: 1;
}
.drop-reveal-content .btn {
  position: relative;
  z-index: 2;
  font-size: 16px;
  padding: 16px 40px;
}

/* SELL FORM */
.sell-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 500px;
}
.sell-form label {
  font-size: 14px;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}
.sell-form select, .sell-form input[type="number"] {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  margin-bottom: 16px;
  outline: none;
  transition: var(--transition);
}
.sell-form select:focus, .sell-form input[type="number"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.sell-form select option { background: var(--bg-secondary); }

/* EMPTY STATE */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state-emoji {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
}
.empty-state-text { font-size: 16px; }

/* 3D MANGO */
.mango-3d { perspective: 800px; }
.mango-3d .mango-emoji {
  animation: rotate3d 6s linear infinite;
}
@keyframes rotate3d {
  0% { transform: rotateY(0deg); }
  100% { transform: rotateY(360deg); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-10px); }
  40% { transform: translateX(10px); }
  60% { transform: translateX(-7px); }
  80% { transform: translateX(7px); }
}

/* POLICY MODAL */
.policy-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 600;
  backdrop-filter: blur(10px);
  animation: fadeIn 0.2s ease;
  padding: 20px;
}
.policy-modal {
  width: 100%;
  max-width: 700px;
  max-height: 85vh;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}
.policy-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-tertiary);
  flex-shrink: 0;
}
.policy-modal-header h2 {
  font-size: 20px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), #ff6d00);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.policy-modal-body {
  padding: 28px;
  overflow-y: auto;
  flex: 1;
  line-height: 1.7;
  color: var(--text-secondary);
  font-size: 14px;
}
.policy-modal-body h3 {
  color: var(--text-primary);
  font-size: 17px;
  font-weight: 700;
  margin: 24px 0 12px;
}
.policy-modal-body h3:first-child { margin-top: 0; }
.policy-modal-body p { margin-bottom: 12px; }
.policy-modal-body ul {
  padding-left: 24px;
  margin-bottom: 16px;
}
.policy-modal-body li { margin-bottom: 8px; }
.policy-modal-body strong {
  color: var(--text-primary);
  font-weight: 700;
}
.policy-modal-body .policy-meta {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 24px;
  font-size: 13px;
}
.policy-modal-body .policy-meta strong { color: var(--accent); }
.policy-modal-footer {
  padding: 18px 28px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
  background: var(--bg-tertiary);
}

/* ===== МОБИЛЬНАЯ ВЕРСИЯ (НОВАЯ!) ===== */
@media (max-width: 900px) {
  :root {
    --brand-bar-height: 30px;
    --top-bar-height: 56px;
    --mobile-nav-height: 60px;
    --ad-banner-height: 60px;
  }

  /* СТРУКТУРА: бренд → топбар → мобильная навигация → главная → реклама */
  .game-screen {
    grid-template-columns: 1fr;
    grid-template-rows:
      var(--brand-bar-height)
      var(--top-bar-height)
      var(--mobile-nav-height)
      1fr;
    grid-template-areas:
      "brand"
      "topbar"
      "mobilenav"
      "main";
  }

  /* СКРЫВАЕМ САЙДБАР НА МОБИЛЬНЫХ */
  .sidebar {
    display: none;
  }

  /* ПОКАЗЫВАЕМ МОБИЛЬНУЮ НАВИГАЦИЮ */
  .mobile-nav {
    grid-area: mobilenav;
    display: flex;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 6px 8px;
    gap: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .mobile-nav::-webkit-scrollbar { display: none; }

  .mobile-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 10px;
    transition: var(--transition);
    font-family: inherit;
    min-width: 64px;
    flex-shrink: 0;
    position: relative;
  }

  .mobile-nav-btn .material-icons-round {
    font-size: 20px;
  }

  .mobile-nav-text {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.3px;
  }

  .mobile-nav-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
  }

  .mobile-nav-btn.active {
    background: linear-gradient(135deg, var(--accent), #ff6d00);
    color: var(--bg-primary);
    border-color: var(--accent);
    box-shadow: 0 4px 12px var(--accent-glow);
  }

  .mobile-nav-btn.notification-dot::after {
    content: '';
    position: absolute;
    top: 4px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--error);
    border-radius: 50%;
    display: none;
    animation: pulse 2s infinite;
  }

  .mobile-nav-btn.notification-dot.has-notification::after {
    display: block;
  }

  /* ВЕРХНИЙ БРЕНД */
  .brand-bar {
    padding: 0 10px;
    font-size: 10px;
  }
  .brand-title { font-size: 11px; }
  .brand-copyright { font-size: 9px; }
  .brand-right { display: none; } /* Политики только на ПК */

  /* ТОПБАР */
  .top-bar {
    padding: 0 10px;
    gap: 8px;
  }
  .top-bar-left, .top-bar-right { gap: 6px; }
  .user-name { display: none; }
  .user-avatar { width: 38px; height: 38px; font-size: 26px; }
  .user-info { gap: 6px; }

  .score-display {
    padding: 6px 12px;
    gap: 6px;
  }
  .score-icon { font-size: 20px; }
  .score-value { font-size: 15px; }

  .global-counter { display: none; }

  .btn-icon {
    width: 36px;
    height: 36px;
  }
  .btn-icon .material-icons-round { font-size: 20px; }

  /* MAIN AREA */
  .main-area {
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .stats-bar {
    padding: 8px 12px;
    gap: 8px;
  }
  .stat-box { padding: 8px 12px; }
  .stat-box-header { font-size: 11px; margin-bottom: 4px; }
  .stat-bar-container { height: 6px; }

  .game-area {
    padding: 10px 16px;
    flex: 1;
    min-height: 0;
  }

  .mango-container {
    width: 220px;
    height: 220px;
  }
  .mango-glow {
    width: 170px;
    height: 170px;
  }
  .mango-button {
    width: 160px;
    height: 160px;
  }
  .mango-emoji {
    font-size: 110px;
  }

  .click-info {
    gap: 8px;
    margin-top: 10px;
    font-size: 12px;
  }
  .click-info span {
    padding: 5px 10px;
  }

  /* AD BANNER MOBILE */
  .ad-banner {
    padding: 6px;
    min-height: var(--ad-banner-height);
  }
  .ad-placeholder {
    height: 50px;
    max-width: 320px;
    font-size: 11px;
  }
  .ad-placeholder .material-icons-round { font-size: 20px; }
  .ad-placeholder small { display: none; }

  /* ПАНЕЛИ - открываются под мобильной навигацией */
  .panel {
    top: calc(var(--brand-bar-height) + var(--top-bar-height) + var(--mobile-nav-height));
    left: 0;
    right: 0;
    bottom: 0;
  }

  .panel-header {
    padding: 12px 16px;
  }
  .panel-header h2 { font-size: 17px; }
  .btn-close-panel { width: 32px; height: 32px; }
  .btn-close-panel .material-icons-round { font-size: 20px; }

  .panel-tabs {
    padding: 10px 12px;
    gap: 6px;
  }
  .panel-tab {
    padding: 7px 12px;
    font-size: 12px;
  }

  .panel-content {
    padding: 14px;
  }

  .item-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .item-card { padding: 12px; }
  .item-card-emoji { font-size: 40px; margin: 8px 0; }
  .item-card-name { font-size: 13px; }
  .item-card-rarity-text { font-size: 9px; }
  .item-card-desc { font-size: 10px; min-height: 26px; }
  .item-card-price { font-size: 12px; padding: 6px; }
  .item-card-badge { font-size: 9px; padding: 2px 6px; }

  .daily-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }
  .daily-box { padding: 12px 6px; }
  .daily-box-emoji { font-size: 28px; }
  .daily-box-day { font-size: 9px; }
  .daily-box-reward { font-size: 10px; }

  .recipe-card {
    grid-template-columns: 1fr;
    padding: 14px;
    gap: 12px;
  }
  .recipe-right { align-items: stretch; }
  .recipe-result-emoji { font-size: 38px; }
  .recipe-result-info h4 { font-size: 14px; }
  .recipe-ingredient { font-size: 11px; padding: 6px 10px; }
  .recipe-cost { font-size: 13px; }

  .trade-listing {
    padding: 12px;
    gap: 10px;
  }
  .trade-item-emoji { font-size: 36px; }
  .trade-item-name { font-size: 13px; }
  .trade-item-seller { font-size: 11px; }
  .trade-item-price { font-size: 15px; }

  .notifications {
    top: calc(var(--brand-bar-height) + var(--top-bar-height) + var(--mobile-nav-height) + 10px);
    right: 8px;
    left: 8px;
    max-width: none;
  }
  .notification {
    padding: 10px 14px;
    font-size: 13px;
  }

  .drop-reveal-emoji { font-size: 110px; }
  .drop-reveal-name { font-size: 22px; }
  .drop-reveal-rarity { font-size: 13px; }

  .policy-modal-body {
    padding: 18px;
    font-size: 13px;
  }
  .policy-modal-body h3 { font-size: 15px; }
  .policy-modal-header { padding: 14px 18px; }
  .policy-modal-header h2 { font-size: 17px; }
  .policy-modal-footer { padding: 14px 18px; }

  .modal {
    max-width: 95%;
  }
  .modal-header { padding: 14px 18px; }
  .modal-body { padding: 18px; }
  .modal-footer { padding: 14px 18px; flex-wrap: wrap; }
}

/* ОЧЕНЬ МАЛЕНЬКИЕ ЭКРАНЫ */
@media (max-width: 480px) {
  .item-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .mango-container {
    width: 200px;
    height: 200px;
  }
  .mango-button {
    width: 140px;
    height: 140px;
  }
  .mango-emoji { font-size: 95px; }

  .mobile-nav-btn {
    min-width: 58px;
    padding: 5px 8px;
  }
  .mobile-nav-text { font-size: 9px; }
}

/* ОЧЕНЬ НИЗКИЕ ЭКРАНЫ (например, ландшафт телефона) */
@media (max-height: 600px) and (max-width: 900px) {
  .mango-container {
    width: 160px;
    height: 160px;
  }
  .mango-button {
    width: 120px;
    height: 120px;
  }
  .mango-emoji { font-size: 85px; }

  .stats-bar { padding: 6px 12px; }
  .stat-box { padding: 6px 10px; }

  .ad-banner { display: none; } /* Скрываем рекламу в ландшафте */
}

/* ===== 3D MANGO CANVAS ===== */
.mango-container canvas {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100% !important;
  height: 100% !important;
  pointer-events: none;
  z-index: 1;
}

.mango-button {
  background: transparent !important;
  z-index: 3;
}

/* ===== АКСЕССУАРЫ ===== */
.accessories-container {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 280px;
  height: 280px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 4;
}

.accessory-item {
  position: absolute;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
  animation: accessoryFloat 3s ease-in-out infinite;
}

@keyframes accessoryFloat {
  0%, 100% { transform: translate(-50%, -50%) rotate(0deg); }
  50% { transform: translate(-50%, -50%) rotate(2deg); }
}

/* АУРЫ */
.aura-effect {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  animation: auraRotate 4s linear infinite;
  font-size: 0 !important;
}

.aura-fire {
  background: radial-gradient(circle, rgba(255,87,34,0.4) 0%, rgba(255,152,0,0.2) 40%, transparent 70%);
  box-shadow: 0 0 60px rgba(255,87,34,0.6);
}

.aura-ice {
  background: radial-gradient(circle, rgba(33,150,243,0.4) 0%, rgba(129,212,250,0.2) 40%, transparent 70%);
  box-shadow: 0 0 60px rgba(33,150,243,0.6);
}

.aura-lightning {
  background: radial-gradient(circle, rgba(255,235,59,0.4) 0%, rgba(0,188,212,0.2) 40%, transparent 70%);
  box-shadow: 0 0 60px rgba(255,235,59,0.6);
  animation: auraRotate 2s linear infinite, auraFlicker 0.5s ease-in-out infinite;
}

.aura-cosmic {
  background: radial-gradient(circle, rgba(224,64,251,0.4) 0%, rgba(124,77,255,0.3) 30%, rgba(0,188,212,0.2) 50%, transparent 70%);
  box-shadow: 0 0 80px rgba(224,64,251,0.6);
  animation: auraRotate 5s linear infinite, auraPulse 2s ease-in-out infinite;
}

@keyframes auraRotate {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes auraFlicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

@keyframes auraPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.1); }
}

/* ===== ПИТОМЦЫ ===== */
.pets-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 6;
}

.pet-item {
  position: absolute;
  font-size: 40px;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.4));
  transition: left 0.5s linear, top 0.5s linear;
  animation: petBob 2s ease-in-out infinite;
}

@keyframes petBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* ===== ФОНЫ ===== */
.background-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.background-overlay.bg-active {
  opacity: 1;
}

/* Закат */
.bg-bg_sunset {
  background: linear-gradient(180deg,
    #ff6b35 0%,
    #f7931e 30%,
    #fdc830 60%,
    #f37335 100%);
}
.bg-bg_sunset .sun {
  position: absolute;
  bottom: 20%;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, #fff9c4 0%, #ffeb3b 50%, #ff9800 100%);
  border-radius: 50%;
  box-shadow: 0 0 80px #ffeb3b;
  animation: sunPulse 4s ease-in-out infinite;
}
@keyframes sunPulse {
  0%, 100% { box-shadow: 0 0 80px #ffeb3b; }
  50% { box-shadow: 0 0 120px #ffeb3b, 0 0 200px #ff9800; }
}

/* Океан */
.bg-bg_ocean {
  background: linear-gradient(180deg,
    #4fc3f7 0%,
    #29b6f6 50%,
    #0288d1 100%);
}
.bg-bg_ocean .wave {
  position: absolute;
  left: 0;
  width: 200%;
  height: 30px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  border-radius: 50%;
  animation: waveMove 4s linear infinite;
}
@keyframes waveMove {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* Лес */
.bg-bg_forest {
  background: linear-gradient(180deg,
    #66bb6a 0%,
    #43a047 50%,
    #1b5e20 100%);
}
.bg-bg_forest .forest-element {
  position: absolute;
  animation: forestSway 3s ease-in-out infinite;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}
@keyframes forestSway {
  0%, 100% { transform: rotate(-3deg); }
  50% { transform: rotate(3deg); }
}

/* Космос / Измерение / Аврора */
.bg-bg_space,
.bg-bg_dimension {
  background: radial-gradient(ellipse at center,
    #1a237e 0%,
    #000051 50%,
    #000000 100%);
}
.bg-bg_aurora {
  background: linear-gradient(180deg,
    #001f3f 0%,
    #003366 30%,
    #0a4d68 70%,
    #003366 100%);
}
.bg-bg_aurora::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 60%;
  background: linear-gradient(180deg,
    rgba(76,175,80,0.4) 0%,
    rgba(0,188,212,0.3) 30%,
    rgba(156,39,176,0.2) 60%,
    transparent 100%);
  animation: auroraMove 8s ease-in-out infinite;
  filter: blur(20px);
}
@keyframes auroraMove {
  0%, 100% { transform: translateY(0) scaleY(1); opacity: 0.7; }
  50% { transform: translateY(-10px) scaleY(1.1); opacity: 1; }
}
.star {
  position: absolute;
  background: white;
  border-radius: 50%;
  animation: starTwinkle 2s ease-in-out infinite;
}
@keyframes starTwinkle {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.5); }
}

/* Неоновый город */
.bg-bg_neon_city {
  background: linear-gradient(180deg,
    #0a0a2e 0%,
    #1a1a4e 50%,
    #2d1b69 100%);
}
.bg-bg_neon_city .neon-building {
  position: absolute;
  bottom: 0;
  width: 8%;
  border-top: 2px solid;
  border-image: linear-gradient(90deg, #e040fb, #00bcd4) 1;
  opacity: 0.6;
}

/* Вулкан */
.bg-bg_volcano {
  background: radial-gradient(ellipse at bottom,
    #ff3d00 0%,
    #d84315 30%,
    #4e342e 60%,
    #1a0000 100%);
}
.bg-bg_volcano .lava-particle {
  position: absolute;
  bottom: 0;
  width: 6px;
  height: 6px;
  background: radial-gradient(circle, #ffeb3b, #ff5722);
  border-radius: 50%;
  box-shadow: 0 0 10px #ff5722;
  animation: lavaRise 3s ease-out infinite;
}
@keyframes lavaRise {
  0% { bottom: 0; opacity: 1; transform: scale(1); }
  100% { bottom: 100%; opacity: 0; transform: scale(0.3); }
}

/* Небеса */
.bg-bg_heaven {
  background: linear-gradient(180deg,
    #fff9c4 0%,
    #ffecb3 40%,
    #fff59d 70%,
    #fff9c4 100%);
}
.bg-bg_heaven .cloud {
  position: absolute;
  animation: cloudFloat 15s linear infinite;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
  opacity: 0.8;
}
@keyframes cloudFloat {
  from { transform: translateX(-100px); }
  to { transform: translateX(calc(100vw + 100px)); }
}

/* ===== СЛЕД ЗА КУРСОРОМ ===== */
.trail-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  overflow: hidden;
}

.trail-particle {
  position: fixed;
  font-size: 24px;
  pointer-events: none;
  animation: trailFade 1s ease-out forwards;
  filter: drop-shadow(0 0 8px rgba(255,255,255,0.5));
  transform: translate(-50%, -50%);
}

@keyframes trailFade {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.3) translateY(-30px);
  }
}

/* ===== ЭФФЕКТЫ КЛИКА ===== */
.click-effect {
  position: absolute;
  pointer-events: none;
  font-size: 60px;
  z-index: 50;
  transform: translate(-50%, -50%);
}

.effect-pop {
  animation: effectPop 0.6s ease-out forwards;
}
@keyframes effectPop {
  0% { transform: translate(-50%, -50%) scale(0.3); opacity: 0; }
  50% { transform: translate(-50%, -50%) scale(1.5); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(2); opacity: 0; }
}

.effect-coin {
  font-size: 28px;
  animation: effectCoin 1.2s ease-out forwards;
}
@keyframes effectCoin {
  0% {
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%)
              rotate(var(--angle))
              translateX(100px)
              scale(0.3);
    opacity: 0;
  }
}

.effect-explosion {
  font-size: 80px;
  animation: effectExplosion 0.8s ease-out forwards;
}
@keyframes effectExplosion {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
  50% { transform: translate(-50%, -50%) scale(2); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(3); opacity: 0; }
}

.effect-portal {
  animation: effectPortal 1.2s ease-out forwards;
}
@keyframes effectPortal {
  0% { transform: translate(-50%, -50%) scale(0) rotate(0deg); opacity: 0; }
  50% { transform: translate(-50%, -50%) scale(1.5) rotate(360deg); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(2) rotate(720deg); opacity: 0; }
}

.effect-nuke {
  font-size: 100px;
  animation: effectNuke 1.5s ease-out forwards;
}
@keyframes effectNuke {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 0; filter: brightness(2); }
  30% { transform: translate(-50%, -50%) scale(1); opacity: 1; filter: brightness(3); }
  100% { transform: translate(-50%, -50%) scale(4); opacity: 0; filter: brightness(1); }
}

/* Эффект на фоне делает игровую область видимой */
.game-area {
  position: relative;
  z-index: 1;
}

.stats-bar {
  position: relative;
  z-index: 2;
}
