/* ═══════════════════════════════════════════════════════════════
   SATOSHI CLICKER — MAIN CSS
   ═══════════════════════════════════════════════════════════════ */
:root {
  --bg:           #050510;
  --bg2:          #090920;
  --bg3:          #0d0d28;
  --card:         #0d1030;
  --card2:        #121535;
  --accent:       #f7931a;
  --accent2:      #FFD700;
  --blue:         #4996cc;
  --green:        #27ae60;
  --purple:       #9b59b6;
  --red:          #e74c3c;
  --text:         #e8e8f0;
  --text2:        #8890b0;
  --text3:        #4a5080;
  --energy-color: #4996cc;
  --nav-h:        64px;
  --header-h:     90px;
  font-size: 16px;
}

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

html, body {
  height: 100%;
  width: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', 'SF Pro Display', -apple-system, sans-serif;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

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

/* ── Layout principal ── */
#app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  /* Padding bas pour la nav fixe + safe area iPhone */
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
}

/* ── Header ── */
#header {
  height: var(--header-h);
  min-height: var(--header-h);
  flex-shrink: 0;
  padding: 8px 16px 6px;
  background: linear-gradient(180deg, #050510 0%, transparent 100%);
  z-index: 10;
  position: relative;
  overflow: visible; /* permet à la liste activité de déborder vers le bas */
}

.counter-main {
  font-size: clamp(24px, 7vw, 38px);
  font-weight: 900;
  color: var(--accent2);
  text-align: center;
  line-height: 1;
  text-shadow: 0 0 20px rgba(255,215,0,0.5);
  letter-spacing: -1px;
}
.counter-label {
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 3px;
  color: var(--text2);
  margin-top: 2px;
  text-transform: uppercase;
}
.level-bar-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  padding: 0 4px;
}
.level-label { font-size: 10px; font-weight: 800; color: var(--accent2); white-space: nowrap; min-width: 50px; }
.level-bar-track { flex: 1; height: 4px; background: rgba(255,255,255,0.1); border-radius: 3px; overflow: hidden; }
.level-bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent2), var(--accent)); border-radius: 3px; transition: width 0.4s ease; width: 0%; }
.level-next-xp { font-size: 9px; color: var(--text3); white-space: nowrap; min-width: 56px; text-align: right; }

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

/* ── Contenu scrollable ── */
#content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  position: relative;
  z-index: 0;
}
#content::-webkit-scrollbar { width: 3px; }
#content::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 2px; }

.tab-panel { padding: 0 12px 20px; }
.tab-panel.hidden { display: none; }
.tab-panel[data-panel="farm"] {
  position: relative;
  height: 100%;
  padding: 0;
  overflow: hidden;
}
[data-panel="shop"] {
  height: 100%;
  overflow-y: auto;
  padding: 12px 12px 24px;
  box-sizing: border-box;
}

/* ── Navigation bottom — FIXED ── */
#nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: flex-start;
  padding-top: 4px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(5, 5, 16, 0.98);
  border-top: 1px solid rgba(73,150,204,0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 200;
  padding-left: 4px;
  padding-right: 4px;
}
.nav-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text3);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 6px 2px;
  border-radius: 10px;
  transition: color 0.2s, background 0.2s;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  height: var(--nav-h);
}
.nav-tab .nav-icon { font-size: 18px; line-height: 1; }
.nav-tab.active { color: var(--accent); background: rgba(247,147,26,0.08); }
.nav-tab.active::after {
  content: '';
  position: absolute;
  top: 0; left: 20%; right: 20%;
  height: 2px;
  background: var(--accent);
  border-radius: 0 0 3px 3px;
}
.nav-tab:active { background: rgba(255,255,255,0.05); }

