/* =========================================================
   PMSB SCRIM SYSTEM
   トンマナ: 生成りの紙 / 黒ベタの帯 / ネイビーの斜めカット / 方眼 / 網点
   ========================================================= */
:root {
  --paper: #e4e1db;
  --paper-2: #eeece7;
  --paper-3: #d8d4cc;
  --ink: #141414;
  --ink-2: #2a2a2a;
  --muted: #6d6a63;
  --line: rgba(20, 20, 20, .16);
  --grid: rgba(56, 70, 109, .10);
  --navy: #38466d;
  --navy-2: #4b5c8f;
  --ok: #2f8f4e;
  --warn: #d77f00;
  --ng: #c8322a;
  --gold: #c99a12;
  --band: var(--ink);      /* 黒い帯（見出し・タブ・ボタン） */
  --on-band: #ffffff;      /* 帯の上の文字 */
  --field: #ffffff;        /* 入力欄・明るい面 */
  --warn-bg: #fff6e3;

  --f-jp: "Noto Sans JP", "Hiragino Sans", "Yu Gothic UI", sans-serif;
  --f-wide: "transducer-variable", "Archivo", "Noto Sans JP", sans-serif;   /* 横長の英字ラベル */
  --f-num: "Anton", "Archivo", sans-serif;           /* 数字・番号 */
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--paper); }
body {
  margin: 0; min-height: 100vh;
  color: var(--ink); font-family: var(--f-jp); font-size: 14px;
  background:
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 96px 96px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 96px 96px,
    var(--paper);
  position: relative;
}
/* 右下のネイビーの斜めカットと、左下の網点 */
body::before, body::after { content: ""; position: fixed; pointer-events: none; z-index: 0; }
body::before {
  right: 0; bottom: 0; width: 46vw; height: 30vh;
  background: var(--navy);
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
  opacity: .9;
}
body::after {
  left: 0; bottom: 0; width: 40vw; height: 40vh;
  background: radial-gradient(circle, rgba(20,20,20,.18) 1.1px, transparent 1.4px) 0 0 / 7px 7px;
  -webkit-mask-image: linear-gradient(45deg, #000 0%, transparent 55%);
          mask-image: linear-gradient(45deg, #000 0%, transparent 55%);
}
#app, .topbar { position: relative; z-index: 1; }

a { color: var(--navy); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ---------- ヘッダー ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 28px;
  padding: 0 24px 0 28px; height: 64px;
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
}
.topbar::before {   /* 左上のネイビーの斜め */
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 18px;
  background: var(--navy); clip-path: polygon(0 0, 100% 0, 0 100%);
}
.brand { display: flex; align-items: center; gap: 14px; color: var(--ink); }
.brand img { height: 30px; display: block; }
.brand-sep { width: 1.5px; height: 30px; background: var(--ink); }
.brand-label { display: flex; flex-direction: column; gap: 2px; }
.brand-label span {
  background: var(--band); color: var(--on-band); padding: 1px 7px 0;
  font-family: var(--f-wide); font-stretch: 125%; font-weight: 600; font-size: 10px; letter-spacing: .1em; line-height: 1.5;
}
.topbar nav { display: flex; gap: 2px; margin-left: auto; }
.topbar nav a {
  color: var(--ink); padding: 8px 14px; font-weight: 700; font-size: 13px;
  border: 1.5px solid transparent;
}
.topbar nav a:hover { border-color: var(--ink); }
.topbar nav a.active { background: var(--band); color: var(--on-band); }
.me { display: flex; align-items: center; gap: 8px; padding-left: 14px; border-left: 1.5px solid var(--line); }
.me-chip { display: flex; align-items: center; gap: 0; color: var(--ink); border: 1.5px solid var(--ink); font-size: 12px; font-weight: 700; }
.me-chip:hover { background: var(--field); }
.me-role { background: var(--band); color: var(--on-band); padding: 3px 7px; }
.me-name { padding: 3px 9px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

main { padding: 28px 24px 120px; max-width: 1480px; margin: 0 auto; }

/* 見出し: 黒帯の英字ラベル + 日本語 */
.eyebrow {
  display: inline-block; background: var(--band); color: var(--on-band);
  font-family: var(--f-wide); font-stretch: 125%; font-weight: 600; font-size: 11px; letter-spacing: .14em;
  padding: 2px 9px 1px; margin-bottom: 6px;
}
h1 { font-size: 24px; font-weight: 900; margin: 0 0 18px; letter-spacing: .02em; }
h2 { font-size: 13px; margin: 0 0 12px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
h2::before { content: ""; width: 4px; height: 14px; background: var(--navy); }

.panel { background: var(--paper-2); border: 1.5px solid var(--ink); padding: 18px; position: relative; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.stack > * + * { margin-top: 18px; }

/* ---------- ボタン・入力 ---------- */
.btn {
  border: 1.5px solid var(--ink); background: transparent; padding: 7px 16px;
  cursor: pointer; white-space: nowrap; font-weight: 700; font-size: 13px; color: var(--ink);
  transition: background .12s, color .12s;
}
.btn:hover { background: var(--band); color: var(--on-band); }
.btn.primary { background: var(--band); color: var(--on-band); }
.btn.primary:hover { background: var(--navy); border-color: var(--navy); }
.btn.danger { color: var(--ng); border-color: var(--ng); }
.btn.danger:hover { background: var(--ng); color: #fff; }
.btn.sm { padding: 3px 10px; font-size: 12px; }
.btn:disabled { opacity: .4; cursor: default; }

input[type=text], input[type=password], input[type=date], input[type=number], select, textarea {
  background: var(--field); border: 1.5px solid var(--ink); border-radius: 0; padding: 7px 9px;
}
input:focus, select:focus, textarea:focus { outline: 3px solid var(--navy-2); outline-offset: 0; }
input::placeholder, textarea::placeholder { color: #a9a59c; }
textarea { width: 100%; min-height: 160px; resize: vertical; }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: 11px; font-weight: 700; color: var(--ink-2); }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

/* ---------- 表 ---------- */
table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
table.list thead th {
  background: var(--band); color: var(--on-band); font-weight: 600; font-size: 11px; letter-spacing: .06em;
  font-family: var(--f-wide); font-stretch: 112%; white-space: nowrap;
}
table.list td.num, table.list th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.list td.rank { font-family: var(--f-num); font-size: 18px; width: 44px; }
table.list td.big { font-family: var(--f-num); font-size: 18px; }
table.list tr.click { cursor: pointer; }
table.list tr.click:hover td { background: var(--field); }

.badge { display: inline-block; padding: 0 7px; font-size: 11px; font-weight: 700; border: 1.5px solid var(--ink); }
.badge.ok { color: var(--ok); border-color: var(--ok); }
.badge.warn { color: var(--warn); border-color: var(--warn); }
.badge.ng { color: var(--ng); border-color: var(--ng); }
.badge.tag { background: var(--band); color: var(--on-band); }

/* ---------- タブ ---------- */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--ink); margin-bottom: 18px; }
.tabs a { padding: 10px 20px; color: var(--ink); font-weight: 700; }
.tabs a.active { background: var(--band); color: var(--on-band); }
.tabs a:not(.active):hover { background: var(--paper-3); }

/* イベント見出し */
.evhead h1 { margin: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.evhead .ev-series { background: var(--navy); color: #fff; padding: 5px 12px 3px; font-family: var(--f-wide); font-stretch: 125%; font-size: 14px; font-weight: 700; letter-spacing: .08em; }
.evhead .ev-group { background: var(--band); color: var(--on-band); padding: 5px 12px 3px; font-family: var(--f-wide); font-stretch: 125%; font-size: 14px; font-weight: 700; letter-spacing: .08em; }
.evhead .ev-date { font-family: var(--f-num); font-size: 32px; font-weight: 400; letter-spacing: .02em; line-height: 1; }
.evhead .ev-meta { font-size: 12px; color: var(--muted); font-weight: 500; }

/* ---------- 結果入力 ---------- */
.input-layout { display: grid; grid-template-columns: 1fr 390px; gap: 22px; align-items: start; }
@media (max-width: 1100px) { .input-layout { grid-template-columns: 1fr; } }
.input-layout > * { min-width: 0; }
.side { overflow-x: auto; }
.round-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.round-tabs button {
  min-width: 70px; font-family: var(--f-num); font-size: 18px; font-weight: 400; letter-spacing: .04em; padding: 4px 14px;
}
.round-tabs button.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.round-tabs button .dot { display: inline-block; width: 8px; height: 8px; margin-left: 7px; background: transparent; border: 1.5px solid currentColor; vertical-align: 2px; }
.round-tabs button .dot.done { background: var(--ok); border-color: var(--ok); }
.round-tabs button .dot.warn { background: var(--warn); border-color: var(--warn); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.tcard { background: var(--paper-2); border: 1.5px solid var(--ink); }
.tcard.dup { outline: 3px solid var(--warn); outline-offset: -1px; }
.tcard .head { display: flex; align-items: stretch; background: var(--band); color: var(--on-band); height: 48px; }
.tcard .slot {
  width: 44px; flex: none; display: flex; align-items: center; justify-content: center;
  background: var(--slot, var(--navy)); color: #fff;
  font-family: var(--f-num); font-size: 22px; letter-spacing: .02em;
}
.tcard .tname { flex: 1; display: flex; align-items: center; padding: 0 10px; font-weight: 800; overflow: hidden; white-space: nowrap; min-width: 0; }
.tcard .tname span { overflow: hidden; text-overflow: ellipsis; }
.tcard .place {
  width: 62px; margin: 7px 0; text-align: center; border: 0; background: var(--field); color: var(--ink);
  font-family: var(--f-num); font-size: 22px; padding: 0;
}
.tcard .place::placeholder { font-family: var(--f-jp); font-size: 11px; font-weight: 700; }
.tcard .place.first { background: var(--gold); color: #fff; }
.tcard .pts { width: 60px; flex: none; display: flex; align-items: center; justify-content: flex-end; padding-right: 10px; font-family: var(--f-num); font-size: 17px; color: #d6d2c8; }
.tcard .players { padding: 6px 12px 10px; }
.tcard .prow { display: flex; align-items: center; gap: 8px; padding: 3px 0; border-bottom: 1px dashed var(--line); }
.tcard .prow:last-child { border-bottom: 0; }
.tcard .prow .pname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.tcard .prow input { width: 52px; text-align: center; font-family: var(--f-num); font-size: 17px; padding: 3px 0; }
.tcard .empty { color: var(--muted); font-size: 12px; padding: 6px 0; }

.side { position: sticky; top: 84px; padding: 0; }
.side .side-head { background: var(--band); color: var(--on-band); padding: 12px 16px; }
.side .side-head .title { font-family: var(--f-num); font-size: 26px; letter-spacing: .02em; line-height: 1; }
.side .side-head .sub { font-size: 11px; color: #bdb9b0; margin-top: 5px; }
.side table.list td, .side table.list th { padding: 6px 8px; }
.side table.list thead th { background: var(--navy); }
.side td.tn { max-width: 128px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }

.warnings { border: 1.5px solid var(--warn); border-left-width: 8px; background: var(--warn-bg); padding: 10px 14px; }
.warnings b { color: #8a5200; }
.warnings ul { margin: 6px 0 0; padding-left: 18px; }
.savestate { font-size: 12px; font-weight: 700; padding: 4px 10px; border: 1.5px solid var(--muted); color: var(--muted); background: var(--paper-2); }
.savestate.saving { color: var(--warn); border-color: var(--warn); }
.savestate.saved { color: var(--ok); border-color: var(--ok); }
.savestate.error { color: #fff; background: var(--ng); border-color: var(--ng); }

/* ---------- チーム設定 ---------- */
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 10px; }
.slotcard { display: flex; background: var(--paper-2); border: 1.5px dashed var(--muted); cursor: pointer; min-height: 56px; }
.slotcard.filled { border: 1.5px solid var(--ink); }
.slotcard:hover { background: var(--field); }
.slotcard .sno {
  width: 48px; flex: none; display: flex; align-items: flex-start; justify-content: center; padding-top: 10px;
  background: var(--slot, var(--navy)); color: #fff; font-family: var(--f-num); font-size: 22px;
}
.slotcard:not(.filled) .sno { background: transparent; color: var(--muted); }
.slotcard .sbody { flex: 1; padding: 10px 12px; min-width: 0; }
.slotcard .sbody b { font-weight: 800; }
.slotcard .players-list { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.7; }

/* ---------- モーダル ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(20,20,20,.55); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal { background: var(--paper-2); border: 2px solid var(--ink); width: min(640px, 100%); max-height: 90vh; overflow: auto; padding: 0 20px 20px; }
.modal h1 { font-size: 16px; margin: 0 -20px; padding: 0 20px 0 0; background: var(--band); color: var(--on-band); display: flex; gap: 12px; align-items: stretch; height: 46px; }
.modal h1 .sno { background: var(--slot, var(--navy)); font-family: var(--f-num); font-weight: 400; font-size: 22px; width: 52px; display: flex; align-items: center; justify-content: center; }
.modal h1 .t { display: flex; align-items: center; }
.player-edit { display: grid; grid-template-columns: 1fr 1fr 34px; gap: 6px; margin-top: 6px; }
.player-edit input { width: 100%; }

/* ---------- 選手登録 ---------- */
.reg { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.reg:first-child { padding-top: 0; }
.reg:last-child { border-bottom: 0; padding-bottom: 0; }
.reg .plist { font-size: 12px; color: var(--ink-2); line-height: 1.8; margin-top: 4px; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--band); color: var(--on-band); padding: 10px 20px; z-index: 100; font-weight: 700; }
.toast.error { background: var(--ng); }

@media (max-width: 640px) {
  main { padding: 16px 12px 100px; }
  .topbar { gap: 10px; padding: 0 10px 0 18px; height: 56px; }
  .brand img { height: 20px; }
  .brand-sep, .brand-label { display: none; }
  .topbar nav a { padding: 6px 8px; font-size: 12px; }
  .topbar { flex-wrap: wrap; height: auto; padding-block: 8px; row-gap: 6px; }
  .me { border-left: 0; padding-left: 0; margin-left: auto; }
  .me-name { max-width: 90px; }
  .evhead h1 { flex-basis: 100%; }
  .evhead .btn { padding: 5px 10px; font-size: 12px; }
  .evhead .ev-date { font-size: 24px; }
  .cards { grid-template-columns: 1fr; }
  body::before { width: 70vw; height: 14vh; }
}

/* ---------- 配信 ---------- */
.bc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 20px; align-items: start; }
@media (max-width: 1100px) { .bc-layout { grid-template-columns: minmax(0, 1fr); } }
.onair { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1.5px solid var(--muted); color: var(--muted); font-weight: 700; margin-bottom: 12px; }
.onair-dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.onair.on { border-color: var(--ng); color: var(--ng); background: var(--field); }
.onair.on .onair-dot { animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .2; } }
@media (prefers-reduced-motion: reduce) { .onair.on .onair-dot { animation: none; } }
.rank-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.rank-buttons .btn { font-family: var(--f-num); font-size: 17px; font-weight: 400; letter-spacing: .03em; padding: 6px 14px; }
.rank-buttons .btn.danger { font-family: var(--f-jp); font-size: 13px; font-weight: 700; }
.url-list { display: flex; flex-direction: column; gap: 12px; }
.url-label { font-size: 12px; font-weight: 700; margin-bottom: 4px; }
.url-input { font-family: ui-monospace, Menlo, monospace; font-size: 12px; min-width: 0; }
.obs-note { margin-top: 14px; padding: 10px 12px; background: var(--field); border-left: 6px solid var(--navy); line-height: 1.7; }
.bc-preview { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 14px; }
.pv-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border: 1.5px solid var(--ink);
  background: repeating-conic-gradient(#cfcac0 0 25%, #e9e6df 0 50%) 0 0 / 16px 16px; }
.pv-frame iframe { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; border: 0; transform-origin: 0 0; pointer-events: none; }
.pw-box { border-color: var(--ok); border-width: 2px; }
.pw-code { font-family: ui-monospace, Menlo, monospace; font-size: 15px; background: var(--field); padding: 8px 12px; border: 1.5px solid var(--ink); user-select: all; }

/* ---------- ロゴ ---------- */
.logo-thumb { width: 40px; height: 40px; object-fit: contain; display: block; background: var(--band); padding: 3px; }
.logo-thumb.none { display: flex; align-items: center; justify-content: center; background: transparent; border: 1.5px dashed var(--muted); color: var(--muted); font-size: 10px; padding: 0; }
.lf-box { margin-top: 14px; padding: 14px; background: var(--field); border: 1.5px solid var(--ink); overflow-x: auto; }

/* ---------- 結果画像 ---------- */
.img-controls select { min-width: 0; }
.img-preview { margin-top: 14px; border: 1.5px solid var(--ink); background: var(--band); }
.img-preview img { display: block; width: 100%; height: auto; }
table.list tr.qualified td:first-child { box-shadow: inset 5px 0 0 var(--navy); }
.qualify-box { margin-bottom: 14px; border-color: var(--navy); border-width: 2px; }

/* =========================================================
   LUMINA（LIVE BROADCAST CONTROL SYSTEM）
   漆黒に紫の光。ロゴの「光の弧」と、四隅の斜めの光の帯をモチーフに
   ========================================================= */
body.lumina {
  color-scheme: dark;
  --paper: #07060b; --paper-2: #100d18; --paper-3: #1b1628;
  --ink: #f1eef8; --ink-2: #d2cbe2; --muted: #8b83a3;
  --navy: #8b5cf6; --navy-2: #a78bfa;
  --grid: rgba(167, 139, 250, .035);
  --line: rgba(255, 255, 255, .09);
  --band: #000000; --on-band: #ffffff;
  --field: #0b0912;
  --warn-bg: #2a1d07;
  --ok: #4ade80; --warn: #f5a524; --ng: #ff5470; --gold: #a78bfa;
  --f-wide: "transducer-variable", "Archivo", "Noto Sans JP", sans-serif;
  background:
    linear-gradient(135deg, transparent 0 9%, rgba(139, 92, 246, .10) 9% 11.5%, transparent 11.5%) fixed,
    linear-gradient(135deg, transparent 0 88%, rgba(139, 92, 246, .10) 88% 90%, transparent 90%) fixed,
    radial-gradient(55vw 45vh at 100% 100%, rgba(124, 58, 237, .16), transparent 70%) fixed,
    radial-gradient(45vw 40vh at 0% 0%, rgba(124, 58, 237, .14), transparent 70%) fixed,
    var(--paper);
}
html:has(body.lumina) { background: #07060b; }
body.lumina::before, body.lumina::after { display: none; }

body.lumina .topbar { background: rgba(5, 4, 9, .92); backdrop-filter: blur(8px); border-bottom: 1px solid rgba(167,139,250,.28);
  box-shadow: 0 1px 0 rgba(0,0,0,.6), 0 10px 30px -18px rgba(139,92,246,.6); }
body.lumina .topbar::before { display: none; }
body.lumina .brand img { height: 24px; }
body.lumina .pv-frame { background: #000; }
body.lumina .brand-sep { background: rgba(167,139,250,.35); height: 26px; width: 1px; }
.crumb { display: flex; align-items: center; gap: 8px; font-family: var(--f-wide); font-stretch: 125%; font-weight: 600;
  font-size: 11px; letter-spacing: .22em; color: var(--ink-2); white-space: nowrap; }
.crumb b { color: #fff; font-weight: 700; }
.crumb i { font-style: normal; color: var(--navy-2); }
body.lumina .topbar nav a.active,
body.lumina .tabs a.active,
body.lumina .btn.primary,
body.lumina .me-role,
body.lumina .eyebrow { background: var(--navy); border-color: var(--navy); color: #fff; }
body.lumina .btn.primary:hover { background: var(--navy-2); border-color: var(--navy-2); }
body.lumina .btn:hover { background: #fff; color: #000; }
body.lumina .btn.danger:hover { background: var(--ng); color: #fff; }
body.lumina .panel { border-color: rgba(255,255,255,.16); }
body.lumina .panel, body.lumina .tcard, body.lumina .modal { box-shadow: 0 0 0 1px rgba(0,0,0,.6); }
body.lumina .tabs { border-bottom-color: var(--navy); }
body.lumina table.list thead th { border-bottom: 2px solid var(--navy); }
body.lumina table.list tr.click:hover td,
body.lumina .slotcard:hover { background: var(--paper-3); }
body.lumina .evhead .ev-date { color: #fff; }
body.lumina .tcard .head, body.lumina .side .side-head, body.lumina .modal h1 { border-bottom: 2px solid var(--navy); }
body.lumina .tcard .place { background: #fff; color: #000; }
body.lumina .tcard .place.first { background: var(--navy); color: #fff; }
body.lumina .onair.on { background: rgba(139,92,246,.14); }
body.lumina .warnings b { color: #ffc46a; }
body.lumina .warnings { color: #ffd9a0; }
body.lumina input::placeholder, body.lumina textarea::placeholder { color: #5d5670; }
body.lumina .eyebrow { letter-spacing: .3em; }
body.lumina .panel { background: linear-gradient(180deg, rgba(139,92,246,.05), transparent 120px), var(--paper-2); }
body.lumina .btn.primary { box-shadow: 0 0 18px -6px rgba(139,92,246,.9); }
body.lumina input:focus, body.lumina select:focus, body.lumina textarea:focus { outline: 2px solid var(--navy); }
body.lumina .pw-code, body.lumina .obs-note, body.lumina .lf-box { color: var(--ink); }
body.lumina .toast { background: #fff; color: #000; }
body.lumina .toast.error { background: var(--ng); color: #fff; }
body.lumina .logo-thumb.none { color: var(--muted); }

.side table.list td.big { font-size: 16px; }
body.lumina .login-head { border-bottom: 2px solid var(--navy); }
body.lumina .login-head .labels span:first-child { background: var(--navy); color: #fff; }
body.lumina .login { border-color: rgba(255,255,255,.18); }

/* ---------- フィラー（待機画面）の設定 ---------- */
.fl-timer { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: var(--band); color: var(--on-band); padding: 12px 14px; }
.fl-clock { display: flex; align-items: baseline; gap: 12px; }
#fl-left { font-family: var(--f-num); font-size: 44px; line-height: 1; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.fl-state { font-size: 11px; font-weight: 700; padding: 2px 8px; border: 1px solid currentColor; opacity: .85; }
.fl-state.running { background: var(--navy); border-color: var(--navy); color: #fff; opacity: 1; }
.fl-sec { border-top: 1px solid var(--line, rgba(127,127,127,.25)); margin-top: 14px; padding-top: 12px; }
.fl-h { font-weight: 800; font-size: 13px; margin-bottom: 8px; }
.fl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 560px) { .fl-grid { grid-template-columns: 1fr; } }
label.check { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
label.check input { width: 16px; height: 16px; accent-color: var(--navy); }
.fl-slides { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.fl-slide { border: 1px solid var(--line, rgba(127,127,127,.35)); background: #000; }
.fl-slide img, .fl-slide video, .fl-bg img, .fl-bg video { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #000; }
.fl-slide-ops { display: flex; align-items: center; gap: 4px; padding: 6px; background: var(--paper-2); }
.fl-slide-ops span { margin-right: auto; font-weight: 700; padding-left: 2px; }
.fl-slide-ops .btn { padding: 2px 8px; }
.fl-bg { max-width: 320px; border: 1px solid var(--line, rgba(127,127,127,.35)); }
label.btn { cursor: pointer; }
#fl-busy { margin-top: 10px; font-weight: 700; color: var(--navy); }

/* ---------- クレジット ---------- */
.site-credit { position: relative; z-index: 1; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; font-family: var(--f-wide); font-stretch: 112%;
  font-size: 10px; font-weight: 500; letter-spacing: .14em; color: var(--muted); padding: 0 16px 28px; }
main:has(+ .site-credit) { min-height: calc(100vh - 64px - 52px); padding-bottom: 48px; }   /* 中身が短くてもクレジットは画面の一番下 */
main + .site-credit { padding-top: 12px; padding-bottom: 28px; }
.site-credit img { height: 22px; width: auto; display: block; opacity: .75; }

/* ---------- 配信：モニター（プレビュー / プログラム） ---------- */
.bc-stage { width: min(520px, 100%); font-size: 15px; font-weight: 700; padding: 10px 12px; }
.mon-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .mon-grid { grid-template-columns: 1fr; } }
.mon-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; min-height: 22px; }
.mon-tag { font-family: var(--f-wide); font-stretch: 125%; font-weight: 700; font-size: 11px; letter-spacing: .2em;
  padding: 2px 8px; border: 1px solid currentColor; }
.mon.pv .mon-tag { color: #4ade80; }
.mon.pg .mon-tag { color: #ff4d5e; }
.mon.pg.live .mon-tag { background: #ff4d5e; color: #fff; border-color: #ff4d5e; }
.mon-cap { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
button.mon-frame { display: block; width: 100%; padding: 0; cursor: zoom-in; background: #000; font: inherit; }
.mon.pv .mon-frame { border: 2px solid rgba(74, 222, 128, .7); }
.mon.pg .mon-frame { border: 2px solid rgba(255, 77, 94, .55); }
.mon.pg.live .mon-frame { border-color: #ff4d5e; box-shadow: 0 0 22px -6px rgba(255, 77, 94, .8); }
button.mon-frame:hover { filter: brightness(1.08); }
.rank-ops { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; margin-top: 14px; }
.rank-ops .rank-buttons { flex: 1; min-width: 260px; }
.take { display: flex; flex-direction: column; gap: 8px; align-items: stretch; min-width: 220px; }
.btn.take-btn { background: #ff3b4e; border-color: #ff3b4e; color: #fff; font-family: var(--f-wide); font-stretch: 125%;
  font-size: 22px; letter-spacing: .24em; padding: 12px 18px 10px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  box-shadow: 0 0 24px -6px rgba(255, 59, 78, .9); }
.btn.take-btn span { font-family: var(--f-jp); font-size: 11px; letter-spacing: .04em; font-weight: 700; }
.btn.take-btn:hover { background: #ff5767; color: #fff; }
.btn.take-btn:disabled { background: transparent; color: var(--muted); border-color: var(--line); box-shadow: none; }
.seg { display: inline-flex; }
.seg .btn + .btn { border-left-width: 0; }
.fl-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 20px; align-items: start; }
@media (max-width: 1000px) { .fl-layout { grid-template-columns: 1fr; } }

/* 拡大表示 */
.pop { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, .86); display: grid; place-items: center; padding: 16px; }
.pop-in { display: flex; flex-direction: column; gap: 8px; }
.pop-head { display: flex; justify-content: space-between; align-items: center; color: #fff; font-family: var(--f-wide); letter-spacing: .2em; }
.pop-frame { position: relative; overflow: hidden; background: #000; }
.pop-frame iframe { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; border: 0; transform-origin: 0 0; }
.mon-cap .onair-dot { color: #ff4d5e; animation: blink 1.2s infinite; }

/* ---------- 集計完了 ---------- */
.fin-bar { display: flex; align-items: center; gap: 14px; padding: 12px 16px; margin-bottom: 14px;
  border: 1px solid rgba(167, 139, 250, .45); background: rgba(139, 92, 246, .08); }
.fin-bar .small { color: var(--muted); margin-top: 2px; }
.fin-bar.done { border-color: rgba(74, 222, 128, .55); background: rgba(74, 222, 128, .08); }
.fin-mark { width: 30px; height: 30px; display: grid; place-items: center; background: var(--ok); color: #04130a; font-weight: 900; font-size: 18px; flex: none; }
.fin-tick { color: var(--ok); font-weight: 900; margin-left: 4px; }
input:disabled { opacity: .55; cursor: not-allowed; }

/* 大会の切り替え（ヘッダー） */
.ed-sel { background: transparent; border: 1px solid rgba(167, 139, 250, .45); color: var(--ink-2); padding: 3px 8px;
  font-family: var(--f-wide); font-stretch: 112%; font-weight: 600; font-size: 11px; letter-spacing: .16em; cursor: pointer; }
.ed-sel:hover { border-color: var(--navy-2); color: #fff; }
.ed-sel option { background: #100d18; color: var(--ink); }
.rank-buttons .btn.other-day:not(.primary) { opacity: .4; }

/* まとめて入力 */
details.bulk { margin-top: 18px; }
details.bulk summary { cursor: pointer; list-style: none; }
details.bulk summary::-webkit-details-marker { display: none; }
details.bulk summary::before { content: "＋"; color: var(--navy-2); margin-right: 8px; font-weight: 900; }
details.bulk[open] summary::before { content: "－"; }
details.bulk textarea { margin-top: 12px; min-height: 180px; font-family: ui-monospace, Menlo, monospace; font-size: 13px; }

/* Discord 送信（CSL など） */
.dc-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
body.lumina .dc-img.checker { background: repeating-conic-gradient(#2a2433 0 25%, #1a1622 0 50%) 0 0 / 18px 18px; }
.dc-send { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 14px; }
.pop-frame.checker-bg { background: repeating-conic-gradient(#2a2433 0 25%, #1a1622 0 50%) 0 0 / 24px 24px; }
