:root {
  --panel-bg: rgba(255, 255, 255, 0.94);
  --panel-fg: #2b2b2b;
  --muted: #777;
  --accent: #e9a79f;
  --line: #ddd;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  font-family: system-ui, "Hiragino Sans", "Yu Gothic UI", sans-serif;
  background: transparent;
}

/* 背景モード（OBS では透過のまま） */
body[data-bg="checker"] {
  background-color: #eee;
  background-image:
    linear-gradient(45deg, #ddd 25%, transparent 25%, transparent 75%, #ddd 75%),
    linear-gradient(45deg, #ddd 25%, transparent 25%, transparent 75%, #ddd 75%);
  background-size: 24px 24px;
  background-position: 0 0, 12px 12px;
}
body[data-bg="green"] { background: #00b140; }
/* 配信イメージ: 中央に動画枠、右下にちるちゅう */
body[data-bg="video"] { background: #20242c; }
body[data-bg="video"]::before {
  content: "解説する動画";
  position: fixed;
  left: 8%; top: 8%; width: 62%; height: 70%;
  display: grid; place-items: center;
  background: #3a4150; color: #9aa3b5; font-size: 20px; border-radius: 6px;
}
body[data-bg="video"] #stage {
  left: auto; top: auto; right: 2%; bottom: 0;
  width: 30vw; height: 42vh;
}

#stage { position: fixed; inset: 0; }

#panel {
  position: fixed; top: 12px; right: 12px; width: 300px; max-height: calc(100% - 24px);
  overflow-y: auto; padding: 12px 14px;
  background: var(--panel-bg); color: var(--panel-fg);
  border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  font-size: 13px;
}
#panel[hidden] { display: none; }
#panel header { display: flex; align-items: baseline; justify-content: space-between; }
#panel h1 { font-size: 15px; margin: 0 0 8px; }
#panel h2 { font-size: 12px; color: var(--muted); margin: 12px 0 6px; font-weight: 600; }
.hint { color: var(--muted); font-size: 11px; }

.param { display: grid; grid-template-columns: 96px 1fr 40px; align-items: center; gap: 6px; margin: 3px 0; }
.param input { width: 100%; accent-color: var(--accent); }
.param output { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }

.btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
button {
  font: inherit; padding: 4px 10px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--panel-fg);
}
button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
button kbd { font-size: 10px; opacity: 0.7; margin-left: 4px; }

.status { margin: 6px 0 0; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.status[data-state="running"] { color: #3a8f5c; }
.status[data-state="lost"] { color: #b7791f; }
.status[data-state="error"] { color: #c0392b; }
.track-video { width: 100%; margin-top: 6px; border-radius: 6px; transform: scaleX(-1); background: #000; }
button:disabled { opacity: 0.45; cursor: default; }

.file-btn {
  display: inline-block; padding: 4px 10px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--line); background: #fff;
}
.meter { height: 6px; margin-top: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.meter > div { height: 100%; width: 0; background: var(--accent); transition: width 60ms linear; }
select { font: inherit; padding: 3px 6px; border-radius: 6px; border: 1px solid var(--line); background: #fff; }

.check { display: block; margin: 3px 0; }
.url { width: 100%; margin-top: 6px; font: 11px ui-monospace, monospace; padding: 4px; border: 1px solid var(--line); border-radius: 4px; }
