:root {
  color-scheme: dark;
  --bg: #0c0f18;
  --panel: #171b2a;
  --panel-2: #20263a;
  --line: #303850;
  --text: #f5f7ff;
  --muted: #aab2ca;
  --primary: #79e8c5;
  --primary-ink: #06271e;
  --danger: #ff7c8e;
  --warning: #ffd66b;
  --radius: 16px;
  font-family: Inter, "Noto Sans JP", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
button, input, textarea, select { font: inherit; }
button, .button {
  border: 0; border-radius: 10px; padding: .72rem 1rem; background: var(--primary); color: var(--primary-ink);
  font-weight: 750; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
}
button:hover, .button:hover { filter: brightness(1.08); }
button:disabled { opacity: .45; cursor: not-allowed; }
.secondary { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); }
.danger { color: #2b070c; background: var(--danger); }
.ghost-danger { color: var(--danger); background: transparent; border: 1px solid #71333e; }
.shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 24px 0 56px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: linear-gradient(135deg,#79e8c5,#7ba8ff); color: #07111d; font-weight: 900; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(1.45rem, 4vw, 2.15rem); margin-bottom: .3rem; }
h2 { font-size: 1.2rem; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.login { width: min(440px, calc(100% - 32px)); margin: 12vh auto; }
.login .brand { margin-bottom: 28px; }
.stack { display: grid; gap: 16px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.spread { justify-content: space-between; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.event-card { display: grid; gap: 14px; }
.event-card h2 { margin: 0; }
.badge { border-radius: 99px; padding: .25rem .58rem; font-size: .75rem; font-weight: 800; background: #244238; color: #91f1ce; }
.badge.off { background: #4b3035; color: #ffacb7; }
label { display: grid; gap: 7px; color: var(--muted); font-size: .9rem; }
input, textarea, select {
  width: 100%; color: var(--text); background: #0e1220; border: 1px solid var(--line); border-radius: 10px; padding: .78rem .85rem; outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px #79e8c522; }
input[type="color"] { padding: 4px; min-height: 44px; }
input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--primary); }
.toggle { display: flex; flex-direction: row; align-items: center; gap: 10px; color: var(--text); }
.two-col { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); gap: 18px; align-items: start; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .wide { grid-column: 1 / -1; }
.tabs { display: flex; gap: 8px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tab { border-radius: 10px 10px 0 0; background: transparent; color: var(--muted); white-space: nowrap; border-bottom: 3px solid transparent; }
.tab.active { background: var(--panel-2); color: var(--primary); border-bottom-color: var(--primary); }
[data-pane][hidden] { display: none !important; }
.section-heading { border-left: 4px solid var(--primary); padding: 4px 0 4px 14px; margin-bottom: 4px; }
.section-heading h2 { margin: 0 0 5px; color: var(--text); font-size: 1.3rem; }
.section-heading p { margin: 0; color: var(--muted); font-size: .9rem; }
.url-box { display: grid; grid-template-columns: 100px 1fr auto; align-items: center; gap: 8px; }
.url-box input { min-width: 0; }
.qr { width: 180px; max-width: 100%; background: white; padding: 8px; border-radius: 12px; }
.comment-list { max-height: 600px; overflow: auto; display: grid; gap: 8px; }
.comment-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.file-button { cursor: pointer; }
.comment-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; background: #0f1422; padding: 12px; border-radius: 10px; }
.comment-row.hidden-comment { opacity: .5; }
.comment-row p { margin: 0 0 4px; word-break: break-word; }
.notice { border-radius: 10px; padding: 11px 13px; background: #26344e; color: #dbe8ff; }
.notice.error { background: #512630; color: #ffc5cd; }
.notice.success { background: #194739; color: #a4f7d8; }
.ai-settings { background: #142a2b; border: 1px solid #28514e; border-radius: 12px; padding: 14px; }
.ai-settings p { margin: 8px 0 0 32px; }
.playback-settings { background: #17243b; border: 1px solid #304a73; border-radius: 12px; padding: 14px; }
.playback-settings p { margin: 10px 0 0; line-height: 1.7; }

.join-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(circle at top, #253760, var(--bg) 60%); }
.join-card { width: min(560px, 100%); }
.comment-input { min-height: 130px; font-size: 1.2rem; resize: vertical; }
.big-button { width: 100%; padding: 1rem; font-size: 1.1rem; }
.counter { text-align: right; color: var(--muted); }

.stage { position: fixed; inset: 0; overflow: hidden; background: #000; }
.stage.overlay { background: transparent; }
.stage-message { position: absolute; z-index: 3; inset: 0; display: grid; place-items: center; pointer-events: none; }
.stage-message span { background: #000b; padding: 12px 20px; border-radius: 99px; }
.flying-comment { position: absolute; white-space: nowrap; font-weight: 800; will-change: transform; line-height: 1.2; animation-name: fly-rtl; animation-timing-function: linear; animation-fill-mode: forwards; }
.stage.paused .flying-comment { animation-play-state: paused; }
@keyframes fly-rtl { from { transform: translateX(100vw); } to { transform: translateX(-110%); } }
@keyframes fly-ltr { from { transform: translateX(-110%); } to { transform: translateX(100vw); } }

@media (max-width: 760px) {
  .two-col { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  .url-box { grid-template-columns: 1fr auto; }
  .url-box strong { grid-column: 1 / -1; }
  .shell { width: min(100% - 22px, 1180px); padding-top: 14px; }
}
