/* ============================================================
   STEMulator home page scene (HTML version)
   2026-11-26 Phil updated: created - styles for js/stem-home.js, the arcade cue and the
   sign-up card.
   ============================================================ */

/* ---- scene, fit, zoom ---- */
#stem-scroll {
  position: fixed; left: 0; right: 0; bottom: 0; top: var(--stem-top, 0px);
  display: flex; overflow: hidden; z-index: 1;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  scrollbar-width: none;
}
#stem-scroll::-webkit-scrollbar { display: none; }
html.stem-zoomed #stem-scroll { overflow: auto; touch-action: pan-x pan-y; cursor: grab; }
html.stem-dragging #stem-scroll, html.stem-dragging #stem-scroll * { cursor: grabbing !important; }
#stem-frame { position: relative; flex: 0 0 auto; margin: auto; }
#stem-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; opacity: 0; }
html.stem-ready #stem-world { opacity: 1; }
html.stem-shown #stem-world { transition: none; }   /* no lasting layer after the fade-in */
#stem-stage { position: absolute; width: 0; height: 0; }
.stem-l { position: absolute; pointer-events: none; -webkit-user-select: none; user-select: none; -webkit-user-drag: none; }
.stem-move { transition: translate .16s linear; }      /* only pictures that move on hover (the car) */
.stem-l, .stem-hits, .stem-fx svg { overflow: visible; }
/* navStyle.css sets img { max-height: 100% } - the scene's containers have no height, so switch that off here */
#stem-world img, #stem-arcade-cue img, #stem-signup-card img { max-width: none; max-height: none; }
.stem-group-in { position: absolute; width: 0; height: 0; }
.stem-sweep-g { transition: transform .16s linear, visibility 0s linear .2s; transform-box: view-box; transform-origin: 0 0; visibility: hidden; }
.stem-sweep-g.on { visibility: visible; transition: transform .16s linear, visibility 0s; }
.stem-globe-map { transform-box: view-box; transform-origin: 0 0; }
.stem-pixel { image-rendering: pixelated; image-rendering: crisp-edges; }

