/* GlowFix — modern, chunky, image-first UI */
:root {
  --bg: #070b14;
  --bg2: #0e1524;
  --panel: #151d30;
  --panel2: #1a2438;
  --text: #f4f7ff;
  --muted: #8b9bb8;
  --accent: #ffc14a;
  --accent2: #5eead4;
  --danger: #fb7185;
  --ok: #4ade80;
  --wire-live: #f87171;
  --wire-neutral: #60a5fa;
  --plus: #f87171;
  --minus: #60a5fa;
  --shade: #c4b5fd;
  --lamp-base: #64748b;
  --bulb-glass: rgba(255, 248, 220, 0.55);
  --glow: rgba(255, 200, 60, 0.9);
  --radius: 20px;
  --tap: 56px;
  --tap-lg: 64px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --shadow: 0 12px 40px rgba(0,0,0,0.45);
}

*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg); color: var(--text);
  font-family: var(--font);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; border: none; background: none; }
[hidden] { display: none !important; }

.app {
  max-width: 430px;
  margin: 0 auto;
  height: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse 90% 55% at 50% -10%, #1e3a5f 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 80% 100%, #1a274455 0%, transparent 50%),
    var(--bg);
  position: relative;
}

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 18px 16px calc(14px + env(safe-area-inset-bottom));
  gap: 14px;
  min-height: 0;
}
.screen.active { display: flex; }

/* Start — minimal */
.brand {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; gap: 14px;
}
.logo-orb {
  width: 120px; height: 120px; border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 40% 35%, #2a3a58, #121a2b);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08), 0 0 48px rgba(255,191,58,0.35), var(--shadow);
}
.logo { font-size: 64px; line-height: 1; filter: drop-shadow(0 0 20px var(--glow)); }
.brand h1 {
  margin: 0; font-size: 2.6rem; letter-spacing: 0.06em; font-weight: 800;
  background: linear-gradient(135deg, #fff 30%, var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.btn {
  min-height: var(--tap);
  min-width: var(--tap);
  padding: 14px 24px;
  border-radius: 16px;
  font-weight: 700;
  font-size: 1.05rem;
  transition: transform 0.12s ease, opacity 0.12s, box-shadow 0.12s;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-xl { min-height: var(--tap-lg); font-size: 1.25rem; letter-spacing: 0.02em; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #f59e0b);
  color: #1a1200;
  width: 100%;
  box-shadow: 0 10px 28px rgba(255, 191, 58, 0.4);
}
.btn-secondary {
  background: var(--panel);
  border: 1px solid rgba(255,255,255,0.12);
  width: 100%;
  min-height: var(--tap);
}
.btn-ghost {
  width: var(--tap); height: var(--tap);
  border-radius: 16px;
  background: rgba(255,255,255,0.07);
  font-size: 1.4rem;
  display: grid; place-items: center;
}
.btn-ghost:hover { background: rgba(255,255,255,0.12); }
.btn-ghost-wide {
  width: var(--tap); height: var(--tap);
  margin: 0 auto;
  border-radius: 16px;
  background: rgba(255,255,255,0.06);
  font-size: 1.3rem;
  display: grid; place-items: center;
  color: var(--muted);
}

.disclaimer-short, .disclaimer-footer, .safety-line {
  margin: 0; font-size: 0.7rem; line-height: 1.3; color: var(--muted); text-align: center;
  opacity: 0.85;
}
.disclaimer-footer { padding-top: 2px; }

/* Topbar */
.topbar {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}
.topbar h2 { margin: 0; flex: 1; text-align: center; font-size: 1.25rem; font-weight: 700; }
.spacer { width: var(--tap); flex-shrink: 0; }
.progress-wrap { flex: 1; text-align: center; min-width: 0; }
.level-title { margin: 0; font-size: 1rem; font-weight: 700; }
.phase-label { margin: 2px 0 0; font-size: 0.7rem; color: var(--muted); min-height: 1em; }
.progress {
  height: 8px; border-radius: 999px; background: rgba(255,255,255,0.1);
  margin-top: 8px; overflow: hidden;
}
.progress-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent2), var(--accent));
  border-radius: inherit;
  transition: width 0.35s ease;
}

/* Level cards — icon-first, chunky */
.level-list {
  flex: 1; display: flex; flex-direction: column; gap: 10px;
  justify-content: flex-start; overflow-y: auto;
  -webkit-overflow-scrolling: touch; padding-bottom: 8px; min-height: 0;
}
.level-list.scrollable { overscroll-behavior: contain; }
.level-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid rgba(255,255,255,0.08);
  text-align: left; width: 100%;
  min-height: 72px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
