/* =========================================================================
   ENERGY MUSEUM — Theme & Design System
   Captures the sci-fi museum look from the mockups: deep-navy tech panels,
   cyan/gold accents, beveled metallic frames, glows. Pure CSS, no images
   required for the UI chrome (dioramas used only as content art).
   ========================================================================= */

/* ---------- Design tokens ---------- */
:root {
  /* Backgrounds */
  --bg-0:        #060a16;
  --bg-1:        #0a1224;
  --bg-2:        #0e1a30;
  --panel:       rgba(14, 26, 48, 0.86);
  --panel-solid: #0e1a30;
  --panel-inset: rgba(6, 12, 26, 0.72);

  /* Accents */
  --cyan:        #35c6ff;
  --cyan-soft:   #8fe3ff;
  --blue:        #1f7fe5;
  --blue-deep:   #1450b4;
  --gold:        #ffb020;
  --gold-soft:   #ffd36b;
  --green:       #7ed321;
  --green-deep:  #4fae10;
  --red:         #ff4d4d;
  --red-deep:    #c62828;

  /* Frame metal */
  --steel-1:     #2a3852;
  --steel-2:     #16233c;
  --edge-light:  #40597f;

  /* Text */
  --ink:         #eaf3ff;
  --ink-dim:     #9fb4d4;
  --ink-faint:   #67809f;

  /* Fonts */
  --font-display: "Fredoka", "Segoe UI", system-ui, sans-serif;
  --font-ui:      "Chakra Petch", "Segoe UI", system-ui, sans-serif;

  /* Station accent (overridden per-station via body[data-station]) */
  --accent:      var(--gold);
  --accent-soft: var(--gold-soft);

  /* Sizing */
  --radius:      16px;
  --radius-sm:   10px;
}

