/* Learned helplessness lesson. All rules scoped under .lh-* */
.lh-sc { position: relative; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.lh-hero img { width: 300px; max-width: 100%; max-height: 34vh; object-fit: contain; display: block; filter: drop-shadow(0 16px 28px rgba(123,92,253,.3)); }
.lh-note { font-size: 13px; color: var(--dim); text-align: center; line-height: 1.35; max-width: 320px; }

/* ---------- the paired dogs ---------- */
.lh-pair { display: grid; grid-template-columns: 1fr 44px 1fr; align-items: center; width: 100%; padding-top: 4px; }
.lh-dogc { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.lh-tag { font-size: 14px; font-weight: 800; letter-spacing: .02em; }
.lh-dogw { position: relative; width: 100%; max-width: 150px; }
.lh-dogw img { display: block; width: 100%; transition: filter .2s; }
.lh-bolt { position: absolute; top: -4px; left: 50%; width: 26px; margin-left: -13px; opacity: 0; fill: var(--gold); filter: drop-shadow(0 0 6px rgba(252,192,80,.9)); }
.lh-pair.shock .lh-bolt { opacity: 1; animation: lhFlick .18s steps(2) 12; }
.lh-pair.shock .lh-dogw img { filter: drop-shadow(0 0 10px rgba(216,85,85,.85)) saturate(1.2); }
@keyframes lhFlick { 50% { opacity: .35; } }
.lh-link { display: flex; flex-direction: column; align-items: center; gap: 2px; font-style: normal; font-size: 12px; color: var(--dim); text-align: center; line-height: 1.1; }
.lh-link svg { width: 40px; height: 12px; stroke: var(--line-strong); stroke-width: 3; stroke-dasharray: 4 3; fill: none; }
.lh-pair.shock .lh-link svg { stroke: var(--gold); }
.lh-panel { min-width: 118px; min-height: 48px; padding: 0 14px; border-radius: 14px; font: 700 15px var(--sans); color: var(--text);
  background: var(--surface); border: 2px solid var(--line-strong); box-shadow: 0 4px 0 #2b2e38; transition: transform .08s, opacity .2s; }
.lh-panel:active { transform: translateY(3px); box-shadow: 0 1px 0 #2b2e38; }
.lh-panel:disabled { opacity: .4; }
.lh-a .lh-panel:not(:disabled) { border-color: var(--gold); }
.lh-said { min-height: 18px; font-size: 13px; font-weight: 700; color: var(--dim); }
.lh-said.no { color: var(--red); }
.lh-said.ok { color: var(--mint); }
.lh-tally { display: flex; gap: 14px; align-items: baseline; justify-content: center; font-size: 13px; color: var(--dim); }
.lh-tally b { font: 600 16px var(--mono); color: var(--text); }

/* ---------- summary rows ---------- */
.lh-sum { width: 100%; display: flex; flex-direction: column; gap: 10px; padding-top: 8px; }
.lh-row { display: grid; grid-template-columns: 70px 1fr; gap: 2px 10px; padding: 12px 14px; border-radius: 14px; background: var(--raised); transition: box-shadow .2s; }
.lh-row b { grid-row: 1 / 3; align-self: center; font-size: 16px; }
.lh-row span { font: 600 14px var(--mono); }
.lh-row em { font-style: normal; font-size: 13px; color: var(--dim); }
.lh-ra em { color: var(--gold); }
.lh-row.on { box-shadow: inset 0 0 0 2px var(--mint); }

/* ---------- the hop box ---------- */
.lh-boxes { width: 100%; display: flex; flex-direction: column; gap: 8px; padding-top: 2px; }
.lh-lane { display: grid; grid-template-columns: 22px 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: end; }
.lh-lk { grid-row: 1 / 3; align-self: center; font-size: 16px; font-weight: 800; }
.lh-lcap { font-size: 12px; color: var(--dim); padding-top: 2px; }
.lh-box { position: relative; height: 58px; border-radius: 10px; background: var(--raised); overflow: hidden; }
.lh-fl, .lh-fr { position: absolute; bottom: 0; height: 6px; width: 48%; }
.lh-fl { left: 0; background: var(--line-strong); }
.lh-fr { right: 0; background: var(--line-strong); }
.lh-wall { position: absolute; left: 50%; bottom: 0; width: 6px; height: 18px; margin-left: -3px; border-radius: 3px 3px 0 0; background: var(--dim); }
.lh-lane.shock .lh-fl { background: var(--gold); box-shadow: 0 0 10px rgba(252,192,80,.9); animation: lhFlick .18s steps(2) 10; }
.lh-sdog { position: absolute; left: 10px; bottom: 5px; height: 42px; }
.lh-sdog.lie { height: 28px; }
.lh-lane.stuck .lh-lcap { color: var(--red); font-weight: 700; }

/* ---------- the circuit ---------- */
.lh-cir { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.lh-cirrow { display: flex; align-items: flex-end; gap: 14px; }
.lh-brain { position: relative; width: 236px; aspect-ratio: 1; }
.lh-brain img { width: 100%; height: 100%; display: block; opacity: .55; filter: saturate(.7); }
.lh-brain svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.lh-t { font: 800 40px var(--sans); fill: var(--text); paint-order: stroke; stroke: var(--bg); stroke-width: 10px; stroke-linejoin: round; }
.lh-tz { fill: var(--dim); }
.lh-meter { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; padding-bottom: 20px; }
.lh-meter svg { width: 26px; height: 150px; display: block; }
.lh-brake { fill: none; stroke: #8E88A8; stroke-width: 12; stroke-dasharray: 18 14; transition: stroke .2s; }
.lh-brakeend { stroke: #8E88A8; stroke-width: 12; stroke-linecap: round; }
.lh-det .lh-dot { fill: #3A405C; stroke: var(--bg); stroke-width: 6; transition: fill .2s; }
.lh-det .lh-halo { fill: var(--gold); opacity: 0; transition: opacity .2s; }
.lh-cir.detecting .lh-det .lh-dot { fill: var(--gold); }
.lh-cir.detecting .lh-det .lh-halo { opacity: .3; }
.lh-cir.detecting .lh-brake, .lh-cir.detecting .lh-brakeend { stroke: var(--gold); }
.lh-alm .lh-dot { fill: #6E3A48; stroke: var(--bg); stroke-width: 6; }
.lh-alm .lh-halo { fill: var(--red); opacity: 0; transition: opacity .3s; }
.lh-cir.hot .lh-alm .lh-dot { fill: var(--red); }
.lh-cir.hot .lh-alm .lh-halo { opacity: .35; }
.lh-zap path { fill: #8E88A8; transition: fill .1s; }
.lh-zapline { stroke: #8E88A8; stroke-width: 10; stroke-dasharray: 14 12; }
.lh-cir.zapping .lh-zap path { fill: var(--gold); }
.lh-cir.zapping .lh-zapline { stroke: var(--gold); }
.lh-mtr { fill: var(--raised); stroke: var(--line-strong); stroke-width: 2; }
.lh-mfill { fill: var(--red); }
.lh-x { opacity: 0; }
.lh-x path { stroke: var(--red); stroke-width: 14; stroke-linecap: round; }
.lh-cir.mark-det .lh-xdet, .lh-cir.mark-alm .lh-xalm { opacity: 1; }
.lh-out { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--dim); }
.lh-out img { height: 40px; }
.lh-out b { color: var(--text); }
.lh-out.bad b { color: var(--red); }
.lh-out.ok b { color: var(--mint); }

/* ---------- backward ---------- */
.lh-flip { width: 100%; display: flex; flex-direction: column; gap: 10px; padding-top: 6px; }
.lh-then, .lh-now { padding: 12px 14px; border-radius: 14px; background: var(--raised); }
.lh-then em, .lh-now em { font: 600 13px var(--mono); font-style: normal; color: var(--dim); }
.lh-then p, .lh-now p { margin: 4px 0 0; font-size: 15px; line-height: 1.35; }
.lh-then p { text-decoration: line-through; text-decoration-color: var(--red); color: var(--dim); }
.lh-now { box-shadow: inset 0 0 0 2px var(--gold); }
.lh-now b { color: var(--gold); }
.lh-flip q { font-family: var(--serif); font-size: 17px; font-style: italic; text-align: center; padding-top: 4px; }
.lh-flip cite { font-size: 12px; font-style: normal; color: var(--dim); text-align: center; }

@media (max-height: 700px) {
  .lh-hero img { max-height: 30vh; }
  .lh-dogw { max-width: 124px; }
  .lh-box { height: 50px; }
  .lh-sdog { height: 36px; }
  .lh-brain { width: 200px; }
  .lh-meter svg { height: 128px; }
}