.level-card:not(.locked):active { transform: scale(0.98); }
.level-card:not(.locked):hover { border-color: rgba(255,191,58,0.45); }
.level-card.locked { opacity: 0.5; }
.level-card.done { border-color: rgba(74,222,128,0.5); background: linear-gradient(90deg, rgba(74,222,128,0.08), var(--panel)); }
.level-icon { font-size: 1.75rem; width: 40px; text-align: center; flex-shrink: 0; line-height: 1; }
.level-num {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  background: rgba(255,191,58,0.18); color: var(--accent);
  font-weight: 800; font-size: 1.15rem; flex-shrink: 0;
}
.level-meta { flex: 1; display: flex; flex-direction: column; gap: 0; min-width: 0; }
.level-meta strong { font-size: 1.1rem; font-weight: 700; }
.level-meta small { display: none; }
.level-badge { font-size: 1.1rem; color: var(--accent2); white-space: nowrap; min-width: 28px; text-align: center; }

/* Stage — big play area */
.stage {
  flex: 1;
  min-height: 320px;
  border-radius: 24px;
  background:
    radial-gradient(ellipse 70% 60% at 50% 40%, #1a2744 0%, transparent 70%),
    linear-gradient(180deg, #121a2e 0%, #0a101c 100%);
  border: 1px solid rgba(255,255,255,0.07);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), var(--shadow);
}
.stage-inner {
  width: 100%; height: 100%;
  position: relative;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 12px;
  transform: scale(1.32);
  transform-origin: center center;
}

.hint {
  min-height: 1.6em; margin: 0;
  font-size: 0.95rem; font-weight: 600; color: var(--accent);
  text-align: center; line-height: 1.25;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255,191,58,0.08);
}
.hint:empty { background: transparent; padding: 0; min-height: 0.5em; }
.actions {
  display: flex; flex-direction: column; gap: 10px;
  flex-shrink: 0;
}

/* Intro — icon + title only */
.intro-panel {
  text-align: center; padding: 12px; max-width: 300px;
}
.intro-panel h3 { margin: 0; font-size: 1.5rem; font-weight: 800; }
.intro-panel p { display: none; }
.intro-art {
  font-size: 88px; margin-bottom: 8px; line-height: 1;
  filter: drop-shadow(0 0 24px rgba(255,191,58,0.4));
}

/* Modal — visual first */
.modal-root {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(3, 6, 12, 0.78);
  backdrop-filter: blur(8px);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 16px; padding-bottom: calc(16px + env(safe-area-inset-bottom));
}
.modal {
  width: 100%; max-width: 420px;
  background: var(--bg2);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 24px;
  padding: 22px 18px 18px;
  max-height: 85dvh; overflow: auto;
  box-shadow: 0 -12px 48px rgba(0,0,0,0.55);
}
.modal-kicker {
  margin: 0 0 4px; font-size: 0.65rem; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--accent2); font-weight: 700;
}
.modal h3 { margin: 0 0 10px; font-size: 1.35rem; font-weight: 800; text-align: center; }
.modal-body { color: var(--text); font-size: 0.95rem; line-height: 1.35; text-align: center; }
.modal-body ol { display: none; }
.modal-body .simp { display: none; }
.modal-body .diagram {
  margin: 4px 0 12px; padding: 16px; border-radius: 16px;
  background: rgba(0,0,0,0.35); text-align: center;
  border: 1px solid rgba(255,255,255,0.06);
}
.modal-body .diagram.big svg { width: 100%; max-height: 160px; height: auto; }
.modal-body .diagram svg { width: 100%; height: auto; max-height: 140px; }
.lesson-one {
  margin: 0; font-size: 1.15rem; font-weight: 700; color: var(--text);
  letter-spacing: 0.01em;
}
.win-art {
  font-size: 72px; line-height: 1; margin: 8px 0 4px;
  filter: drop-shadow(0 0 28px var(--glow));
  animation: winPulse 1.2s ease infinite;
}
.modal-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }

.win-glow { animation: winPulse 1.2s ease infinite; }
@keyframes winPulse {
  0%, 100% { filter: drop-shadow(0 0 12px var(--glow)); }
  50% { filter: drop-shadow(0 0 32px var(--glow)); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .win-art { animation: none; }
}

@media (min-width: 600px) {
  .app {
    max-width: 420px;
    margin: 24px auto;
    height: calc(100% - 48px);
    min-height: 720px;
    border-radius: 28px;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 24px 64px rgba(0,0,0,0.5);
    overflow: hidden;
  }
  .modal-root { align-items: center; }
  .modal { border-radius: 24px; }
}

/* Bigger hotspots / contacts */
.hotspot { outline: 3px dashed rgba(255,191,58,0.65); outline-offset: 4px; animation: pulse-hot 1.4s ease-in-out infinite; cursor: pointer; }
@keyframes pulse-hot { 50% { outline-color: rgba(94,234,212,0.75); } }

.contact-bottom {
  width: 22px !important; height: 14px !important;
  min-width: 22px; min-height: 14px;
}
.socket-screw { width: 18px !important; height: 18px !important; }
.battery { min-height: 36px; font-size: 0.85rem !important; }
.nl-module { width: 80px !important; height: 60px !important; }
.nl-led { width: 24px !important; height: 24px !important; }
.rm-power { width: 56px !important; height: 56px !important; font-size: 22px !important; }
.bell-plunger { width: 56px !important; height: 56px !important; }
.usb-pins .pin { width: 10px !important; height: 20px !important; }
.fl-switch { width: 52px !important; height: 24px !important; }
.fl-switch .knob { width: 22px !important; height: 18px !important; }
.strip-switch { width: 56px !important; height: 32px !important; }
.part-chip {
  padding: 0; width: 12px; height: 12px; border-radius: 50%;
  background: rgba(255,255,255,0.25); border: 2px solid rgba(255,255,255,0.2);
  font-size: 0; color: transparent; overflow: hidden;
}


/* Desk / table */
.desk {
  position: absolute; bottom: 8%; left: 8%; right: 8%; height: 18%;
  background: linear-gradient(180deg, #3d2b1f, #2a1c14);
  border-radius: 8px 8px 4px 4px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

/* ===== LAMP (Level 1) ===== */
.lamp {
  position: relative;
  width: 210px; height: 300px;
  margin-bottom: 40px;
}
.lamp-shade {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 160px; height: 80px;
  background: linear-gradient(180deg, #ddd6fe, var(--shade));
  border-radius: 8px 8px 40% 40%;
  box-shadow: inset 0 -8px 16px rgba(0,0,0,0.15);
  z-index: 5;
  cursor: grab;
  transition: transform 0.45s ease, opacity 0.45s ease;
  touch-action: none;
}
.lamp-shade::after {
  content: ""; position: absolute; bottom: -6px; left: 20%; right: 20%; height: 8px;
  background: #a78bfa; border-radius: 4px;
}
.lamp-shade.removed {
  transform: translate(-50%, -120px) rotate(-8deg);
  opacity: 0; pointer-events: none;
}
.lamp-shade.hotspot::before {
  content: ""; position: absolute; inset: -8px;
  border: 2px dashed var(--accent); border-radius: 12px;
  animation: pulse 1.4s ease infinite;
}

.lamp-bulb {
  position: absolute; top: 62px; left: 50%; transform: translateX(-50%);
  width: 68px; height: 86px; z-index: 4;
  cursor: grab; touch-action: none;
  transition: transform 0.4s ease, opacity 0.4s;
}
.lamp-bulb .glass {
  width: 56px; height: 48px;
  background: radial-gradient(ellipse at 40% 30%, #fff8e7, var(--bulb-glass));
  border: 2px solid rgba(255,255,255,0.35);
  border-radius: 50% 50% 40% 40%;
  position: relative;
}
.lamp-bulb .filament {
  position: absolute; top: 18px; left: 50%; transform: translateX(-50%);
  width: 18px; height: 14px;
  border: 2px solid #fbbf24;
  border-radius: 50%;
  opacity: 0.7;
}
.lamp-bulb .base {
  width: 36px; height: 22px; margin: -2px auto 0;
  background: repeating-linear-gradient(180deg, #a8a29e 0 3px, #78716c 3px 6px);
  border-radius: 0 0 4px 4px;
}
.lamp-bulb.lit .glass {
  background: radial-gradient(ellipse at 40% 30%, #fff, #ffe08a);
  box-shadow: 0 0 40px 12px var(--glow), 0 0 80px 24px rgba(255,180,40,0.35);
}
.lamp-bulb.lit .filament { opacity: 1; border-color: #fff; box-shadow: 0 0 8px #fff; }
.lamp-bulb.unscrewed {
  transform: translate(70px, 40px) rotate(25deg);
}
.lamp-bulb.hotspot .glass {
  outline: 2px dashed var(--accent); outline-offset: 4px;
  animation: pulse 1.4s ease infinite;
}
.lamp-bulb.aside {
  position: absolute; top: 120px; left: auto; right: -10px;
  transform: rotate(18deg); z-index: 6;
}

.lamp-socket {
  position: absolute; top: 118px; left: 50%; transform: translateX(-50%);
  width: 64px; height: 50px; z-index: 3;
}
.socket-ring {
  width: 64px; height: 28px;
  background: linear-gradient(180deg, #94a3b8, #64748b);
  border-radius: 4px;
  display: flex; align-items: center; justify-content: space-around;
  padding: 0 8px;
  cursor: pointer;
}
.socket-screw {
  width: 14px; height: 14px; border-radius: 50%;
  background: #334155; border: 2px solid #94a3b8;
  position: relative;
}
.socket-screw::after {
  content: ""; position: absolute; top: 50%; left: 2px; right: 2px; height: 2px;
  background: #94a3b8; transform: translateY(-50%);
}
.socket-screw.out { opacity: 0.25; transform: scale(0.6); }
.socket-inner {
  margin-top: 2px; height: 36px;
  background: #1e293b; border: 2px solid #475569; border-radius: 0 0 8px 8px;
  position: relative; overflow: hidden;
  display: none;
}
.lamp-socket.open .socket-ring { opacity: 0.35; }
.lamp-socket.open .socket-inner { display: block; }
.lamp-socket.hotspot .socket-ring {
  outline: 2px dashed var(--accent); outline-offset: 3px;
  animation: pulse 1.4s ease infinite;
}

.contact-bottom {
  position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%);
  width: 16px; height: 10px;
  background: #fbbf24; border-radius: 2px 2px 4px 4px;
  box-shadow: 0 0 0 2px #92400e;
  cursor: grab; touch-action: none;
  transition: bottom 0.25s ease, background 0.25s;
}
.contact-bottom.loose {
  bottom: 0; background: #fb7185;
  box-shadow: 0 0 0 2px #9f1239, 0 0 12px rgba(251,113,133,0.5);
}
.contact-bottom.fixed {
  bottom: 10px; background: #4ade80;
  box-shadow: 0 0 0 2px #166534, 0 0 10px rgba(74,222,128,0.5);
}
.contact-bottom.hotspot {
  outline: 2px dashed var(--accent); outline-offset: 4px;
  animation: pulse 1.4s ease infinite;
}
.contact-thread {
  position: absolute; top: 4px; left: 4px; right: 4px; height: 8px;
  background: repeating-linear-gradient(90deg, #94a3b8 0 4px, #64748b 4px 8px);
  border-radius: 2px; opacity: 0.8;
}

.lamp-stem {
  position: absolute; top: 168px; left: 50%; transform: translateX(-50%);
  width: 14px; height: 50px;
  background: linear-gradient(90deg, #94a3b8, #475569);
  border-radius: 4px; z-index: 2;
}
.lamp-base {
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100px; height: 28px;
  background: linear-gradient(180deg, #78879a, var(--lamp-base));
  border-radius: 8px 8px 12px 12px; z-index: 1;
}
.wires {
  position: absolute; top: 155px; left: 50%; transform: translateX(-50%);
  width: 80px; height: 40px; pointer-events: none; opacity: 0;
  transition: opacity 0.3s;
}
.wires.visible { opacity: 1; }
.wire {
  position: absolute; width: 3px; height: 36px; border-radius: 2px;
}
.wire.live { left: 28px; background: var(--wire-live); }
.wire.neutral { right: 28px; background: var(--wire-neutral); }

/* Schematic */
.schematic {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 12px; width: 100%; max-width: 280px;
}
.schematic svg { width: 100%; height: auto; max-height: 140px; }
.schematic-label { font-size: 0.75rem; color: var(--muted); }

/* Parts tray */
.parts-tray {
  position: absolute; bottom: 10px; left: 10px; right: 10px;
  display: flex; gap: 8px; justify-content: center; flex-wrap: wrap;
  pointer-events: none;
}
.part-chip {
  padding: 4px 10px; border-radius: 999px;
  background: rgba(0,0,0,0.45); border: 1px solid rgba(255,255,255,0.1);
  font-size: 0.7rem; color: var(--muted);
}
.part-chip.got { color: var(--ok); border-color: rgba(74,222,128,0.4); }

/* ===== FLASHLIGHT (Level 2) ===== */
.flashlight {
  position: relative;
  width: 260px; height: 110px;
  margin-bottom: 50px;
}
.fl-head {
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 58px; height: 70px;
  background: linear-gradient(90deg, #94a3b8, #64748b);
  border-radius: 8px 4px 4px 8px;
  cursor: grab; touch-action: none;
  z-index: 4;
  transition: transform 0.45s ease, opacity 0.45s;
}
.fl-head::before {
  content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 36px;
  background: radial-gradient(circle at 40% 40%, #e2e8f0, #64748b);
  border-radius: 50%; border: 2px solid #475569;
}
.fl-head.removed {
  transform: translate(-80px, -80%) rotate(-25deg);
  opacity: 0; pointer-events: none;
}
.fl-head.hotspot {
  outline: 2px dashed var(--accent); outline-offset: 4px;
  animation: pulse 1.4s ease infinite;
}
.fl-bulb-mini {
  position: absolute; left: 48px; top: 50%; transform: translateY(-50%);
  width: 22px; height: 28px; z-index: 3;
  opacity: 0; transition: opacity 0.3s;
}
.flashlight.head-off .fl-bulb-mini { opacity: 1; }
.fl-bulb-mini .glass {
  width: 22px; height: 18px;
  background: var(--bulb-glass); border: 1px solid rgba(255,255,255,0.4);
  border-radius: 50%;
}
.fl-bulb-mini.lit .glass {
  background: #ffe08a;
  box-shadow: 0 0 30px 10px var(--glow), 40px 0 60px 20px rgba(255,200,60,0.4);
}
.fl-body {
  position: absolute; left: 50px; top: 50%; transform: translateY(-50%);
  width: 130px; height: 48px;
  background: linear-gradient(180deg, #334155, #1e293b);
  border-radius: 6px; z-index: 2;
  border: 1px solid #475569;
}
.fl-switch {
  position: absolute; top: -6px; left: 40px;
  width: 40px; height: 18px;
  background: #0f172a; border-radius: 4px; border: 1px solid #64748b;
  cursor: pointer; z-index: 5;
}
.fl-switch .knob {
  position: absolute; top: 2px; left: 2px;
  width: 16px; height: 12px;
  background: #94a3b8; border-radius: 3px;
  transition: left 0.2s ease, background 0.2s;
}
.fl-switch.on .knob { left: 20px; background: var(--ok); }
.fl-switch.hotspot {
  outline: 2px dashed var(--accent); outline-offset: 3px;
  animation: pulse 1.4s ease infinite;
}
.fl-tail {
  position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  width: 44px; height: 48px;
  background: linear-gradient(90deg, #475569, #64748b);
  border-radius: 4px 10px 10px 4px;
  cursor: grab; touch-action: none; z-index: 3;
  transition: transform 0.4s, opacity 0.4s;
}
.fl-tail.removed {
  transform: translate(60px, -80%) rotate(20deg);
  opacity: 0; pointer-events: none;
}
.fl-tail.hotspot {
  outline: 2px dashed var(--accent); outline-offset: 3px;
  animation: pulse 1.4s ease infinite;
}
.fl-beam {
  position: absolute; left: -120px; top: 50%; transform: translateY(-50%);
  width: 120px; height: 80px;
  background: linear-gradient(90deg, rgba(255,200,60,0.55), transparent);
  clip-path: polygon(100% 30%, 100% 70%, 0 100%, 0 0);
  opacity: 0; pointer-events: none; z-index: 1;
  transition: opacity 0.4s;
}
.fl-beam.on { opacity: 1; }

.battery-bay {
  position: absolute; left: 58px; top: 50%; transform: translateY(-50%);
  width: 110px; height: 36px;
  display: none; gap: 4px; align-items: center; justify-content: center;
  z-index: 6; background: #0f172a; border-radius: 4px; border: 1px dashed #475569;
}
.flashlight.open-bay .battery-bay { display: flex; }
.flashlight.open-bay .fl-body { opacity: 0.35; }
.flashlight.open-bay .fl-switch { opacity: 1; z-index: 8; }
.flashlight.open-bay .battery-bay { top: 58%; }

.battery {
  width: 48px; height: 28px;
  background: linear-gradient(180deg, #e2e8f0, #94a3b8);
  border-radius: 3px; border: 1px solid #64748b;
  position: relative; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 4px; font-size: 0.65rem; font-weight: 700;
  user-select: none; touch-action: manipulation;
  transition: transform 0.3s ease;
}
.battery .plus { color: #dc2626; }
.battery .minus { color: #1d4ed8; }
.battery.reversed { transform: scaleX(-1); background: linear-gradient(180deg, #fecaca, #f87171); }
.battery.reversed .plus, .battery.reversed .minus { transform: scaleX(-1); }
.battery.ok { background: linear-gradient(180deg, #bbf7d0, #86efac); }
.battery.hotspot {
  outline: 2px dashed var(--accent); outline-offset: 3px;
  animation: pulse 1.4s ease infinite;
}
.bay-marks {
  position: absolute; inset: 0; pointer-events: none;
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 6px; font-size: 0.55rem; color: var(--muted); opacity: 0.7;
}

/* ===== Levels 3–10 objects ===== */
.hotspot { outline: 2px dashed rgba(255,191,58,0.55); outline-offset: 3px; animation: pulse-hot 1.4s ease-in-out infinite; cursor: pointer; }
@keyframes pulse-hot { 50% { outline-color: rgba(94,234,212,0.7); } }

/* Night light */
.nl { position: relative; width: 190px; height: 210px; }
.nl-cover { position: absolute; inset: 0 10px auto; height: 70px; background: radial-gradient(ellipse, #fef3c7, #f59e0b88); border-radius: 50% 50% 40% 40%; z-index: 3; transition: transform .35s, opacity .35s; }
.nl-cover.removed { transform: translateY(-80px); opacity: 0.25; pointer-events: none; }
.nl-body { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); width: 120px; height: 110px; background: #1e293b; border-radius: 16px; border: 1px solid #475569; }
.nl-module { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); width: 64px; height: 48px; background: #334155; border-radius: 8px; display: grid; place-items: center; transition: transform .3s; }
.nl-module.flipped { transform: translateX(-50%) rotate(180deg); }
.nl-module.ok { transform: translateX(-50%) rotate(0deg); border: 2px solid #4ade80; }
.nl-module.out { transform: translateX(80px) translateY(-40px); opacity: 0.7; }
.nl-led { width: 18px; height: 18px; border-radius: 50%; background: #64748b; }
.nl.lit .nl-led, .nl.lit .nl-cover { background: #fde68a; box-shadow: 0 0 28px #fbbf24; }
.nl-marks { position: absolute; bottom: 2px; left: 4px; right: 4px; display: flex; justify-content: space-between; font-size: 10px; }
.nl-marks b { color: #f87171; } .nl-marks i { color: #60a5fa; font-style: normal; }
.nl-holder { position: absolute; top: 70px; left: 20px; right: 20px; display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.h-plus { color: #f87171; } .h-minus { color: #60a5fa; }
.nl-door { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); background: #0f172a; padding: 4px 10px; border-radius: 6px; font-size: 10px; color: var(--muted); }
.nl-door.open { outline: 1px solid #4ade80; }

/* Remote */
.remote { position: relative; width: 140px; height: 250px; background: #1e293b; border-radius: 16px; border: 1px solid #475569; padding: 10px; }
.rm-ir { position: absolute; top: -6px; left: 50%; transform: translateX(-50%); width: 24px; height: 8px; background: #334155; border-radius: 4px; }
.rm-ir.blink, .remote.ir-on .rm-ir { background: #f87171; box-shadow: 0 0 16px #f87171; animation: irblink .4s ease 2; }
@keyframes irblink { 50% { opacity: 0.3; } }
.rm-keypad { display: grid; gap: 8px; margin-top: 12px; }
.rm-power { width: 44px; height: 44px; border-radius: 50%; background: #0f172a; border: 1px solid #64748b; margin: 0 auto; font-size: 18px; }
.rm-pad { height: 28px; background: #334155; border-radius: 8px; }
.rm-pcb { display: none; font-size: 10px; color: var(--muted); text-align: center; margin-top: 8px; }
.rm-shell.open .rm-pcb.show { display: block; }
.rm-bay { position: absolute; bottom: 36px; left: 10px; right: 10px; height: 52px; }
.rm-cover { position: absolute; inset: 0; background: #334155; border-radius: 8px; z-index: 2; transition: transform .3s; }
.rm-cover.removed { transform: translateX(90px); opacity: 0.3; }
.rm-bay .battery { position: relative; z-index: 1; width: 100%; height: 22px; margin: 4px 0; }
.rm-screws { position: absolute; bottom: 8px; left: 0; right: 0; text-align: center; color: var(--muted); font-size: 12px; }

/* Doorbell */
.bell { position: relative; width: 160px; height: 180px; }
.bell-face { position: absolute; inset: 0; background: linear-gradient(145deg,#94a3b8,#64748b); border-radius: 20px; display: grid; place-items: center; font-weight: 700; z-index: 3; transition: transform .35s, opacity .35s; }
.bell-face.removed { transform: translateY(-90px); opacity: 0.2; pointer-events: none; }
.bell-body { position: absolute; inset: 20px; background: #1e293b; border-radius: 16px; border: 1px solid #475569; }
.bell-plunger { position: absolute; top: 24px; left: 50%; transform: translateX(-50%); width: 48px; height: 48px; border-radius: 50%; background: #f8fafc; box-shadow: inset 0 -4px #cbd5e1; }
.bell-plunger.out { transform: translate(70px, -30px); opacity: 0.6; }
.bell-contact { position: absolute; top: 80px; left: 50%; width: 40px; height: 10px; background: #94a3b8; border-radius: 2px; transform: translateX(-50%) translateY(12px); transition: transform .25s; }
.bell-contact.ok { transform: translateX(-50%) translateY(0); background: #4ade80; }
.bell-contact.open { background: #fb7185; }
.bell-drawer { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--muted); background: #0f172a; padding: 4px 8px; border-radius: 6px; }
.bell-drawer.open { outline: 1px solid #4ade80; }
.bell-chip { position: absolute; right: 10px; top: 50%; font-size: 9px; color: #64748b; }
.ding-burst { position: absolute; top: -10px; right: -20px; font-size: 1.4rem; font-weight: 800; color: var(--accent); opacity: 0; }
.ding-burst.show { opacity: 1; animation: dingpop .5s ease; }
@keyframes dingpop { from { transform: scale(0.5); } to { transform: scale(1.1); } }
.bell.ding .bell-plunger { transform: translateX(-50%) translateY(6px); }

/* Fan */
.fan { position: relative; width: 180px; height: 200px; }
.fan-grill { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); width: 110px; height: 110px; border-radius: 50%; border: 4px solid #64748b; background: radial-gradient(circle, transparent 40%, #33415555 41%); z-index: 3; transition: transform .35s, opacity .35s; }
.fan-grill.removed { transform: translate(-50%, -80px); opacity: 0.25; pointer-events: none; }
.fan-blade { position: absolute; top: 30px; left: 50%; transform: translateX(-50%); width: 80px; height: 80px; display: grid; place-items: center; font-size: 48px; color: #94a3b8; z-index: 2; }
.fan-blade.out { transform: translate(70px, -40px); opacity: 0.5; }
.fan-blade.spin { animation: spinblade 0.6s linear infinite; color: #5eead4; }
@keyframes spinblade { to { transform: translateX(-50%) rotate(360deg); } }
.fan-motor { position: absolute; top: 55px; left: 50%; transform: translateX(-50%); width: 28px; height: 28px; border-radius: 50%; background: #0f172a; display: grid; place-items: center; font-size: 10px; color: var(--muted); z-index: 1; }
.fan-shell { position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%); width: 90px; height: 36px; background: #1e293b; border-radius: 10px; border: 1px solid #475569; }
.fan-shell.open { outline: 1px dashed #5eead4; }
.usb-plug { display: none; position: absolute; bottom: 8px; left: 8px; }
.usb-plug.show { display: block; }
.usb-pins { display: flex; gap: 4px; background: #cbd5e1; padding: 4px 6px; border-radius: 4px; }
.usb-pins .pin { width: 6px; height: 14px; background: #64748b; border-radius: 1px; }
.usb-pins .pin.bent { transform: translateX(-4px) rotate(-25deg); background: #fb7185; }
.usb-pins .pin.ok { background: #4ade80; transform: none; }
.usb-label { font-size: 9px; color: var(--muted); }
.usb-port { position: absolute; bottom: 8px; right: 8px; background: #0f172a; border: 1px solid #475569; padding: 6px 10px; border-radius: 6px; font-size: 11px; color: var(--accent2); }
.usb-port.in { border-color: #4ade80; box-shadow: 0 0 12px #4ade8055; }
.breeze { position: absolute; top: 20px; right: -10px; width: 40px; height: 80px; opacity: 0; background: repeating-linear-gradient(90deg, transparent, transparent 6px, #5eead433 6px, #5eead433 8px); }
.breeze.show { opacity: 1; animation: breeze 0.8s linear infinite; }
@keyframes breeze { to { transform: translateX(8px); opacity: 0.4; } }

/* Cable */
.cable-scene { width: 100%; max-width: 320px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.phone { width: 70px; height: 120px; background: #0f172a; border-radius: 12px; border: 2px solid #64748b; display: grid; place-items: center; }
.phone.charging { border-color: #4ade80; box-shadow: 0 0 20px #4ade8055; }
.phone-bat { font-size: 14px; font-weight: 700; color: var(--accent); }
.cable-line { width: 90%; height: 40px; position: relative; }
.cable-jacket { height: 16px; margin: 12px auto; width: 80%; background: #334155; border-radius: 8px; position: relative; }
.cable-jacket.peeled { height: 36px; background: #1e293b; border: 1px dashed #64748b; padding: 6px; }
.cable-jacket .wire { height: 6px; border-radius: 3px; margin: 3px 0; position: relative; }
.cable-jacket .wire.red { background: #f87171; }
.cable-jacket .wire.blk { background: #94a3b8; }
.cable-jacket .wire.broken::after { content: ""; position: absolute; left: 45%; top: -2px; width: 12px; height: 10px; background: var(--bg); border-left: 2px solid #fb7185; border-right: 2px solid #fb7185; }
.cable-jacket .wire.ok { background: #4ade80; }
.wall-end { padding: 8px 14px; background: #1e293b; border: 1px solid #475569; border-radius: 8px; font-size: 12px; }

/* Power strip */
.strip { position: relative; width: 260px; height: 120px; background: #1e293b; border-radius: 12px; border: 2px solid #475569; padding: 10px; }
.strip.unplugged { opacity: 0.85; filter: grayscale(0.35); }
.strip.plugged { filter: none; opacity: 1; border-color: #4ade80; }
.strip-badge { position: absolute; top: -10px; right: 8px; font-size: 9px; background: #fb7185; color: #1a1200; padding: 2px 6px; border-radius: 4px; font-weight: 700; }
.strip.plugged .strip-badge { background: #4ade80; }
.strip-switch { position: absolute; top: 12px; left: 12px; width: 48px; height: 28px; background: #0f172a; border-radius: 6px; border: 1px solid #64748b; }
.strip-switch .knob { position: absolute; top: 3px; left: 3px; width: 18px; height: 20px; background: #64748b; border-radius: 4px; transition: left .2s; }
.strip-switch.on .knob { left: 24px; background: #4ade80; }
.strip-cover { position: absolute; top: 8px; left: 70px; width: 70px; height: 36px; background: #334155; border-radius: 6px; z-index: 2; transition: transform .3s; }
.strip-cover.removed { transform: translateY(-50px); opacity: 0.3; }
.strip-contact { position: absolute; top: 18px; left: 78px; width: 50px; height: 12px; background: #fb7185; border-radius: 2px; z-index: 1; }
.strip-contact.ok { background: #4ade80; }
.strip-bus { position: absolute; bottom: 36px; left: 12px; right: 12px; font-size: 10px; color: var(--muted); opacity: 0; }
.strip-bus.show { opacity: 1; }
.strip-outlets { position: absolute; bottom: 10px; left: 12px; display: flex; gap: 10px; }
.outlet { width: 28px; height: 18px; border: 2px solid #64748b; border-radius: 4px; }
.outlet.on { border-color: #fbbf24; box-shadow: 0 0 8px #fbbf2455; }
.strip-demo-lamp { position: absolute; bottom: 10px; right: 14px; width: 16px; height: 16px; border-radius: 50%; background: #334155; }
.strip-demo-lamp.on { background: #fde68a; box-shadow: 0 0 16px #fbbf24; }

/* Desk lamp rocker */
.dlamp { position: relative; width: 140px; height: 220px; }
.dl-shade { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 100px; height: 50px; background: #c4b5fd; border-radius: 50% 50% 8% 8%; z-index: 3; transition: transform .35s, opacity .35s; }
.dl-shade.removed { transform: translate(-50%, -70px); opacity: 0.25; }
.dl-bulb { position: absolute; top: 40px; left: 50%; transform: translateX(-50%); width: 36px; height: 50px; background: rgba(255,248,220,0.35); border-radius: 50% 50% 20% 20%; z-index: 2; }
.dl-bulb.out { transform: translate(60px, -20px); opacity: 0.5; }
.dl-bulb.on, .dlamp.lit .dl-bulb { background: #fde68a; box-shadow: 0 0 30px #fbbf24; }
.dl-stem { position: absolute; top: 90px; left: 50%; transform: translateX(-50%); width: 10px; height: 60px; background: #64748b; }
.dl-switch-box { position: absolute; top: 130px; left: 58%; width: 70px; height: 44px; background: #1e293b; border: 1px solid #475569; border-radius: 8px; padding: 4px; }
.dl-switch-box.open { outline: 1px dashed #5eead4; width: 90px; }
.dl-rocker { font-size: 11px; background: #0f172a; border-radius: 4px; text-align: center; padding: 4px; margin-bottom: 4px; }
.dl-rocker.on { background: #4ade80; color: #052e16; font-weight: 700; }
.dl-term { height: 14px; background: #334155; border-radius: 3px; position: relative; }
.dl-term.loose .dl-wire { position: absolute; left: -16px; top: 4px; width: 20px; height: 4px; background: #f87171; transform: rotate(-20deg); }
.dl-term.ok { background: #4ade80; }
.dl-term.ok .dl-wire { display: none; }
.dl-base { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); width: 90px; height: 16px; background: #64748b; border-radius: 8px; }
.dlamp.lit { filter: drop-shadow(0 0 20px #fbbf2488); }

/* Kettle */
.kettle { position: relative; width: 180px; height: 210px; }
.kt-badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 9px; background: #fb7185; color: #1a1200; padding: 2px 8px; border-radius: 4px; font-weight: 700; z-index: 5; }
.kt-pot { position: absolute; top: 20px; left: 50%; transform: translateX(-50%); width: 100px; height: 110px; background: linear-gradient(180deg,#94a3b8,#64748b); border-radius: 12px 12px 8px 8px; transition: transform .35s; overflow: hidden; z-index: 2; }
.kt-pot.up { transform: translate(-50%, -30px); }
.kt-water { position: absolute; bottom: 8px; left: 8px; right: 8px; height: 40%; background: #38bdf855; border-radius: 4px; }
.kt-water.hot { background: #fbbf2488; }
.kt-steam { position: absolute; top: 4px; left: 30%; width: 40%; height: 20px; opacity: 0; background: linear-gradient(transparent, #e2e8f088); }
.kt-steam.show { opacity: 1; animation: steam 1s ease infinite; }
@keyframes steam { 50% { transform: translateY(-6px); opacity: 0.5; } }
.kt-base { position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%); width: 120px; height: 50px; background: #1e293b; border: 1px solid #475569; border-radius: 10px; z-index: 1; }
.kt-base.open { outline: 1px dashed #fbbf24; height: 70px; }
.kt-thermo { position: absolute; top: 10px; left: 12px; font-size: 10px; background: #fb7185; color: #1a1200; padding: 4px 6px; border-radius: 4px; font-weight: 600; }
.kt-thermo.ok { background: #4ade80; }
.kt-heater { position: absolute; bottom: 8px; right: 10px; font-size: 9px; color: var(--muted); }
.kt-heater.on { color: #f87171; font-weight: 700; }
.kt-status { position: absolute; bottom: 4px; left: 0; right: 0; text-align: center; font-size: 11px; color: var(--muted); }
.kettle.off .kt-status { color: #4ade80; }

