/* ============================================
   🚀 CHEMVENTUR STAGE 3 GAME - NEON HUD
   ============================================ */
.s3g-root {
  --g: #00ff41; --g2: #00aa2a; --cy: #00ffff; --warn: #ffaa00; --bad: #ff0044; --bg: #001100;
  position: relative; width: 100%; height: 100%; overflow: hidden; background: #000a03;
  font-family: "Courier New", monospace; color: var(--g); user-select: none; -webkit-user-select: none;
}
.s3g-canvas { position: absolute; inset: 0; display: block; cursor: none; touch-action: none; }
.s3g-hud { position: absolute; inset: 0; pointer-events: none; }
.s3g-hud button, .s3g-panel, .s3g-panel * { pointer-events: auto; }

.s3g-left { position: absolute; top: 10px; left: 12px; display: flex; flex-direction: column; gap: 4px; max-width: 60vw; }
.s3g-tl { text-shadow: 0 0 8px var(--g); }
.s3g-title { font-size: 18px; font-weight: bold; letter-spacing: 1px; }
.s3g-stats { font-size: 11px; color: #b8ffc9; margin-top: 3px; }
.s3g-target { font-size: 13px; color: var(--cy); margin-top: 4px; text-shadow: 0 0 8px var(--cy); }

.s3g-bl { display: flex; flex-direction: column; gap: 6px; max-width: 70vw; }
.s3g-guns, .s3g-palette, .s3g-actions, .s3g-row { display: flex; flex-wrap: wrap; gap: 5px; }
.s3g-actions { position: absolute; top: 10px; right: 12px; justify-content: flex-end; max-width: 46vw; }

.s3g-btn, .s3g-chip, .s3g-tbtn {
  background: rgba(0, 34, 0, 0.85); color: var(--g); border: 2px solid var(--g); border-radius: 4px;
  padding: 5px 9px; font-family: inherit; font-size: 11px; cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s;
}
.s3g-btn:hover:not(:disabled), .s3g-btn.active { background: var(--g); color: var(--bg); box-shadow: 0 0 12px var(--g); }
.s3g-btn:disabled { opacity: .4; cursor: not-allowed; }
.s3g-mode { border-color: var(--cy); color: var(--cy); min-width: 64px; }
.s3g-mode.active { background: var(--cy); color: var(--bg); box-shadow: 0 0 12px var(--cy); }
/* guns 1–2 pellets / power buttons and the Grid panel (s3g-pne.js, s3g-grid.js) */
.s3g-pellets { border-color: #ff4a4a; color: #ff8a8a; } .s3g-power { border-color: #ffb04a; color: #ffc98a; }
.s3g-pellets[hidden], .s3g-power[hidden] { display: none; }
.s3g-gridpanel { left: 12px; top: 92px; width: min(330px, 92vw); z-index: 2; }
.s3g-gridopt { display: grid; grid-template-columns: auto 1fr; gap: 0 8px; align-items: center; margin: 0 0 8px; cursor: pointer; }
.s3g-gridopt input { width: 16px; height: 16px; accent-color: #00ff41; grid-row: span 2; }
.s3g-gridname { color: #d8ffe0; font-weight: bold; } .s3g-gridinfo { font-size: 10px; color: #9be89b; }
/* Electrogun electrics readout and help card (s3g-pne.js) */
.s3g-watts { align-self: center; padding: 4px 8px; border: 1px solid #ffe066; border-radius: 6px; color: #fff3b0; font-size: 11px; background: rgba(40, 30, 0, .55); }
.s3g-watts[hidden] { display: none; }
.s3g-electrics { margin: 6px 0 10px; padding: 8px; border: 1px solid #ffe066; border-radius: 8px; background: rgba(40, 30, 0, .35); }
.s3g-electrics-title { color: #ffe066; font-weight: bold; margin-bottom: 4px; }
.s3g-chip { --chip: #fff; border-color: var(--chip); color: var(--chip); min-width: 30px; padding: 3px 6px; }
.s3g-chip.active { background: var(--chip); color: #000; box-shadow: 0 0 10px var(--chip); }
.s3g-inv { font-size: 10px; color: #9be89b; }

.s3g-status {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); max-width: 46vw; text-align: center;
  font-size: 12px; padding: 4px 10px; background: rgba(0, 0, 0, .55); border: 1px solid currentColor; border-radius: 4px;
}
.s3g-status:empty { display: none; }
.s3g-status.s3g-ok { color: var(--g); } .s3g-status.s3g-info { color: var(--cy); }
.s3g-status.s3g-warn { color: var(--warn); } .s3g-status.s3g-error { color: var(--bad); }

.s3g-cross {
  position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px;
  border: 2px solid var(--g); border-radius: 50%; box-shadow: 0 0 10px var(--g);
}
.s3g-cross::after { content: ''; position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px; background: var(--g); border-radius: 50%; }

.s3g-panel {
  position: absolute; background: linear-gradient(135deg, #001100, #002200); border: 3px solid var(--g);
  border-radius: 10px; padding: 12px; box-shadow: 0 0 25px rgba(0, 255, 65, .35); font-size: 12px;
}
.s3g-panel[hidden] { display: none; }
.s3g-panel-title { font-size: 15px; margin-bottom: 8px; text-shadow: 0 0 8px var(--g); }
.s3g-id { right: 12px; top: 56px; width: min(360px, 92vw); z-index: 2; }  /* above the FIRST DISCOVERY banner */
.s3g-info { display: grid; grid-template-columns: max-content 1fr; gap: 3px 10px; margin: 0 0 8px; }
.s3g-info dt { color: var(--g2); } .s3g-info dd { margin: 0; color: #d8ffe0; word-break: break-all; }
.s3g-info a { color: var(--cy); }
.s3g-notes { margin: 0 0 8px; padding-left: 16px; color: var(--warn); font-size: 10px; } .s3g-notes:empty { display: none; }
.s3g-help { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, 94vw); max-height: 86vh; overflow: auto; }
.s3g-help-list { display: grid; grid-template-columns: max-content 1fr; gap: 3px 14px; margin: 0 0 8px; }
.s3g-help-list dt { color: var(--cy); } .s3g-help-list dd { margin: 0; color: #d8ffe0; }
.s3g-small { font-size: 10px; color: #9be89b; line-height: 1.4; }

.s3g-start {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: radial-gradient(circle, rgba(0, 40, 10, .55), rgba(0, 0, 0, .8)); pointer-events: auto; text-align: center; padding: 20px;
}
.s3g-start[hidden] { display: none; }
.s3g-start-title { font-size: 34px; font-weight: bold; text-shadow: 0 0 18px var(--g); }
.s3g-start-sub { font-size: 14px; color: var(--cy); max-width: 560px; }
.s3g-start-btn { font-size: 20px; padding: 12px 30px; }

.s3g-touchbar { display: none; position: absolute; right: 10px; bottom: 60px; flex-direction: column; gap: 8px; }
.s3g-touch .s3g-touchbar { display: flex; }
.s3g-touch .s3g-cross { display: none; }
.s3g-tbtn { font-size: 14px; padding: 12px 14px; min-width: 70px; }
@media (max-width: 640px) {
  .s3g-title { font-size: 14px; } .s3g-actions { max-width: 60vw; } .s3g-actions .s3g-btn { font-size: 10px; padding: 4px 6px; }
  .s3g-status { max-width: 90vw; bottom: auto; top: 92px; }
}

/* FIRST DISCOVERY banner (s3g-discovery.js) */
.s3g-discovery {
  position: absolute; left: 50%; top: 18%; transform: translateX(-50%); text-align: center; pointer-events: none;
  z-index: 1; box-sizing: border-box; max-width: min(40vw, 600px);   /* stays clear of the identify panel on wide screens */
  padding: 10px 26px; border: 2px solid var(--cy); border-radius: 10px; background: rgba(0, 20, 12, .55);
  box-shadow: 0 0 24px var(--cy), inset 0 0 18px rgba(0, 255, 255, .25); transition: opacity .15s linear;
}
.s3g-discovery[hidden] { display: none; }
.s3g-discovery-kind { font-size: 12px; letter-spacing: 3px; color: var(--cy); }
.s3g-discovery-name { font-size: 24px; font-weight: bold; color: #fff; text-shadow: 0 0 12px var(--g), 0 0 26px var(--cy); }
@media (max-width: 640px) { .s3g-discovery-name { font-size: 18px; } }

/* BOTS (s3g-bots.js): name tag + speech bubble above each bot */
.s3g-botlabel { position: absolute; left: 0; top: 0; pointer-events: none; text-align: center; white-space: nowrap; will-change: transform; }
.s3g-botname { font-size: 11px; font-weight: bold; color: var(--bot); text-shadow: 0 0 6px var(--bot), 0 0 2px #000; }
.s3g-botinfo { font-size: 9px; color: #d8ffe0; text-shadow: 0 0 3px #000; }
.s3g-botmsg {
  display: inline-block; max-width: 300px; white-space: normal; margin-bottom: 3px; padding: 3px 7px; font-size: 10px; line-height: 1.3;
  color: var(--bot); background: rgba(0, 0, 0, .75); border: 1px solid var(--bot); border-radius: 6px;
}
.s3g-botmsg[hidden] { display: none; }

/* Root page (index.html) puts a "Stages 0–2" link in the top-left corner: move the HUD title below it */
#older ~ #s3g .s3g-left { top: 44px; }

/* v120 layout: guns are icon-only buttons in the bottom middle, between the two corner toggles
   (⌨️ 💬 bottom-left, 🍿 bottom-right, added by the shared desk script) */
.s3g-guns { position: absolute; left: 52px; right: 52px; bottom: 12px; justify-content: center; align-items: flex-end; gap: 5px; max-width: none; }
.s3g-guns .s3g-gun, .s3g-guns .s3g-mode, .s3g-guns .s3g-pellets, .s3g-guns .s3g-power {
  min-width: 0; width: 38px; height: 38px; padding: 0; font-size: 19px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.s3g-guns .s3g-pellets, .s3g-guns .s3g-power { font-size: 12px; }
.s3g-status { bottom: 66px; }
.s3g-touchbar { bottom: 80px; }
.s3g-start-help { max-width: 640px; margin-top: 4px; padding: 10px 14px; border: 1px solid var(--g2); border-radius: 8px;
  background: rgba(0, 20, 8, .6); font-size: 12px; line-height: 1.5; color: #d8ffe0; text-align: left; }
.s3g-start-row { display: flex; flex-direction: column; margin-bottom: 4px; }
.s3g-start-row b { color: var(--cy); font-size: 12px; }
.s3g-start-guns { display: flex; flex-wrap: wrap; gap: 3px 12px; font-size: 11px; color: #b8ffc9; }
@media (max-height: 520px) {
  .s3g-start { gap: 6px; padding: 8px; } .s3g-start-title { font-size: 24px; } .s3g-start-sub { font-size: 12px; }
  .s3g-start-btn { font-size: 16px; padding: 8px 22px; } .s3g-start-help { font-size: 10px; padding: 6px 10px; }
  .s3g-start-guns { font-size: 10px; }
}
@media (max-width: 640px) { .s3g-status { bottom: auto; top: 92px; } }

.s3g-guns .s3g-pellets[hidden], .s3g-guns .s3g-power[hidden] { display: none !important; }

/* panel toggles: a small button stays visible while its panel is hidden */
.s3g-ptog { align-self: flex-start; width: 26px; height: 26px; padding: 0; font-size: 13px; line-height: 1; cursor: pointer; flex: none;
  background: rgba(0, 34, 0, .85); border: 1px solid var(--g2); border-radius: 50%; color: var(--g); }
.s3g-ptog.off { opacity: .55; border-style: dashed; }
.s3g-tl .s3g-ptog { margin-bottom: 4px; display: block; }
.s3g-actions .s3g-ptog { order: 99; }
.s3g-hide-info .s3g-tl > :not(.s3g-ptog),
.s3g-hide-actions .s3g-actions > :not(.s3g-ptog),
.s3g-hide-bl .s3g-bl > :not(.s3g-ptog),
.s3g-hide-guns .s3g-guns > :not(.s3g-ptog) { display: none !important; }
.s3g-guns .s3g-ptog { width: 30px; height: 30px; align-self: flex-end; }

/* phones: minimal HUD */
@media (max-width: 900px), (max-height: 500px) {
  .s3g-left { top: 6px; left: 8px; } .s3g-title { font-size: 11px; letter-spacing: 0; } .s3g-stats { font-size: 8px; margin-top: 1px; } .s3g-target { font-size: 9px; margin-top: 1px; }
  .s3g-actions { top: 6px; right: 8px; gap: 3px; max-width: 70vw; }
  .s3g-actions .s3g-btn { font-size: 9px; padding: 2px 5px; border-width: 1px; }
  .s3g-bl { gap: 3px; }
  .s3g-chip { font-size: 9px; min-width: 22px; padding: 1px 3px; border-width: 1px; } .s3g-palette { gap: 3px; }
  .s3g-inv { font-size: 8px; }
  .s3g-guns { left: 46px; right: 46px; bottom: 8px; gap: 3px; }
  .s3g-guns .s3g-gun, .s3g-guns .s3g-mode, .s3g-guns .s3g-pellets, .s3g-guns .s3g-power { width: 28px; height: 28px; font-size: 14px; border-width: 1px; }
  .s3g-guns .s3g-pellets, .s3g-guns .s3g-power { font-size: 9px; }
  .s3g-guns .s3g-ptog { width: 24px; height: 24px; font-size: 11px; }
  .s3g-status { font-size: 9px; padding: 2px 6px; bottom: 44px; top: auto; max-width: 56vw; }
  .s3g-touchbar { bottom: 62px; right: 6px; gap: 4px; } .s3g-tbtn { font-size: 10px; padding: 6px 7px; min-width: 44px; border-width: 1px; }
  .s3g-start-title { font-size: 22px; } .s3g-start-sub { font-size: 11px; }
  #older ~ #s3g .s3g-left { top: 28px; }
}

/* v120 clean screen: the shared desk script's corner buttons are replaced by toggles + the top-right menu */
.s3g-ptog-bl, .s3g-ptog-br { position: absolute; bottom: 8px; width: 34px; height: 34px; font-size: 16px; z-index: 5; }
.s3g-ptog-bl { left: 8px; } .s3g-ptog-br { right: 8px; }
.s3g-pad { position: absolute; bottom: 50px; width: 108px; height: 108px; border-radius: 50%; touch-action: none; user-select: none;
  border: 1px solid var(--g2); background: radial-gradient(circle, rgba(0,60,20,.35), rgba(0,20,8,.25)); pointer-events: auto; opacity: .85; }
.s3g-pad-left { left: 12px; } .s3g-pad-right { right: 12px; }
.s3g-pad-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 9px; color: var(--g2); letter-spacing: 1px; }
.s3g-pad-knob { position: absolute; left: 50%; top: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%;
  background: rgba(0, 255, 65, .25); border: 1px solid var(--g); pointer-events: none; }
.s3g-hide-padL .s3g-pad-left, .s3g-hide-padR .s3g-pad-right { display: none; }
.s3g-touchbar { right: 132px; bottom: 50px; }
.s3g-actions .s3g-btn[title] { min-width: 0; }
@media (max-width: 900px), (max-height: 500px) {
  .s3g-pad { width: 92px; height: 92px; bottom: 46px; } .s3g-pad-knob { width: 34px; height: 34px; margin: -17px 0 0 -17px; }
  .s3g-ptog-bl, .s3g-ptog-br { width: 30px; height: 30px; font-size: 14px; }
  .s3g-touchbar { right: 112px; bottom: 46px; }
}

/* time speed toggle: top middle */
.s3g-timebtn { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); font-size: 11px; padding: 3px 9px; border-radius: 14px; }
@media (max-width: 900px), (max-height: 500px) { .s3g-timebtn { font-size: 9px; padding: 2px 7px; border-width: 1px; } }
/* ============================================
   STEERING MODES (js/s3g-steering.js): picker, options window, Cessna touch sticks, instruments, left-handed swap
   ============================================ */
.s3g-root {
  --s3g-stick: clamp(96px, min(30vh, 26vw), 190px);      /* touch stick diameter: scales with the screen, bigger on tablets */
  --s3g-att: clamp(60px, 13vmin, 118px);                  /* attitude indicator diameter */
  --s3g-safe-l: env(safe-area-inset-left, 0px); --s3g-safe-r: env(safe-area-inset-right, 0px);
  --s3g-safe-t: env(safe-area-inset-top, 0px); --s3g-safe-b: env(safe-area-inset-bottom, 0px);
  --s3g-bottom: 58px;                                      /* gap under the sticks / touch bar: leaves room for the gun icons */
}
@media (max-width: 900px), (max-height: 500px) { .s3g-root { --s3g-bottom: 46px; } }
@media (orientation: portrait) and (max-width: 900px) { .s3g-root { --s3g-bottom: 84px; } }   /* gun icons wrap to two rows */
/* start-screen picker */
.s3g-steerpick { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 12px; border: 1px solid var(--g2); border-radius: 8px; background: rgba(0, 20, 8, .6); max-width: min(640px, 94vw); }
.s3g-steerpick b { color: var(--cy); font-size: 12px; }
.s3g-steerbtns { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.s3g-steerbtn { font-size: 13px; padding: 7px 12px; min-height: 36px; }
.s3g-steerhint { max-width: 520px; }
@media (max-height: 520px) { .s3g-steerpick { padding: 4px 8px; gap: 3px; } .s3g-steerbtn { font-size: 11px; padding: 4px 8px; min-height: 28px; } }

/* options window */
.s3g-optpanel { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(520px, 94vw); max-height: 88vh; overflow: auto; z-index: 6; }
.s3g-optrow { display: grid; grid-template-columns: 112px 1fr; gap: 2px 10px; align-items: center; margin-bottom: 7px; }
.s3g-optrow > .s3g-gridinfo { grid-column: 2; margin-top: -2px; }
.s3g-optname { color: var(--cy); font-size: 12px; }
.s3g-optctl { display: flex; align-items: center; gap: 8px; } .s3g-optctl input[type=range] { flex: 1; min-width: 0; accent-color: var(--g); }
.s3g-optctl input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--g); }
.s3g-optval { min-width: 40px; text-align: right; font-size: 11px; color: #d8ffe0; }
.s3g-opthint { margin: -2px 0 8px; }
.s3g-ptog-gear { font-size: 14px; }
@media (max-height: 520px) { .s3g-optpanel { padding: 8px 10px; } .s3g-optrow { margin-bottom: 4px; } .s3g-panel-title { margin-bottom: 4px; } }

/* Cessna touch sticks: right = aileron + elevator, left = rudder + throttle (the lever holds). Hidden unless Cessna is selected. */
.s3g-stick { display: none; position: absolute; bottom: calc(var(--s3g-bottom) + var(--s3g-safe-b)); box-sizing: border-box; width: var(--s3g-stick); height: var(--s3g-stick); border-radius: 50%;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; pointer-events: auto; z-index: 3;
  border: 2px solid var(--g2); background: radial-gradient(circle, rgba(0, 60, 20, .4), rgba(0, 20, 8, .28)); opacity: .9; }
.s3g-stick-left { left: calc(12px + var(--s3g-safe-l)); } .s3g-stick-right { right: calc(12px + var(--s3g-safe-r)); }
.s3g-steer-cessna .s3g-stick { display: block; }
.s3g-steer-cessna .s3g-pad { display: none; }
.s3g-steer-cessna.s3g-hide-padL .s3g-stick-left, .s3g-steer-cessna.s3g-hide-padR .s3g-stick-right { display: none; }
.s3g-stick-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; white-space: pre-line; font-size: clamp(7px, calc(var(--s3g-stick) * .075), 11px); line-height: 1.5; color: var(--g2); letter-spacing: .5px; pointer-events: none; }
.s3g-stick-knob { position: absolute; left: 50%; top: 50%; width: 38%; height: 38%; margin: -19% 0 0 -19%; border-radius: 50%; background: rgba(0, 255, 65, .28); border: 2px solid var(--g); pointer-events: none; will-change: transform; }
/* the left stick also shows the held throttle as a bar on its edge */
.s3g-stick-left::after { content: ""; position: absolute; left: -2px; bottom: 6%; width: 4px; height: var(--thr, 0%); max-height: 88%; background: var(--cy); border-radius: 2px; pointer-events: none; opacity: .8; }
/* the touch buttons stay clear of the sticks, on the inner side of the right one */
.s3g-steer-cessna .s3g-touchbar { right: calc(var(--s3g-stick) + 24px + var(--s3g-safe-r)); bottom: calc(var(--s3g-bottom) + var(--s3g-safe-b)); }
.s3g-steer-cessna .s3g-ptog-bl { left: calc(8px + var(--s3g-safe-l)); } .s3g-steer-cessna .s3g-ptog-br { right: calc(8px + var(--s3g-safe-r)); }

/* left-handed: swap the pads / sticks and the touch bar */
.s3g-lefty .s3g-pad-left, .s3g-lefty .s3g-stick-left { left: auto; right: calc(12px + var(--s3g-safe-r)); }
.s3g-lefty .s3g-pad-right, .s3g-lefty .s3g-stick-right { right: auto; left: calc(12px + var(--s3g-safe-l)); }
.s3g-lefty .s3g-ptog-bl { left: auto; right: calc(8px + var(--s3g-safe-r)); } .s3g-lefty .s3g-ptog-br { right: auto; left: calc(8px + var(--s3g-safe-l)); }
.s3g-lefty .s3g-touchbar { right: auto; left: 132px; }
@media (max-width: 900px), (max-height: 500px) { .s3g-lefty .s3g-touchbar { left: 112px; } }
.s3g-lefty.s3g-steer-cessna .s3g-touchbar { right: auto; left: calc(var(--s3g-stick) + 24px + var(--s3g-safe-l)); }

/* Cessna instruments: top centre, clear of the corner clusters and the touch bar */
.s3g-instr { position: absolute; top: calc(6px + var(--s3g-safe-t)); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 2px; pointer-events: none; z-index: 2; text-shadow: 0 0 6px #000; }
.s3g-instr[hidden] { display: none; }
.s3g-instr-row { display: flex; align-items: stretch; gap: 6px; }
.s3g-att { width: var(--s3g-att); height: var(--s3g-att); border-radius: 50%; background: #001a08; box-shadow: 0 0 10px rgba(0, 255, 65, .35); }
.s3g-thr { width: 8px; border: 1px solid var(--g2); border-radius: 4px; background: rgba(0, 20, 8, .7); display: flex; align-items: flex-end; overflow: hidden; }
.s3g-thr-fill { width: 100%; height: 35%; background: var(--cy); }
.s3g-instr-spd, .s3g-instr-thr { font-size: clamp(9px, 1.7vmin, 12px); color: #d8ffe0; letter-spacing: 1px; line-height: 1.15; }
.s3g-instr-thr { color: var(--cy); }
.s3g-instr-edge { font-size: clamp(8px, 1.6vmin, 11px); color: var(--warn); font-weight: bold; text-shadow: 0 0 8px var(--warn); }
.s3g-instr-edge[hidden] { display: none; }
.s3g-steer-cessna .s3g-discovery { top: max(18%, calc(var(--s3g-att) + 64px)); }

/* ============================================
   KEYBOARD LAYER (js/s3g-keys.js) + STAGE SELECTOR (js/s3g-stages.js)
   ============================================ */
.s3g-ptog[hidden], .s3g-keys-link[hidden], .s3g-start-keys[hidden], .s3g-optkeys:has(.s3g-keys-link[hidden]) { display: none !important; }
.s3g-ptog-keys { font-size: 14px; }
.s3g-start-keys { display: flex; justify-content: center; }
.s3g-optkeys { display: flex; margin: 4px 0 8px; }
/* keyboard options window */
.s3g-keywin { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, 94vw); max-height: 88vh; overflow: auto; z-index: 7; }
.s3g-keys-sub { color: var(--cy); font-size: 12px; margin: 8px 0 4px; }
.s3g-keys-presets { justify-content: flex-start; }
.s3g-keys-presets .s3g-steerbtn { font-size: 12px; padding: 5px 10px; min-height: 30px; }
.s3g-keys-msgbox { display: flex; align-items: center; gap: 8px; min-height: 16px; margin: 4px 0; }
.s3g-keys-msg.warn { color: var(--warn); }
.s3g-keys-list { display: grid; grid-template-columns: 1fr auto auto; gap: 4px 6px; align-items: center; margin-bottom: 10px; }
.s3g-keys-group { grid-column: 1 / -1; color: var(--cy); font-size: 12px; margin-top: 6px; border-bottom: 1px solid var(--g2); }
.s3g-keys-row { display: contents; }
.s3g-keys-name { color: #d8ffe0; }
.s3g-keys-slot { min-width: 64px; padding: 4px 8px; font-size: 12px; text-align: center; }
.s3g-keys-slot.empty { opacity: .6; }
.s3g-keys-slot.capturing { background: var(--g); color: #000; box-shadow: 0 0 12px var(--g); }
/* stage selector on the opening screen */
.s3g-stagepick { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 12px; border: 1px solid var(--g2); border-radius: 8px; background: rgba(0, 20, 8, .6); max-width: min(660px, 94vw); }
.s3g-stagepick b { color: var(--cy); font-size: 12px; }
.s3g-stagelist { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.s3g-stage { display: flex; flex-direction: column; align-items: center; min-width: 96px; padding: 6px 8px; border: 1px solid var(--g2); border-radius: 8px; background: rgba(0, 30, 10, .7);
  color: #d8ffe0; font: inherit; font-size: 11px; text-decoration: none; cursor: pointer; line-height: 1.3; }
.s3g-stage b { color: var(--g); font-size: 13px; } .s3g-stage-icon { font-size: 18px; } .s3g-stage-sub { color: #9be89b; font-size: 10px; }
.s3g-stage.older:hover, .s3g-stage.older:focus-visible { border-color: var(--cy); box-shadow: 0 0 10px var(--cy); }
.s3g-stage.current { border-color: var(--g); box-shadow: 0 0 12px rgba(0, 255, 65, .5); }
.s3g-stage.current:hover { background: rgba(0, 80, 25, .8); }
.s3g-stage.soon { opacity: .5; border-style: dashed; cursor: not-allowed; }
@media (max-height: 520px), (max-width: 640px) {
  .s3g-stagepick { padding: 4px 8px; gap: 3px; } .s3g-stagelist { gap: 4px; } .s3g-stage { min-width: 0; padding: 3px 7px; flex-direction: row; gap: 5px; font-size: 10px; }
  .s3g-stage b { font-size: 11px; } .s3g-stage-icon { font-size: 13px; } .s3g-stage-sub { display: none; }
  .s3g-stagepick > .s3g-small { display: none; }
  .s3g-keywin { padding: 8px 10px; }
}
.s3g-start { overflow: auto; justify-content: safe center; }