/* ── Header counters ── */
.header-counters { display: flex; align-items: center; justify-content: center; gap: 12px; }
.usdc-balance-wrap {
  display: flex; flex-direction: column; align-items: center; cursor: pointer;
  padding: 3px 10px; border-radius: 10px;
  border: 1px solid rgba(38,161,123,0.3); background: rgba(38,161,123,0.08);
  transition: background .2s; min-width: 64px;
}
.usdc-balance-amount { font-size: clamp(14px, 4vw, 20px); font-weight: 900; color: #26a17b; line-height: 1; }
.usdc-balance-label { font-size: 8px; font-weight: 700; letter-spacing: 2px; color: #26a17b; opacity: .7; text-transform: uppercase; margin-top: 1px; }

/* ── Activity bar ── */
.activity-bar {
  width: 100%;
  border-bottom: 1px solid rgba(142,68,173,0.2);
  position: relative;
  z-index: 20;
  overflow: visible;
}
.activity-bar-handle {
  display: flex; align-items: center; gap: 6px; padding: 4px 12px;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  user-select: none; min-height: 28px;
}
.activity-bar-handle:active { background: rgba(142,68,173,0.08); }
.activity-bar-left { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
.activity-bar-title { font-size: 9px; font-weight: 800; color: #8e44ad; letter-spacing: 1px; text-transform: uppercase; }
.activity-badge { background: #e30021; color: #fff; font-size: 8px; font-weight: 900; border-radius: 8px; padding: 1px 5px; min-width: 16px; text-align: center; }
.activity-badge.hidden { display: none; }
.activity-bar-preview { flex: 1; font-size: 9px; color: rgba(255,255,255,0.35); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-bar-arrow { font-size: 10px; color: rgba(255,255,255,0.3); flex-shrink: 0; transition: transform 0.25s; }
.activity-bar.open .activity-bar-arrow { transform: rotate(180deg); }
/* Liste dépliée — position absolute pour ne pas pousser le header */
.activity-list {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  top: var(--header-h);
  max-height: 220px;
  overflow-y: auto;
  background: rgba(5,3,15,0.98);
  border: 1px solid rgba(142,68,173,0.3);
  border-top: none;
  border-radius: 0 0 12px 12px;
  z-index: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  pointer-events: all;
}
.activity-list.hidden { display: none; }
.activity-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid rgba(255,255,255,0.04); }
.activity-item:last-child { border-bottom: none; }
.activity-item-icon { font-size: 15px; min-width: 20px; text-align: center; flex-shrink: 0; }
.activity-item-text { flex: 1; font-size: 11px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-item-time { font-size: 9px; color: rgba(255,255,255,0.3); flex-shrink: 0; }
.activity-empty { padding: 14px; text-align: center; font-size: 11px; color: rgba(255,255,255,0.25); }

/* ── Bouton mute ── */
.btn-mute {
  position: absolute; top: 10px; right: 12px;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 50%; width: 28px; height: 28px; font-size: 13px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; z-index: 15;
}
.btn-mute.muted { opacity: 0.4; }

/* ── Sections ── */
.section-title { font-size: 11px; font-weight: 800; letter-spacing: 3px; text-transform: uppercase; color: var(--text2); margin: 16px 0 8px; }

/* ── Buildings ── */
.building-card { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid rgba(255,255,255,0.06); border-radius: 14px; padding: 12px; margin-bottom: 8px; position: relative; overflow: hidden; }
.building-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--bcolor, var(--accent)); border-radius: 14px 0 0 14px; }
.building-card.affordable { border-color: var(--bcolor, var(--accent)); background: var(--card2); }
.building-card.locked { opacity: 0.4; }
.bld-emoji { font-size: 28px; width: 36px; text-align: center; flex-shrink: 0; }
.bld-info { flex: 1; min-width: 0; }
.bld-name { font-size: 13px; font-weight: 800; color: var(--text); }
.bld-prod { font-size: 11px; color: var(--green); margin-top: 2px; }
.bld-owned-badge { background: rgba(255,255,255,0.08); border-radius: 8px; padding: 4px 10px; font-size: 13px; font-weight: 900; color: var(--text2); min-width: 40px; text-align: center; flex-shrink: 0; }
.bld-buy-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; border: none; border-radius: 10px; padding: 8px 12px; cursor: pointer; min-width: 72px; flex-shrink: 0; font-weight: 800; }
.bld-buy-btn:active { transform: scale(0.92); }
.bld-buy-btn.can-afford { background: var(--bcolor, var(--accent)); }
.bld-buy-btn.cant-afford { background: rgba(255,255,255,0.06); cursor: not-allowed; opacity: 0.5; }
.bld-cost { font-size: 12px; color: #fff; }

/* ── Upgrades ── */
.upgrade-section-title { font-size: 11px; font-weight: 800; letter-spacing: 2px; color: var(--text2); text-transform: uppercase; margin: 16px 0 6px; }
.upgrade-card { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid rgba(255,255,255,0.06); border-radius: 12px; padding: 10px 12px; margin-bottom: 6px; }
.upgrade-card.bought { opacity: 0.5; }
.upgrade-card.locked { opacity: 0.35; }
.upgrade-card.affordable { border-color: var(--accent); background: var(--card2); }
.upg-emoji { font-size: 24px; width: 32px; text-align: center; flex-shrink: 0; }
.upg-info { flex: 1; }
.upg-name { font-size: 13px; font-weight: 800; }
.upg-desc { font-size: 11px; color: var(--text2); margin-top: 2px; }
.upg-cost { font-size: 11px; color: var(--accent); margin-top: 2px; font-weight: 700; }
.upg-req { font-size: 10px; color: var(--text3); }
.upg-buy-btn { border: none; border-radius: 8px; padding: 6px 12px; font-size: 11px; font-weight: 800; cursor: pointer; flex-shrink: 0; }
.upg-buy-btn:active { transform: scale(0.92); }
.upg-buy-btn.can-afford { background: var(--accent); color: #000; }
.upg-buy-btn.cant-afford { background: rgba(255,255,255,0.08); color: var(--text3); cursor: not-allowed; }

/* ── Achievements ── */
.ach-count { text-align: center; color: var(--text2); font-size: 12px; margin: 8px 0 12px; }
.ach-card { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 12px; padding: 10px 12px; margin-bottom: 6px; border: 1px solid rgba(255,255,255,0.06); }
.ach-card.unlocked { border-color: rgba(255,215,0,0.25); }
.ach-card.locked { opacity: 0.35; }
.ach-emoji { font-size: 24px; width: 32px; }
.ach-info { flex: 1; }
.ach-name { font-size: 13px; font-weight: 800; }
.ach-desc { font-size: 11px; color: var(--text2); }
.ach-date { font-size: 10px; color: var(--text3); margin-top: 2px; }
.ach-check { font-size: 18px; color: var(--accent2); }

/* ── Leaderboard ── */
.leaderboard-header { text-align: center; padding: 20px 0 12px; }
.leaderboard-icon { font-size: 40px; }
.leaderboard-title { font-size: 18px; font-weight: 900; color: var(--accent2); letter-spacing: 2px; display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.leaderboard-loading, .leaderboard-error { text-align: center; color: var(--text2); font-size: 13px; padding: 30px 12px; }
.leaderboard-auth-required { text-align: center; background: var(--card); border-radius: 12px; padding: 24px 16px; }
.leaderboard-auth-required p { color: var(--text2); font-size: 13px; margin-bottom: 14px; line-height: 1.6; }
.leaderboard-login-btn { display: inline-block; background: var(--blue); color: #fff; text-decoration: none; border-radius: 10px; padding: 10px 20px; font-size: 13px; font-weight: 800; }
.leaderboard-list { display: flex; flex-direction: column; gap: 6px; padding-bottom: 20px; }
.leaderboard-row { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 10px; padding: 10px 14px; font-size: 13px; }
.leaderboard-row-me { border: 1px solid var(--blue); background: rgba(73,150,204,0.08); }
.leaderboard-rank { flex-shrink: 0; width: 32px; font-weight: 900; color: var(--accent2); text-align: center; }
.leaderboard-username { flex: 1; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leaderboard-score { flex-shrink: 0; font-weight: 800; color: var(--text2); }

/* ── Banners ── */
#event-banner {
  position: fixed; top: 12px; left: 50%;
  transform: translateX(-50%) translateY(-80px);
  z-index: 60; background: rgba(10,5,20,0.95);
  border: 1px solid var(--ecolor, var(--purple)); border-radius: 20px;
  padding: 8px 16px; display: flex; align-items: center; gap: 8px;
  backdrop-filter: blur(10px);
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1);
  white-space: nowrap;
}
#event-banner.visible { transform: translateX(-50%) translateY(0); }
#malus-banner {
  position: fixed; top: 56px; left: 50%;
  transform: translateX(-50%) translateY(-80px);
  z-index: 60; background: rgba(20,2,5,0.97);
  border: 1px solid var(--mcolor, #8e44ad); border-radius: 20px;
  padding: 8px 16px; display: flex; align-items: center; gap: 8px;
  backdrop-filter: blur(10px);
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1);
  white-space: nowrap;
}
#malus-banner.visible { transform: translateX(-50%) translateY(0); }
.malus-name { font-size: 13px; font-weight: 900; color: var(--mcolor, #8e44ad); }
.malus-desc { font-size: 11px; color: var(--text2); }
#malus-timer { font-size: 13px; font-weight: 700; color: var(--text2); }
.event-name { font-size: 13px; font-weight: 900; color: var(--ecolor, var(--purple)); }
.event-desc { font-size: 10px; color: var(--text2); }
#event-timer { font-size: 11px; color: var(--text2); margin-left: 4px; }

/* ── Click bonus btn ── */
.click-bonus-btn {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 80; width: 130px; height: 130px; border-radius: 50%;
  border: 4px solid #fff;
  background: radial-gradient(circle at 35% 30%, #FFD700, var(--accent));
  box-shadow: 0 0 40px rgba(255,215,0,0.7);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  cursor: pointer; animation: click-bonus-breathe 0.9s ease-in-out infinite;
}
.click-bonus-btn.hidden { display: none; }
.click-bonus-icon { font-size: 38px; line-height: 1; }
.click-bonus-label { font-size: 12px; font-weight: 900; color: #000; text-align: center; }
.click-bonus-pulse { animation: click-bonus-tap 0.12s ease-out; }
@keyframes click-bonus-breathe {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.03); }
}
@keyframes click-bonus-tap {
  0% { transform: translate(-50%, -50%) scale(0.85); }
  100% { transform: translate(-50%, -50%) scale(1); }
}

/* ── Notifications ── */
#notif-container {
  position: fixed; top: calc(var(--header-h) + 8px);
  left: 50%; transform: translateX(-50%);
  z-index: 70; display: flex; flex-direction: column; gap: 4px;
  width: min(380px, 90vw); pointer-events: none;
}
.notif {
  background: var(--card2); border-radius: 10px; padding: 10px 14px;
  font-size: 13px; font-weight: 600; text-align: center;
  opacity: 0; transform: translateY(-8px);
  transition: opacity 0.3s, transform 0.3s;
  border-left: 3px solid var(--accent);
}
.notif.show { opacity: 1; transform: translateY(0); }
.notif-warning { border-color: var(--red); }
.notif-success { border-color: var(--green); }
.notif-reward { border-color: var(--green); background: rgba(39,174,96,0.08); }

/* ── Modals ── */
#daily-modal {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(0,0,0,0.85); display: none;
  align-items: center; justify-content: center; backdrop-filter: blur(8px);
}
#daily-modal.visible { display: flex; }
.daily-box { background: var(--bg3); border: 1px solid var(--accent); border-radius: 20px; padding: 28px 24px; text-align: center; max-width: 300px; width: 90%; }
.daily-icon { font-size: 48px; margin-bottom: 8px; }
.daily-title { font-size: 18px; font-weight: 900; color: var(--accent); margin-bottom: 4px; }
.daily-streak { font-size: 13px; color: var(--text2); margin-bottom: 12px; }
.daily-amount { font-size: 26px; font-weight: 900; color: var(--accent2); margin-bottom: 16px; }
.daily-claim { background: var(--accent); color: #000; border: none; border-radius: 12px; padding: 12px 24px; font-size: 15px; font-weight: 900; cursor: pointer; width: 100%; }

#offline-modal { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,0.85); display: none; align-items: center; justify-content: center; }
#offline-modal.visible { display: flex; }
.offline-box { background: var(--bg3); border: 1px solid var(--blue); border-radius: 20px; padding: 24px; text-align: center; max-width: 300px; width: 90%; }

/* ══ FERME ISOMÉTRIQUE ══ */
.farm-view { position: absolute; inset: 0; }
.elec-bill-banner {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  z-index: 50; display: flex; align-items: center; gap: 10px;
  background: rgba(20,5,5,0.92); border: 1px solid #e30021; border-radius: 14px;
  padding: 8px 14px; backdrop-filter: blur(8px); white-space: nowrap;
}
.elec-bill-banner.hidden { display: none; }
#elec-bill-text { font-size: 13px; font-weight: 700; color: #fff; }
.elec-pay-btn { background: #e30021; color: #fff; border: none; border-radius: 8px; padding: 5px 12px; font-size: 12px; font-weight: 800; cursor: pointer; }
.farm-map-view { position: absolute; inset: 0; }
.farm-map-view.hidden { display: none; }
#farm-collect-badges { position: absolute; inset: 0; pointer-events: none; }
.farm-map-badge {
  position: absolute; top: 0; left: 0; pointer-events: all;
  width: 36px; height: 36px; border-radius: 50%; border: 2px solid #fff;
  font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  margin-left: -18px; margin-top: -18px; -webkit-tap-highlight-color: transparent;
}
.farm-map-badge-collect { background: radial-gradient(circle at 35% 30%, #ff6b35, #e30021); box-shadow: 0 2px 8px rgba(227,0,33,0.6); animation: collect-badge-pulse 1s ease-in-out infinite; }
.farm-map-badge-electric { background: radial-gradient(circle at 35% 30%, #ffe066, #f0a500); box-shadow: 0 2px 8px rgba(240,165,0,0.7); animation: electric-badge-pulse 1.2s ease-in-out infinite; }
@keyframes collect-badge-pulse { 0%,100% { box-shadow: 0 2px 8px rgba(227,0,33,0.6); } 50% { box-shadow: 0 2px 16px rgba(227,0,33,0.9); } }
@keyframes electric-badge-pulse { 0%,100% { box-shadow: 0 2px 8px rgba(240,165,0,0.7); } 50% { box-shadow: 0 2px 16px rgba(240,165,0,1); } }
#farm-canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
#farm-canvas:active { cursor: grabbing; }
.farm-hangar-view { position: absolute; inset: 0; padding: 16px 12px; overflow-y: auto; }
.farm-hangar-view.hidden { display: none; }
.farm-hangar-back { background: var(--card2); color: var(--text); border: 1px solid rgba(255,255,255,0.08); border-radius: 10px; padding: 8px 14px; font-size: 13px; font-weight: 700; cursor: pointer; margin-bottom: 12px; }
.farm-hangar-title-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.farm-hangar-title-sprite { width: 48px; height: 48px; object-fit: contain; flex-shrink: 0; }
.farm-hangar-title { font-size: 18px; font-weight: 900; color: var(--blue); }
.farm-upgrade-panel { display: flex; align-items: center; justify-content: space-between; background: var(--card); border: 1px solid rgba(73,150,204,0.25); border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; font-size: 13px; }
.farm-upgrade-btn { background: var(--blue); color: #fff; border: none; border-radius: 8px; padding: 7px 14px; font-size: 12px; font-weight: 800; cursor: pointer; }
.farm-upgrade-building { border-color: rgba(253,221,7,0.3); color: var(--accent2); }
.farm-upgrade-countdown { font-weight: 800; }
.farm-upgrade-maxed { border-color: rgba(255,215,0,0.3); color: var(--accent2); justify-content: center; }
.farm-hangar-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.farm-hangar-capacity { font-size: 13px; font-weight: 800; }
.farm-add-miner-btn { background: var(--blue); color: #fff; border: none; border-radius: 10px; padding: 9px 16px; font-size: 12px; font-weight: 800; cursor: pointer; }
.farm-add-miner-btn:disabled { background: rgba(255,255,255,0.08); color: var(--text3); cursor: not-allowed; }
.farm-hangar-list { display: flex; flex-direction: column; gap: 10px; padding-bottom: 20px; }
.farm-miner-empty-hint { text-align: center; color: var(--text3); font-size: 13px; padding: 30px 0; }
.farm-miner-card { display: flex; flex-direction: column; align-items: center; gap: 10px; background: var(--card); border: 1px solid rgba(255,255,255,0.06); border-radius: 16px; padding: 16px; }
.farm-miner-sprite-wrap { flex-shrink: 0; width: 180px; height: 180px; display: flex; align-items: center; justify-content: center; }
.farm-miner-sprite { max-width: 100%; max-height: 100%; object-fit: contain; }
.farm-miner-sprite-building { opacity: 0.45; filter: grayscale(0.6); }
.farm-miner-info { width: 100%; text-align: center; }
@media (min-width: 460px) {
  .farm-miner-card { flex-direction: row; align-items: center; }
  .farm-miner-sprite-wrap { width: 100px; height: 100px; }
  .farm-miner-info { text-align: left; }
}
.farm-miner-info { flex: 1; min-width: 0; }
.farm-miner-name { font-size: 13px; font-weight: 800; margin-bottom: 6px; }
.farm-miner-countdown { font-size: 13px; font-weight: 800; color: var(--accent2); }
.farm-miner-stock-track { width: 100%; height: 6px; background: rgba(255,255,255,0.06); border-radius: 4px; overflow: hidden; margin-bottom: 8px; }
.farm-miner-stock-fill { height: 100%; background: linear-gradient(90deg, var(--blue), var(--accent2)); transition: width 0.3s; }
.farm-miner-actions { display: flex; gap: 8px; }
.farm-miner-btn { border: none; border-radius: 8px; padding: 7px 12px; font-size: 11px; font-weight: 800; cursor: pointer; }
.farm-miner-btn-collect { background: var(--blue); color: #fff; }
.farm-miner-btn-pay { background: var(--red); color: #fff; }
.farm-miner-off { border-color: rgba(231,76,60,0.4); background: rgba(231,76,60,0.06); }
.farm-miner-building { border-color: rgba(253,221,7,0.25); }
.farm-miner-upgrade-col { flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 90px; width: 100%; }
@media (min-width: 460px) { .farm-miner-upgrade-col { width: auto; } }
.farm-miner-btn-upgrade { background: var(--accent); color: #000; width: 100%; }
.farm-miner-upgrade-time { font-size: 10px; color: var(--text3); }
.farm-miner-maxed { font-size: 12px; font-weight: 800; color: var(--accent2); }
.hangars-empty-hint { text-align: center; color: var(--text3); font-size: 13px; padding: 30px 12px; }
.hangar-list-card { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid rgba(255,255,255,0.06); border-radius: 16px; padding: 12px 14px; margin-bottom: 10px; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.hangar-list-card:hover { border-color: var(--blue); background: rgba(73,150,204,0.06); }
.hangar-list-card-building { cursor: default; border-color: rgba(253,221,7,0.25); }
.hangar-list-sprite-wrap { flex-shrink: 0; width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; font-size: 28px; }
.hangar-list-sprite { max-width: 100%; max-height: 100%; object-fit: contain; }
.hangar-list-info { flex: 1; min-width: 0; }
.hangar-list-name { font-size: 14px; font-weight: 800; margin-bottom: 4px; }
.hangar-list-sub { font-size: 12px; color: var(--text2); }
.hangar-list-arrow { flex-shrink: 0; color: var(--text3); font-size: 14px; }
.world-toggle-btn {
  position: absolute; top: 52px; right: 12px; z-index: 20;
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.15); background: rgba(10,10,30,0.85);
  font-size: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(6px); -webkit-tap-highlight-color: transparent;
}
.world-toggle-btn:active { transform: scale(0.9); }
.world-toggle-btn.active { border-color: #4996cc; box-shadow: 0 0 10px rgba(73,150,204,0.5); }
.farm-world-view { position: absolute; inset: 0; overflow: hidden; touch-action: none; }
.farm-world-view.hidden { display: none; }
#world-canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }

/* ══ BOUTIQUE ══ */
.shop-header { text-align: center; padding: 8px 0 16px; }
.shop-title { font-size: 1.4rem; font-weight: 700; color: #f5a623; margin: 0 0 4px; }
.shop-subtitle { font-size: 0.75rem; color: #888; }
.shop-category { margin-bottom: 20px; }
.shop-cat-label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #666; margin-bottom: 8px; padding-left: 2px; }
.shop-card { display: flex; align-items: center; gap: 12px; background: #1a1a2e; border: 1px solid #2a2a4a; border-radius: 12px; padding: 12px; margin-bottom: 8px; }
.shop-card:active { transform: scale(.98); }
.shop-card-sprite { width: 56px; height: 56px; object-fit: contain; min-width: 56px; border-radius: 6px; padding: 2px; }
.shop-card-body { flex: 1; min-width: 0; }
.shop-card-name { font-size: .9rem; font-weight: 700; color: #eee; margin-bottom: 2px; }
.shop-card-desc { font-size: .72rem; color: #888; line-height: 1.3; }
.shop-buy-btn { background: linear-gradient(135deg, #f5a623, #e67e22); color: #fff; font-weight: 700; font-size: .8rem; border: none; border-radius: 8px; padding: 8px 12px; white-space: nowrap; cursor: pointer; min-width: 72px; text-align: center; }
.shop-buy-btn:active { transform: scale(.95); }
.shop-buy-btn--owned, .shop-buy-btn:disabled { background: #333; color: #555; cursor: default; }
.shop-buy-btn--usdc { background: linear-gradient(135deg, #26a17b, #1a7a5e); }
.shop-buy-btn--low { background: #222; color: #555; border: 1px dashed #333; }
.shop-footer { text-align: center; font-size: .7rem; color: #555; padding-top: 8px; }
.shop-recharge-btn { display: block; width: 100%; background: rgba(38,161,123,.12); border: 1px solid rgba(38,161,123,.35); color: #26a17b; font-size: .82rem; font-weight: 700; padding: 12px 0; border-radius: 12px; cursor: pointer; margin-top: 8px; }
.usdc-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.78); z-index: 9100; display: flex; align-items: flex-end; justify-content: center; }
.usdc-modal { background: #0f0f23; border: 1px solid #2a2a4a; border-radius: 20px 20px 0 0; padding: 20px 20px 36px; width: 100%; max-width: 480px; position: relative; }
.usdc-modal-close { position: absolute; top: 14px; right: 16px; background: #1a1a2e; border: 1px solid #333; border-radius: 50%; width: 32px; height: 32px; font-size: 1rem; color: #aaa; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.usdc-modal-title { font-size: 1.2rem; font-weight: 800; color: #26a17b; margin-bottom: 4px; text-align: center; }
.usdc-modal-sub { font-size: .72rem; color: #666; text-align: center; margin-bottom: 18px; }
.usdc-current-balance { background: rgba(38,161,123,.1); border: 1px solid rgba(38,161,123,.25); border-radius: 12px; padding: 12px 16px; text-align: center; margin-bottom: 18px; }
.usdc-current-balance-val { font-size: 1.8rem; font-weight: 900; color: #26a17b; }
.usdc-current-balance-label { font-size: .7rem; color: #26a17b; opacity: .7; font-weight: 600; text-transform: uppercase; letter-spacing: 2px; }
.usdc-deposit-section { background: #1a1a2e; border: 1px solid #2a2a4a; border-radius: 14px; padding: 16px; margin-bottom: 14px; }
.usdc-deposit-title { font-size: .78rem; font-weight: 700; color: #aaa; margin-bottom: 12px; text-align: center; }
.usdc-deposit-hint { font-size: .66rem; color: #555; text-align: center; }
.usdc-history-title { font-size: .72rem; font-weight: 700; color: #555; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.usdc-history-row { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid #1a1a2e; font-size: .72rem; }
.usdc-history-amount { color: #26a17b; font-weight: 700; }
.usdc-history-type { color: #888; }
.usdc-history-date { color: #444; font-size: .62rem; }
.usdc-paliers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0; }
.usdc-palier-btn { display: flex; flex-direction: column; align-items: center; padding: 10px 4px; border-radius: 10px; border: 2px solid #f5a623; background: rgba(245,166,35,0.08); cursor: pointer; gap: 2px; }
.usdc-palier-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.usdc-palier-val { font-size: 1.1rem; font-weight: 800; color: #f5a623; }
.usdc-palier-label { font-size: .6rem; color: #888; text-transform: uppercase; }
.promo-active-bar { background: linear-gradient(90deg, rgba(46,204,113,0.15), rgba(46,204,113,0.05)); border: 1px solid rgba(46,204,113,0.4); border-radius: 10px; padding: 8px 14px; font-size: .78rem; color: #2ecc71; margin: 0 0 10px; text-align: center; }
.promo-input-wrap { display: flex; gap: 8px; margin: 10px 0 6px; }
.promo-input { flex: 1; background: rgba(255,255,255,0.06); border: 1.5px solid rgba(255,255,255,0.15); border-radius: 10px; color: #fff; padding: 10px 14px; font-size: .85rem; outline: none; text-transform: uppercase; }
.promo-input:focus { border-color: #f5a623; }
.promo-submit-btn { background: #f5a623; color: #000; border: none; border-radius: 10px; padding: 10px 16px; font-weight: 800; font-size: .85rem; cursor: pointer; white-space: nowrap; }
.promo-submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.promo-msg { font-size: .75rem; min-height: 18px; text-align: center; }

/* ══ TUTORIAL ══ */
#tuto-overlay { position: fixed; inset: 0; z-index: 1000; pointer-events: none; }
.tuto-bubble { position: fixed; z-index: 1100; animation: tuto-pop .25s cubic-bezier(.34,1.56,.64,1) both; }
@keyframes tuto-pop { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: scale(1); } }
.tuto-bubble-inner { background: linear-gradient(135deg, #0d1f35, #112233); border: 1.5px solid #4996cc; border-radius: 16px; padding: 20px; box-shadow: 0 8px 32px rgba(0,0,0,.6); }
.tuto-step-counter { font-size: 11px; font-weight: 700; color: #4996cc; text-transform: uppercase; letter-spacing: .8px; margin-bottom: 8px; }
.tuto-title { font-size: 17px; font-weight: 900; color: #fff; margin-bottom: 10px; line-height: 1.3; }
.tuto-text { font-size: 14px; color: rgba(255,255,255,.75); line-height: 1.55; margin-bottom: 16px; }
.tuto-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tuto-btn { border: none; border-radius: 10px; padding: 9px 18px; font-size: 14px; font-weight: 800; cursor: pointer; }
.tuto-btn-next { background: #4996cc; color: #fff; flex: 1; }
.tuto-btn-quit { background: transparent; color: rgba(255,255,255,.35); font-size: 12px; padding: 6px 10px; border: 1px solid rgba(255,255,255,.15); border-radius: 8px; }
.tuto-waiting { font-size: 12px; color: #f7931a; font-weight: 700; animation: tuto-pulse 1.5s ease-in-out infinite; }
@keyframes tuto-pulse { 0%,100% { opacity: 1; } 50% { opacity: .5; } }
.tuto-highlight { outline: 3px solid #f7931a !important; outline-offset: 4px !important; border-radius: 10px !important; position: relative; z-index: 1050; animation: tuto-glow 1.2s ease-in-out infinite; }
@keyframes tuto-glow { 0%,100% { box-shadow: 0 0 0 4px rgba(247,147,26,.18); } 50% { box-shadow: 0 0 0 10px rgba(247,147,26,.35); } }

@media (min-width: 768px) {
  #app { max-width: 900px; }
  #nav { max-width: 900px; }
  #content { padding: 16px 32px 0; }
}
@media (min-width: 1200px) {
  #app { max-width: 1200px; }
  #nav { max-width: 1200px; }
}
@media (max-width: 360px) {
  .nav-tab .nav-icon { font-size: 16px; }
  .nav-tab { font-size: 7px; }
}
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-thumb { background: rgba(247,147,26,0.3); border-radius: 2px; }

/* ══ ARBRE DE COMPÉTENCES ══ */
.skill-header { text-align:center; padding:16px 0 12px; }
.skill-header-title { font-size:1.2rem; font-weight:900; color:var(--accent2); }
.skill-header-sub { font-size:.75rem; color:var(--text3); margin-top:4px; }
.skill-branches { display:flex; flex-direction:column; gap:20px; padding-bottom:24px; }
.skill-branch { background:var(--card); border:1px solid rgba(255,255,255,0.06); border-radius:16px; padding:14px; }
.skill-branch-title { font-size:.85rem; font-weight:900; letter-spacing:1px; margin-bottom:12px; }
.skill-list { display:flex; flex-direction:column; gap:8px; }
.skill-card { display:flex; align-items:center; gap:10px; background:rgba(255,255,255,0.03); border:1px solid rgba(255,255,255,0.06); border-radius:12px; padding:10px 12px; }
.skill-card.skill-locked { opacity:.45; }
.skill-card.skill-active { border-color:rgba(255,215,0,0.2); background:rgba(255,215,0,0.04); }
.skill-icon { width:36px; height:36px; border-radius:10px; border:1px solid; display:flex; align-items:center; justify-content:center; font-size:18px; flex-shrink:0; }
.skill-info { flex:1; min-width:0; }
.skill-name { font-size:.82rem; font-weight:800; color:var(--text); margin-bottom:2px; display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.skill-level-badge { font-size:.65rem; font-weight:900; border-radius:99px; padding:1px 7px; color:#000; }
.skill-desc { font-size:.7rem; color:var(--text2); line-height:1.3; }
.skill-requires { font-size:.65rem; color:var(--text3); margin-top:3px; }
.skill-buy-btn { border:none; border-radius:10px; padding:7px 10px; font-size:.72rem; font-weight:800; cursor:pointer; min-width:72px; text-align:center; flex-shrink:0; white-space:nowrap; transition:transform .1s; }
.skill-buy-btn:active { transform:scale(.93); }
.skill-btn-afford { background:linear-gradient(135deg,var(--accent2),var(--accent)); color:#000; }
.skill-btn-poor { background:rgba(255,255,255,0.06); color:var(--text3); border:1px dashed rgba(255,255,255,0.1); cursor:not-allowed; }
.skill-btn-locked { background:rgba(255,255,255,0.04); color:var(--text3); cursor:not-allowed; }
