* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f4f6f9;
  color: #2b2f36;
  overflow: hidden;
}

.app { display: flex; height: 100vh; }

.stage { position: relative; flex: 1; min-width: 0; }
#scene { display: block; width: 100%; height: 100%; }

.hud {
  position: absolute;
  top: 14px; left: 14px;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.7;
  min-width: 230px;
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 16px rgba(31,41,55,0.08);
}
.hud .st { font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.hud .ok { color: #1f9d57; }
.hud .bad { color: #e53935; }
.hud .k { color: #7a8695; }
.hud .v { float: right; font-variant-numeric: tabular-nums; }

.panel {
  width: 340px;
  flex-shrink: 0;
  background: #ffffff;
  border-left: 1px solid #e7eaef;
  padding: 18px 18px 60px;
  overflow-y: auto;
}
.panel h1 { font-size: 20px; margin: 0 0 2px; color: #1f2937; }
.panel .sub { margin: 0 0 16px; color: #7a8695; font-size: 13px; }
.panel section { margin-bottom: 16px; }
.panel hr { border: none; border-top: 1px solid #e7eaef; margin: 18px 0; }

.seg {
  display: flex; gap: 6px;
  background: #eef1f5;
  padding: 4px; border-radius: 10px;
}
.seg button {
  flex: 1; padding: 8px; border: none; border-radius: 7px;
  background: transparent; color: #5b6673; cursor: pointer;
  font-size: 13px; font-weight: 600;
}
.seg button.active { background: #2c6cff; color: #fff; }

.row { display: flex; justify-content: space-between; font-size: 13px; color: #7a8695; margin-bottom: 6px; }

.ctl { display: block; margin-bottom: 14px; font-size: 13px; }
.ctl span { display: flex; justify-content: space-between; margin-bottom: 6px; color: #3b424c; }
.ctl b { color: #2c6cff; font-variant-numeric: tabular-nums; }
input[type="range"] { width: 100%; accent-color: #2c6cff; }

.drive-btns { display: flex; gap: 8px; }
.drivebtn {
  flex: 1; padding: 12px; border: 1px solid #d7dce3;
  border-radius: 9px; background: #f4f6f9; color: #2b2f36;
  cursor: pointer; font-size: 14px; font-weight: 600;
  user-select: none;
}
.drivebtn:active, .drivebtn.held { background: #2c6cff; border-color: #2c6cff; color: #fff; }
.drivebtn.primary { background: #2c6cff; border-color: #2c6cff; color: #fff; }
button.wide {
  width: 100%; padding: 11px; border: 1px solid #d7dce3;
  border-radius: 9px; background: #f4f6f9; color: #2b2f36; cursor: pointer;
  font-size: 14px; font-weight: 600;
}

.hint { font-size: 12px; color: #9aa2ad; margin: 8px 0 0; }
.check { font-size: 13px; color: #3b424c; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.hidden { display: none; }

@media (max-width: 720px) {
  .app { flex-direction: column; }
  .panel { width: 100%; border-left: none; border-top: 1px solid #e7eaef; }
}
