/* 3D sandbox page. Shares tokens with style.css. */
.sim-card { padding: 0; overflow: hidden; }
.sim-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 72vh;
  min-height: 320px;
  background: #e9e3d6;
  outline: none;
  touch-action: none;
}
.sim-stage:focus-visible { box-shadow: inset 0 0 0 2px var(--tube); }
.sim-stage canvas#view { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.sim-stage .label3d {
  font: 11px/1.2 "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: rgba(251, 248, 241, 0.86);
  border: 1px solid #d2c8b6;
  padding: 2px 6px;
  border-radius: 3px;
  white-space: nowrap;
  pointer-events: none;
}

.hud {
  position: absolute;
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink);
  background: rgba(251, 248, 241, 0.9);
  border: 1px solid #d2c8b6;
  padding: 8px 10px;
  pointer-events: none;
}
.hud-left { top: 10px; left: 10px; min-width: 200px; }
.hud-left .row { display: flex; justify-content: space-between; gap: 14px; }
.hud-left .row span:first-child { color: var(--muted); }
.hud-left .mode { font-weight: 650; font-size: 13px; letter-spacing: 0.04em; margin-bottom: 2px; }
.hud-right { top: 10px; right: 10px; width: 230px; }
.hud-right .bar { display: grid; grid-template-columns: 5.2rem 1fr 3.3rem; gap: 6px; align-items: center; margin: 2px 0; }
.hud-right .bar span:first-child { color: var(--muted); }
.hud-right .bar span:last-child { text-align: right; }
.hud-right .track { position: relative; height: 7px; background: #ece5d6; }
.hud-right .fill { position: absolute; top: 0; bottom: 0; background: var(--tube); }
.hud-right .fill.hot { background: var(--open); }
.hud-right .fill.sat { background: var(--red); }
.hud-right .zero { position: absolute; top: -2px; bottom: -2px; left: 50%; width: 1px; background: var(--muted); }
.hud-right h4 { margin: 6px 0 2px; font: 600 11px/1.2 "Segoe UI", system-ui, sans-serif; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.hud-right h4:first-child { margin-top: 0; }
.hud-banner {
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  text-align: center;
  padding: 12px 16px;
  border-left: 3px solid var(--red);
  max-width: 80%;
}
.sim-keys { margin: 0; padding: 8px 12px 0; font-size: 12px; line-height: 1.5; color: var(--muted); }
.sim-keys b { color: var(--ink); font-weight: 600; }

.pad { position: absolute; right: 12px; bottom: 12px; display: none; grid-template-columns: repeat(3, 44px); grid-template-rows: repeat(2, 44px); gap: 6px; }
.pad button { font-size: 18px; padding: 0; opacity: 0.9; touch-action: none; }
.pad [data-hold="up"] { grid-column: 2; grid-row: 1; }
.pad [data-hold="left"] { grid-column: 1; grid-row: 2; }
.pad [data-hold="down"] { grid-column: 2; grid-row: 2; }
.pad [data-hold="right"] { grid-column: 3; grid-row: 2; }
@media (pointer: coarse) {
  .pad { display: grid; }
  .hud-banner { bottom: 120px; }
}

.sim-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: end;
  padding: 10px 12px;
  border-top: 1px solid #d9d0c0;
  background: #fff;
}
.sim-bar label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.sim-bar label:last-child { min-width: 160px; flex: 1; }
select { font: inherit; padding: 4px 6px; border: 1px solid #c3b8a4; border-radius: 4px; background: #fff; color: var(--ink); }

.sim-charts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 10px 12px 12px; }
.sim-charts h3 { margin: 0 0 4px; font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
canvas.chart { width: 100%; height: 110px; display: block; background: #fffdf8; border: 1px solid var(--dim); }

.sim-lower { margin-top: 16px; grid-template-columns: 1fr 1fr; }
.knobs label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--ink); font-size: 13px; }
.sim-notes { margin: 6px 0 8px; padding-left: 18px; font-size: 13px; line-height: 1.45; }
.sim-notes li { margin-bottom: 4px; }

@media (max-width: 900px) {
  .sim-charts, .sim-lower { grid-template-columns: 1fr; }
  .sim-stage { aspect-ratio: 4 / 3; }
  .hud-right { width: 190px; }
}
@media (max-width: 560px) {
  .hud-right { display: none; }
  .hud-left { min-width: 0; font-size: 11px; padding: 5px 7px; }
  .hud-left .row:nth-child(n+5) { display: none; }
  .hud-banner { font-size: 13px; max-width: 92%; }
}
