/* simulation.css — Écran de simulation : noir pur + visuels batterie Android/iOS. */

body.ibm-simulating { overflow: hidden; }

.sim-root {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #000000;        /* noir pur */
  color: #fff;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

/* Couche noire (fond de base) */
.sim-black { position: absolute; inset: 0; background: #000; }

/* Couche des visuels de batterie, centrée, au-dessus du noir */
.sim-battery-layer {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
  padding:
    env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px)
    env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}

/* Zone tactile discrète du geste secret (invisible) */
.sim-tapzone {
  position: absolute;
  width: 32vw; height: 22vh;
  max-width: 180px; max-height: 180px;
  z-index: 100000;
  background: transparent;
  pointer-events: auto;
  touch-action: none;
}
.sim-tapzone.corner-top-left { top: 0; left: 0; }
.sim-tapzone.corner-top-right { top: 0; right: 0; }
.sim-tapzone.corner-bottom-left { bottom: 0; left: 0; }
.sim-tapzone.corner-bottom-right { bottom: 0; right: 0; }

/* ============ BATTERIE (commun) ============ */
.battery {
  display: flex; flex-direction: column; align-items: center; gap: 22px;
  opacity: 0; transform: scale(.96);
  transition: opacity .28s ease, transform .28s ease;
}
.battery.is-visible { opacity: 1; transform: scale(1); }

.battery__shell { display: flex; align-items: center; }
.battery__body { position: relative; overflow: hidden; }
.battery__fill { position: absolute; top: 0; left: 0; bottom: 0; }
.battery__bolt {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
}
.battery__bolt svg { width: 38%; height: 60%; fill: #fff; }
.battery__label { font-variant-numeric: tabular-nums; }

/* ---------- Thème ANDROID ---------- */
.theme-android .battery__body {
  width: 128px; height: 58px;
  border: 3px solid #eceff1;
  border-radius: 8px;
}
.theme-android .battery__fill {
  background: #eceff1;
  border-radius: 4px;
  margin: 3px;
  top: 0; bottom: 0; height: auto;
}
.theme-android .battery__fill.is-critical { background: #e53935; }
.theme-android .battery__cap {
  width: 6px; height: 22px; margin-left: 3px;
  background: #eceff1; border-radius: 0 3px 3px 0;
}
.theme-android .battery__label {
  font-family: Roboto, "Segoe UI", system-ui, sans-serif;
  font-size: 2.2rem; font-weight: 400; color: #eceff1; letter-spacing: .01em;
}
.theme-android .battery.is-charging .battery__bolt svg { fill: #69f0ae; }

/* ---------- Thème iOS ---------- */
.theme-ios .battery__body {
  width: 134px; height: 60px;
  border: 2.5px solid rgba(255,255,255,.5);
  border-radius: 11px;
}
.theme-ios .battery__fill {
  background: rgba(255,255,255,.9);
  border-radius: 7px;
  margin: 4px;
  top: 0; bottom: 0; height: auto;
}
.theme-ios .battery__fill.is-critical { background: #ff3b30; }
.theme-ios .battery__cap {
  width: 5px; height: 18px; margin-left: 3px;
  background: rgba(255,255,255,.5); border-radius: 0 4px 4px 0;
}
.theme-ios .battery__label {
  font-family: -apple-system, "SF Pro Display", "Helvetica Neue", system-ui, sans-serif;
  font-size: 2.6rem; font-weight: 300; color: #fff; letter-spacing: -.01em;
}
.theme-ios .battery.is-charging .battery__bolt svg { fill: #fff; }

/* ---------- Animation de charge (commune) ---------- */
.battery.is-charging { animation: ibm-charge-pulse 1.4s ease-in-out infinite; }
@keyframes ibm-charge-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .72; }
}
.battery.is-charging .battery__bolt { animation: ibm-bolt 1.4s ease-in-out infinite; }
@keyframes ibm-bolt {
  0%, 100% { transform: scale(1); opacity: .95; }
  50% { transform: scale(1.08); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .battery, .battery.is-charging, .battery.is-charging .battery__bolt { animation: none; transition: opacity .1s linear; }
}
