:root {
  --bg: #0d151e;
  --bg2: #131e29;
  --card: #1a2633;
  --card2: #1f2e3d;
  --card-h: #243649;
  --line: #2a3a4c;
  --line2: #3a5068;
  --fg: #eef3f8;
  --dim: #92a3b5;
  --accent: #ffc83d;
  --accent2: #46d39a;
  --danger: #ff6b6b;
  --radius: 14px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
/* La page ne defile jamais : tout tient dans l'ecran, seules les listes defilent a l'interieur */
html, body { height: 100%; overflow: hidden; }
body {
  margin: 0;
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(70, 140, 210, .22), transparent 70%),
    radial-gradient(700px 500px at 110% 110%, rgba(255, 200, 61, .07), transparent 70%),
    var(--bg);
  color: var(--fg);
  font: 15px/1.4 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
  touch-action: manipulation;          /* pas de zoom au double-tap : on peut taper vite */
}
button { font: inherit; color: inherit; }
button, .chip, .tab, .item, .tech, .play { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
[hidden] { display: none !important; }

.app {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 500px);
  grid-template-rows: minmax(0, 1fr);
  gap: 18px;
  max-width: 1400px;
  margin: 0 auto;
  height: 100vh;
  height: 100dvh;
  padding: calc(12px + var(--safe-t)) calc(16px + var(--safe-r)) calc(12px + var(--safe-b)) calc(16px + var(--safe-l));
}
.app > * { min-width: 0; min-height: 0; }

/* ------------------------------------------------------------ zone de jeu */
.play {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
}
.counters { position: relative; flex: none; width: 100%; text-align: center; }
.logo {
  margin: 0 0 2px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .5px;
  color: var(--dim);
}
.logo span { color: var(--accent); }
.energy {
  font-size: clamp(32px, 5.5vw, 54px);
  line-height: 1.1;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #fff 30%, #ffe08a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 18px rgba(255, 200, 61, .25));
}
.rate { color: var(--accent2); font-weight: 600; font-variant-numeric: tabular-nums; }
.boosts { min-height: 24px; margin-top: 4px; display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.boost {
  background: rgba(255, 200, 61, .15);
  border: 1px solid rgba(255, 200, 61, .5);
  color: var(--accent);
  border-radius: 99px;
  padding: 2px 10px;
  font-size: 13px;
  font-weight: 600;
  animation: glow 1.6s ease-in-out infinite;
}
@keyframes glow { 50% { box-shadow: 0 0 12px rgba(255, 200, 61, .35); } }
.fs-btn {
  position: absolute;
  top: 0;
  right: 0;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--dim);
  font-size: 18px;
  cursor: pointer;
}

