/* 全画面キャンバスと控えめな操作パネル */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #000; color: #eee;
  font-family: system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", sans-serif; }
canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; touch-action: none; cursor: crosshair; }
body.idle canvas { cursor: none; }

.panel { position: fixed; top: 12px; right: 12px; width: 280px; max-height: calc(100vh - 24px); overflow: auto;
  padding: 12px 14px; border-radius: 12px; background: rgba(12, 14, 20, 0.72); backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, 0.08); font-size: 13px;
  transition: opacity .35s, transform .35s; }
.panel.hidden, body.idle .panel.hidden { opacity: 0; transform: translateX(16px); pointer-events: none; }
body.idle .panel:not(:hover):not(.hidden) { opacity: 0.12; }
.panel header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.panel h1 { font-size: 14px; font-weight: 600; margin: 0; letter-spacing: .04em; }
.row { display: grid; grid-template-columns: 56px 1fr 34px; align-items: center; gap: 8px; margin: 7px 0; }
.row select { grid-column: 2 / 4; }
.row output { text-align: right; font-variant-numeric: tabular-nums; opacity: .8; }
.fk { margin: -2px 0 6px 64px; font-size: 11px; opacity: .65; font-variant-numeric: tabular-nums; }
select, button { font: inherit; color: inherit; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 7px; padding: 5px 8px; }
select option { background: #1a1d26; }
button { cursor: pointer; }
button:hover, select:hover { background: rgba(255, 255, 255, 0.16); }
input[type=range] { width: 100%; accent-color: #7fd1c7; }
.check { display: flex; align-items: center; gap: 6px; margin: 6px 0; }
.buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.icon { padding: 0 8px; line-height: 22px; }
.help { margin-top: 10px; opacity: .85; }
.help summary { cursor: pointer; }
.help ul { padding-left: 18px; margin: 6px 0 0; line-height: 1.7; }
kbd { font: 11px ui-monospace, monospace; padding: 0 4px; border-radius: 4px; border: 1px solid rgba(255,255,255,.25); }
.status { white-space: pre-line; margin-top: 10px; font-size: 11px; opacity: .6; font-variant-numeric: tabular-nums; line-height: 1.5; }

.fab { position: fixed; top: 12px; right: 12px; width: 40px; height: 40px; border-radius: 50%; font-size: 18px;
  background: rgba(12, 14, 20, 0.6); opacity: 0; pointer-events: none; transition: opacity .3s; }
.fab.show { opacity: .8; pointer-events: auto; }
body.idle .fab.show:not(:hover) { opacity: 0; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); padding: 7px 14px; border-radius: 999px;
  background: rgba(12, 14, 20, 0.75); font-size: 13px; opacity: 0; transition: opacity .4s; pointer-events: none; }
.toast.show { opacity: 1; }

.error { position: fixed; inset: 0; display: grid; place-items: center; background: #0b0d12; padding: 24px; text-align: center; }
.error[hidden] { display: none; }
.error h2 { font-size: 18px; }
.error p { opacity: .8; line-height: 1.7; max-width: 520px; }

@media (max-width: 520px) {
  .panel { left: 8px; right: 8px; top: auto; bottom: 8px; width: auto; max-height: 55vh; }
}