/* clickable shapes (real links) */
.stem-hits { position: absolute; pointer-events: none; }
.stem-hits path { fill: transparent; pointer-events: all; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.stem-hits a { outline: none; }
.stem-hits a:focus-visible path { stroke: #fff; stroke-width: 3; stroke-dasharray: 8 5; }

/* "How to explore" box */
.stem-window { overflow: hidden; box-sizing: border-box; }
.stem-tut, .stem-preview { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.stem-tut-img { position: absolute; left: 0; top: 0; opacity: 0; max-width: none; }
.stem-tut-hl { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.stem-tut-hl g g { transform-box: view-box; transform-origin: 0 0; }
.stem-preview { opacity: 0; transition: opacity .12s; background: #0b1c28; }
.stem-preview.on { opacity: 1; }
.stem-preview img { position: absolute; max-width: none; }

/* hands + tap rings */
.stem-fx { position: absolute; left: 0; top: 0; width: 0; height: 0; pointer-events: none; }
.stem-hint-label { position: absolute; opacity: 0; }
.stem-hand { position: absolute; width: 0; height: 0; --hw: max(33.3px, calc(40px / var(--stem-s, 1))); }
.stem-hand img { position: absolute; left: 0; top: 0; width: var(--hw); height: auto; max-width: none; opacity: 0; }
.stem-hand img.stem-ripple { opacity: 1; display: none; transform: translate(-50%, -50%); z-index: 0; }

/* zoom buttons + phone hint (same look as before) */
#stem-zoom-bar { position: fixed; right: 12px; bottom: 16px; z-index: 60; display: none; flex-direction: column; gap: 6px; }
html.stem-portrait #stem-zoom-bar, html.stem-zoomed #stem-zoom-bar { display: flex; }
#stem-zoom-bar button { width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255,255,255,.88); color: #10324a; font: 700 22px/1 Arial, sans-serif; box-shadow: 0 2px 8px rgba(0,0,0,.35); }
#stem-zoom-bar button:hover { background: #fff; }
#stem-swipe-hint { position: fixed; left: 50%; bottom: 14%; transform: translateX(-50%); background: rgba(0,0,0,.65); color: #fff;
  font: 600 15px/1.2 Arial, sans-serif; padding: 10px 18px; border-radius: 22px; z-index: 50; pointer-events: none;
  opacity: 0; transition: opacity .5s; white-space: nowrap; }
#stem-swipe-hint.show { opacity: 1; }

/* ---- arcade cue (controller + arrow) ---- */
#stem-arcade-cue { position: fixed; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: 40; pointer-events: none; }  /* clipped: anything sticking out made phones widen the page */
#stem-arcade-cue .cue-ctrl { position: absolute; left: 0; top: 0; pointer-events: auto; cursor: pointer; border: 0; padding: 0; background: none;
  transform: translate(-50%, -50%) scale(0); -webkit-tap-highlight-color: transparent; }
#stem-arcade-cue .cue-ctrl img { display: block; width: 100%; height: auto;
  filter: drop-shadow(0 0 1.5px #fff) drop-shadow(0 0 1.5px #fff) drop-shadow(0 0 10px rgba(255,200,150,.65)) drop-shadow(0 4px 8px rgba(0,0,0,.6)); }
#stem-arcade-cue .cue-arrow { position: absolute; left: 0; top: 0; opacity: 0; transform-origin: 0 50%; }
#stem-arcade-cue .cue-arrow svg { display: block; width: 100%; height: 100%; overflow: visible; }

/* ---- sign-up card (replaces the old sign-up modal; same look as the award cards) ---- */
#stem-signup-card { position: fixed; left: 16px; bottom: 16px; z-index: 2147482000; width: min(370px, calc(100vw - 24px));
  background: #fff; color: #10324a; border-radius: 14px; border-top: 4px solid #d3672b; box-shadow: 0 10px 34px rgba(0,0,0,.45);
  padding: 16px 40px 16px 16px; font: 14px/1.4 Arial, sans-serif; text-align: left;
  opacity: 0; transform: translateY(16px); transition: opacity .35s, transform .35s; display: none; }
#stem-signup-card.show { opacity: 1; transform: translateY(0); }
#stem-signup-card .sc-row { display: flex; gap: 12px; align-items: flex-start; }
#stem-signup-card .sc-mascot { width: 64px; height: auto; flex: 0 0 auto; }
#stem-signup-card .sc-label { color: #d3672b; font-weight: 700; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
#stem-signup-card .sc-title { font-weight: 700; font-size: 17px; margin: 2px 0 4px; }
#stem-signup-card .sc-text { margin: 0; }
#stem-signup-card .sc-perks { margin: 8px 0 0; padding: 0; list-style: none; }
#stem-signup-card .sc-perks li { margin: 3px 0; }
#stem-signup-card .sc-actions { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-top: 12px; }
#stem-signup-card .sc-cta { display: inline-block; background: #d3672b; color: #fff !important; text-decoration: none; font-weight: 700;
  padding: 8px 16px; border-radius: 18px; }
#stem-signup-card .sc-cta:hover { background: #b9531c; }
#stem-signup-card .sc-link { color: #0f5b7d !important; font-weight: 700; text-decoration: none; }
#stem-signup-card .sc-later { border: 0; background: none; color: #6b7c88; font: inherit; cursor: pointer; padding: 0; }
#stem-signup-card .sc-close { position: absolute; top: 6px; right: 8px; border: 0; background: none; color: #6b7c88; font-size: 22px;
  line-height: 1; cursor: pointer; padding: 4px 6px; }
#stem-signup-card .sc-short { display: none; }
@media (max-width: 600px), (max-height: 500px) {          /* phones: short version, so it never hides the scene */
  #stem-signup-card { left: 10px; right: 10px; width: auto; bottom: 10px; padding: 12px 34px 12px 12px; }
  #stem-signup-card .sc-mascot { width: 44px; }
  #stem-signup-card .sc-title { font-size: 15px; }
  #stem-signup-card .sc-perks { display: none; }
  #stem-signup-card .sc-short { display: inline; }
  #stem-signup-card .sc-actions { margin-top: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  #stem-signup-card { transition: none; }
  .stem-sweep-g, .stem-l { transition: none; }
}

/* ---- layout editor (?edit) ---- */
html.stem-edit img.stem-l { pointer-events: auto; cursor: move; }
html.stem-edit .stem-hits { display: none; }
html.stem-edit.stem-edit-hits .stem-hits { display: block; }
html.stem-edit.stem-edit-hits .stem-hits path { fill: rgba(255,0,180,.18); stroke: #ff00b4; stroke-width: 2; pointer-events: none; }
html.stem-edit .stem-sel { outline: 2px dashed #ff00b4; outline-offset: 2px; }
#stem-editor { position: fixed; right: 12px; top: 70px; z-index: 2147483000; width: 330px; background: #0b2433; color: #fff;
  border: 1px solid #2e6f8e; border-radius: 10px; padding: 12px; font: 13px/1.4 Arial, sans-serif; box-shadow: 0 8px 24px rgba(0,0,0,.5); }
#stem-editor h4 { margin: 0 0 6px; font-size: 14px; color: #f2b38c; }
#stem-editor pre { white-space: pre-wrap; word-break: break-all; background: #06161f; padding: 8px; border-radius: 6px; max-height: 160px;
  overflow: auto; font: 11px/1.35 Consolas, monospace; margin: 8px 0; }
#stem-editor button { background: #d3672b; color: #fff; border: 0; border-radius: 14px; padding: 6px 10px; margin: 2px 4px 2px 0; cursor: pointer; font: 700 12px Arial, sans-serif; }
#stem-editor button.alt { background: #1d4f66; }
#stem-editor small { color: #9fc3d4; display: block; margin-top: 6px; }

/* old Animate page showed a "turn your device" picture upright - not needed any more */
.rotated { display: none !important; }
