:root {
  --bg: #14171b;
  --panel: #1f242b;
  --panel2: #2a313a;
  --text: #e9edf2;
  --muted: #9aa5b1;
  --accent: #3da5ff;
  --danger: #ff5d5d;
  --warn: #ffb020;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font-family: system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", sans-serif; -webkit-text-size-adjust: 100%; }
body { display: flex; flex-direction: column; height: 100dvh; overflow: hidden; overscroll-behavior: none; }
button, .button { font: inherit; color: var(--text); background: var(--panel2); border: 1px solid #39424d;
  border-radius: 10px; padding: 9px 14px; cursor: pointer; text-decoration: none; display: inline-block; -webkit-tap-highlight-color: transparent; }
button:active, .button:active { transform: translateY(1px); }
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button.danger { color: var(--danger); }
button:disabled { opacity: .45; }

.top { display: flex; align-items: center; gap: 12px; padding: calc(env(safe-area-inset-top) + 8px) 16px 8px; background: var(--panel); border-bottom: 1px solid #000; }
.brand { font-weight: 700; letter-spacing: .02em; }
.stats { flex: 1; font-size: 12px; line-height: 1.35; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
button.icon { width: 34px; height: 34px; padding: 0; border-radius: 50%; }

#stage { position: relative; flex: 1; min-height: 0; }
#view { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#mini { position: absolute; right: 10px; bottom: 10px; width: 120px; height: 150px; border-radius: 8px;
  border: 1px solid #3a434e; box-shadow: 0 4px 16px rgba(0,0,0,.5); cursor: pointer; }
#mini[hidden] { display: none; }

.empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 24px 16px; pointer-events: none; }
.empty h1 { font-size: 22px; line-height: 1.4; margin: 0 0 10px; }
.empty p { color: var(--muted); font-size: 14px; line-height: 1.6; margin: 0 0 18px; }
.empty .hint { font-size: 12px; margin-top: 18px; }
.empty-actions { display: flex; flex-direction: column; gap: 10px; width: min(320px, 100%); pointer-events: auto; }
.empty[hidden] { display: none; }

.tools { display: flex; justify-content: space-around; gap: 4px; padding: 6px 6px calc(env(safe-area-inset-bottom) + 6px);
  background: var(--panel); border-top: 1px solid #000; overflow-x: auto; }
.tools button { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; max-width: 84px; padding: 6px 2px;
  font-size: 11px; background: transparent; border-color: transparent; }
.tools button .ic { font-size: 19px; line-height: 1; }
.tools button.primary { background: var(--accent); }
.tools button.on { background: var(--panel2); border-color: var(--warn); color: var(--warn); }

.livebar, .adjustbar { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); background: rgba(20,23,27,.92);
  border: 1px solid #3a434e; border-radius: 12px; padding: 8px 10px; display: flex; gap: 8px; align-items: center;
  max-width: calc(100% - 20px); flex-wrap: wrap; justify-content: center; backdrop-filter: blur(6px); }
.livebar[hidden], .adjustbar[hidden] { display: none; }
.adjustbar { flex-direction: column; }
.adjust-hint { font-size: 12px; color: var(--muted); }
.livebar button, .adjustbar button { padding: 6px 10px; font-size: 13px; }
.live-state { color: #4cd964; }
.live-state.lost { color: var(--warn); }
.live-state.paused { color: var(--muted); }

.toast { position: absolute; left: 50%; bottom: 56px; transform: translateX(-50%); background: rgba(0,0,0,.85); color: #fff;
  padding: 10px 16px; border-radius: 10px; font-size: 14px; max-width: calc(100% - 160px); text-align: center; pointer-events: none; }
.toast[hidden] { display: none; }

dialog { background: var(--panel); color: var(--text); border: 1px solid #3a434e; border-radius: 14px; padding: 18px;
  width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto; }
dialog::backdrop { background: rgba(0,0,0,.6); }
dialog h2 { margin: 0 0 8px; font-size: 18px; }
.sub { color: var(--muted); font-size: 13px; line-height: 1.6; margin: 0 0 12px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.row.end { justify-content: flex-end; }
.crop-wrap { display: flex; justify-content: center; background: #000; border-radius: 8px; padding: 6px; }
.crop-wrap canvas { touch-action: none; display: block; }
label { display: block; margin: 12px 0; font-size: 14px; }
label select, label input[type=range] { display: block; width: 100%; margin-top: 6px; }
select { font: inherit; color: var(--text); background: var(--panel2); border: 1px solid #39424d; border-radius: 8px; padding: 8px; }
small { color: var(--muted); font-size: 12px; }
output { color: var(--accent); margin-left: 6px; }
progress { width: 100%; height: 10px; }
.prog-mini { width: 100%; height: 180px; display: block; border-radius: 8px; margin-top: 8px; }
.warn { color: var(--warn); font-size: 13px; min-height: 1em; }
.exp-result { background: var(--panel2); border-radius: 10px; padding: 10px 12px; margin-top: 8px; }
.exp-result p { margin: 0; font-size: 14px; }
.help { padding-left: 1.2em; line-height: 1.7; font-size: 14px; }
.help li { margin-bottom: 6px; }
.only-desktop.unsupported { display: none !important; }

/* ---- LargePic 追加 ---- */
.logo { width: 28px; height: 28px; border-radius: 7px; }
.brand { display: flex; flex-direction: column; line-height: 1.05; }
.brand small { font-size: 10px; color: var(--muted); font-weight: 500; }
.hero { width: 76px; height: 76px; border-radius: 18px; margin-bottom: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
button.big { padding: 13px 16px; font-size: 16px; }
.empty a, .sub a { color: var(--accent); }
.fill-chip { position: absolute; left: 10px; bottom: 10px; background: #5a1f24; border-color: var(--danger); color: #ffd6d6;
  font-size: 13px; padding: 8px 12px; border-radius: 20px; box-shadow: 0 4px 14px rgba(0,0,0,.4); }
.fill-chip[hidden] { display: none; }
.tools .rec-btn .ic { color: var(--danger); }
.live-state.rec { color: var(--danger); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.rules { display: grid; gap: 6px; margin: 10px 0; }
.rules div { display: flex; gap: 10px; align-items: center; background: var(--panel2); border-radius: 10px; padding: 8px 10px; font-size: 14px; }
.rules > div > b.n { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-size: 13px; }
.steps { padding-left: 1.3em; font-size: 14px; line-height: 1.7; margin: 10px 0; }
.col { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.col [hidden] { display: none; }
.note { background: #3a2a10; border: 1px solid var(--warn); border-radius: 10px; padding: 10px 12px; font-size: 13px; line-height: 1.6; margin: 0 0 8px; }
.note[hidden] { display: none; }
.center { text-align: center; margin-top: 10px; }
.small { font-size: 12px; }
.seg-row { display: flex; align-items: center; gap: 10px; margin: 10px 0; font-size: 14px; }
.seg-row > span { width: 64px; flex: none; }
.seg { display: flex; flex: 1; border: 1px solid #39424d; border-radius: 10px; overflow: hidden; }
.seg button { flex: 1; border: 0; border-radius: 0; background: transparent; padding: 8px 4px; font-size: 14px; }
.seg button + button { border-left: 1px solid #39424d; }
.seg button.on { background: var(--accent); color: #fff; font-weight: 600; }
.trim-canvas { width: 100%; height: 240px; display: block; border-radius: 8px; background: #111418; }
.help-dlg h3 { font-size: 15px; margin: 16px 0 4px; color: var(--accent); }
.help-dlg ul.help { padding-left: 1.2em; }
.range[hidden] { display: none; }
.range label { margin: 8px 0; }
