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

:root {
  --bg: #fdf8f1;
  --card: #ffffff;
  --border: #e6e0d6;
  --text: #1f2a44;
  --muted: #7a8196;
  --green: #1fa84a;
  --orange: #f08a1c;
  --blue: #3a7be0;
  --purple: #7a4de0;
  --red: #e53950;
  --shadow: 0 2px 8px rgba(40, 30, 10, .08);
}

body {
  background: #2a2a30;
  font-family: 'Segoe UI', system-ui, -apple-system, 'Noto Sans', 'Noto Sans SC', 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans', 'Yu Gothic', 'Meiryo', sans-serif;
  color: var(--text);
  display: flex;
  justify-content: center;
}

.app {
  width: 100%;
  max-width: 440px;
  height: 100vh;
  height: var(--app-h, 100dvh);   /* hauteur réellement visible (barres du navigateur mobile exclues), mise à jour par settings.js */
  max-height: 960px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.content {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px 6px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: none;
}
.content::-webkit-scrollbar { display: none; }

.card {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.green { color: var(--green); }
.orange { color: var(--orange); }

/* ===== TOP BAR ===== */
.topbar {
  margin: 8px 10px 0;
  padding: 8px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}
.top-stat { display: flex; align-items: center; gap: 5px; min-width: 0; }
.top-ico {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 17px; color: #fff; flex-shrink: 0;
}
.top-ico.btc { background: #f7931a; }
.top-ico.usd { background: none; color: #1fa84a; font-size: 26px; }
.top-ico.block { background: none; color: var(--blue); font-size: 26px; }
.top-ico.hash { background: none; color: var(--purple); font-size: 26px; }
.top-val { font-size: 11.5px; font-weight: 800; white-space: nowrap; }
.top-sub { font-size: 10px; font-weight: 600; color: var(--muted); }
.top-sub.green { color: var(--green); }
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: #cfe3f7; border: 2px solid #fff; box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center; font-size: 22px;
  flex-shrink: 0;
}

/* ===== TITRE ===== */
.title-row { display: flex; justify-content: space-between; align-items: flex-start; }
.title-row > div:first-child { flex: 1; }
h1 { font-size: 24px; font-weight: 800; }
h2 { font-size: 16px; font-weight: 800; margin-bottom: 6px; }
.subtitle { font-size: 12px; color: var(--muted); margin: 2px 0 5px; }
.title-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.pct { font-size: 12px; color: var(--muted); font-weight: 700; }

.btn-outline {
  background: #fff; border: 1.5px solid var(--border); border-radius: 12px;
  padding: 9px 12px; font-weight: 800; font-size: 13px; color: var(--text);
  cursor: pointer; box-shadow: var(--shadow);
}
.btn-outline.small { padding: 6px 12px; font-size: 12px; }
.btn-outline:active { transform: scale(.96); }

.progress { background: #ece6da; border-radius: 10px; height: 20px; position: relative; overflow: hidden; }
.progress.thin { height: 8px; width: 170px; }
.progress-fill { height: 100%; border-radius: 10px; transition: width .4s; }
.progress-fill.orange { background: linear-gradient(#ffb43a, #f08a1c); }
.progress-fill.blue { background: linear-gradient(#6aa8ff, #3a7be0); }

/* ===== SCÈNE ISOMÉTRIQUE (CSS) ===== */
.scene {
  position: relative;
  height: 250px;
  border-radius: 16px;
  overflow: hidden;
  background: #f7efe0;
  flex-shrink: 0;
}
.scene > * { position: absolute; }
.scene-wall { inset: 0 0 38% 0; background: linear-gradient(#f4ece0, #ece2d0); }
.scene-floor { inset: 62% 0 0 0; background: repeating-linear-gradient(90deg, #e0b887 0 28px, #d6ab78 28px 30px); }
.s-window { left: 50%; top: 12%; width: 22%; height: 38%; background: linear-gradient(#8ec9ee, #bfe3f5 60%, #7fb36b); border: 5px solid #f4f1ea; box-shadow: 0 0 0 2px #cfc6b3; }
.s-curtain { top: 8%; width: 7%; height: 46%; background: repeating-linear-gradient(90deg, #6f95d2 0 5px, #82a6e0 5px 10px); border-radius: 0 0 8px 8px; }
.s-curtain.l { left: 45%; } .s-curtain.r { left: 73%; }
.s-poster { background: #fff7e4; border: 4px solid #a67a49; text-align: center; font-weight: 800; box-shadow: 1px 2px 4px rgba(0,0,0,.2); }
.s-poster.hodl { left: 36%; top: 10%; width: 11%; height: 20%; font-size: 9px; padding-top: 6px; color: #8a5a28; }
.s-poster.hodl span { display: block; margin: 3px auto 0; width: 18px; height: 18px; border-radius: 50%; background: #f7931a; color: #fff; font-size: 12px; line-height: 18px; }
.s-poster.moon { right: 3%; top: 8%; width: 14%; height: 28%; background: #243e86; border-color: #1a2d66; color: #fff; font-size: 8px; padding-top: 5px; line-height: 1.2; }
.s-shelf { left: 3%; top: 28%; width: 20%; height: 9px; background: #b98655; box-shadow: 0 3px 0 #8d6538; display: flex; align-items: flex-end; gap: 2px; padding-left: 4px; }
.s-shelf i { width: 8px; height: 26px; margin-top: -24px; background: #4a6fa5; border-radius: 1px; }
.s-shelf i:nth-child(2) { background: #b04a4a; height: 22px; margin-top: -20px; }
.s-shelf i:nth-child(3) { background: #4a8a5a; }
.s-shelf i:nth-child(4) { background: #d4a43a; height: 20px; margin-top: -18px; }
.s-desk { left: 3%; top: 54%; width: 36%; height: 8px; background: #b98655; box-shadow: 0 4px 0 #8d6538; border-radius: 2px; }
.s-desk::before, .s-desk::after { content: ''; position: absolute; top: 12px; width: 7px; height: 56px; background: #a37245; }
.s-desk::before { left: 4px; } .s-desk::after { right: 4px; }
.s-monitor { left: 10%; top: 33%; width: 17%; height: 21%; background: #12181f; border: 4px solid #2a3340; border-radius: 4px; color: #3ae0ff; text-align: center; font-size: 24px; font-weight: 900; line-height: 52px; text-shadow: 0 0 8px #3ae0ff; }
.s-keyboard { left: 12%; top: 56%; width: 14%; height: 4%; background: #20252c; border-radius: 2px; }
.s-chair { left: 24%; top: 62%; width: 10%; height: 22%; background: #3b5fb0; border-radius: 6px; box-shadow: 0 0 0 3px #a37245; }
.s-bed { left: 50%; top: 48%; width: 38%; height: 28%; background: repeating-linear-gradient(135deg, #4f78c4 0 14px, #5d86d0 14px 28px); border-radius: 8px; border-bottom: 8px solid #a37245; }
.s-pillow { left: 76%; top: 44%; width: 14%; height: 9%; background: #f4f1ea; border-radius: 6px; }
.s-rug { left: 30%; top: 76%; width: 30%; height: 16%; background: #5d86d0; transform: skewX(-30deg); border-radius: 4px; opacity: .9; }
.s-box { right: 4%; top: 72%; width: 14%; height: 17%; background: #c99a5a; border: 2px solid #a37a40; }
.s-backpack { left: 3%; top: 72%; width: 9%; height: 18%; background: #3b5aa6; border-radius: 12px 12px 4px 4px; }
.s-lamp { left: 45%; top: 40%; width: 4%; height: 10%; background: radial-gradient(#ffe88a, #e0b030); border-radius: 50%; box-shadow: 0 0 14px #ffe88a; }
.block-timer {
  left: 8px; right: 8px; bottom: 6px;
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.88); border-radius: 10px; padding: 4px 8px;
  font-size: 11px; font-weight: 700;
}
.block-timer .progress { flex: 1; width: auto; }

/* Animation écran quand on mine */
.s-monitor.pulse { animation: pulse .5s; }
@keyframes pulse { 50% { box-shadow: 0 0 22px #3ae0ff; transform: scale(1.06); } }

/* ===== STATS ===== */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); padding: 10px 4px; }
.stat-box { text-align: center; padding: 0 4px; border-right: 1px solid var(--border); }
.stat-box:last-child { border: 0; }
.stat-label { font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 3px; }
.stat-label .ico { font-size: 15px; }
.ico.purple { color: var(--purple); } .ico.yellow { color: #f2b21c; } .ico.blue { color: var(--blue); } .ico.green { color: var(--green); }
.stat-val { font-size: 17px; font-weight: 800; margin: 6px 0 2px; }
.stat-sub { font-size: 11px; font-weight: 700; }

/* ===== MINEURS ===== */
.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.section-head h2 { margin: 0; }
.miners { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.miner { padding: 8px 5px; text-align: center; position: relative; }
.miner.locked { opacity: .55; filter: grayscale(.8); }
.miner h4 { font-size: 11px; font-weight: 800; }
.miner .lvl { display: inline-block; background: #f1ece2; border-radius: 6px; font-size: 9px; padding: 1px 8px; margin: 3px 0; color: var(--muted); font-weight: 700; }
.miner .pic { font-size: 40px; height: 50px; display: flex; align-items: center; justify-content: center; filter: drop-shadow(0 3px 2px rgba(0,0,0,.25)); }
.m-row { display: flex; justify-content: space-between; font-size: 8.5px; font-weight: 700; margin: 3px 0; }
.m-row b { font-weight: 800; }
.m-row span { color: var(--muted); }
.btn-buy {
  width: 100%; margin-top: 5px; padding: 6px 0;
  background: linear-gradient(#4b8ff0, #2f6bd0); color: #fff;
  border: 0; border-bottom: 3px solid #1f4fa0; border-radius: 7px;
  font-weight: 800; font-size: 9.5px; cursor: pointer;
}
.btn-buy:active { transform: translateY(2px); border-bottom-width: 1px; }
.btn-buy:disabled { background: #b8bfcc; border-bottom-color: #8f96a3; cursor: not-allowed; }
.cost { font-size: 9px; font-weight: 700; color: var(--muted); margin-top: 2px; }

/* ===== ACTIONS RAPIDES ===== */
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.quick-card { text-align: center; padding: 10px 2px; border-radius: 12px; border: 1.5px solid var(--border); cursor: pointer; position: relative; font-weight: 800; transition: transform .1s; }
.quick-card:active { transform: scale(.95); }
.quick-card.orange { background: #fff2e0; }
.quick-card.green { background: #eef0f3; }
.quick-card.blue { background: #e8f1fd; }
.quick-card.red { background: #fde9e4; }
.q-ico { font-size: 32px; }
.q-name { font-size: 11.5px; margin: 2px 0; }
.q-state { font-size: 11.5px; color: var(--muted); }
.quick-card.active .q-state { color: var(--green); }
.notif-dot { position: absolute; top: 8px; right: 8px; width: 9px; height: 9px; background: var(--red); border-radius: 50%; }

/* ===== NAV ===== */
.nav { display: grid; grid-template-columns: repeat(6, 1fr); padding: 4px 6px; background: #fff; border-top: 1.5px solid var(--border); }
.nav-item { display: flex; flex-direction: column; align-items: center; font-size: 10px; font-weight: 700; color: var(--muted); padding: 4px 0; border-radius: 10px; cursor: pointer; }
.nav-item span { font-size: 22px; }
.nav-item.active { background: #fff0dc; color: var(--orange); border: 1.5px solid #f3d6ad; }

/* ===== XP ===== */
.xpbar { margin: 0 10px 8px; padding: 6px 8px; display: flex; align-items: center; gap: 8px; }
.xp-star { font-size: 26px; }
.xpbar .progress { flex: 1; height: 22px; }
.xp-text { position: absolute; inset: 0; text-align: center; line-height: 22px; font-size: 11px; font-weight: 800; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.5); }

/* ===== MODALE TECH ===== */
.modal { position: absolute; inset: 0; background: rgba(20,24,40,.6); z-index: 50; display: flex; align-items: flex-end; }
.modal.hidden, .toast.hidden { display: none; }
.modal-box { background: var(--bg); width: 100%; max-height: 88%; border-radius: 20px 20px 0 0; padding: 14px; overflow-y: auto; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.close { background: #eee; border: 0; width: 32px; height: 32px; border-radius: 50%; font-size: 16px; cursor: pointer; }
.tech-cols { display: flex; flex-direction: column; gap: 14px; }
.tech-cat h3 { font-size: 13px; margin-bottom: 6px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.tech-line { display: flex; align-items: center; gap: 4px; overflow-x: auto; padding-bottom: 4px; }
.tech-arrow { color: var(--muted); font-weight: 900; flex-shrink: 0; }
.tech-node { flex: 0 0 112px; background: #fff; border: 2px solid var(--border); border-radius: 12px; padding: 8px 6px; text-align: center; box-shadow: var(--shadow); }
.tech-node.owned { border-color: var(--green); background: #eaf8ee; }
.tech-node.available { border-color: var(--blue); }
.tech-node.locked { opacity: .5; }
.tech-node .t-ico { font-size: 26px; }
.tech-node .t-name { font-size: 10.5px; font-weight: 800; margin: 2px 0; }
.tech-node .t-desc { font-size: 9px; color: var(--muted); min-height: 24px; }
.tech-node button { margin-top: 4px; width: 100%; border: 0; border-radius: 6px; padding: 5px 0; font-size: 10px; font-weight: 800; background: var(--blue); color: #fff; cursor: pointer; }
.tech-node button:disabled { background: #b8bfcc; }
.tech-node .t-done { font-size: 10px; font-weight: 800; color: var(--green); margin-top: 4px; }

/* ===== TOAST ===== */
.toast { position: absolute; top: 76px; left: 50%; transform: translateX(-50%); background: #1f2a44; color: #fff; padding: 8px 16px; border-radius: 20px; font-size: 12px; font-weight: 700; z-index: 100; box-shadow: 0 4px 10px rgba(0,0,0,.3); }

@media (max-height: 800px) { .scene { height: 190px; } }

/* ---------- Mes Mineurs ---------- */
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.link-btn {
  background: none;
  border: none;
  color: #f7931a;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.95rem;
}
.link-btn:hover { text-decoration: underline; }

.miners-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.miner-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.miner-item.active {
  border-color: #f7931a;
  box-shadow: 0 0 8px rgba(247, 147, 26, 0.35);
}

.miner-rank {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #f7931a;
  color: #000;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.miner-info { flex: 1; min-width: 0; }
.miner-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.miner-stats { font-size: 0.8rem; opacity: 0.75; }

.miner-badge {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 20px;
  background: #2ecc71;
  color: #000;
  font-weight: 700;
  white-space: nowrap;
}
.miner-badge.locked { background: #555; color: #ddd; }

.miner-empty { opacity: 0.6; text-align: center; padding: 12px; }

/* ---------- Modale ---------- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}
.modal.hidden { display: none; }

.modal-content {
  background: #1b1d23;
  color: #fff;
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  border-radius: 14px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.modal-header h2 { font-size: 1.1rem; margin: 0; }
.modal-header span { opacity: 0.6; font-size: 0.85rem; font-weight: 400; }

.close-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
}
/* ===== MENU DE LANCEMENT ===== */
.launch { position: absolute; inset: 0; z-index: 200; background: var(--bg); overflow-y: auto; display: flex; }
.launch.hidden, .ad-layer.hidden { display: none; }
.launch-box { margin: auto; width: 100%; padding: 24px 18px; text-align: center; }
.launch-logo { width: 64px; height: 64px; margin: 0 auto 8px; border-radius: 50%; background: #f7931a; color: #fff;
  font-size: 40px; font-weight: 900; line-height: 64px; box-shadow: var(--shadow); }
.launch form { margin-top: 16px; display: flex; flex-direction: column; gap: 12px; text-align: left; }
.launch label { font-size: 12px; font-weight: 800; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.launch input { background: #fff; border: 1.5px solid var(--border); border-radius: 12px; padding: 11px 12px;
  font: inherit; font-size: 15px; font-weight: 600; color: var(--text); box-shadow: var(--shadow); }
.launch input:focus { outline: none; border-color: var(--orange); }
.launch-ad { padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.launch-ad b { display: block; font-size: 14px; }
.launch-ad small { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.launch-ad.done { border-color: var(--green); }
.launch-ad button:disabled { color: var(--green); cursor: default; }
.launch-err { min-height: 16px; font-size: 12px; font-weight: 700; color: var(--red); }
.btn-primary { border: 0; border-radius: 14px; padding: 14px; font-size: 16px; font-weight: 800; color: #fff; cursor: pointer;
  background: linear-gradient(#ffb43a, var(--orange)); box-shadow: var(--shadow); }
.btn-primary:active { transform: scale(.97); }
.ad-layer { position: absolute; inset: 0; z-index: 10; background: var(--bg); }
.ad-layer iframe { width: 100%; height: 100%; border: 0; }

/* ===== INDICATEUR DE MINAGE ===== */
.mining-dot { display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 50%; background: var(--green);
  animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.s-monitor.mining { animation: glow 2s infinite; }
@keyframes glow { 50% { box-shadow: 0 0 18px #3ae0ff; } }
#minersModal .modal-box { border-radius: 20px; max-width: 420px; color: var(--text); }
#minersModal .miner-item { background: #fff; color: var(--text); border: 1.5px solid var(--border); }

/* ===== BARRE DU HAUT : tout centré ===== */
.topbar { align-items: center; }
.topbar .top-stat { flex: 1; flex-direction: column; justify-content: center; align-items: center; gap: 2px; text-align: center; }
.topbar .top-stat > div:last-child { text-align: center; }
.top-ico { display: flex; align-items: center; justify-content: center; line-height: 1; padding: 0; width: 30px; height: 30px; }
.top-ico.btc { font-size: 18px; padding-top: 1px; }
.top-ico.usd, .top-ico.block, .top-ico.hash { font-size: 24px; }
.top-val, .top-sub { white-space: nowrap; text-align: center; }
.launch-logo { display: flex; align-items: center; justify-content: center; line-height: 1; }

/* ===== AFFICHES AVEC IMAGE (pub cliquable) ===== */
.s-poster.has-img { background: none; border: 0; padding: 0; box-shadow: none; overflow: hidden; border-radius: 2px; }
.s-poster.has-img a, .s-poster.has-img img { display: block; width: 100%; height: 100%; }
.s-poster.has-img img { object-fit: fill; }
.s-poster.has-img a { cursor: pointer; }
/* pubs carrées : on garde les proportions 1:1 */
.s-poster.has-img { height: auto; aspect-ratio: 1 / 1; }
.s-poster.has-img img { object-fit: cover; }

/* ===== PIOCHE QUI FRAPPE ===== */
.pick { display: inline-block; transform-origin: 85% 90%; animation: swing .9s ease-in infinite; }
@keyframes swing { 0% { transform: rotate(-50deg); } 45% { transform: rotate(15deg); } 55% { transform: rotate(15deg); } 100% { transform: rotate(-50deg); } }

/* ===== MARCHÉ / XP ===== */
.ad-layer.ad-global { position: absolute; inset: 0; z-index: 300; }
#marketModal .modal-box { border-radius: 20px; max-width: 420px; color: var(--text); }
.mk-card { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; margin-bottom: 8px; }
.mk-card small { display: block; color: var(--muted); font-size: 11.5px; font-weight: 600; }
.mk-card button:disabled { opacity: .45; cursor: not-allowed; }
.mk-h { margin: 14px 0 8px; font-size: 14px; display: flex; justify-content: space-between; align-items: baseline; }
.mk-h small { font-size: 11.5px; color: var(--muted); font-weight: 700; }
.mk-note { display: block; font-size: 11px; color: var(--muted); margin: -2px 2px 6px; }

/* la pub passe devant toutes les fenêtres (Marché, etc.) */
.ad-layer.ad-global { z-index: 9500; }

/* ===== LOGO BITCOIN DU TITRE ===== */
.logo-btc { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; margin-right: 8px;
  border-radius: 50%; background: #f7931a; color: #fff; font-size: 21px; font-weight: 900; line-height: 1; vertical-align: middle; }

/* ===== PIOCHE : reste dans sa case, ne touche plus les bords ===== */
.pick { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; margin: 0 4px 0 2px;
  font-size: 13px; line-height: 1; transform-origin: 55% 55%; animation: swing .9s ease-in infinite; }
@keyframes swing { 0% { transform: rotate(-28deg); } 45% { transform: rotate(14deg); } 55% { transform: rotate(14deg); } 100% { transform: rotate(-28deg); } }

/* ===== COMPTE ===== */
#accountModal .modal-box { border-radius: 20px; max-width: 420px; color: var(--text); }
.acc-id { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 10px 12px; margin-bottom: 8px; }
.acc-id small { width: 100%; color: var(--muted); font-size: 11.5px; font-weight: 600; }
.acc-id code { flex: 1; font-size: 11px; word-break: break-all; }

/* ===== MODE NUIT (de 18 h à 6 h, heure de l'utilisateur) ===== */
:root[data-theme="dark"] { color-scheme: dark; --bg: #12172a; --card: #1c2440; --border: #2d385a; --text: #e8ecf7; --muted: #8f99b8; --shadow: 0 2px 8px rgba(0,0,0,.4); }
[data-theme="dark"] .btn-outline, [data-theme="dark"] .launch input, [data-theme="dark"] .tech-node,
[data-theme="dark"] #minersModal .miner-item, [data-theme="dark"] .nav { background: var(--card); }
[data-theme="dark"] .progress { background: #263050; }
[data-theme="dark"] .nav-item.active { background: #3a2c18; border-color: #7a5a2a; }
[data-theme="dark"] .close { background: #2d385a; color: var(--text); }
[data-theme="dark"] .quick-card.orange { background: #3a2c1a; }
[data-theme="dark"] .quick-card.green  { background: #1f2c33; }
[data-theme="dark"] .quick-card.blue   { background: #1c2b48; }
[data-theme="dark"] .quick-card.red    { background: #3a2226; }
[data-theme="dark"] .block-timer { background: rgba(14,19,40,.88); }
/* chambre de nuit : voile bleu, mais le PC, la lampe, la fenêtre, les affiches (pubs) et la barre restent lumineux */
[data-theme="dark"] .scene::after { content: ''; position: absolute; inset: 0; background: rgba(14,22,70,.5); z-index: 1; pointer-events: none; }
[data-theme="dark"] .s-monitor, [data-theme="dark"] .s-lamp, [data-theme="dark"] .s-window,
[data-theme="dark"] .s-poster, [data-theme="dark"] .block-timer { z-index: 2; }
[data-theme="dark"] .s-window { background: radial-gradient(circle at 72% 30%, #fff6cf 0 9%, transparent 10%), linear-gradient(#070d2b, #1a2a5e 62%, #14301f); border-color: #8d8a84; }
[data-theme="dark"] .s-lamp { box-shadow: 0 0 26px 6px #ffd45a; }

/* ===== PHOTO DE PROFIL ===== */
.avatar.has-img, .acc-avatar.has-img { font-size: 0; background-size: cover; background-position: center; }
.acc-photo { display: flex; align-items: center; gap: 14px; padding: 12px; margin-bottom: 8px; }
.acc-avatar { width: 84px; height: 84px; flex-shrink: 0; border-radius: 50%; background: #cfe3f7 center / cover; border: 3px solid var(--border);
  display: flex; align-items: center; justify-content: center; font-size: 42px; }
.acc-photo-btns { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.acc-photo-btns small { color: var(--muted); font-size: 11px; font-weight: 600; }

#overclockModal .modal-box { border-radius: 20px; max-width: 420px; color: var(--text); }

/* ===== INTERRUPTEUR EN SERVICE / ARRÊTÉ ===== */
.miner-qty { font-size: .75rem; font-weight: 800; color: var(--orange); margin-left: 4px; }
.miner-sw { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 9.5px; font-weight: 800; color: var(--muted); flex-shrink: 0; }
.miner-item.active .miner-sw span { color: var(--green); }
.sw { position: relative; width: 46px; height: 26px; border: 0; border-radius: 13px; background: #c9c2b4; cursor: pointer; transition: background .2s; }
.sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s; }
.sw.on { background: var(--green); }
.sw.on::after { transform: translateX(20px); }
.miner-item:not(.active) .miner-name, .miner-item:not(.active) .miner-stats { opacity: .6; }
[data-theme="dark"] .sw { background: #3a4466; }
[data-theme="dark"] .sw.on { background: var(--green); }

/* ===== LOGO DE MARQUE (Intel / AMD) ===== */
.miner-logo { width: 46px; height: 40px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; padding: 4px 5px;
  background: #fff; border: 1.5px solid var(--border); border-radius: 12px; }
.miner-logo img { width: 100%; height: 100%; object-fit: contain; }

/* ===== ONGLETS DU BAS : contour orange au survol, comme « Accueil » ===== */
.nav-item { border: 1.5px solid transparent; transition: background .15s, border-color .15s, color .15s; }
@media (hover: hover) {
  .nav-item:hover { background: #fff0dc; color: var(--orange); border-color: #f3d6ad; }
  [data-theme="dark"] .nav-item:hover { background: #3a2c18; border-color: #7a5a2a; }
}

/* ===== ACTIONS RAPIDES : contour de la couleur de la carte au survol ===== */
.quick-card { transition: transform .1s, border-color .15s, box-shadow .15s; }
.quick-card.orange { --accent: var(--orange); }
.quick-card.green  { --accent: var(--green); }
.quick-card.blue   { --accent: var(--blue); }
.quick-card.red    { --accent: var(--red); }
@media (hover: hover) {
  .quick-card:hover { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
}

/* ===== ARBRE DES TECHNOLOGIES MATÉRIELLES ===== */
#hwModal .modal-box { border-radius: 20px; max-width: 420px; color: var(--text); }
.hw-tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.hw-tabs.sub { margin-top: -2px; }
.hw-tab { flex: 1; padding: 7px 4px; border: 1.5px solid var(--border); border-radius: 10px; background: var(--card); color: var(--muted);
  font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; }
.hw-tab.on { border-color: var(--orange); color: var(--orange); }
.hw-list { position: relative; margin-left: 10px; padding-left: 16px; border-left: 3px solid var(--border); }
.hw-node { position: relative; margin-bottom: 8px; }
.hw-dot { position: absolute; left: -26px; top: 16px; width: 13px; height: 13px; border-radius: 50%; background: var(--border); border: 2px solid var(--bg); }
.hw-node.done .hw-dot { background: var(--green); }
.hw-node.current .hw-dot { background: var(--orange); box-shadow: 0 0 0 3px rgba(240,138,28,.3); }
.hw-node.next .hw-dot { background: var(--blue); }
.hw-node.done .hw-list, .hw-node.locked { opacity: .65; }
.hw-node.current .hw-card { border-color: var(--orange); }
.hw-node.next .hw-card { border-color: var(--blue); }
.hw-card { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 11px; }
.hw-info small { display: block; color: var(--muted); font-size: 11.5px; font-weight: 600; }
.hw-info b { font-size: 13.5px; }
.hw-tag { font-size: 10.5px; font-weight: 800; color: var(--muted); }
.hw-info .ok, .hw-unlock .ok { color: var(--green); }
.hw-info .no, .hw-unlock .no { color: var(--red); }
.hw-unlock { padding: 10px 12px; margin-bottom: 8px; }
.hw-unlock small { display: block; font-size: 12px; font-weight: 700; margin-top: 3px; }
.hw-research { width: 100%; margin-top: 10px; }

/* ===== MAGASIN ===== */
#shopModal .modal-box { border-radius: 20px; max-width: 420px; color: var(--text); }
.shop-prod { padding: 10px 12px; margin-bottom: 8px; }
.shop-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.shop-info small { display: block; color: var(--muted); font-size: 11.5px; font-weight: 600; }
.shop-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.shop-btns button:disabled { opacity: .45; cursor: not-allowed; }
.shop-btns .sell { color: var(--green); }
.elec-alert { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 8px 0; padding: 10px 12px;
  border: 1.5px solid var(--red); border-radius: 14px; background: rgba(239,68,68,.12); color: var(--text); font-size: 12.5px; font-weight: 700; }
.elec-alert.hidden { display: none; }

/* ===== BOURSE : bougies + vente ===== */
.ex-card { padding: 12px; margin-bottom: 10px; }
.ex-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; }
.ex-head .ok { color: var(--green); font-weight: 800; }
.ex-head .no { color: var(--red); font-weight: 800; }
.ex-head small { font-size: 11px; }
.ex-chart { width: 100%; height: auto; margin: 6px 0 2px; }
.ex-have, .ex-est { display: block; font-size: 12px; color: var(--muted); font-weight: 600; margin: 4px 0; }
.ex-row { display: flex; gap: 6px; align-items: center; margin: 6px 0 2px; }
.ex-row input { flex: 1; min-width: 0; padding: 8px 10px; border: 1.5px solid var(--border); border-radius: 10px; background: var(--card); color: var(--text); font: inherit; font-size: 14px; font-weight: 700; }
.ex-row input:focus { outline: none; border-color: var(--orange); }
.ex-card .shop-btns { margin-top: 8px; }

/* ===== ACHAT = VERT, VENTE = ROUGE ===== */
.btn-outline.buy, .shop-btns .buy { color: var(--green); border-color: var(--green); }
.btn-outline.sell, .shop-btns .sell { color: var(--red); border-color: var(--red); }
.btn-outline.buy:disabled, .btn-outline.sell:disabled { opacity: .4; }

/* ===== TEMPÉRATURE ===== */
.stat-sub.red { color: var(--red); }
.arrow-down { color: var(--red); font-size: 11px; margin-left: 2px; }
#coolModal .modal-box { border-radius: 20px; max-width: 420px; color: var(--text); }

#qCooling.on { color: var(--green); }

/* ===== DEVOIRS ===== */
#hkModal .modal-box { border-radius: 20px; max-width: 420px; color: var(--text); }
.hk-on { color: var(--green) !important; font-weight: 800 !important; }

.notif-dot.hidden { display: none; }

.miner-emoji { font-size: 22px; }

/* v0.0.45 : ligne niveau + barre XP courte */
.lvl-row { display: flex; align-items: center; gap: 8px; }
.lvl-row .subtitle { white-space: nowrap; margin: 0; }
.progress.thin.lvl-bar { width: 64px; flex: none; }
.nav-item em { font-style: normal; }
/* Paramètres */
.set-row { padding: 10px 2px; border-bottom: 1px solid var(--border); }
.set-row b { display: block; margin-bottom: 6px; }
.set-row small { display: block; color: var(--muted); font-size: 11px; margin-top: 5px; }
.set-row .hw-tabs { margin-bottom: 0; }
.dd { position: relative; }
.dd-btn, .dd-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 1.5px solid var(--border); border-radius: 10px; background: var(--card); color: var(--text, inherit); font-weight: 700; cursor: pointer; text-align: left; }
.dd-btn span { margin-left: auto; color: var(--muted); }
.dd-btn img, .dd-item img { width: 24px; height: 16px; border-radius: 2px; object-fit: cover; box-shadow: 0 0 0 1px rgba(0,0,0,.15); }
.dd-list { margin-top: 4px; display: flex; flex-direction: column; gap: 4px; }
.dd-list.hidden { display: none; }
.dd-item.on { border-color: var(--orange); color: var(--orange); }

/* v0.0.46 : Paramètres = même format que les autres menus + espace menu / XP */
#setModal .modal-box { border-radius: 20px; max-width: 420px; color: var(--text); }
.xpbar { margin-top: 8px; }

/* v0.0.47 : aucun mineur actif -> voyant rouge, pioche à l'arrêt, barre rouge clignotante */
.block-timer.idle .mining-dot { background: #e5484d; animation: blink 1s infinite; }
.block-timer.idle .pick { animation: none; transform: rotate(-28deg); }
.block-timer.idle .progress-fill { background: linear-gradient(#ff6b6b, #d92d32); animation: flashRed .8s infinite; }
@keyframes flashRed { 50% { opacity: .25; } }
.nav-item.locked { opacity: .45; }
#ecoModal .modal-box { border-radius: 20px; max-width: 420px; color: var(--text); }
.xp-star { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; font-size: 0; }
.logo-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.logo-opt { min-width: 40px; height: 40px; padding: 4px; border: 1.5px solid var(--border); border-radius: 10px; background: var(--card); color: var(--text); font-weight: 800; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.logo-opt.on { border-color: var(--orange); box-shadow: 0 0 0 1px var(--orange); }
.logo-pick { display: block; margin-bottom: 8px; padding: 12px; }

#loginModal { align-items: center; padding: 16px; }
#loginModal .modal-box { border-radius: 20px; max-width: 380px; margin: 0 auto; text-align: center; color: var(--text); }
.lg-ico { font-size: 44px; } #loginModal h2 { margin: 6px 0; }
.lg-xp { font-size: 30px; font-weight: 900; color: var(--green); margin: 8px 0; }
#loginModal small { display: block; color: var(--muted); margin-bottom: 12px; }

.set-row small.credit a { color: var(--orange); font-weight: 700; text-decoration: none; }

.vol { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.vol.off { opacity: .45; }
.vol input[type=range] { flex: 1; accent-color: var(--orange); height: 28px; cursor: pointer; }
.vol #musVolTxt { min-width: 44px; text-align: right; font-weight: 800; }

.vol-ico { width: 34px; height: 34px; flex: none; display: inline-flex; align-items: center; justify-content: center; border: 0; background: transparent; font-size: 20px; cursor: pointer; color: var(--text); border-radius: 50%; }
.vol-ico:hover { background: rgba(255,255,255,.08); }
.vol-ico:disabled { cursor: default; }

#legalModal .modal-box { border-radius: 20px; max-width: 420px; color: var(--text); }
.legal { font-size: 13px; line-height: 1.5; }
.legal h3 { margin: 16px 0 6px; font-size: 14px; color: var(--orange); }
.legal p { margin: 0 0 8px; color: var(--text); }
.legal .lg-intro { color: var(--muted); }
.legal a { color: var(--orange); font-weight: 700; }
mark.todo { background: #ffe08a; color: #3a2a00; border-radius: 4px; padding: 0 3px; font-weight: 700; }
.legal-btn { width: 100%; padding: 10px; }
.legal p { text-align: justify; text-justify: inter-word; hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word; }
.legal h3 { text-align: left; }

/* v0.0.64 : choix de la langue au premier lancement */
.lang-pick { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.lang-chip { display: flex; align-items: center; gap: 6px; padding: 7px 11px; border: 1.5px solid var(--border); border-radius: 999px;
  background: var(--card); color: var(--text); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.lang-chip img { width: 20px; height: 14px; object-fit: cover; border-radius: 2px; }
.lang-chip.on { border-color: var(--orange); box-shadow: 0 0 0 2px rgba(247,147,26,.25); }

/* v0.0.69 : classement */
#rankModal .modal-box { border-radius: 20px; max-width: 440px; color: var(--text); }
.rk-demo { background: rgba(247,147,26,.14); border: 1px solid var(--orange); border-radius: 12px; padding: 8px 10px; font-size: 12px; font-weight: 600; margin-bottom: 8px; }
/* mêmes colonnes pour l'en-tête et les lignes : l'en-tête est dans la liste (collant) donc parfaitement aligné */
.rk-list { display: flex; flex-direction: column; gap: 4px; max-height: 50vh; overflow-y: auto; overscroll-behavior: contain; margin-bottom: 8px; }
.rk-head, .rk-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) 52px 36px 76px; column-gap: 6px; align-items: center; padding: 7px 10px; font-size: 13px; }
.rk-head { position: sticky; top: 0; z-index: 1; background: var(--bg, #1c2333); color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; }
.rk-head .rk-l, .rk-head .rk-h, .rk-head .rk-b, .rk-row .rk-l, .rk-row .rk-h, .rk-row .rk-b { text-align: right; }
.rk-b { font-variant-numeric: tabular-nums; font-size: 12px; white-space: nowrap; color: var(--muted); }
.rk-row { background: var(--card); border: 1px solid var(--border); border-radius: 10px; font-weight: 700; }
.rk-row.me { border-color: var(--orange); box-shadow: 0 0 0 2px rgba(247,147,26,.25); }
.rk-n { font-weight: 900; color: var(--muted); text-align: center; }
.rk-u { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .rk-u em { color: var(--orange); font-style: normal; font-size: 11px; }
.rk-l { color: var(--muted); font-size: 12px; white-space: nowrap; } .rk-h { font-variant-numeric: tabular-nums; white-space: nowrap; }
.rk-up { color: var(--green); font-weight: 900; } .rk-down { color: var(--red); font-weight: 900; } .rk-same { color: var(--muted); font-weight: 700; }
/* podium : or, argent, bronze */
.rk-row.m1 { border-color: #f5c542; background: linear-gradient(90deg, rgba(245,197,66,.20), var(--card) 55%); } .rk-row.m1 .rk-n { color: #f5c542; font-size: 16px; }
.rk-row.m2 { border-color: #c0c7d1; background: linear-gradient(90deg, rgba(192,199,209,.18), var(--card) 55%); } .rk-row.m2 .rk-n { color: #c0c7d1; font-size: 15px; }
.rk-row.m3 { border-color: #b8743a; background: linear-gradient(90deg, rgba(184,116,58,.22), var(--card) 55%); } .rk-row.m3 .rk-n { color: #cd8a4b; font-size: 15px; }
.rk-troph { margin-left: 2px; }
.stat-box:has(#statRank) { cursor: pointer; }

/* v0.0.73 : cercle du hashrate = progression du bloc en 4 tranches (vide, ¼, ½, ¾, plein au bloc trouvé) */
.pie { width: 22px; height: 22px; border-radius: 50%; box-sizing: border-box; border: 2.5px solid currentColor; display: block; background: transparent; }
.pie[data-q="1"] { background: conic-gradient(currentColor 0 25%, transparent 25% 100%); }
.pie[data-q="2"] { background: conic-gradient(currentColor 0 50%, transparent 50% 100%); }
.pie[data-q="3"] { background: conic-gradient(currentColor 0 75%, transparent 75% 100%); }
.pie[data-q="4"] { background: currentColor; }

/* v0.0.75 : affiches encadrées (cadre en bois + passe-partout + clou et fil), pour qu'on ne dirait plus deux images collées au mur */
.s-poster.has-img { overflow: visible; padding: 3px; border: 5px solid; border-radius: 2px; background: #f6f0e4;
  border-image: linear-gradient(135deg, #e0aa66 0%, #9a642d 28%, #6b4220 50%, #b57a3d 74%, #7a4c24 100%) 1;
  box-shadow: 0 0 0 1px rgba(40,22,8,.55), 2px 5px 9px rgba(0,0,0,.38), inset 0 0 0 1px rgba(0,0,0,.18); }
.s-poster.has-img.hodl { width: 12.5%; } .s-poster.has-img.moon { width: 15.5%; }
.s-poster.has-img a, .s-poster.has-img img { outline: 1px solid rgba(0,0,0,.28); outline-offset: -1px; }
.s-poster.has-img::before { content: ""; position: absolute; top: -17px; left: 50%; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #d8d8d8, #555); box-shadow: 0 1px 2px rgba(0,0,0,.5); }
.s-poster.has-img::after { content: ""; position: absolute; top: -14px; left: 50%; width: 46px; height: 14px; margin-left: -23px; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 46 14'%3E%3Cpath d='M2 14 L23 1 L44 14' fill='none' stroke='%23463018' stroke-width='1.2'/%3E%3C/svg%3E") center / 100% 100% no-repeat; }

/* v0.0.79 : boutons d'achat maintenables (pas de sélection de texte ni de menu contextuel au doigt) */
button.buy[data-act] { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }

/* ===== Fenêtre d'annonce (niveau 150, retour hors ligne) : centrée dans l'app ===== */
.mp-overlay { position: absolute; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 22px; background: rgba(8,12,24,.82); animation: mpFade .35s ease-out; overflow: hidden; }
.mp-fx { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.mp-rays { position: absolute; left: 50%; top: 50%; width: 170%; aspect-ratio: 1; transform: translate(-50%, -50%); background: repeating-conic-gradient(from 0deg, rgba(247,147,26,.16) 0 10deg, transparent 10deg 24deg); -webkit-mask-image: radial-gradient(circle, #000 0%, transparent 62%); mask-image: radial-gradient(circle, #000 0%, transparent 62%); animation: mpSpin 40s linear infinite; }
.mp-fx i { position: absolute; bottom: -30px; font-style: normal; font-weight: 900; font-size: 20px; color: rgba(247,147,26,.55); animation: mpRise linear infinite; }
.mp-card { position: relative; width: 100%; max-width: 330px; text-align: center; padding: 22px 18px 18px; border-radius: 22px; background: linear-gradient(160deg, #263256, #1a2140); border: 1px solid rgba(247,147,26,.55); box-shadow: 0 0 0 4px rgba(247,147,26,.12), 0 18px 50px rgba(0,0,0,.55), 0 0 60px rgba(247,147,26,.25); color: #fff; animation: mpPop .45s cubic-bezier(.2,1.4,.4,1); }
.mp-icon { font-size: 46px; line-height: 1; margin-bottom: 6px; animation: mpBob 2.4s ease-in-out infinite; }
.mp-card h2 { margin: 0 0 4px; font-size: 21px; font-weight: 900; }
.mp-card p { margin: 6px 0; font-size: 14px; line-height: 1.4; color: #dbe3f7; }
.mp-card p.mp-hi { font-size: 16px; font-weight: 800; color: #ffb454; }
.mp-btn { margin-top: 14px; width: 100%; padding: 12px; border: 0; border-radius: 14px; font-size: 16px; font-weight: 900; color: #1a1100; background: linear-gradient(180deg, #ffc15a, #f7931a); cursor: pointer; box-shadow: 0 4px 0 #b86a08; }
.mp-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #b86a08; }
@keyframes mpFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes mpPop { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes mpSpin { to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes mpRise { from { transform: translateY(0) rotate(0); opacity: 0; } 15% { opacity: 1; } to { transform: translateY(-110vh) rotate(40deg); opacity: 0; } }
@keyframes mpBob { 50% { transform: translateY(-5px) scale(1.06); } }
@media (prefers-reduced-motion: reduce) { .mp-rays, .mp-fx i, .mp-icon { animation: none; } }

/* Logos d'XP verrouillés + info */
.logo-opt.locked { opacity: .85; cursor: help; }
.logo-info { display: block; margin-top: 8px; min-height: 1.3em; font-weight: 700; }
/* Barre d'XP après le niveau de bascule : couleur différente + bandes blanches animées */
.progress-fill.stripe { background: linear-gradient(#8f7bff, #5a3fd6); position: relative; overflow: hidden; }
.progress-fill.stripe::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(-45deg, rgba(255,255,255,.55) 0 8px, rgba(255,255,255,0) 8px 16px); background-size: 22.63px 22.63px; animation: xpStripe 1s linear infinite; }
@keyframes xpStripe { to { background-position: 22.63px 0; } }
@media (prefers-reduced-motion: reduce) { .progress-fill.stripe::after { animation: none; } }

/* Barre de minage : le texte reste sur une ligne ; la barre rétrécit quand le texte est long */
.block-timer > span:first-child { flex: 0 1 auto; min-width: 0; max-width: 62%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.block-timer .progress { min-width: 24px; }
.block-timer > span:last-child { flex: none; white-space: nowrap; }

/* ===== CHARGEMENT (pioche + logo Bitcoin) ===== */
.ld-overlay { position: absolute; inset: 0; z-index: 9800; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: radial-gradient(circle at 50% 42%, rgba(255,248,235,.97), rgba(247,236,214,.99)); }
[data-theme="dark"] .ld-overlay { background: radial-gradient(circle at 50% 42%, #1c2447, #0b1020); }
.ld-stage { position: relative; width: 180px; height: 180px; }
.ld-stage svg { position: absolute; inset: 0; overflow: visible; }
.ld-pick { transform-box: view-box; transform-origin: 0 0; transform: translate(150px, 168px) rotate(34deg); animation: ldSwing 1s cubic-bezier(.5,0,.3,1) infinite; }
@keyframes ldSwing {
  0%   { transform: translate(150px, 168px) rotate(40deg); }
  41%  { transform: translate(150px, 168px) rotate(-33deg); }
  46%  { transform: translate(150px, 168px) rotate(-29deg); }
  100% { transform: translate(150px, 168px) rotate(40deg); }
}
.ld-coin { transform-box: fill-box; transform-origin: 50% 100%; animation: ldCoin 1s infinite; }
@keyframes ldCoin { 0%, 39% { transform: none; } 43% { transform: scale(1.05, .92); } 58% { transform: scale(.99, 1.02); } 70%, 100% { transform: none; } }
.ld-fx { position: absolute; left: 70px; top: 66px; width: 0; height: 0; }
.ld-c { position: absolute; left: -9px; top: -9px; width: 18px; height: 18px; border-radius: 50%; background: #f7931a; border: 2px solid #a85a00; color: #fff; font: 900 11px/14px Arial, sans-serif; text-align: center; font-style: normal; opacity: 0; animation: ldFly .9s ease-out forwards; }
@keyframes ldFly { 0% { opacity: 1; transform: translate(0,0) scale(.5) rotate(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx), calc(var(--dy) + 55px)) scale(1) rotate(var(--r)); } }
.ld-text { font-size: 20px; font-weight: 800; letter-spacing: .5px; color: var(--text); }
[data-theme="dark"] .ld-text { color: #f4f1ea; }
.ld-dots i { font-style: normal; animation: ldDot 1.2s infinite; opacity: .2; } .ld-dots i:nth-child(2) { animation-delay: .2s; } .ld-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes ldDot { 0%, 60%, 100% { opacity: .2; } 30% { opacity: 1; } }

/* ===== ÉCRAN DE CONNEXION ===== */
.launch.lg { display: block; overflow: hidden; background: radial-gradient(ellipse at 50% 28%, rgba(247,147,26,.20), transparent 62%), var(--bg); }
/* tout le contenu est centré dans la page : titre, chambre, formulaire */
.lg-scroll { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; display: flex; }
.lg-stack { margin: auto; width: 100%; max-width: 460px; padding: 16px 14px 74px; display: flex; flex-direction: column; align-items: stretch; gap: 14px; }
.lg-title { text-align: center; font-size: clamp(34px, 11vw, 48px); line-height: 1.05; font-weight: 900; letter-spacing: .5px; margin: 0; }
.lg-title .t1 { color: #f7931a; text-shadow: 0 3px 0 #9a5300, 0 6px 14px rgba(154,83,0,.45); }
.lg-title .t2 { color: #2f86ff; text-shadow: 0 3px 0 #0f3a8f, 0 6px 14px rgba(15,58,143,.45); }
.lg-room { position: relative; flex: none; overflow: hidden; border-radius: 18px; border: 1.5px solid var(--border); box-shadow: 0 8px 28px rgba(20,16,40,.22); }
.lg-wall { position: absolute; inset: 0; background: repeating-linear-gradient(90deg, #f4ece0 0 22px, #efe5d4 22px 44px); }
[data-theme="dark"] .lg-wall::after { content: ''; position: absolute; inset: 0; background: rgba(14,22,70,.5); }
.launch.lg .lg-scene { position: relative; flex: none; width: 100%; height: auto; aspect-ratio: 440 / 250; border-radius: 0; }
.lg-wall .s-lights { position: absolute; top: 6px; }
.lg-card { position: relative; z-index: 5; background: var(--card); border: 1.5px solid var(--border); border-radius: 18px; padding: 14px 14px 12px; box-shadow: 0 8px 28px rgba(20,16,40,.28); }
/* écrans plus longs (création de compte…) ou téléphones courts : on masque la chambre pour tout garder visible */
@media (max-height: 1100px) { .launch.lg:not([data-view="login"]) .lg-room { display: none; } }
@media (max-height: 760px) { .launch.lg .lg-room { display: none; } }
.lg-card form { display: flex; flex-direction: column; gap: 9px; }
.lg-h { font-size: 17px; font-weight: 900; text-align: center; }
.lg-p { font-size: 12px; color: var(--muted); font-weight: 600; text-align: center; }
.lg-f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 800; color: var(--muted); min-width: 0; }
.lg-f input, .lg-card input { background: var(--card); color: var(--text); border: 1.5px solid var(--border); border-radius: 12px; padding: 10px 12px; font-size: 15px; font-weight: 600; width: 100%; min-width: 0; }
.lg-f input:focus { outline: none; border-color: var(--orange); }
.lg-pw { display: flex; gap: 6px; align-items: stretch; position: relative; }
.lg-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; font-size: 17px; cursor: pointer; opacity: .6; padding: 4px 6px; }
.lg-pw:has(.lg-send) input { flex: 1; }
.lg-send { white-space: nowrap; flex-shrink: 0; }
.lg-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lg-link { background: none; border: 0; color: var(--blue); font-weight: 800; font-size: 13px; cursor: pointer; padding: 4px; text-align: center; }
.lg-sep { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; font-weight: 700; } .lg-sep::before, .lg-sep::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.lg-err { min-height: 16px; font-size: 12.5px; font-weight: 700; color: var(--red); text-align: center; } .lg-err.ok { color: var(--green); }
.lg-hint { font-size: 11px; color: var(--muted); font-weight: 700; }
.lg-rules { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 1px 8px; font-size: 11px; font-weight: 700; color: var(--muted); } .lg-rules li.ok { color: var(--green); }
.lg-langrow { display: flex; gap: 6px; flex-wrap: wrap; } .lg-langrow .lang-chip { padding: 6px 9px; }
.lg-codebox.hidden { display: none; }
.lg-fab { position: absolute; z-index: 8; bottom: 12px; width: 42px; height: 42px; border-radius: 50%; border: 2px solid rgba(255,255,255,.65); background: rgba(24,30,60,.78); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 3px 10px rgba(0,0,0,.3); }
.lg-fab img { width: 26px; height: 18px; object-fit: cover; border-radius: 3px; }
.lg-sound { left: 14px; }
.lg-lang { position: absolute; right: 14px; bottom: 12px; z-index: 8; }
.lg-lang .lg-fab { position: static; }
.lg-langlist { position: absolute; bottom: 50px; right: 0; display: flex; flex-direction: column; gap: 6px; padding: 6px; background: rgba(24,30,60,.92); border-radius: 22px; box-shadow: 0 6px 18px rgba(0,0,0,.4); }
.lg-langlist.hidden { display: none; }
.lg-flag { border: 2px solid transparent; background: transparent; border-radius: 6px; padding: 2px; cursor: pointer; display: flex; } .lg-flag img { width: 30px; height: 21px; object-fit: cover; border-radius: 3px; } .lg-flag.on { border-color: var(--orange); }
.lg .launch-ad { margin: 0; }
/* détails de la chambre (écran de connexion) */
.lg-scene .s-monitor { box-shadow: 0 0 18px rgba(58,224,255,.7); animation: lgGlow 2.4s ease-in-out infinite; }
@keyframes lgGlow { 50% { box-shadow: 0 0 30px rgba(58,224,255,1); } }
.s-lights { left: 0; right: 0; top: 0; height: 7%; display: flex; justify-content: space-around; align-items: flex-end; background: linear-gradient(transparent 48%, rgba(60,40,20,.55) 48%, rgba(60,40,20,.55) 54%, transparent 54%); }
.s-lights i { position: static; width: 7px; height: 7px; border-radius: 50%; background: #ffd46b; box-shadow: 0 0 8px #ffd46b; animation: lgTw 1.8s infinite; } .s-lights i:nth-child(3n) { background: #ff7a7a; box-shadow: 0 0 8px #ff7a7a; animation-delay: .5s; } .s-lights i:nth-child(3n+1) { background: #7ad0ff; box-shadow: 0 0 8px #7ad0ff; animation-delay: 1.1s; }
@keyframes lgTw { 50% { opacity: .35; } }
.s-clock { left: 27%; top: 9%; width: 7.5%; aspect-ratio: 1; border-radius: 50%; background: #fff; border: 3px solid #a67a49; }
.s-clock b, .s-clock u { position: absolute; left: 50%; bottom: 50%; width: 2px; background: #1f2a44; transform-origin: bottom; } .s-clock b { height: 34%; transform: rotate(35deg); } .s-clock u { height: 42%; width: 1.5px; background: #e53950; animation: lgTick 12s linear infinite; }
@keyframes lgTick { to { transform: rotate(360deg); } }
.s-rig { left: 29%; top: 41%; width: 9%; height: 13.5%; background: #2a3340; border: 2px solid #12181f; border-radius: 3px; display: flex; flex-direction: column; justify-content: space-around; padding: 3px; }
.s-rig em { position: static; display: block; height: 22%; border-radius: 2px; background: repeating-linear-gradient(90deg, #12181f 0 3px, #3b4656 3px 5px); }
.s-rig span { position: absolute; right: 3px; top: 3px; width: 4px; height: 4px; border-radius: 50%; background: #3ae07a; box-shadow: 0 0 6px #3ae07a; animation: lgTw 1s infinite; }
.s-cup { left: 4%; top: 49%; width: 3.2%; height: 5.5%; background: #fff; border: 2px solid #c9c1b2; border-radius: 0 0 4px 4px; }
.s-cup b { position: absolute; left: 30%; top: -9px; width: 3px; height: 8px; border-radius: 3px; background: rgba(255,255,255,.8); animation: lgSteam 2.2s infinite; } @keyframes lgSteam { 0% { opacity: 0; transform: translateY(4px); } 50% { opacity: .9; } 100% { opacity: 0; transform: translateY(-6px); } }
.s-plant { left: 41%; top: 58%; width: 5%; height: 15%; }
.s-plant::before { content: ''; position: absolute; left: 10%; right: 10%; bottom: 0; height: 38%; background: #b4693a; border-radius: 2px 2px 6px 6px; }
.s-plant i { position: absolute; bottom: 30%; width: 38%; height: 62%; background: #3f9a52; border-radius: 80% 0 80% 0; transform-origin: bottom; } .s-plant i:nth-child(1) { left: 6%; transform: rotate(-25deg); } .s-plant i:nth-child(2) { left: 32%; background: #4cb561; height: 74%; } .s-plant i:nth-child(3) { right: 6%; transform: rotate(28deg) scaleX(-1); }
.s-float { inset: 0; pointer-events: none; } .s-float i { position: absolute; bottom: 8%; width: 16px; height: 16px; border-radius: 50%; background: #f7931a; border: 2px solid #a85a00; color: #fff; font: 900 10px/12px Arial, sans-serif; text-align: center; font-style: normal; opacity: 0; animation: lgUp 7s linear infinite; }
.s-float i:nth-child(1) { left: 44%; animation-delay: 0s; } .s-float i:nth-child(2) { left: 58%; animation-delay: 1.6s; } .s-float i:nth-child(3) { left: 71%; animation-delay: 3.1s; } .s-float i:nth-child(4) { left: 20%; animation-delay: 4.4s; } .s-float i:nth-child(5) { left: 85%; animation-delay: 5.6s; }
@keyframes lgUp { 0% { opacity: 0; transform: translateY(0) rotate(0); } 12% { opacity: .95; } 80% { opacity: .8; } 100% { opacity: 0; transform: translateY(-190px) rotate(300deg); } }
/* page bannie */
.ban-overlay { position: absolute; inset: 0; z-index: 9900; display: flex; align-items: center; justify-content: center; background: rgba(10,12,28,.94); padding: 24px; }
.ban-box { background: var(--card); border-radius: 18px; padding: 22px; text-align: center; display: flex; flex-direction: column; gap: 10px; max-width: 340px; width: 100%; } .ban-ico { font-size: 44px; }

/* ===== MENU SÉCURITÉ ===== */
.sec-body { display: flex; flex-direction: column; gap: 10px; }
.sec-grade, .sec-sec { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.sec-grade > small { color: var(--muted); font-weight: 600; font-size: 11.5px; }
.sec-b { display: flex; justify-content: space-between; align-items: center; gap: 8px; border: 1.5px solid var(--border); border-radius: 10px; padding: 7px 10px; font-size: 12px; } .sec-b small { font-weight: 700; color: var(--muted); text-align: right; }
.sec-b.on { border-color: var(--green); background: rgba(31,168,74,.1); }
.sec-on { font-size: 11px; font-weight: 800; color: var(--green); }
.sec-qr { display: flex; justify-content: center; } .sec-qr svg { border-radius: 10px; border: 1.5px solid var(--border); }
.sec-secret { display: flex; gap: 8px; align-items: center; justify-content: space-between; } .sec-secret code { font-size: 13px; word-break: break-all; font-weight: 800; }
.sec-keys { list-style: none; display: flex; flex-direction: column; gap: 6px; } .sec-keys li { display: flex; justify-content: space-between; align-items: center; gap: 8px; border: 1.5px solid var(--border); border-radius: 10px; padding: 6px 10px; font-size: 13px; font-weight: 700; }
.acc-sec { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; } .acc-sec small { display: block; font-size: 11px; color: var(--muted); font-weight: 700; }
.acc-logout { width: 100%; margin-top: 8px; }
.sec-sec .lg-f input { background: var(--card); color: var(--text); border: 1.5px solid var(--border); border-radius: 12px; padding: 10px 12px; font-size: 15px; width: 100%; }
.launch.lg.hidden { display: none; }

.adm-notice { z-index: 9950; } .adm-notice .ban-box { border: 2px solid var(--orange); } .adm-notice-txt { white-space: pre-wrap; line-height: 1.45; font-weight: 600; text-align: left; }

header .avatar { cursor: pointer; }

/* menu Compte : résumé en haut, chiffres clés en grille */
.acc-photo { align-items: center; }
.acc-head { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; flex: 1; }
.acc-name { font-size: 20px; font-weight: 900; line-height: 1.1; word-break: break-word; } .acc-user { color: var(--muted); font-weight: 800; font-size: 13px; }
.acc-lvl { display: inline-block; margin-top: 2px; background: var(--orange); color: #fff; font-weight: 900; font-size: 12.5px; padding: 2px 10px; border-radius: 999px; }
.acc-head .acc-photo-btns { flex-direction: row; flex-wrap: wrap; margin-top: 6px; }
.acc-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.acc-stat { padding: 9px 12px; display: flex; flex-direction: column; gap: 2px; margin: 0; min-width: 0; } .acc-stat small { color: var(--muted); font-size: 11px; font-weight: 700; } .acc-stat b { font-size: 16px; font-weight: 900; word-break: break-word; }
.acc-stat.wide { grid-column: 1 / -1; } .acc-stat.wide b { font-size: 24px; color: var(--green); }
.acc-sec, .logo-pick { margin-bottom: 8px; }
/* Paramètres : version + ID unique */
.set-about { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--border); padding-top: 12px; }
.set-kv { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; } .set-kv small { color: var(--muted); font-weight: 700; font-size: 12px; } .set-kv b { font-size: 15px; }
.set-id small { width: 100%; } .set-id code { flex: 1; font-size: 11px; word-break: break-all; }

/* ===== Tutoriel du débutant (tutorial.js) ===== */
.tuto { position: fixed; inset: 0; z-index: 400; font-family: inherit; }
.tuto-offer { background: rgba(20,24,40,.72); display: flex; align-items: center; justify-content: center; padding: 18px; }
.tuto-card { background: var(--card, #fff); color: var(--text, #1f2a44); border-radius: 20px; box-shadow: 0 12px 40px rgba(0,0,0,.35); }
.tuto-welcome { width: 100%; max-width: 380px; padding: 26px 22px 18px; text-align: center; display: flex; flex-direction: column; gap: 10px; }
.tuto-welcome h2 { margin: 0; font-size: 22px; }
.tuto-welcome p { margin: 0 0 6px; font-size: 15px; line-height: 1.5; color: var(--muted, #7a8196); }
.tuto-welcome small { color: var(--muted, #7a8196); font-size: 12px; }
.tuto-emoji { width: 62px; height: 62px; line-height: 62px; margin: 0 auto; border-radius: 50%; background: linear-gradient(135deg,#ffb347,#f08a1c); color: #fff; font-size: 36px; font-weight: 800; }
.tuto-go { background: var(--orange, #f08a1c); color: #fff; border: 0; border-radius: 12px; padding: 13px 16px; font-weight: 700; font-size: 15px; font-family: inherit; cursor: pointer; }
.tuto-skip, .tuto-back { background: none; border: 1.5px solid var(--border, #e6e0d6); color: var(--text, #1f2a44); border-radius: 12px; padding: 12px 16px; font-weight: 600; font-size: 14px; font-family: inherit; cursor: pointer; }
.tuto-back:disabled { opacity: .35; cursor: default; }
.tuto-spot { position: fixed; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(20,24,40,.72), 0 0 0 3px var(--orange, #f08a1c); transition: all .25s ease; pointer-events: none; }
.tuto-tip { position: fixed; left: 12px; right: 12px; max-width: 420px; margin: 0 auto; padding: 16px 16px 10px; }
.tuto-tip h3 { margin: 4px 0 6px; font-size: 18px; }
.tuto-tip p { margin: 0 0 12px; font-size: 14.5px; line-height: 1.5; color: var(--muted, #5b6479); }
.tuto-btns { display: flex; gap: 10px; } .tuto-btns button { flex: 1; }
.tuto-quit { display: block; margin: 8px auto 2px; background: none; border: 0; color: var(--muted, #7a8196); font-weight: 600; font-size: 12px; font-family: inherit; text-decoration: underline; cursor: pointer; }
.tuto-dots { display: flex; gap: 5px; } .tuto-dots i { flex: 1; height: 4px; border-radius: 2px; background: var(--border, #e6e0d6); }
.tuto-dots i.on { background: var(--orange, #f08a1c); } .tuto-dots i.past { background: #f7c98f; }