/* Per-station accent theming */
[data-station="solar"]      { --accent:#ffb020; --accent-soft:#ffd36b; }
[data-station="wind"]       { --accent:#31d6c8; --accent-soft:#8ef1e8; }
[data-station="hydro"]      { --accent:#3aa0ff; --accent-soft:#9fd0ff; }
[data-station="fossil"]     { --accent:#e0873a; --accent-soft:#f2c08a; }
[data-station="nuclear"]    { --accent:#b06bff; --accent-soft:#dcb8ff; }
[data-station="geothermal"] { --accent:#ff7a3a; --accent-soft:#ffb488; }
[data-station="biomass"]    { --accent:#7ed321; --accent-soft:#c1f28a; }

/* ---------- Reset ---------- */
* { margin:0; padding:0; box-sizing:border-box; }
html, body { height:100%; }
body {
  font-family: var(--font-ui);
  color: var(--ink);
  background:
    radial-gradient(1200px 700px at 50% -10%, #14284a 0%, transparent 60%),
    radial-gradient(900px 600px at 50% 120%, #10203c 0%, transparent 60%),
    var(--bg-0);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}
img { display:block; max-width:100%; }
button { font-family: inherit; cursor: pointer; color: inherit; }

/* =========================================================================
   Stage scaling — a fixed 1280x720 (16:9) design canvas scaled to the viewport
   ========================================================================= */
#stage-wrap {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  overflow: hidden;
}
#stage {
  position: relative;
  width: 1280px; height: 720px;
  transform-origin: center center;
  border-radius: 4px;
  overflow: hidden;
  background:
    radial-gradient(1100px 700px at 50% -5%, #16294c 0%, transparent 62%),
    radial-gradient(800px 520px at 15% 110%, #10203c 0%, transparent 60%),
    radial-gradient(800px 520px at 85% 110%, #121b38 0%, transparent 60%),
    var(--bg-1);
}

/* Screens fill the stage */
.screen {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  animation: screen-in .45s cubic-bezier(.2,.8,.2,1) both;
}
/* Animate transform only — opacity stays 1 so content is never hidden even if
   the animation is throttled/frozen (headless renderers, reduced-motion, etc.). */
@keyframes screen-in {
  from { transform: translateY(10px) scale(.99); }
  to   { transform: none; }
}
.screen.leaving { animation: screen-out .3s ease both; }
@keyframes screen-out { to { opacity:0; transform: scale(1.02); } }

/* Fullscreen button */
#fullscreen-btn {
  position: fixed; right: 12px; bottom: 12px; z-index: 50;
  width: 40px; height: 40px; border-radius: 10px;
  background: rgba(14,26,48,.75); border: 1px solid var(--edge-light);
  color: var(--cyan-soft); font-size: 18px; line-height: 1;
  backdrop-filter: blur(4px);
  transition: transform .12s, background .2s;
}
#fullscreen-btn:hover { transform: translateY(-2px); background: rgba(31,111,229,.4); }

/* Rotate nudge (portrait phones only) */
#rotate-nudge {
  position: fixed; inset: 0; z-index: 100; display: none;
  place-items: center; text-align: center;
  background: var(--bg-0); color: var(--ink);
}
.rotate-inner { max-width: 300px; padding: 24px; }
.rotate-icon { font-size: 54px; margin-bottom: 12px; animation: rock 1.6s ease-in-out infinite; }
@keyframes rock { 0%,100%{transform:rotate(-12deg)} 50%{transform:rotate(12deg)} }
@media (max-width: 640px) and (orientation: portrait) {
  #rotate-nudge { display: grid; }
}

/* =========================================================================
   Shared chrome: panels, frames, headers
   ========================================================================= */

/* Beveled sci-fi panel/frame */
.panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--edge-light);
  border-radius: var(--radius);
  box-shadow:
    inset 0 1px 0 rgba(120,160,220,.25),
    inset 0 0 40px rgba(6,12,26,.6),
    0 8px 30px rgba(0,0,0,.5);
  backdrop-filter: blur(2px);
}
/* Glowing corner accents used on framed modal screens */
.framed {
  position: absolute; inset: 14px;
  border-radius: 18px;
  padding: 18px 22px;
  background:
    linear-gradient(180deg, rgba(16,30,54,.92), rgba(9,17,34,.94));
  border: 2px solid var(--steel-1);
  box-shadow:
    inset 0 0 0 2px rgba(53,198,255,.10),
    inset 0 0 60px rgba(6,12,26,.7),
    0 10px 40px rgba(0,0,0,.55);
  display: flex; flex-direction: column;
}
.framed::before, .framed::after {
  content:""; position:absolute; width:60px; height:60px; pointer-events:none;
  border: 2px solid var(--cyan);
  filter: drop-shadow(0 0 6px rgba(53,198,255,.6));
  opacity: .8;
}
.framed::before { top:-2px; left:-2px; border-right:0; border-bottom:0; border-top-left-radius:18px; }
.framed::after  { bottom:-2px; right:-2px; border-left:0; border-top:0; border-bottom-right-radius:18px; }

/* Screen title chip (the hexagon-y header banner) */
.title-chip {
  align-self: center;
  margin: -6px 0 14px;
  padding: 8px 30px;
  background: linear-gradient(180deg, #12233f, #0c1830);
  border: 2px solid var(--steel-1);
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(53,198,255,.15), 0 4px 16px rgba(0,0,0,.5);
  text-align: center;
}
.title-chip h1 {
  font-family: var(--font-display);
  font-weight: 700; letter-spacing: .5px;
  font-size: 30px; line-height: 1;
  color: #eaf3ff; text-transform: uppercase;
  text-shadow: 0 2px 0 rgba(0,0,0,.4), 0 0 18px rgba(53,198,255,.35);
}
.title-chip .sub {
  display:block; margin-top:5px; font-size:14px; font-weight:600;
  color: var(--accent); letter-spacing:.4px;
}

/* Small pill/badge label */
.pill {
  display:inline-flex; align-items:center; gap:6px;
  padding: 4px 12px; border-radius: 999px;
  background: rgba(53,198,255,.12); border:1px solid rgba(53,198,255,.35);
  color: var(--cyan-soft); font-size:13px; font-weight:600;
}

/* =========================================================================
   Buttons
   ========================================================================= */
.btn {
  position: relative;
  display: inline-flex; align-items:center; justify-content:center; gap:10px;
  padding: 12px 26px; border:none; border-radius: 12px;
  font-family: var(--font-ui); font-weight: 700; font-size: 17px;
  letter-spacing: .3px; color: #fff;
  background: linear-gradient(180deg, var(--blue), var(--blue-deep));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 4px 0 #0c336f, 0 8px 18px rgba(0,0,0,.45);
  transition: transform .08s, box-shadow .08s, filter .15s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(3px); box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 1px 0 #0c336f, 0 3px 8px rgba(0,0,0,.4); }
.btn:focus-visible { outline: 3px solid var(--cyan-soft); outline-offset: 2px; }

.btn--lg { padding: 16px 46px; font-size: 22px; }
.btn--gold  { background: linear-gradient(180deg, #ffc24d, #f19a12); box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 4px 0 #a5620a, 0 8px 18px rgba(0,0,0,.45); color:#3a2600; }
.btn--green { background: linear-gradient(180deg, #8fe04a, #4fae10); box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 4px 0 #2f6d08, 0 8px 18px rgba(0,0,0,.45); color:#123; }
.btn--red   { background: linear-gradient(180deg, #ff6a5a, #c62828); box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 4px 0 #7c1818, 0 8px 18px rgba(0,0,0,.45); }
.btn--ghost {
  background: rgba(14,26,48,.7); border:1px solid var(--edge-light);
  box-shadow: inset 0 1px 0 rgba(120,160,220,.2); color: var(--ink);
}
.btn--sm { padding: 9px 16px; font-size: 14px; border-radius: 10px; }
.btn[disabled] { opacity:.45; cursor: not-allowed; filter:grayscale(.4); }

/* Icon round button (close, settings) */
.icon-btn {
  width: 42px; height: 42px; border-radius: 10px; font-size: 18px;
  display: grid; place-items:center;
  background: rgba(14,26,48,.8); border:1px solid var(--edge-light); color: var(--cyan-soft);
  transition: transform .1s, background .2s;
}
.icon-btn:hover { transform: translateY(-2px); background: rgba(31,111,229,.4); }

/* =========================================================================
   HUD (top bar: avatar, name, level, XP, energy)
   ========================================================================= */
.hud {
  position: absolute; top: 16px; left: 16px; right: 16px;
  display: flex; align-items: flex-start; gap: 12px; z-index: 20;
  pointer-events: none;
}
.hud > * { pointer-events: auto; }
.hud-profile {
  display:flex; align-items:center; gap:10px;
  padding: 8px 14px 8px 8px; border-radius: 14px;
  background: rgba(9,17,34,.8); border:1px solid var(--edge-light);
  box-shadow: 0 4px 16px rgba(0,0,0,.4);
}
.hud-avatar {
  width: 44px; height: 44px; border-radius: 12px; flex:none;
  display:grid; place-items:center; font-size: 24px;
  background: radial-gradient(circle at 40% 30%, #2a4a86, #12233f);
  border: 2px solid var(--cyan); box-shadow: 0 0 12px rgba(53,198,255,.5);
}
.hud-name { font-family: var(--font-display); font-weight:600; font-size:17px; line-height:1.05; }
.hud-lvl  { font-size: 12px; color: var(--gold-soft); font-weight:600; }
.hud-xp {
  margin-top: 4px; width: 150px; height: 8px; border-radius: 5px;
  background: rgba(6,12,26,.9); overflow:hidden; border:1px solid rgba(120,160,220,.25);
}
.hud-xp > i { display:block; height:100%; background: linear-gradient(90deg, var(--cyan), var(--blue)); box-shadow: 0 0 8px var(--cyan); }
.hud-xp-label { font-size: 11px; color: var(--ink-dim); margin-top:2px; }
.hud-energy {
  display:flex; align-items:center; gap:7px;
  padding: 7px 14px; border-radius: 12px; align-self:flex-start;
  background: rgba(9,17,34,.8); border:1px solid var(--edge-light); font-weight:700;
}
.hud-energy .bolt { color: var(--gold); filter: drop-shadow(0 0 6px var(--gold)); }
.hud-spacer { flex: 1; }

/* =========================================================================
   Dr. Watt mascot + speech bubble
   ========================================================================= */
.drwatt {
  display: flex; flex-direction: column; align-items: center; gap: 8px; flex: none;
}
.drwatt-portrait {
  width: 150px; height: 176px; border-radius: 16px; overflow: hidden;
  display: grid; place-items: center;
  background: radial-gradient(circle at 45% 30%, #24457f 0%, #0d1c36 75%);
  border: 2px solid var(--cyan); box-shadow: 0 0 22px rgba(53,198,255,.4), inset 0 0 20px rgba(0,0,0,.5);
}
.drwatt-img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.drwatt-emoji { font-size: 66px; }
.badge-big-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.badge-big-emoji { font-size: 78px; }
.drwatt-name { font-family: var(--font-display); font-weight:600; color: var(--gold); font-size:16px; }
.speech {
  position: relative; max-width: 260px;
  padding: 12px 16px; border-radius: 14px;
  background: linear-gradient(180deg, rgba(20,36,64,.96), rgba(12,24,46,.96));
  border: 1px solid var(--cyan); color: var(--ink); font-size: 15px; line-height:1.35;
  box-shadow: 0 0 16px rgba(53,198,255,.25);
}
.speech b { color: var(--gold); }

/* =========================================================================
   Progress dots (1 of 5 …)
   ========================================================================= */
.progress-track {
  display: flex; align-items: center; justify-content: center; gap: 12px;
}
.progress-dots { display:flex; gap:12px; align-items:center; }
.pdot {
  width: 16px; height: 16px; border-radius: 50%;
  background: rgba(6,12,26,.9); border: 2px solid var(--steel-1);
  transition: all .25s;
}
.pdot.done { background: var(--cyan); border-color: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.pdot.active { background: var(--cyan-soft); border-color: var(--cyan-soft); box-shadow: 0 0 14px var(--cyan); transform: scale(1.25); }
.progress-count {
  padding: 5px 18px; border-radius: 10px; font-weight:700; font-size:16px;
  background: rgba(9,17,34,.85); border:1px solid var(--steel-1);
}
.progress-count b { color: var(--cyan); }

/* =========================================================================
   Info / content cards used in exhibits
   ========================================================================= */
.info-col { width: 300px; flex: none; display:flex; flex-direction:column; gap:14px; }
.info-card {
  background: var(--panel-inset); border:1px solid rgba(53,198,255,.22);
  border-radius: var(--radius-sm); padding: 14px 16px;
}
.info-card h3 { font-family: var(--font-display); font-weight:600; font-size:19px; margin-bottom:6px; display:flex; align-items:center; gap:8px; }
.info-card p  { color: var(--ink-dim); font-size:15px; line-height:1.4; }
.info-card .divider { height:1px; background: linear-gradient(90deg, transparent, rgba(53,198,255,.4), transparent); margin: 12px 0; }
.eq-label { color: var(--accent); font-weight:700; font-size:14px; letter-spacing:.3px; }
.eq-chain { color: var(--ink); font-size:15px; line-height:1.5; }

/* Feedback banner (Correct / info) */
.feedback {
  display:flex; align-items:center; gap:12px;
  margin-top: 14px; padding: 12px 18px; border-radius: 12px;
  font-size: 16px; font-weight:600;
  border: 1.5px solid var(--green); background: rgba(126,211,33,.12); color: #dff5b8;
  animation: pop .35s ease both;
}
.feedback .tick { color: var(--green); font-size:22px; }
.feedback.info { border-color: var(--cyan); background: rgba(53,198,255,.1); color: var(--cyan-soft); }
.feedback.bad  { border-color: var(--red); background: rgba(255,77,77,.12); color: #ffc9c9; }
@keyframes pop { from{transform:scale(.96); opacity:0} to{transform:none; opacity:1} }

/* =========================================================================
   Widget: drag-to-order (Energy Conversion Builder)
   ========================================================================= */
.dragrow { display:flex; align-items:center; gap:14px; justify-content:center; flex-wrap:wrap; margin: 8px 0 4px; }
.slot {
  position: relative; width: 190px; min-height: 130px; border-radius: 14px;
  border: 2px dashed rgba(53,198,255,.4); background: rgba(6,12,26,.5);
  display:grid; place-items:center; transition: border-color .15s, background .15s;
}
.slot.over { border-color: var(--cyan); background: rgba(53,198,255,.12); }
.slot.filled { border-style: solid; }
.slot .slot-idx { position:absolute; top:6px; left:10px; font-size:12px; color:var(--ink-faint); }
.arrow { font-size: 28px; color: var(--accent); filter: drop-shadow(0 0 6px var(--accent)); }
.tile {
  width: 178px; min-height: 118px; border-radius: 12px; padding: 12px;
  background: linear-gradient(180deg, #16294c, #0e1c36);
  border: 2px solid var(--cyan); color: var(--ink);
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px;
  text-align:center; font-weight:600; font-size:15px;
  box-shadow: 0 4px 14px rgba(0,0,0,.4);
  touch-action: none; cursor: grab;
}
.tile .tile-ico { font-size: 34px; }
.tile.dragging { opacity:.6; cursor: grabbing; }
.tile.ghost { position: fixed; z-index: 999; pointer-events:none; margin:0; box-shadow: 0 12px 30px rgba(0,0,0,.6); }
.tilebank { display:flex; gap:12px; justify-content:center; flex-wrap:wrap; margin-top: 12px; }
.tilebank-label { text-align:center; color: var(--ink-faint); font-size:13px; margin-bottom:6px; }

/* =========================================================================
   Widget: match pairs — two columns + connector lines drawn on correct match
   ========================================================================= */
.match2 { position: relative; width: 100%; max-width: 760px; margin: 0 auto; }
.match2-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; z-index: 1; }
.m2-line { stroke: var(--green); stroke-width: 4; stroke-linecap: round;
  filter: drop-shadow(0 0 5px var(--green)); animation: m2draw .35s ease both; }
@keyframes m2draw { from { opacity:0; } to { opacity:1; } }
.match2-cols { position: relative; z-index: 2; display: flex; justify-content: space-between; gap: 90px; }
.m2-col { display: flex; flex-direction: column; gap: 16px; }
.m2-col.left { flex: none; }
.m2-col.right { flex: 1; }
.m2-source {
  display: grid; place-items: center; width: 88px; height: 88px; border-radius: 14px;
  border: 2px solid var(--steel-1); background: rgba(6,12,26,.6); cursor: pointer;
  box-shadow: inset 0 0 18px rgba(0,0,0,.5); transition: border-color .15s, box-shadow .15s, transform .1s;
}
.m2-source:hover { border-color: var(--cyan); }
.m2-ico { font-size: 46px; line-height: 1; }
.m2-target {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 0 16px; min-height: 88px; border-radius: 14px; font-weight: 600; font-size: 16px;
  border: 2px solid var(--steel-1); background: rgba(9,17,34,.8); cursor: pointer;
  transition: border-color .15s, background .15s;
}
.m2-target:hover { border-color: var(--cyan); }
.m2-source.selected, .m2-target.selected { border-color: var(--gold); box-shadow: 0 0 14px rgba(255,176,32,.55); }
.m2-source.linked, .m2-target.linked { border-color: var(--green); background: rgba(126,211,33,.12); cursor: default; }
.m2-source.wrong, .m2-target.wrong { border-color: var(--red); animation: shake .35s; }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-5px)} 75%{transform:translateX(5px)} }
.m2-tick { color: var(--green); font-size: 20px; opacity: 0; transition: opacity .2s; }
.m2-target.linked .m2-tick { opacity: 1; }

/* =========================================================================
   Widget: fission (nuclear) — plant diagram + chain reaction
   ========================================================================= */
.fis-plant { display: flex; align-items: stretch; justify-content: center; gap: 8px; flex-wrap: nowrap; }
.fis-box {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px; border-radius: 12px; border: 1px solid var(--edge-light);
  background: rgba(9,17,34,.6); min-width: 96px;
}
.fis-box.reactor { min-width: 172px; }
.fis-cap { font-size: 12px; color: var(--ink-dim); font-weight: 600; text-align: center; }
.fis-stage { position: relative; flex: 1; display: grid; place-items: center; min-height: 118px; width: 100%; }
.fis-arrow { align-self: center; font-size: 24px; color: var(--accent); }
.fis-reactor { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; place-items: center; padding: 6px; }
.fis-atom { position: relative; font-size: 30px; transition: transform .2s, opacity .2s; }
.fis-atom.fis-done { opacity: .45; transform: scale(.7); }
.fis-burst { position: absolute; inset: -6px; display: grid; place-items: center; color: var(--gold);
  font-size: 34px; filter: drop-shadow(0 0 8px var(--gold)); animation: burst .5s ease both; }
@keyframes burst { 0%{transform:scale(.3);opacity:0} 40%{opacity:1} 100%{transform:scale(1.8);opacity:0} }
.fis-neutrons { position: absolute; inset: 0; pointer-events: none; }
.fis-neutron { position: absolute; top: 50%; left: 4%; width: 12px; height: 12px; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #fff, var(--cyan)); box-shadow: 0 0 10px var(--cyan);
  animation: neutron-fly .6s ease-in both; }
@keyframes neutron-fly { from { left: -6%; } to { left: 80%; } }
.fis-water { position: relative; width: 46px; height: 84px; border-radius: 6px; overflow: hidden;
  border: 2px solid #9fb4d4; background: rgba(6,12,26,.6); }
.fis-water > i { position: absolute; bottom: 0; left: 0; width: 100%; height: 10%;
  background: linear-gradient(180deg, #3a86ff, #1c4a86); transition: height .4s, background .4s; }
.fis-box.hot .fis-water > i { background: linear-gradient(180deg, #ff7a3a, #b5202a); }
.fis-steam { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); font-size: 20px; opacity: 0; transition: opacity .3s; }
.fis-box.boiling .fis-steam { opacity: 1; animation: rise-steam 1.2s ease-in-out infinite; }
@keyframes rise-steam { 0%,100%{transform:translate(-50%,0);opacity:.5} 50%{transform:translate(-50%,-8px);opacity:1} }
.fis-turbine { font-size: 46px; }
.fis-turbine.spinning { animation: spin .6s linear infinite; }
.fis-bulb { font-size: 46px; filter: grayscale(1) brightness(.6); transition: filter .3s; }
.fis-bulb.lit { filter: none; animation: bulb-glow 1.4s ease-in-out infinite; }
@keyframes bulb-glow { 0%,100%{filter:drop-shadow(0 0 4px var(--gold))} 50%{filter:drop-shadow(0 0 16px var(--gold))} }
.fis-heat { display: flex; align-items: center; gap: 10px; justify-content: center; font-size: 14px; color: var(--ink-dim); font-weight: 600; }
.fis-heatbar { width: 260px; height: 12px; border-radius: 7px; background: rgba(6,12,26,.9); border: 1px solid var(--edge-light); overflow: hidden; }
.fis-heatbar > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #3a86ff, #ff7a3a, #b5202a); transition: width .4s; }

/* =========================================================================
   Dr. Watt tip button + tip box
   ========================================================================= */
.tip-btn { margin-top: 10px; }
.tip-box {
  margin-top: 10px; max-width: 240px; padding: 10px 12px; border-radius: 12px; font-size: 14px; line-height: 1.35;
  background: rgba(53,198,255,.1); border: 1px solid var(--cyan); color: var(--cyan-soft);
  animation: pop .3s ease both;
}
.tip-box b { color: var(--gold); }

/* =========================================================================
   Widget: rotate-to-target (Face the Sun)
   ========================================================================= */
.rotate-stage {
  position: relative; flex:1; min-height: 300px; border-radius: 14px;
  background: radial-gradient(600px 300px at 50% 20%, rgba(53,198,255,.08), transparent 70%);
  display:grid; place-items:center; overflow:hidden;
}
.sun {
  position:absolute; top: 42px; left: 90px; font-size: 62px;
  filter: drop-shadow(0 0 20px var(--gold));
  animation: sun-pulse 2.4s ease-in-out infinite;
}
@keyframes sun-pulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.08)} }
.rays { position:absolute; top:70px; left:120px; pointer-events:none; opacity:.85; }
.panel-rig { position: relative; width: 220px; height: 220px; display:grid; place-items:center; }
.panel-pivot {
  width: 150px; height: 96px; border-radius: 8px;
  background: repeating-linear-gradient(90deg, #1b2f6b 0 14px, #22409a 14px 16px),
              repeating-linear-gradient(0deg, transparent 0 20px, rgba(0,0,0,.35) 20px 22px);
  border: 3px solid #9fb4d4; box-shadow: 0 6px 16px rgba(0,0,0,.5);
  transform-origin: center bottom; transition: filter .2s; touch-action: none; cursor: grab;
}
.panel-pivot.aligned { box-shadow: 0 0 26px var(--gold), 0 6px 16px rgba(0,0,0,.5); }
.panel-base { position:absolute; bottom: 4px; width: 90px; height: 22px; border-radius: 50%;
  background: radial-gradient(circle, rgba(53,198,255,.5), transparent 70%); }
.rotate-hint { position:absolute; bottom: 14px; left:50%; transform:translateX(-50%); color: var(--ink-dim); font-size:14px; }
.capture-meter {
  position:absolute; top: 16px; right: 16px; text-align:center;
  padding: 10px 14px; border-radius: 12px; background: rgba(9,17,34,.85); border:1px solid var(--steel-1);
}
.capture-meter .big { font-family: var(--font-display); font-size: 30px; font-weight:700; color: var(--gold); }
.capture-meter .lbl { font-size:12px; color: var(--ink-dim); }

/* =========================================================================
   Widget: slider (Heat the Boiler / Wind Turns the Blades / Release the Water)
   ========================================================================= */
.react-wrap { height: 150px; display:grid; place-items:center; transition: transform .1s; }
.react-ico { font-size: 96px; line-height:1; filter: drop-shadow(0 0 18px var(--accent)); transition: opacity .1s; }
.sld-wrap { width: 540px; max-width: 84%; margin: 0 auto; }
.sld-track {
  position: relative; height: 28px; border-radius: 15px; cursor: pointer;
  background: linear-gradient(90deg, #1c4a86 0%, #2a5aa0 40%, #b5602a 75%, #b5202a 100%);
  border: 1px solid var(--edge-light);
  box-shadow: inset 0 2px 8px rgba(0,0,0,.55), 0 0 14px rgba(53,198,255,.18);
}
.sld-track > i {
  position:absolute; left:0; top:0; height:100%; width:0; border-radius:15px; pointer-events:none;
  background: linear-gradient(90deg, rgba(143,227,255,.5), rgba(255,150,60,.55));
  box-shadow: 0 0 12px rgba(255,150,60,.4);
}
.sld-handle {
  position:absolute; top:50%; width:34px; height:34px; border-radius:50%;
  background: radial-gradient(circle at 40% 35%, #eaf3ff, #9fb4d4);
  border: 3px solid var(--cyan); transform: translate(-50%,-50%);
  box-shadow: 0 0 14px var(--cyan), 0 2px 6px rgba(0,0,0,.5); cursor: grab;
}
.sld-handle:active { cursor: grabbing; }
.sld-handle:focus-visible { outline: 3px solid var(--cyan-soft); outline-offset: 3px; }
.sld-labels { display:flex; justify-content:space-between; margin-top:10px; font-weight:700; font-size:15px; color: var(--ink-dim); }
.sld-hint { color: var(--ink-dim); font-size:14px; text-align:center; }
@keyframes spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }

/* =========================================================================
   Quiz (Assessment) + Try Again
   ========================================================================= */
.quiz-grid { display:flex; gap: 16px; flex:1; }
.quiz-q { flex:1; display:flex; flex-direction:column; gap:10px; }
.quiz-q h4 { font-size:16px; font-weight:600; line-height:1.3; display:flex; gap:8px; }
.quiz-q .qnum { color: var(--cyan); font-weight:700; }
.opt {
  display:flex; align-items:center; gap:10px;
  padding: 11px 14px; border-radius: 10px; font-size:15px;
  border:1.5px solid var(--steel-1); background: rgba(9,17,34,.7);
  cursor:pointer; transition: border-color .12s, background .12s;
}
.opt:hover { border-color: var(--cyan); }
.opt .box { width:20px; height:20px; border-radius:50%; border:2px solid var(--ink-faint); flex:none; display:grid; place-items:center; }
.opt.multi .box { border-radius:6px; }
.opt.selected { border-color: var(--cyan); background: rgba(53,198,255,.1); }
.opt.selected .box { border-color: var(--cyan); background: var(--cyan); }
.opt.correct { border-color: var(--green); background: rgba(126,211,33,.14); color:#dff5b8; }
.opt.correct .box { border-color: var(--green); background: var(--green); }
.opt.wrong { border-color: var(--red); background: rgba(255,77,77,.14); color:#ffc9c9; }
.opt.wrong .box { border-color: var(--red); background: var(--red); }
.opt .box::after { content:"✓"; font-size:12px; color:#08131f; opacity:0; font-weight:900; }
.opt.selected .box::after, .opt.correct .box::after { opacity:1; }
.opt.wrong .box::after { content:"✕"; opacity:1; color:#fff; }

/* =========================================================================
   Badge popup + toast
   ========================================================================= */
.overlay {
  position:absolute; inset:0; z-index:40; display:grid; place-items:center;
  background: rgba(3,7,16,.72); backdrop-filter: blur(3px);
  animation: fade .25s both;
}
@keyframes fade { from{opacity:0} to{opacity:1} }
.badge-pop {
  width: 640px; max-width: 92%; text-align:center; padding: 30px;
  animation: pop .4s cubic-bezier(.2,1.2,.3,1) both;
}
.badge-pop h2 { font-family: var(--font-display); font-size: 34px; color: #fff; text-shadow: 0 0 18px var(--cyan); }
.badge-big {
  width: 150px; height: 150px; margin: 18px auto; border-radius: 50%; overflow: hidden;
  display:grid; place-items:center; font-size: 78px;
  background: radial-gradient(circle at 45% 35%, #2a4a86, #0d1c36);
  border: 4px solid var(--gold); box-shadow: 0 0 40px var(--gold), inset 0 0 24px rgba(0,0,0,.5);
  animation: badge-spin 1s ease both;
}
@keyframes badge-spin { from{transform:rotateY(180deg) scale(.5); opacity:0} to{transform:none; opacity:1} }
.badge-count { font-size:18px; color: var(--ink-dim); margin-bottom:6px; }
.badge-count b { color: var(--gold); font-family: var(--font-display); font-size:22px; }

.toast {
  position:absolute; bottom: 20px; left:50%; transform: translateX(-50%);
  padding: 10px 20px; border-radius: 12px; z-index:60;
  background: rgba(9,17,34,.95); border:1px solid var(--cyan); color: var(--cyan-soft);
  font-weight:600; box-shadow: 0 8px 24px rgba(0,0,0,.5);
  animation: toast-in .3s ease both;
}
@keyframes toast-in { from{opacity:0; transform:translate(-50%,10px)} to{opacity:1; transform:translate(-50%,0)} }

/* =========================================================================
   Badges gallery + Mission Complete
   ========================================================================= */
.badge-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
  margin: 14px auto 4px; max-width: 940px;
}
.badge-card {
  padding: 14px 10px; border-radius: 14px; text-align: center;
  background: var(--panel-inset); border: 2px solid var(--steel-1);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  transition: transform .12s;
}
.badge-card.got { border-color: var(--accent); box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 35%, transparent), inset 0 0 22px rgba(0,0,0,.4); }
.badge-card.got:hover { transform: translateY(-3px); }
.badge-card-name { font-family: var(--font-display); font-weight: 600; font-size: 15px; letter-spacing:.3px; text-transform: uppercase; }
.badge-card.got .badge-card-name { color: var(--accent-soft); }
.badge-card.locked .badge-card-name { color: var(--ink-faint); }
.badge-medal {
  width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 45% 35%, #223c66, #0b1730);
  border: 3px solid var(--steel-1); overflow: hidden;
}
.badge-card.got .badge-medal { border-color: var(--accent); box-shadow: 0 0 16px color-mix(in srgb, var(--accent) 45%, transparent), inset 0 0 16px rgba(0,0,0,.5); }
.badge-img { width: 100%; height: 100%; object-fit: cover; }
.badge-emoji { font-size: 48px; line-height: 1; }
.badge-card.locked .badge-medal { filter: grayscale(1) brightness(.6); }
.badge-status { font-size: 13px; font-weight: 600; }
.badge-card.got .badge-status { color: var(--accent-soft); }
.badge-card.locked .badge-status { color: var(--ink-faint); }

.complete-badges { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; margin: 16px 0; }
.cbadge {
  width: 84px; height: 84px; border-radius: 14px; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(circle at 45% 35%, #223c66, #0b1730);
  border: 2px solid var(--accent, var(--gold));
  box-shadow: 0 0 14px color-mix(in srgb, var(--accent, var(--gold)) 40%, transparent);
  animation: badge-spin .8s ease both;
}
.complete-banner {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px 24px; border-radius: 12px; font-size: 18px;
  background: rgba(255,176,32,.12); border: 1.5px solid var(--gold); color: var(--gold-soft);
}
.complete-banner b { color: var(--gold); font-family: var(--font-display); }

/* =========================================================================
   Menu + Map + Overview specific
   ========================================================================= */
.menu { align-items:center; justify-content:center; text-align:center; }
.menu-bg, .overview-hero {
  position:absolute; inset:0; background-size:cover; background-position:center;
  filter: blur(4px) brightness(.5) saturate(1.1); transform: scale(1.08);
}
.menu-scrim { position:absolute; inset:0;
  background: radial-gradient(700px 400px at 50% 40%, rgba(53,198,255,.14), transparent 70%),
              linear-gradient(180deg, rgba(6,10,22,.55), rgba(6,10,22,.85)); }
.menu-inner { position:relative; z-index:2; display:flex; flex-direction:column; align-items:center; gap:18px; }
.game-title { font-family: var(--font-display); font-weight:700; line-height:.92; text-transform:uppercase; }
.game-title .l1 { font-size: 74px; color:#eef5ff; text-shadow: 0 3px 0 #0b1a36, 0 0 26px rgba(53,198,255,.5); letter-spacing:1px; }
.game-title .l2 { font-size: 74px; color: var(--gold); text-shadow: 0 3px 0 #6b3d05, 0 0 26px rgba(255,176,32,.5); letter-spacing:1px; }
.game-tag { font-size:19px; color: var(--cyan-soft); font-weight:600; margin-top:2px; }
.menu-btns { display:flex; gap:14px; margin-top:8px; }

/* Map */
.map { background-size: cover; background-position:center; }
.map-scrim { position:absolute; inset:0; background: linear-gradient(180deg, rgba(6,10,22,.12), rgba(6,10,22,.4)); }
/* invisible station hotspots — a blue border lights up on hover/focus */
.map-hot {
  position:absolute; border-radius: 16px; cursor:pointer; z-index:3;
  border: 2px solid transparent; transition: border-color .15s, box-shadow .15s, transform .12s;
}
.map-hot:hover, .map-hot:focus-visible {
  outline:none; border-color: var(--cyan); box-shadow: 0 0 26px rgba(53,198,255,.55); transform: scale(1.02);
}
.map-hot.done { border-color: rgba(126,211,33,.5); box-shadow: 0 0 14px rgba(126,211,33,.28); }
.map-hot.done:hover, .map-hot.done:focus-visible { border-color: var(--cyan); box-shadow: 0 0 26px rgba(53,198,255,.55); }
/* clickable overlay on the baked "Badges" button — lights up gold on hover */
.map-badges-hot {
  position:absolute; left:9.5%; top:82.8%; width:8.7%; height:15.4%;
  border-radius: 14px; cursor:pointer; z-index:4;
  border: 2px solid transparent; transition: border-color .15s, box-shadow .15s;
}
.map-badges-hot:hover, .map-badges-hot:focus-visible {
  outline:none; border-color: var(--gold);
  box-shadow: 0 0 24px rgba(255,176,32,.7), inset 0 0 22px rgba(255,176,32,.28);
}

/* Overview hero */
.overview { padding: 0; }
.overview-scrim { position:absolute; inset:0; background: linear-gradient(90deg, rgba(6,10,22,.92) 0%, rgba(6,10,22,.55) 55%, rgba(6,10,22,.75) 100%); }
.overview-panel {
  position:relative; z-index:3; margin:auto; margin-left: 60px; align-self:center;
  width: 440px; max-width: 46%;
}

/* Generic exhibit two-column body */
.exhibit-body { flex:1; display:flex; gap: 18px; min-height:0; }
.exhibit-main { flex:1; display:flex; flex-direction:column; min-width:0; }
.exhibit-task-head { display:flex; align-items:center; gap:10px; margin-bottom:10px; }
.exhibit-task-head .pill { margin-left:auto; }
.task-hint { color: var(--ink); font-size:16px; margin-bottom:10px; }

/* Footer nav row inside framed screens */
.exhibit-foot {
  display:flex; align-items:center; justify-content:space-between; gap:14px;
  margin-top: 14px; padding-top: 12px;
}

/* Advantages / disadvantages columns */
.ad-grid { display:flex; gap:18px; flex:1; align-items:stretch; }
.ad-col { flex:1; display:flex; flex-direction:column; gap:12px; }
.ad-head { display:flex; align-items:center; gap:10px; font-family:var(--font-display); font-weight:600; font-size:22px; }
.ad-head.good { color: var(--green); }
.ad-head.bad  { color: var(--red); }
.ad-item {
  display:flex; align-items:center; gap:12px; padding: 14px 16px; border-radius: 12px;
  font-size:15px; line-height:1.35;   /* always visible — no animation dependency */
}
.ad-item .ai-ico { font-size: 26px; flex:none; }
.ad-col.good .ad-item { border:1.5px solid rgba(126,211,33,.5); background: rgba(126,211,33,.08); }
.ad-col.bad  .ad-item { border:1.5px solid rgba(255,120,80,.5); background: rgba(255,120,80,.08); }
@keyframes rise { from { opacity:0; transform: translateY(8px); } to { opacity:1; transform:none; } }

/* Utility */
.center { display:grid; place-items:center; text-align:center; }
.stack { display:flex; flex-direction:column; }
.row { display:flex; align-items:center; }
.gap8{gap:8px}.gap12{gap:12px}.gap16{gap:16px}
.mt8{margin-top:8px}.mt16{margin-top:16px}
.dim { color: var(--ink-dim); }
.hidden { display:none !important; }