/* la maison prend toute la hauteur disponible, sans jamais faire defiler la page */
.house-btn {
  flex: 1 1 0;
  min-height: 100px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 4px;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  touch-action: none;                 /* plusieurs doigts a la fois, sans defilement ni zoom */
}
.house-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 20px; }
.house {
  display: block;
  height: 100%;
  width: auto;
  max-width: min(100%, 600px);
  aspect-ratio: 300 / 260;
  filter: drop-shadow(0 14px 30px rgba(0, 0, 0, .45));
  transition: transform .08s ease-out;
}
.house-btn.pop .house { transform: scale(.965); }
.house .part { opacity: 0; transition: opacity .6s; }
.house .part.on { opacity: 1; }
.house .panel { fill: #1e3a5f; stroke: #7fb2ff; stroke-width: 1; opacity: 0; transition: opacity .6s; }
.house .panel.on { opacity: 1; }
.house .win { fill: #33414f; transition: fill .6s, filter .6s; }
.house .win.lit { filter: drop-shadow(0 0 6px rgba(255, 214, 120, .85)); }
.house .rotor { animation: spin var(--spin, 4s) linear infinite; }
#core.on circle:last-child { animation: spin 6s linear infinite; transform-origin: 270px 156px; }
@keyframes spin { to { transform: rotate(360deg); } }
.house .cloud { transform-box: fill-box; animation: drift 38s ease-in-out infinite alternate; }
.house .cloud.c2 { animation-duration: 52s; animation-delay: -20s; }
.house .cloud.c3 { animation-duration: 45s; animation-delay: -9s; }
@keyframes drift { from { transform: translateX(-12px); } to { transform: translateX(16px); } }
.house .tw { animation: twinkle 3s ease-in-out infinite; }
.house .tw.t2 { animation-delay: -1s; }
.house .tw.t3 { animation-delay: -2s; }
@keyframes twinkle { 50% { opacity: .25; } }

.hint { flex: none; color: var(--dim); margin: 2px 0 0; font-size: 14px; transition: opacity .6s; }
.hint.gone { opacity: 0; height: 0; margin: 0; overflow: hidden; }

.fx { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 4; }
.float {
  position: absolute;
  transform: translate(-50%, -50%);
  font-weight: 800;
  color: var(--accent);
  text-shadow: 0 2px 6px rgba(0, 0, 0, .7);
  animation: rise .9s ease-out forwards;
  white-space: nowrap;
}
@keyframes rise {
  from { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
  to { opacity: 0; transform: translate(-50%, -160%) scale(.9); }
}
.spark {
  position: absolute;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: #ffe27a;
  box-shadow: 0 0 8px #ffc83d;
  animation: spark .5s ease-out forwards;
}
@keyframes spark { to { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0; } }

.sun {
  position: absolute;
  z-index: 5;
  width: 72px;
  height: 72px;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle, #fff6c8 0%, #ffd23f 45%, rgba(255, 170, 0, 0) 72%);
  cursor: pointer;
  font-size: 32px;
  touch-action: none;
  animation: bob 1.6s ease-in-out infinite, fadein .4s;
}
@keyframes bob { 50% { transform: translateY(-8px) scale(1.06); } }
@keyframes fadein { from { opacity: 0; transform: scale(.5); } }

/* ------------------------------------------------------------ panneau */
.panel-side {
  background: linear-gradient(180deg, rgba(255, 255, 255, .025), transparent 120px), var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .3);
}
.tabs { flex: none; display: flex; border-bottom: 1px solid var(--line); background: rgba(0, 0, 0, .15); }
.tab {
  flex: 1;
  min-width: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: none;
  border: 0;
  padding: 8px 2px 7px;
  color: var(--dim);
  cursor: pointer;
  font-weight: 600;
  font-size: 12.5px;
}
.tab i { font-style: normal; font-size: 19px; line-height: 1; }
.tab .badge:not(:empty) { position: absolute; top: 4px; left: calc(50% + 9px); }
.tab .count { position: absolute; top: 6px; left: calc(50% + 12px); font-size: 10.5px; }
.tab .lb { max-width: 100%; }
.tab .ls { display: none; }
.tab .lb { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform .2s;
}
.tab.active { color: var(--fg); }
.tab.active::after { transform: scaleX(1); }
.badge:not(:empty) {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--accent);
  color: #000;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
}
.count { color: var(--dim); font-weight: 400; font-size: 12px; }
.tab-body {
  flex: 1;
  min-height: 0;
  padding: 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--line2) transparent;
}

.buymode { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; color: var(--dim); font-size: 13px; }
.buymode button {
  min-width: 48px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 4px 10px;
  cursor: pointer;
}
.buymode button.active { background: var(--accent); color: #000; border-color: var(--accent); font-weight: 700; }

.list { display: flex; flex-direction: column; gap: 8px; }
.item {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 46px 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: linear-gradient(180deg, var(--card2), var(--card));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 12px 11px;
  text-align: left;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
  transition: background .15s, border-color .2s, box-shadow .2s, opacity .2s, transform .08s;
}
/* progression vers le prix : se remplit a mesure que l'argent arrive */
.item::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: calc(var(--p, 0) * 100%);
  background: linear-gradient(90deg, var(--accent2), var(--accent));
  opacity: .75;
  transition: width .3s;
}
.item:not(.too-expensive):not(:disabled):not(.locked) {
  border-color: rgba(255, 200, 61, .45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 0 0 1px rgba(255, 200, 61, .12), 0 6px 18px rgba(255, 200, 61, .06);
}
.item:active:not(:disabled) { transform: scale(.985); }
.item:disabled { cursor: default; opacity: .5; }
.item .ic {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .05);
  font-size: 27px;
}
.item .name { font-weight: 650; }
.item .sub { color: var(--dim); font-size: 12.5px; }
.item .cost { color: var(--accent); font-weight: 700; font-size: 13.5px; }
.item.too-expensive .cost { color: var(--danger); }
.item .own { font-size: 26px; font-weight: 800; color: var(--dim); font-variant-numeric: tabular-nums; }
.item.locked { cursor: default; filter: grayscale(1); opacity: .45; }
.item.locked .ic { filter: brightness(0); }
.empty, .note { color: var(--dim); font-size: 13px; }

.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.ach {
  background: linear-gradient(180deg, var(--card2), var(--card));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  font-size: 12.5px;
}
.ach:not(.locked) { border-color: rgba(255, 200, 61, .35); }
.ach .ic { font-size: 24px; }
.ach b { display: block; font-size: 13.5px; margin: 2px 0; }
.ach span { color: var(--dim); }
.ach.locked { opacity: .4; filter: grayscale(1); }

