/* AusSci · Where does the energy go? (Year 8): the concept cartoons, the simulations' controls and the drawings.
   Cartoons are drawn on a paper-coloured panel, like a page of a comic, and diagrams on a light plate, with fixed
   colours in light and dark mode alike. Each form of energy keeps one colour through the lesson (see EN.E in
   en-kit.js). */

/* ---------- drawings ---------- */
.dia { display: block; width: 100%; height: auto; font-family: 'Atkinson Next', system-ui, sans-serif; touch-action: manipulation; }
.plate { background: #fbfbf6; border: 1px solid #d8ded9; border-radius: 4px; color: #15231d; }
.dia text { fill: #15231d; pointer-events: none; }
.d-lab { font-size: 13px; fill: #34423c; }
.d-small { font-size: 11.5px; fill: #34423c; }
.dia .d-strong { font-weight: 800; fill: #15231d; }
.dia .d-muted { fill: #5f6b66; }
.dia .d-num { font-variant-numeric: tabular-nums; font-weight: 700; }
.dia .d-halo { paint-order: stroke; stroke: rgba(251, 251, 246, 0.9); stroke-width: 3.5px; stroke-linejoin: round; }
.dia .d-on-dark { fill: #f4f1e8; }
.dia .d-halo-dark { paint-order: stroke; stroke: rgba(10, 14, 24, 0.8); stroke-width: 3.5px; stroke-linejoin: round; }
.art { position: relative; width: 100%; }
.art-cv { display: block; width: 100%; height: auto; border-radius: 4px; background: #e9f1f3; }
.art .art-svg { position: absolute; left: 0; top: 0; width: 100%; height: 100%; max-width: none; overflow: visible; }
.arrow line { stroke: #15231d; stroke-width: 1.6; }
.arrow .arrow-head { fill: #15231d; }

/* ---------- controls ---------- */
.ctl .label { margin-bottom: 0.3rem; }
.ctl-range label { display: block; font-size: 0.889rem; font-weight: 700; margin-bottom: 0.2rem; }
.ctl-range output { font-weight: 800; color: var(--y-deep); margin-left: 0.25rem; }
.ctl-range input[type="range"] { width: 100%; max-width: 36rem; accent-color: var(--accent); min-height: 2rem; }
.lab-run { display: flex; flex-wrap: wrap; gap: 0.5rem 0.8rem; align-items: center; }
.en-ctls { display: flex; flex-wrap: wrap; gap: 0.8rem 1.6rem; align-items: flex-start; }
.en-ctls > .ctl-range { flex: 1 1 14rem; }
.opt-row { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; }
.en-opt { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.889rem; font-weight: 700; cursor: pointer; min-height: 2rem; }
.en-opt input { width: 1.1rem; height: 1.1rem; accent-color: var(--accent); }
.seg { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.seg .btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------- concept cartoons: a comic panel, the same in light and dark mode ---------- */
.cc .lab-body { background: #fbf8f1; color: #15231d; border-radius: 0 0 4px 4px; }
.cc-fig { margin: 0; }
.cc-scene { border: 2px solid #1f2a24; border-radius: 10px; overflow: hidden; background: #ffffff; }
.cc-scene-svg { display: block; width: 100%; height: auto; }
.cc-scene-svg .cc-mark { font: 800 34px 'Atkinson Next', system-ui, sans-serif; fill: #c0392b; }
.cc-scene-svg .cc-q, .cc-face .cc-q { font: 800 30px 'Atkinson Next', system-ui, sans-serif; fill: #7b8781; }
.cc-ask { font-weight: 800; font-size: 1.056rem; line-height: 1.35; margin: 0.65rem 0 0; color: #15231d; max-width: 46rem; }
.cc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 0.9rem 0.8rem; align-items: end; }
.cc-card { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.cc-pick { font: inherit; color: #15231d; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; display: flex; flex-direction: column; align-items: center; width: 100%; text-align: left; }
.cc-bubble { position: relative; display: block; width: 100%; box-sizing: border-box; background: #ffffff; border: 2px solid #1f2a24; border-radius: 16px; padding: 0.6rem 0.75rem; font-size: 0.889rem; line-height: 1.38; color: #15231d; min-height: 7.4rem; }
.cc-bubble::before { content: ''; position: absolute; left: calc(50% - 11px); bottom: -14px; border-style: solid; border-width: 14px 11px 0; border-color: #1f2a24 transparent transparent; }
.cc-bubble::after { content: ''; position: absolute; left: calc(50% - 8px); bottom: -10px; border-style: solid; border-width: 11px 8px 0; border-color: #ffffff transparent transparent; }
.cc-person { display: block; width: 4.6rem; margin-top: 0.9rem; }
.cc-face { display: block; width: 100%; height: auto; overflow: visible; }
.cc-name { display: block; font-weight: 800; font-size: 0.889rem; margin-top: 0.1rem; color: #15231d; text-align: center; }
.cc-tick { visibility: hidden; display: inline-block; font-size: 0.722rem; font-weight: 800; color: #ffffff; background: #1b5e46; border-radius: 999px; padding: 0.1rem 0.55rem; margin-top: 0.25rem; }
.cc-pick:hover .cc-bubble { background: #f2f7f1; }
.cc-pick:hover .cc-bubble::after { border-top-color: #f2f7f1; }
.cc-pick:focus-visible { outline: none; }
.cc-pick:focus-visible .cc-bubble { outline: 3px solid #1b5e46; outline-offset: 3px; }
.cc-card.is-picked .cc-bubble { border-color: #1b5e46; box-shadow: 0 0 0 2px #1b5e46; }
.cc-card.is-picked .cc-bubble::before { border-top-color: #1b5e46; }
.cc-card.is-picked .cc-tick { visibility: visible; }
.cc-bubble-own { border-style: dashed; background: #fffdf8; display: flex; flex-direction: column; gap: 0.3rem; }
.cc-bubble-own::after { border-top-color: #fffdf8; }
.cc-own-l { font-weight: 800; font-size: 0.833rem; }
.cc .cc-bubble-own textarea { background: #ffffff; color: #15231d; border: 1px solid #8d9a93; font-size: 0.833rem; padding: 0.35rem 0.45rem; min-height: 3.6rem; }
.cc .btn { background: #ffffff; color: #15231d; border-color: #56645e; }
.cc .btn:hover { border-color: #15231d; color: #15231d; }
.cc .btn[aria-pressed="true"] { background: #1b5e46; border-color: #1b5e46; color: #ffffff; }
.cc-own-pick { margin-top: 0.35rem; }
.cc-card-own.is-picked .cc-bubble { border-color: #1b5e46; border-style: solid; box-shadow: 0 0 0 2px #1b5e46; }
.cc .cc-status { color: #15231d; }
.cc .cc-status b { color: #1b5e46; }

/* the same cartoon after the simulation: a list to choose from again, with the verdicts */
.cc-again > .lab { border-color: var(--y-stripe); }
.cc-first { margin: 0; color: var(--ink-2); }
.cc-again-q { margin: 0; font-weight: 800; }
.cc-list { display: grid; gap: 0.5rem; }
.cc-row { border: 1px solid var(--rule); border-radius: 4px; background: var(--box); }
.cc-rpick { display: flex; gap: 0.75rem; align-items: center; width: 100%; font: inherit; color: var(--ink); text-align: left; background: none; border: 0; padding: 0.5rem 0.75rem; cursor: pointer; min-height: 3rem; }
.cc-rpick:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; border-radius: 4px; }
.cc-rface { flex: none; width: 2.6rem; border-radius: 50%; background: #f1ede4; overflow: hidden; }
.cc-face-sm { width: 100%; height: auto; display: block; }
.cc-rt { flex: 1; min-width: 0; }
.cc-row.is-picked { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.cc-row.is-picked .cc-rt b::after { content: ' · your choice'; font-weight: 700; color: var(--ink-3); }
.cc-row.is-ok { border-color: var(--ok); }
.cc-row.is-ok.is-picked { background: var(--ok-bg); box-shadow: inset 0 0 0 1px var(--ok); }
.cc-row.is-no.is-picked { background: var(--bad-bg); border-color: var(--bad); box-shadow: inset 0 0 0 1px var(--bad); }
.cc-verdict { margin: 0; padding: 0 0.8rem 0.65rem 4.1rem; font-size: 0.944rem; }
.cc-row.is-ok .cc-verdict strong { color: var(--ok); }
.cc-row.is-no .cc-verdict strong { color: var(--bad); }

/* ---------- energy bars ---------- */
.en-bars-slot { max-width: 48rem; }
.dia .en-bar-track { fill: #e6ebe6; }
.dia .en-bar-total .en-bar-track { fill: #f1f4f0; }
.dia .en-bar-tot { fill: none; stroke: #15231d; stroke-width: 1.5; }
.dia .en-bar-seg { opacity: 0.9; }

/* ---------- screen 1: the skate ramp ---------- */
.ramp-art .art-cv { background: #cfe6f2; }
.ramp-art .art-svg { touch-action: none; }
.dia .ramp-tick { stroke: #3d4a44; stroke-width: 1.2; }
.dia .ramp-start { fill: #1e4678; font-weight: 700; paint-order: stroke; stroke: rgba(240, 246, 248, 0.9); stroke-width: 3px; }
.dia .ramp-read { paint-order: stroke; stroke: rgba(240, 246, 248, 0.9); stroke-width: 3.5px; stroke-linejoin: round; }
.ramp-hit { cursor: grab; }

/* ---------- screen 2: the zoom lens ---------- */
.lens-art .art-cv { background: #efe7da; }
.lens-art .art-svg { touch-action: none; cursor: crosshair; }
.lens-seg .btn { min-height: 2.2rem; }
.dia .lens-badge-t { fill: #ffffff; font-size: 11px; font-weight: 800; }

/* ---------- screen 3: the bouncing ball ---------- */
.bounce-art .art-cv { background: #e4eaee; }
.dia .bounce-rule { fill: rgba(224, 106, 27, 0.22); stroke: #b85a12; stroke-width: 1; stroke-dasharray: 3 2; }
.dia .bounce-rule-t { fill: #8a430c; font-weight: 700; }

/* ---------- screen 4: the circuit and the heat camera ---------- */
.circ-art .art-cv { background: #e6ebe4; }
.circ-flow-slot { max-width: 48rem; }
.dia .flow-box { fill: #ffffff; stroke: #c3ccc6; stroke-width: 1.2; }
.flow-arrow line { stroke-width: 2.6; }
.cam-art .art-cv { background: #dfe6e9; }
.cam-art .art-svg { touch-action: none; cursor: ew-resize; }
.dia .cam-line { stroke: #ffffff; stroke-width: 3; filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.5)); }
.dia .cam-knob { fill: #ffffff; stroke: #1f2a24; stroke-width: 1.5; }
.dia .cam-knob-t { font-size: 16px; font-weight: 800; fill: #1f2a24; }
.dia .cam-ring { fill: none; stroke: #ffffff; stroke-width: 2.5; stroke-dasharray: 6 4; }

/* ---------- screen 5: energy flow diagrams ---------- */
.sk-svg { max-width: 48rem; }
.dia .sk-band { opacity: 0.92; }
.crit-intro { margin: 0; max-width: 44rem; }
.crit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; max-width: 52rem; }
.crit-card { border: 1px solid var(--rule); border-radius: 4px; padding: 0.7rem 0.8rem; background: var(--box); }
.crit-card.is-done { border-color: var(--ok); }
.crit-card > * + * { margin-top: 0.5rem; }
.crit-head { display: flex; align-items: center; gap: 0.55rem; }
.crit-face { width: 2.3rem; flex: none; border-radius: 50%; background: #f1ede4; overflow: hidden; }
.crit-card .fb { margin: 0.5rem 0 0; }

/* ---------- screen 6: the chain reaction machine ---------- */
.chain-art .art-cv { background: #e6ebef; }
.dia .ch-badge circle { fill: #ffffff; stroke: #56645e; stroke-width: 1.5; }
.dia .ch-badge-t { font-size: 12px; font-weight: 800; fill: #34423c; }
.dia .ch-badge.is-now circle { fill: #1b5e46; stroke: #1b5e46; }
.dia .ch-badge.is-now .ch-badge-t { fill: #ffffff; }

/* ---------- screen 7: the fire drill and the fire saw ---------- */
.drill-art .art-cv { background: #ecd3ad; }
.drill-art .art-svg { touch-action: none; cursor: ew-resize; }
.drill-flow-slot, .saw-slot { max-width: 48rem; }
.dia .drill-chip.is-now .flow-box { stroke: #1b5e46; stroke-width: 2.5; }
.dia .saw-wood { fill: #b8834e; stroke: #8a5a2b; stroke-width: 1.4; }
.dia .saw-split { stroke: #4a2c16; stroke-width: 2.5; }
.dia .saw-wedge { fill: #d9b07a; stroke: #8a5a2b; stroke-width: 1; }
.dia .saw-tinder { fill: #d9bf72; stroke: #a88a42; stroke-width: 1; }
.dia .saw-glow { fill: #ff6a1a; filter: blur(6px); }
.dia .saw-woomera { fill: #7a4a26; stroke: #4a2c16; stroke-width: 1.2; }
.saw-svg { touch-action: none; cursor: ew-resize; }

/* ---------- screen 8: the journey and the cartoon maker ---------- */
.jr-list { display: grid; gap: 0.45rem; }
.jr-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 0.4rem 1rem; align-items: center; border: 1px solid var(--rule); border-radius: 4px; padding: 0.45rem 0.7rem; background: var(--box); }
.jr-q { margin: 0; font-weight: 700; }
.jr-picks { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.jr-pick { display: inline-flex; align-items: center; gap: 0.45rem; min-width: 0; }
.jr-face { width: 2.1rem; flex: none; border-radius: 50%; background: #f1ede4; overflow: hidden; }
.jr-t { font-size: 0.889rem; line-height: 1.3; }
.jr-t small { display: block; color: var(--ink-3); font-size: 0.75rem; font-weight: 700; }
.jr-ok { color: var(--ok); font-weight: 800; }
.jr-arrow { color: var(--ink-3); font-weight: 800; }
.mk-ideas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.7rem 1rem; }
.mk-idea { display: flex; gap: 0.6rem; align-items: flex-start; }
.mk-face { width: 2.6rem; flex: none; border-radius: 50%; background: #f1ede4; overflow: hidden; margin-top: 1.4rem; }
.mk-in { flex: 1; min-width: 0; }
.mk-in > label:first-child { display: block; font-weight: 700; font-size: 0.889rem; margin-bottom: 0.25rem; }
.mk-right { margin-top: 0.2rem; font-size: 0.833rem; }
.mk-preview .cc-pick { cursor: default; }
.mk-preview .cc-pick:hover .cc-bubble { background: #ffffff; }

@media (max-width: 640px) {
  .dia .d-small { font-size: 15px; }
  .dia .d-lab { font-size: 16px; }
  .cc-grid { grid-template-columns: minmax(0, 1fr); gap: 0.7rem; }
  .cc-pick, .cc-card-own { display: grid; grid-template-columns: 3.6rem minmax(0, 1fr); grid-template-areas: "face bubble" "name bubble" ". tick"; align-items: center; column-gap: 1rem; width: 100%; }
  .cc-card { align-items: stretch; }
  .cc-person { grid-area: face; width: 3.6rem; margin: 0; }
  .cc-name { grid-area: name; align-self: start; }
  .cc-bubble { grid-area: bubble; min-height: 0; }
  .cc-tick, .cc-own-pick { grid-area: tick; justify-self: start; }
  .cc-bubble::before { left: -14px; top: calc(50% - 10px); bottom: auto; border-width: 10px 14px 10px 0; border-color: transparent #1f2a24 transparent transparent; }
  .cc-bubble::after { left: -10px; top: calc(50% - 7px); bottom: auto; border-width: 7px 11px 7px 0; border-color: transparent #ffffff transparent transparent; }
  .cc-pick:hover .cc-bubble::after { border-top-color: transparent; border-right-color: #f2f7f1; }
  .cc-card.is-picked .cc-bubble::before { border-top-color: transparent; border-right-color: #1b5e46; }
  .cc-bubble-own::after { border-top-color: transparent; border-right-color: #fffdf8; }
  .cc-verdict { padding-left: 0.8rem; }
  .crit-grid, .mk-ideas, .jr-row { grid-template-columns: minmax(0, 1fr); }
}