.card {
  background: linear-gradient(180deg, var(--card2), var(--card));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}
.card h2 { margin: 0 0 8px; font-size: 16px; }
.card p { margin: 6px 0; }
.reno-info { color: var(--accent); font-weight: 600; }
.stats { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin: 0; font-size: 13.5px; }
.stats dt { color: var(--dim); }
.stats dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.row { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.btn {
  background: var(--card-h);
  border: 1px solid var(--line2);
  border-radius: 9px;
  padding: 7px 14px;
  cursor: pointer;
  font-weight: 600;
  transition: filter .15s, transform .08s;
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.danger { background: #5a2323; border-color: #8a3434; }
.btn.danger.ghost { background: none; color: var(--danger); }
.btn.confirm { background: var(--danger); color: #000; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 4px 0; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
textarea {
  width: 100%;
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  font: 12px/1.3 Consolas, monospace;
  resize: vertical;
}

/* ------------------------------------------------------------ bandeau, widgets */
.dim { color: var(--dim); }
.gold { color: var(--accent); }
.rate .sep { color: var(--dim); margin: 0 4px; }
#income { color: var(--accent); }
.strip { flex: none; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 4px 0 0; max-width: 100%; }
.chip {
  background: rgba(27, 39, 52, .85);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 4px 11px;
  font-size: 12.5px;
  white-space: nowrap;
  cursor: pointer;
}
.chip.up { border-color: #5a7a3a; color: #b8f08a; }
.chip.down { border-color: #34506e; color: #9cc8ff; }
.chip.hot { border-color: #b4542f; color: #ffb38a; background: rgba(255, 120, 60, .12); animation: pulse 1.2s ease-in-out infinite; }
.chip.good { border-color: #2f7a55; color: #7be3ad; }
.chip.warn { border-color: #8a6a2a; color: #ffd27a; }
.chip.bad { border-color: #8a3434; color: #ff9a9a; }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px rgba(255, 120, 60, .15); } }

.widgets { flex: none; width: min(100%, 540px); display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.card.mini { margin: 0; padding: 9px 12px; font-size: 13.5px; }
.card.mini p { margin: 4px 0; }
.mini-head, .mini-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.mini-foot { margin-top: 6px; font-size: 12.5px; }
.bar { height: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent2), var(--accent)); transition: width .3s; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.seg button { background: var(--card-h); border: 0; padding: 4px 10px; cursor: pointer; font-size: 12.5px; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.active { background: var(--accent); color: #000; font-weight: 700; }

.sect { margin: 14px 2px 8px; font-size: 12.5px; text-transform: uppercase; letter-spacing: .7px; color: var(--dim); }
.sect:first-of-type { margin-top: 4px; }
.sect .dim { text-transform: none; letter-spacing: 0; font-weight: 400; }
.item.broken { border-color: #8a3434; background: #2a1d22; }
.item.broken .sub { color: #ff9a9a; }
.maint h2 { font-size: 15px; }
.mt-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 6px 0; font-size: 13.5px; flex-wrap: wrap; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.ok { background: #1f4d3a; border-color: #2f7a55; }

/* fumee des sources fossiles */
#smoke .puff { opacity: var(--smoke, .5); animation: smoke 4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
#smoke .p2 { animation-delay: -1.3s; }
#smoke .p3 { animation-delay: -2.6s; }
@keyframes smoke { 0% { transform: translateY(6px) scale(.7); } 100% { transform: translateY(-10px) scale(1.15); } }

/* ------------------------------------------------------------ recherche */
.rs-head .item { margin: 8px 0 4px; }
#rp { color: var(--accent); font-size: 20px; }
.tree { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.branch h3 { margin: 4px 2px 6px; font-size: 13.5px; }
.tech {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 8px;
  width: 100%;
  text-align: left;
  background: linear-gradient(180deg, var(--card2), var(--card));
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 10px;
  margin-bottom: 6px;
  cursor: pointer;
  font-size: 12.5px;
  transition: transform .08s, border-color .2s;
}
.tech.open:not(.too-expensive) { border-color: rgba(255, 200, 61, .5); }
.tech.open:active { transform: scale(.98); }
.tech .t-ic { font-size: 20px; }
.tech b { display: block; font-size: 13px; }
.tech .t-desc { display: block; color: var(--dim); margin: 2px 0; }
.tech .t-cost { display: block; color: var(--accent); font-weight: 700; }
.tech.open.too-expensive .t-cost { color: var(--danger); }
.tech.done { border-color: #2f7a55; background: #17302a; cursor: default; }
.tech.done .t-cost { color: #7be3ad; }
.tech.locked { opacity: .5; cursor: default; }
.tech.locked .t-cost, .tech.excluded .t-cost { color: var(--dim); font-weight: 400; }
.tech.excluded { opacity: .35; cursor: default; text-decoration: line-through; }
.tech:disabled { color: inherit; }

/* ------------------------------------------------------------ notifications */
.toasts {
  position: fixed;
  right: calc(16px + var(--safe-r));
  bottom: calc(16px + var(--safe-b));
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 20;
  max-width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  background: rgba(36, 54, 73, .97);
  border: 1px solid var(--line2);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  padding: 10px 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
  animation: slidein .3s ease-out;
  font-size: 14px;
}
.toast.tip { border-left-color: #6fb6ff; }
.toast.out { opacity: 0; transform: translateX(20px); transition: all .4s; }
@keyframes slidein { from { opacity: 0; transform: translateY(10px); } }

/* ------------------------------------------------------------ souris : survol */
@media (hover: hover) and (pointer: fine) {
  .item:hover:not(:disabled) { background: var(--card-h); }
  .btn:hover:not(:disabled) { filter: brightness(1.15); }
  .tech.open:hover { background: var(--card-h); }
  .sun:hover { filter: brightness(1.15); }
  .tab:hover { color: var(--fg); }
  .chip:hover { border-color: var(--line2); }
}

/* ------------------------------------------------------------ ecrans tactiles (telephone, tablette, Tesla) */
.touch body { font-size: 16px; }
.touch .tab { min-height: 56px; }
.touch .buymode button { min-height: 42px; min-width: 56px; font-size: 15px; }
.touch .seg button { min-height: 38px; padding: 4px 14px; font-size: 14px; }
.touch .btn { min-height: 44px; padding: 8px 16px; }
.touch .btn.small { min-height: 40px; }
.touch .chip { padding: 6px 12px; font-size: 13.5px; }
.touch .item { padding: 11px 12px 13px; }
.touch .tech { padding: 11px 12px; }
.touch .check input { width: 22px; height: 22px; }
.touch .fs-btn { width: 44px; height: 44px; }
/* grand ecran tactile (Tesla, tablette) : tout un peu plus gros */
@media (min-width: 1000px) {
  .touch .item .name { font-size: 16.5px; }
  .touch .item .sub, .touch .item .cost { font-size: 14px; }
  .touch .item .ic { width: 52px; height: 52px; font-size: 30px; }
  .touch .item { grid-template-columns: 52px 1fr auto; }
  .touch .tab { font-size: 15px; }
  .touch .tab i { font-size: 19px; }
  .touch .card.mini { font-size: 15px; }
}

/* ------------------------------------------------------------ telephone en portrait */
@media (max-width: 760px) and (orientation: portrait), (max-width: 560px) {
  .app {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    gap: 8px;
    padding: calc(6px + var(--safe-t)) calc(10px + var(--safe-r)) calc(6px + var(--safe-b)) calc(10px + var(--safe-l));
  }
  .play { overflow: visible; }
  .logo { display: none; }
  .energy { font-size: 32px; }
  .rate { font-size: 14px; }
  .boosts { min-height: 0; margin-top: 2px; }
  .fs-btn { top: 2px; }
  /* bandeau sur une ligne, a faire glisser du doigt */
  .strip {
    width: calc(100% + 20px);
    max-width: none;
    margin: 4px -10px 0;
    padding: 0 10px;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .strip::-webkit-scrollbar { display: none; }
  .house-btn { flex: none; height: clamp(130px, 26dvh, 280px); margin-top: 2px; }
  .hint { font-size: 12.5px; }
  .widgets { width: 100%; gap: 6px; margin-top: 4px; }
  .card.mini { padding: 7px 10px; font-size: 13px; }
  .card.mini p { margin: 2px 0; }
  .card.mini .row { margin: 4px 0 0; }
  /* onglets en bas, sous le pouce */
  .tabs { order: 2; border-bottom: 0; border-top: 1px solid var(--line); }
  .tab { gap: 2px; padding: 7px 2px 6px; font-size: 11px; }
  .tab::after { top: 0; bottom: auto; border-radius: 0 0 3px 3px; }
  .tab .count { display: none; }
  .tab .lf { display: none; }
  .tab .ls { display: inline; }
  .tab-body { padding: 10px; }
  .item { grid-template-columns: 42px 1fr auto; gap: 10px; }
  .item .ic { width: 42px; height: 42px; font-size: 24px; }
  .item .own { font-size: 22px; }
  .toasts { left: 10px; right: 10px; bottom: auto; top: calc(8px + var(--safe-t)); max-width: none; }
}
/* portrait peu haut : maison plus petite */
@media (orientation: portrait) and (max-height: 700px) {
  .house-btn { height: clamp(100px, 18dvh, 180px); }
  .energy { font-size: 27px; }
  .rate { font-size: 13px; }
  .hint { display: none; }
}

/* ------------------------------------------------------------ telephone en paysage (peu de hauteur) */
@media (orientation: landscape) and (max-height: 540px) {
  .app {
    gap: 10px;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 46%);
    padding: calc(6px + var(--safe-t)) calc(10px + var(--safe-r)) calc(6px + var(--safe-b)) calc(10px + var(--safe-l));
  }
  .logo { display: none; }
  .energy { font-size: 28px; }
  .rate { font-size: 13.5px; }
  .boosts { min-height: 0; margin-top: 2px; }
  .strip { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; scrollbar-width: none; }
  .chip { padding: 3px 9px; font-size: 12px; }
  .hint { display: none; }
  .widgets { gap: 4px; margin-top: 4px; }
  .card.mini { padding: 6px 10px; font-size: 12.5px; }
  .card.mini p { margin: 2px 0; }
  .card.mini .row { margin: 4px 0 0; }
  .tab { padding: 8px 2px; font-size: 12px; }
  .touch .tab { min-height: 46px; }
  .tab-body { padding: 8px; }
}
@media (orientation: landscape) and (max-height: 540px) and (max-width: 900px) {
  .tab .lb, .tab .count { display: none; }
  .tab i { font-size: 20px; }
}

/* ------------------------------------------------------------ moins d'animations si demande */
/* ------------------------------------------------------------ saisons et alertes (maison) */
.house .flake { animation: snowfall 3.2s linear infinite; }
.house .flake.f2 { animation-duration: 4.1s; animation-delay: -1.4s; }
.house .flake.f3 { animation-duration: 3.6s; animation-delay: -2.6s; }
@keyframes snowfall { from { transform: translate(0, -14px); } to { transform: translate(6px, 26px); } }
.house.autumn #trees circle { fill: #c8742c; }
.house.autumn #trees circle + circle { fill: #e39a3b; }
.house.autumn #forest path { fill: #8a5a24; }
.house.storm #bolt { animation: bolt 2.7s steps(1) infinite; }
@keyframes bolt { 0%, 86%, 92%, 100% { opacity: 0; } 88%, 94% { opacity: 1; } }
.house.heat #sun-glow { transform-box: fill-box; transform-origin: center; transform: scale(1.5); }

.house #portal .swirl { animation: spin 5s linear infinite; }
.sun.ufo { background: radial-gradient(circle, #e8fff2 0%, #6fffb0 40%, rgba(80, 255, 160, 0) 72%);
  animation: bob 1.4s ease-in-out infinite, ufofly 6s ease-in-out infinite alternate; filter: drop-shadow(0 0 10px #8affc1); }
@keyframes ufofly { from { translate: -30px 0; } to { translate: 30px -10px; } }

/* ------------------------------------------------------------ objectifs, atelier, achat auto */
.goal { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.goal:first-child { border-top: 0; padding-top: 2px; }
.goal .ic { font-size: 22px; width: 30px; text-align: center; flex: none; }
.goal .g-body { flex: 1; min-width: 0; font-size: 13.5px; }
.goal .g-body b { display: block; }
.goal .bar { display: block; margin-top: 4px; }
.goal .g-foot { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 12px; margin-top: 3px; }
.goal .reroll { flex: none; font-size: 16px; line-height: 1; }
.goal .reroll.wait { opacity: .4; }
.item.done { border-color: #2f7a55; background: #17302a; opacity: 1; }
.item.gated { opacity: .75; cursor: default; border-style: dashed; border-color: #6a4fb3; }
.item.gated .sub { color: #c4a8ff; }
.item.unlocks:not(.too-expensive) { border-color: #8a6cff; }
.tech.gated { opacity: .6; cursor: default; border-style: dashed; border-color: #6a4fb3; }
.tech.gated .t-cost { color: #c4a8ff; font-weight: 600; }
.item.done .cost { color: #7be3ad; }
.buymode .auto { margin-left: auto; white-space: nowrap; }
@media (max-width: 400px) { .buymode .auto .al, .buymode.has-auto > span { display: none; } }
.buymode .auto.active { background: var(--accent2); color: #000; border-color: var(--accent2); font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  .house .cloud, .house .tw, .boost, .chip.hot, .house .flake, .house.storm #bolt, .house #portal .swirl, .sun.ufo { animation: none; }
}
