/* ============================================================================
   Sports Coder 2 ワイヤー v1 — 画面の見た目（送出卓・試合一覧・準備・記録・入口 など）
   送出卓は 1600×900 を基準に作り、JS で画面に合わせて全体を等倍で縮める（#app の zoom）。
   配色: タリー（出ている）＝赤 #e53935／モーションの後に出る・確認待ち＝琥珀 #e0a33c
   ============================================================================ */
:root {
  --bg: #111317; --bg2: #16191e; --panel: #1c2026; --panel2: #242931; --well: #0c0e11;
  --line: #2c3139; --line2: #3c434d; --text: #e8eaed; --dim: #9aa2ab; --dim2: #6c737c;
  --live: #e53935; --wait: #e0a33c; --ok: #2f9e44; --accent: #4f8ef7; --wf: #e8c77a;
  --mono: ui-monospace, SFMono-Regular, Menlo, "SF Mono", Consolas, monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif; font-size: 13px; line-height: 1.45; }
button { font-family: inherit; color: inherit; cursor: pointer; border: 0; background: none; font-size: inherit; }
input, select, textarea { font-family: inherit; color: inherit; font-size: 13px; background: var(--well); border: 1px solid var(--line2); border-radius: 5px; padding: 6px 8px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
a { color: #8fb8ff; }
.hide { display: none !important; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.kb { display: inline-block; font-family: var(--mono); font-size: 10.5px; font-weight: 700; line-height: 1.3; padding: 1px 5px; border-radius: 4px; background: #2b3038; border: 1px solid #4a515c; border-bottom-width: 2px; color: #cfd4da; white-space: nowrap; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 6px; background: var(--panel2); border: 1px solid var(--line2); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.btn:hover { border-color: #5d6570; background: #2d333c; }
.btn.pri { background: #2d5ea8; border-color: #3d76c6; font-weight: 800; }
.btn.go { background: #1f6b35; border-color: #2f9e44; font-weight: 800; }
.btn.dgr { border-color: #7d3a36; color: #f3aaa4; }
.btn.sm { padding: 3px 8px; font-size: 11.5px; }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.tag-wf { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 800; color: #1e1705; background: repeating-linear-gradient(135deg, #e8c77a 0 8px, #d8b764 8px 16px); padding: 2px 8px; border-radius: 3px; white-space: nowrap; }

/* ================= 送出卓 ================= */
body.console { overflow: hidden; height: 100vh; }
#app { position: relative; width: 1600px; height: 900px; display: flex; flex-direction: column; overflow: hidden; transform-origin: 0 0; background: var(--bg); }

/* ---- 上の帯 ---- */
.top { flex: 0 0 40px; display: flex; align-items: stretch; background: #181b20; border-bottom: 1px solid var(--line); }
.top .brand { display: flex; align-items: center; gap: 8px; padding: 0 12px; border-right: 1px solid var(--line); }
.top .brand b { font-size: 14px; letter-spacing: .03em; }
.top .mode { display: flex; align-items: center; padding: 0 14px; font-size: 15px; font-weight: 900; border-right: 1px solid var(--line); }
.top .mt { display: flex; flex-direction: column; justify-content: center; padding: 0 14px; min-width: 0; flex: 1; }
.top .mt .t { font-size: 13px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .mt .s { font-size: 10.5px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top nav { display: flex; align-items: stretch; border-left: 1px solid var(--line); }
.top nav a { display: flex; align-items: center; padding: 0 10px; color: var(--dim); text-decoration: none; font-size: 12px; border-right: 1px solid var(--line); white-space: nowrap; }
.top nav a:hover { color: #fff; background: #20252b; }
.top .outst { display: flex; align-items: center; gap: 7px; padding: 0 12px; font-size: 11.5px; border-right: 1px solid var(--line); white-space: nowrap; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #4a515c; flex: 0 0 auto; }
.dot.ok { background: #40c057; box-shadow: 0 0 6px #40c057; } .dot.warn { background: var(--wait); } .dot.bad { background: var(--live); }
.top .tb { display: flex; align-items: center; padding: 0 12px; font-size: 12px; font-weight: 800; color: var(--wf); border-left: 1px solid var(--line); }
.top .tb:hover { background: #221f14; }
.top .tb.on { background: #3a3218; color: #ffe29a; }

/* ---- 今日の試合（常に見える） ---- */
.todaybar { flex: 0 0 36px; display: flex; align-items: center; gap: 8px; padding: 0 12px; background: #14171b; border-bottom: 1px solid var(--line); overflow: hidden; }
.todaybar .lb { font-size: 11px; color: var(--dim2); letter-spacing: .06em; white-space: nowrap; }
.tchip { display: flex; align-items: center; gap: 7px; height: 28px; padding: 0 10px; border-radius: 14px; border: 1px solid var(--line2); background: var(--panel); font-size: 12px; white-space: nowrap; max-width: 330px; flex: 0 1 auto; min-width: 0; }
.tchip:hover { border-color: #6a737f; }
.tchip .n { font-weight: 800; color: var(--dim); }
.tchip .v { font-weight: 800; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tchip .n, .tchip .sg, .tchip .air { flex: 0 0 auto; }
.todaybar > .btn, .todaybar > a.btn, .todaybar .lb { flex: 0 0 auto; }
.console .btn.sm { padding: 5px 10px; }
.tchip .sg { font-size: 10.5px; font-weight: 800; padding: 0 6px; border-radius: 3px; background: #2b3038; color: var(--dim); }
.tchip .sg.live { background: #1f4a2c; color: #9fe0b0; } .tchip .sg.done { background: #2b3038; color: #cfd4da; }
.tchip .warn { color: var(--wait); font-size: 10.5px; }
.tchip.air { border-color: var(--live); background: #3a1413; box-shadow: 0 0 0 1px var(--live) inset; }
.tchip.air .air { font-size: 10.5px; font-weight: 900; color: #fff; background: var(--live); padding: 0 6px; border-radius: 3px; }
.tchip.next { border-color: var(--wait); animation: nextpulse 1.4s ease-in-out infinite; }
@keyframes nextpulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(224,163,60,0); } 50% { box-shadow: 0 0 0 4px rgba(224,163,60,.45); } }
.todaybar .sp { flex: 1; }

/* ---- 本体（左チーム｜中央｜右チーム＝鏡合わせ） ---- */
.main { flex: 1; min-height: 0; display: grid; grid-template-columns: 292px minmax(0, 1fr) 292px; }
.team { position: relative; display: flex; flex-direction: column; min-height: 0; background: var(--bg2); border-top: 4px solid var(--tc); }
.team.A { border-right: 1px solid var(--line); } .team.B { border-left: 1px solid var(--line); }
.thead { padding: 9px 12px 10px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, color-mix(in srgb, var(--tc) 14%, #16191e), #16191e); }
.tn { display: flex; align-items: center; gap: 8px; min-width: 0; }
.team.B .tn { flex-direction: row-reverse; text-align: right; }
.tn .sw { width: 14px; height: 30px; border-radius: 3px; background: var(--tc); flex: 0 0 auto; }
.tn .ab { font-size: 24px; font-weight: 900; line-height: 1.1; white-space: nowrap; }
.tn .full { font-size: 11px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
.tn .side { font-size: 10px; font-weight: 800; color: var(--dim2); border: 1px solid var(--line2); border-radius: 3px; padding: 0 4px; }
.tsc { display: flex; align-items: stretch; gap: 10px; margin-top: 8px; }
.team.B .tsc { flex-direction: row-reverse; }
.tsc .score { width: 96px; flex: 0 0 96px; font-family: var(--mono); font-size: 56px; font-weight: 900; line-height: 74px; text-align: center; background: var(--well); border-radius: 8px; border: 1px solid var(--line); }
.plus { position: relative; flex: 1; height: 74px; border-radius: 10px; border: 3px solid var(--tc); background: color-mix(in srgb, var(--tc) 28%, #1c2026); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.plus .t { font-size: 27px; font-weight: 900; line-height: 1.05; text-shadow: 0 1px 3px rgba(0,0,0,.5); }
.plus .s { font-size: 10.5px; color: #e8eaed; opacity: .85; }
.plus .kb { position: absolute; top: 5px; right: 6px; }
.plus:hover { filter: brightness(1.12); }
.plus:active { transform: translateY(1px); }
.plus.dim { border-color: #3c434d; background: #1c2026; color: var(--dim2); }
.plus.dim .t { text-shadow: none; }
.plus.flash { animation: plusflash .5s ease-out; }
@keyframes plusflash { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,.9); } 100% { box-shadow: 0 0 0 16px rgba(255,255,255,0); } }

.roster { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; }
.rs-h { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 6px; padding: 5px 10px; background: #1a1d22; border-bottom: 1px solid var(--line); font-size: 11px; color: var(--dim); letter-spacing: .04em; }
.rs-h b { color: #cfd4da; font-weight: 800; }
.rs-h .sp { flex: 1; }
.pl { display: flex; align-items: center; gap: 8px; width: 100%; height: 40px; padding: 0 10px 0 8px; border-bottom: 1px solid #20242a; text-align: left; position: relative; }
.pl:hover { background: #1f242b; }
.pl .no { width: 40px; flex: 0 0 40px; height: 30px; line-height: 30px; border-radius: 4px; background: var(--well); border: 1px solid var(--line2); font-family: var(--mono); font-weight: 800; font-size: 14px; text-align: center; }
.pl .pn { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 15px; font-weight: 600; }
.pl .pp { font-size: 10.5px; color: var(--dim); white-space: nowrap; }
.pl .ph { width: 7px; height: 7px; border-radius: 50%; background: #5b6572; flex: 0 0 auto; }
.pl .ph.no-ph { background: transparent; border: 1px solid #3c434d; }
.pl.on { background: #401614; box-shadow: inset 4px 0 0 var(--live); }
.pl.on .no { background: var(--live); border-color: var(--live); color: #fff; }
.pl.wait { background: #33260f; box-shadow: inset 4px 0 0 var(--wait); }
.pl.cur { box-shadow: inset 4px 0 0 #7ad6c4; }
.pl .curb { font-size: 10px; font-weight: 900; color: #0d2c27; background: #7ad6c4; border-radius: 3px; padding: 0 5px; white-space: nowrap; }
.pl .pitb { font-size: 10px; font-weight: 900; color: #fff; background: #5f3dc4; border-radius: 3px; padding: 0 5px; }
.pl.gone { opacity: .38; }
.pl .ord { width: 18px; font-family: var(--mono); font-weight: 800; color: var(--dim); text-align: right; }
.pl .edit { opacity: 0; font-size: 12px; color: var(--dim); padding: 0 4px; }
.pl:hover .edit { opacity: 1; }
.empty-roster { padding: 18px 14px; color: var(--dim); font-size: 12.5px; line-height: 1.7; }
.empty-roster b { color: #fff; }
.addrow { display: flex; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: #191c21; }
.addrow input { width: 64px; } .addrow input.nm { flex: 1; width: auto; min-width: 0; }

/* ---- 選ぶ画面（得点者・交代）＝チームの列の上に大きく ---- */
.picker { position: absolute; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; flex-direction: column; background: #1d170b; border: 2px solid var(--wait); border-top-width: 0; }
.picker .pk-h { background: var(--wait); color: #1a1205; padding: 7px 10px; font-weight: 900; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.picker .pk-h small { font-weight: 700; font-size: 11px; opacity: .85; }
.picker .pk-s { padding: 6px 10px; font-size: 11.5px; color: #f1d9a8; border-bottom: 1px solid #4a3a1a; }
.picker .pk-g { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 8px; align-content: start; }
.picker .pk-g .sec { grid-column: 1 / -1; font-size: 10.5px; color: #c9a45a; letter-spacing: .06em; margin-top: 4px; }
.pb { display: flex; align-items: center; gap: 7px; min-width: 0; height: 50px; padding: 0 8px; border-radius: 7px; background: #2a2416; border: 2px solid #5c4a24; text-align: left; }
.pb:hover { border-color: #f0c060; background: #372e18; }
.pb .no { font-family: var(--mono); font-size: 19px; font-weight: 900; min-width: 30px; text-align: center; color: #ffd98a; }
.pb .pn { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb.sel { border-color: #fff; background: #4a3b16; }
.pb.gone { opacity: .35; pointer-events: none; }
.pb.big { height: 64px; font-size: 16px; font-weight: 900; justify-content: center; }
.picker .pk-f { display: flex; gap: 6px; padding: 8px; border-top: 1px solid #4a3a1a; }
.picker .pk-f .btn { flex: 1; justify-content: center; }
.picker .nohint { grid-column: 1 / -1; padding: 16px 6px; font-size: 13px; color: #f1d9a8; line-height: 1.7; }

/* ---- 中央 ---- */
.center { position: relative; display: flex; flex-direction: column; gap: 9px; padding: 10px 26px; min-width: 0; min-height: 0; }
.ctop { display: flex; gap: 12px; flex: 0 0 246px; min-height: 0; }
.monitor { width: 420px; flex: 0 0 420px; display: flex; flex-direction: column; gap: 4px; }
.monitor .scr { position: relative; width: 420px; height: 236px; background: #000; border: 2px solid var(--line2); border-radius: 6px; overflow: hidden; }
.monitor .scr.hot { border-color: var(--live); }
.monitor iframe { position: absolute; left: 0; top: 0; width: 416px; height: 232px; border: 0; }
.monitor .mbar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 6px; padding: 3px 6px; background: linear-gradient(0deg, rgba(0,0,0,.85), rgba(0,0,0,0)); font-size: 10.5px; color: #cfd4da; }
.monitor .mbar .sp { flex: 1; }
.monitor .mbar button { font-size: 11px; padding: 5px 10px; border-radius: 4px; background: rgba(255,255,255,.16); }
.monitor .mbar button:hover { background: rgba(255,255,255,.25); }
.monitor .mlab { position: absolute; left: 6px; top: 5px; font-size: 10px; font-weight: 800; letter-spacing: .06em; background: rgba(0,0,0,.6); padding: 1px 6px; border-radius: 3px; color: #e8eaed; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 9px; }
.ph2 { font-size: 10.5px; font-weight: 800; letter-spacing: .1em; color: var(--dim2); }
.tpanel { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; padding: 10px 14px; }
.tp-row { display: flex; align-items: center; gap: 8px; }
.tp-time { display: flex; align-items: baseline; gap: 12px; }
.tp-per { font-size: 15px; font-weight: 900; padding: 2px 10px; border-radius: 5px; background: #2b3038; }
.tp-per.play { background: #1f4a2c; color: #b8f0c8; }
.tp-clock { font-family: var(--mono); font-size: 52px; font-weight: 900; line-height: 1; letter-spacing: .02em; cursor: text; }
.tp-clock.run { color: #fff; } .tp-clock.stop { color: #9aa2ab; }
.tp-at { font-family: var(--mono); font-size: 26px; font-weight: 900; color: #fff; background: #e03131; padding: 0 8px; border-radius: 4px; }
.tp-over { font-size: 11.5px; color: var(--wait); font-weight: 700; }
.tp-clockin { font-family: var(--mono); font-size: 40px; width: 170px; }
.cbtn { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; height: 46px; padding: 0 12px; border-radius: 8px; background: var(--panel2); border: 2px solid var(--line2); font-weight: 800; font-size: 13.5px; white-space: nowrap; }
.cbtn:hover { border-color: #6a737f; }
.cbtn .kb { position: absolute; top: 3px; right: 4px; font-size: 9.5px; padding: 0 4px; }
.cbtn small { font-size: 10px; font-weight: 600; color: var(--dim); }
.cbtn.big { height: 54px; font-size: 17px; flex: 1; }
.cbtn.run { background: #3a1413; border-color: var(--live); }
.cbtn.go { background: #1c4a2a; border-color: #2f9e44; }
.cbtn.amber { background: #3a2a10; border-color: var(--wait); }
.cbtn.sm { height: 40px; font-size: 12.5px; flex: 1; }
.cbtn:disabled { opacity: .35; cursor: not-allowed; }
.cbtn.ready { background: #4a3510; border-color: #ffc94d; animation: nextpulse 1.1s ease-in-out infinite; }
.nextbox { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 10px; padding: 6px 4px; }
.nextbox .h { font-size: 20px; font-weight: 900; }
.nextbox .h small { font-size: 12px; color: var(--dim); font-weight: 600; margin-left: 8px; }
.nextbox .nb { height: 72px; border-radius: 10px; border: 3px solid var(--wait); background: #3a2a10; font-size: 19px; font-weight: 900; display: flex; flex-direction: column; align-items: center; justify-content: center; animation: nextpulse 1.4s ease-in-out infinite; }
.nextbox .nb small { font-size: 12px; font-weight: 700; color: #f1d9a8; }
.nextbox .none { color: var(--dim); font-size: 13px; }

.onair { flex: 0 0 34px; display: flex; align-items: center; gap: 6px; padding: 0 10px; background: var(--well); border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.onair .lb { font-size: 10.5px; font-weight: 900; letter-spacing: .08em; color: var(--dim2); white-space: nowrap; margin-right: 4px; }
.oc { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 800; padding: 2px 9px; border-radius: 4px; background: var(--live); color: #fff; white-space: nowrap; }
.oc i { font-style: normal; font-size: 10px; opacity: .85; font-weight: 700; }
.oc.wait { background: var(--wait); color: #1a1205; }
.onair .none { font-size: 12px; color: var(--dim2); }

/* ---- 表示物ボタン（どれも同じ形・同じ押し方） ---- */
.dgrid { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 7px; }
.drow { display: flex; align-items: stretch; gap: 7px; min-height: 0; }
.dlab { flex: 0 0 44px; display: flex; flex-direction: column; justify-content: center; font-size: 10.5px; font-weight: 800; color: var(--dim2); line-height: 1.25; letter-spacing: .02em; }
.dlab small { font-size: 9px; font-weight: 600; }
.dbtn { position: relative; flex: 1 1 0; min-width: 0; min-height: 60px; display: flex; flex-direction: column; justify-content: center; gap: 1px; padding: 5px 10px 6px; border-radius: 8px; background: var(--panel2); border: 2px solid var(--line2); text-align: left; }
.dbtn:hover { border-color: #6a737f; background: #2a3039; }
.dbtn:active { transform: translateY(1px); }
.dbtn .nm { font-size: 14.5px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 30px; }
.dbtn .sub { font-size: 11px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dbtn .kb { position: absolute; top: 5px; right: 6px; }
.dbtn .st { position: absolute; bottom: 5px; right: 6px; font-size: 9.5px; font-weight: 900; letter-spacing: .06em; padding: 0 5px; border-radius: 3px; display: none; }
.dbtn.on { background: #4a1512; border-color: var(--live); box-shadow: inset 0 0 0 1px var(--live); }
.dbtn.on .nm { color: #fff; } .dbtn.on .sub { color: #ffc9c6; }
.dbtn.on .st { display: block; background: var(--live); color: #fff; }
.dbtn.wait { background: #3a2a10; border-color: var(--wait); }
.dbtn.wait .st { display: block; background: var(--wait); color: #1a1205; }
.dbtn.dis .nm, .dbtn.dis .sub { opacity: .45; }
.dbtn.mini { flex: 0 0 64px; align-items: center; text-align: center; padding: 4px; }
.dbtn.mini .nm { font-size: 18px; padding-right: 0; }
.dbtn.mini .kb { position: static; margin-top: 2px; }
.opts { display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 4px 10px; border-radius: 8px; border: 1px dashed var(--line2); min-width: 0; }
.opts .ot { font-size: 10.5px; font-weight: 800; color: var(--dim); white-space: nowrap; }
.chips { display: flex; gap: 5px; flex-wrap: wrap; }
.chk { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 12px; border: 1px solid var(--line2); background: #1a1e23; color: var(--dim); white-space: nowrap; }
.chk.on { background: #24506e; border-color: var(--accent); color: #e3efff; }
.chk.team.on { background: color-mix(in srgb, var(--tc) 40%, #1a1e23); border-color: var(--tc); color: #fff; }
.relink { font-size: 11px; color: #8fb8ff; text-decoration: underline; cursor: pointer; }

/* ---- PK ---- */
.pkp { flex: 0 0 auto; display: flex; align-items: stretch; gap: 10px; padding: 8px 12px; }
.pkp.live { border-color: var(--wait); background: #221b0e; }
.pkp .pkl { width: 110px; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.pkp .pkl b { font-size: 15px; font-weight: 900; }
.pkp .pkl small { font-size: 10.5px; color: var(--dim); }
.pkrows { flex: 1; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.pkr { display: flex; align-items: center; gap: 6px; }
.pkr .t { width: 64px; font-weight: 900; white-space: nowrap; overflow: hidden; }
.pkr .t i { display: inline-block; width: 8px; height: 16px; background: var(--tc); margin-right: 5px; vertical-align: -3px; }
.pkr .marks { flex: 1; display: flex; gap: 3px; min-width: 0; overflow: hidden; }
.pkr .marks span { width: 28px; height: 28px; border-radius: 4px; background: var(--well); border: 1px solid var(--line2); display: grid; place-items: center; font-weight: 900; font-size: 14px; }
.pkr .marks span.o { color: #51cf66; } .pkr .marks span.x { color: #ff6b6b; } .pkr .marks span.sd { border-color: #7d3a36; }
.pkr .marks span.nx { border-color: var(--wait); box-shadow: 0 0 0 1px var(--wait); }
.pkr .tot { width: 26px; font-family: var(--mono); font-weight: 900; font-size: 18px; text-align: center; }
.pkr .cbtn { height: 40px; min-width: 64px; font-size: 16px; }
.pkp .res { font-size: 12px; font-weight: 900; color: #ffd98a; }

/* ---- 野球: BSO・走者・イニング ---- */
.bso { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 8px; padding: 10px 12px; }
.bsorows { display: flex; flex-direction: column; gap: 7px; justify-content: center; }
.bsor { display: flex; align-items: center; gap: 10px; }
.bsor .l { width: 26px; font-size: 22px; font-weight: 900; color: var(--dim); }
.bsor .dots { display: flex; gap: 8px; width: 150px; }
.bsor .dots i { width: 30px; height: 30px; border-radius: 50%; background: #262c35; border: 2px solid #39414c; }
.bsor .dots i.on.g { background: #40c057; border-color: #69db7c; } .bsor .dots i.on.y { background: #fab005; border-color: #ffd43b; } .bsor .dots i.on.r { background: #fa5252; border-color: #ff8787; }
.bsor .cbtn.m { width: 52px; height: 52px; font-size: 20px; }
.bsor .cbtn.p { flex: 1; height: 58px; font-size: 20px; }
.bso .side { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.bso .side .cbtn { flex: 1; }
/* v1.3: 打席の打者（試合の状態・表示では動かない）。大きく出して ◀▶ で直す */
.atbat { flex: 0 0 auto; display: flex; flex-direction: column; gap: 4px; padding: 6px 8px; background: #16202b; border: 1px solid #2c4a66; border-left: 4px solid var(--tc, #4dabf7); border-radius: 8px; min-width: 0; }
.atbat .abh { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #9fb8d0; }
.atbat .abh .l { font-weight: 900; letter-spacing: .1em; color: #cfe3f7; }
.atbat .abh .tm { margin-left: auto; font-weight: 800; }
.atbat .abv { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.atbat .abv .o { font-size: 24px; font-weight: 900; color: #fff; flex: 0 0 auto; }
.atbat .abv .n { font-size: 15px; font-weight: 800; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.atbat .abb { display: flex; gap: 6px; }
.bso .side .atbat .cbtn.ab { flex: 1 1 0; height: 40px; font-size: 16px; }
.bso .side .cbtn.bsc small { font-size: 10px; }
.brow2 { flex: 0 0 182px; display: flex; gap: 10px; min-height: 0; }
.runners { width: 330px; flex: 0 0 330px; position: relative; padding: 8px; }
.runners .cbtn { position: absolute; width: 104px; height: 50px; }
.runners .b2 { left: 113px; top: 14px; } .runners .b3 { left: 12px; top: 64px; } .runners .b1 { left: 214px; top: 64px; } .runners .bc { left: 113px; top: 114px; height: 48px; }
.runners .cbtn.on { background: #4a3a0c; border-color: #ffd43b; color: #fff; }
.runners .ttl { position: absolute; left: 10px; top: 8px; }
.inning { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; padding: 8px 12px; }
.inning .ih { display: flex; align-items: center; gap: 10px; }
.inning .il { font-size: 26px; font-weight: 900; }
.inning .ia { font-size: 12px; color: var(--dim); }
.inning .ia b { color: #fff; }
.mls { width: 100%; border-collapse: collapse; font-size: 12px; }
.mls th, .mls td { border: 1px solid var(--line); text-align: center; height: 19px; font-family: var(--mono); }
.mls th { color: var(--dim); font-weight: 700; }
.mls td.cur, .mls th.cur { background: rgba(255,212,59,.12); }
.mls .tn2 { text-align: left; padding-left: 6px; font-family: inherit; white-space: nowrap; }
.mls .tn2 i { display: inline-block; width: 6px; height: 12px; background: var(--tc); margin-right: 5px; vertical-align: -1px; }
.mls .r { font-weight: 900; color: #ffd98a; }

/* ---- 下の帯（共通ゾーン: 取り消し・背番号・全部消す） ---- */
.common { flex: 0 0 82px; display: grid; grid-template-columns: 400px minmax(0, 1fr) 330px; gap: 26px; padding: 8px 14px; background: #15181c; border-top: 1px solid var(--line); }
.undo { position: relative; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 6px 14px; border-radius: 10px; background: #23282f; border: 2px solid #59616d; text-align: left; }
.undo:hover { border-color: #8a939f; }
.undo .t { font-size: 17px; font-weight: 900; }
.undo .last { font-size: 12px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.undo .last b { color: #e8eaed; }
.undo .kb { position: absolute; top: 6px; right: 8px; }
.undo .note { font-size: 10px; color: var(--dim2); }
.clear { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 10px; background: #34110f; border: 2px solid #8f2b25; }
.clear:hover { border-color: #d0463e; }
.clear .t { position: relative; font-size: 18px; font-weight: 900; letter-spacing: .08em; }
.clear .s { position: relative; font-size: 10.5px; color: #f3b8b3; }
.clear .hold { position: absolute; left: 0; top: 0; bottom: 0; width: calc(var(--hold, 0) * 100%); background: rgba(255,255,255,.28); pointer-events: none; }
.clear.holding { border-color: #fff; }
.numbox { display: flex; align-items: center; gap: 12px; padding: 6px 12px; border-radius: 10px; background: var(--well); border: 2px solid var(--line2); min-width: 0; }
.numbox.act { border-color: var(--accent); }
.numbox.pick { border-color: var(--wait); }
.numbox .lb { font-size: 10.5px; font-weight: 900; color: var(--dim2); letter-spacing: .06em; line-height: 1.3; white-space: nowrap; }
.numbox .tsw { display: flex; border: 1px solid var(--line2); border-radius: 7px; overflow: hidden; flex: 0 0 auto; }
.numbox .tsw button { padding: 0 12px; height: 44px; font-weight: 900; font-size: 15px; color: var(--dim); background: #1a1e23; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.numbox .tsw button.on { color: #fff; background: color-mix(in srgb, var(--tc) 55%, #1a1e23); box-shadow: inset 0 -3px 0 var(--tc); }
.numbox .tsw button + button { border-left: 1px solid var(--line2); }
.numbox .dg { font-family: var(--mono); font-size: 36px; font-weight: 900; min-width: 116px; height: 52px; line-height: 52px; text-align: center; letter-spacing: .08em; background: #000; border-radius: 7px; border: 1px solid var(--line2); color: #ffd98a; }
.numbox .dg.empty { color: #3c434d; }
.numbox .to { flex: 1; min-width: 0; font-size: 12px; color: var(--dim); line-height: 1.45; }
.numbox .to b { color: #fff; font-size: 14px; }
.numbox .to .p { color: #ffd98a; }
.numbox .to .h { font-size: 10.5px; }

/* ---- 確認・切り替え（モーダル） ---- */
.modal-bg { position: absolute; inset: 0; z-index: 200; display: grid; place-items: center; background: rgba(0,0,0,.6); }
.modal { width: 620px; max-width: 92%; background: var(--panel); border: 2px solid var(--wait); border-radius: 12px; padding: 20px 24px 18px; box-shadow: 0 24px 60px rgba(0,0,0,.6); }
.modal h3 { font-size: 20px; font-weight: 900; margin-bottom: 8px; }
.modal p { font-size: 13.5px; color: #d5dade; line-height: 1.75; margin: 6px 0; }
.modal p b { color: #fff; }
.modal .btns { display: flex; gap: 10px; margin-top: 16px; }
.modal .btns .cbtn { flex: 1; height: 54px; font-size: 16px; }
.modal .cd { font-size: 11px; color: var(--dim); margin-top: 8px; }
.modal ul { margin: 6px 0 0 18px; font-size: 13px; line-height: 1.8; color: #d5dade; }

/* ---- 今日の試合のメニュー・準備の引き出し ---- */
.menu { position: absolute; z-index: 150; min-width: 260px; background: #20252c; border: 1px solid var(--line2); border-radius: 8px; box-shadow: 0 14px 40px rgba(0,0,0,.55); padding: 6px; }
.menu .mh { padding: 6px 8px 8px; font-size: 12px; font-weight: 800; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu .mh small { display: block; color: var(--dim); font-weight: 600; }
.menu button { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 5px; font-size: 13px; font-weight: 700; }
.menu button small { display: block; font-size: 10.5px; color: var(--dim); font-weight: 600; }
.menu button:hover { background: #2c333c; }
.drawer { position: absolute; top: 76px; right: 0; bottom: 0; width: 64%; z-index: 140; display: flex; flex-direction: column; background: var(--bg2); border-left: 3px solid var(--accent); box-shadow: -24px 0 50px rgba(0,0,0,.55); }
.drawer .dh { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: #16233a; border-bottom: 1px solid #2f4a75; }
.drawer .dh b { font-size: 14px; }
.drawer .dh .n { font-size: 11.5px; color: #a9c8ff; }
.drawer .dh .sp { flex: 1; }
.drawer iframe { flex: 1; width: 100%; border: 0; background: var(--bg); }

/* ---- ワイヤーだけの仕組み（計測・試す）＝本番には入れない ---- */
.wfbox { background: #1b180d; border: 2px dashed #d8b764; border-radius: 10px; box-shadow: 0 14px 40px rgba(0,0,0,.55); }
.wfbox .wh { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-bottom: 1px dashed #6b5a28; }
.wfbox .wh b { font-size: 13px; color: #ffe29a; }
.wfbox .wh .sp { flex: 1; }
.meas { position: absolute; right: 12px; bottom: 92px; width: 440px; z-index: 120; }
.meas.min { width: auto; }
.meas.min .wb { display: none; }
.meas .wb { padding: 8px 10px 10px; }
.meas .sw { display: flex; align-items: center; gap: 10px; }
.meas .sw .gbtn { height: 46px; padding: 0 14px; border-radius: 8px; background: #3a2a10; border: 2px solid var(--wait); font-weight: 900; font-size: 14px; }
.meas .sw .t { font-family: var(--mono); font-size: 30px; font-weight: 900; color: #ffe29a; min-width: 110px; }
.meas .sw .t.idle { color: #6b5a28; }
.meas table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 11.5px; }
.meas th, .meas td { border-bottom: 1px solid #3a3219; padding: 3px 4px; text-align: right; font-family: var(--mono); }
.meas th { color: #c9a45a; font-family: inherit; font-weight: 700; }
.meas td:first-child, .meas th:first-child { text-align: left; }
.meas tr.avg td { color: #ffe29a; font-weight: 900; border-top: 1px solid #6b5a28; }
.meas .hint { font-size: 11px; color: #c9b27a; line-height: 1.6; margin-top: 6px; }
.meas .ft { display: flex; gap: 6px; margin-top: 8px; }
.trialpop { position: absolute; right: 8px; top: 44px; width: 470px; z-index: 160; }
.trialpop .wb { padding: 6px 12px 12px; }
.trialpop .q { padding: 8px 0; border-bottom: 1px dashed #3a3219; }
.trialpop .q:last-child { border-bottom: 0; }
.trialpop .q .qt { font-size: 12.5px; font-weight: 800; margin-bottom: 5px; }
.trialpop .q .qt small { font-weight: 600; color: #c9b27a; margin-left: 6px; }
.trialpop label { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; padding: 3px 0; cursor: pointer; color: #e3dcc6; }
.trialpop label input { margin-top: 3px; }
.toasts { position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.toast { background: #252b33; border: 1px solid #4a525d; color: #e8eaed; padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 700; box-shadow: 0 10px 30px rgba(0,0,0,.5); max-width: 760px; }
.toast.warn { background: #3a2a10; border-color: var(--wait); color: #ffe29a; }

/* ================= ふつうの画面（入口・モード・試合一覧・準備・記録・プレビュー・D200） ================= */
body.page { min-height: 100vh; }
.pgtop { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; height: 48px; padding: 0 18px; background: #181b20; border-bottom: 1px solid var(--line); }
.pgtop b.t { font-size: 15px; }
.pgtop .sp { flex: 1; }
.pgtop nav { display: flex; gap: 2px; flex-wrap: wrap; }
.pgtop nav a { color: var(--dim); text-decoration: none; font-size: 12.5px; padding: 6px 9px; border-radius: 5px; }
.pgtop nav a:hover, .pgtop nav a.cur { color: #fff; background: #242931; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 22px 22px 60px; }
.wrap.wide { max-width: 1500px; }
h1.pt { font-size: 22px; font-weight: 900; margin-bottom: 4px; }
.lead { color: var(--dim); font-size: 13px; margin-bottom: 18px; line-height: 1.7; }
.sec { margin: 22px 0 10px; font-size: 13px; font-weight: 900; letter-spacing: .06em; color: var(--dim); border-bottom: 1px solid var(--line); padding-bottom: 6px; display: flex; align-items: center; gap: 10px; }
.sec .sp { flex: 1; }
.box { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; }
.note { font-size: 12px; color: var(--dim); line-height: 1.7; }
.note b { color: #fff; }
.warnnote { background: #2a2212; border: 1px solid #6b5a28; color: #f1d9a8; border-radius: 8px; padding: 10px 14px; font-size: 12.5px; line-height: 1.7; }
.warnnote b { color: #ffe29a; }
.oknote { background: #14261b; border: 1px solid #2f6b44; color: #b8f0c8; border-radius: 8px; padding: 10px 14px; font-size: 12.5px; line-height: 1.7; }
.grid2 { display: grid; grid-template-columns: 7fr 5fr; gap: 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.fld { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; }
.fld label { font-size: 11.5px; color: var(--dim); font-weight: 700; }
.fld.row { flex-direction: row; align-items: center; gap: 10px; }
.swatches { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.swatches button { width: 24px; height: 24px; border-radius: 50%; border: 2px solid transparent; }
.swatches button.on { border-color: #fff; box-shadow: 0 0 0 2px var(--accent); }
.swatches input[type=color] { width: 30px; height: 26px; padding: 0 2px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.tbl th { text-align: left; font-size: 10.5px; color: var(--dim2); letter-spacing: .06em; padding: 6px 6px; border-bottom: 1px solid var(--line2); font-weight: 800; white-space: nowrap; }
table.tbl td { padding: 4px 6px; border-bottom: 1px solid #23272d; vertical-align: middle; }
table.tbl tr:hover td { background: #1b1f25; }
table.tbl input { padding: 4px 6px; font-size: 12.5px; }
table.tbl td.c { text-align: center; }
.teamcard { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-left: 6px solid var(--tc); border-radius: 8px; }
.teamcard .lgx { width: 40px; height: 40px; flex: 0 0 40px; display: grid; place-items: center; border-radius: 50%; background: var(--tc); font-weight: 900; font-size: 13px; overflow: hidden; }
.teamcard .lgx img { width: 100%; height: 100%; object-fit: contain; background: #16191e; }
.teamcard .tx { flex: 1; min-width: 0; }
.teamcard .tx b { font-size: 14px; }
.teamcard .tx small { display: block; color: var(--dim); font-size: 11.5px; }
.teamcard.sel { box-shadow: 0 0 0 2px var(--accent); }
.teamsgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(560px, 1fr)); gap: 18px; }
.tblwrap { overflow-x: auto; }
.pill { white-space: nowrap; display: inline-block; font-size: 10.5px; font-weight: 800; padding: 1px 7px; border-radius: 10px; background: #2b3038; color: #cfd4da; margin-right: 4px; }
.pill.ok { background: #1f4a2c; color: #9fe0b0; } .pill.warn { background: #3b3120; color: var(--wait); } .pill.red { background: #4a1512; color: #ffb3b0; }

/* 試合一覧（試合前／試合中／終了の3列） */
.cols3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: start; }
.col { background: #15181c; border: 1px solid var(--line); border-radius: 10px; min-height: 180px; }
.col > h3 { display: flex; align-items: center; gap: 8px; padding: 10px 14px; font-size: 14px; font-weight: 900; border-bottom: 1px solid var(--line); }
.col > h3 .c { font-family: var(--mono); font-size: 12px; color: var(--dim); }
.col.pre > h3 { color: #cfd4da; } .col.live > h3 { color: #9fe0b0; } .col.done > h3 { color: #a9b3be; }
.col .items { padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.col .empty { padding: 14px; color: var(--dim2); font-size: 12px; }
.mcard { background: var(--panel); border: 1px solid var(--line2); border-radius: 9px; padding: 10px 12px; }
.mcard.air { border-color: var(--live); box-shadow: 0 0 0 1px var(--live) inset; }
.mcard .mh { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--dim); }
.mcard .mh b { color: #fff; font-size: 13px; }
.mcard .mh .air { font-size: 10.5px; font-weight: 900; background: var(--live); color: #fff; padding: 0 6px; border-radius: 3px; }
.mcard .vs { display: flex; align-items: center; gap: 8px; margin: 8px 0 6px; }
.mcard .vs .t { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 800; }
.mcard .vs .t.b { justify-content: flex-end; text-align: right; }
.mcard .vs .t i { width: 6px; height: 20px; background: var(--tc); border-radius: 2px; flex: 0 0 auto; }
.mcard .vs .t span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mcard .vs .t.win span { color: #ffd98a; }
.mcard .vs .s { font-family: var(--mono); font-size: 22px; font-weight: 900; white-space: nowrap; }
.mcard .vs .s small { font-size: 11px; color: #ffd98a; display: block; text-align: center; }
.mcard .pr { font-size: 11.5px; color: var(--dim); }
.mcard .acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

/* モード選択・入口 */
.modecards { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.modecard { display: block; text-decoration: none; color: inherit; background: var(--panel); border: 2px solid var(--line2); border-radius: 14px; padding: 22px 24px; }
.modecard:hover { border-color: var(--accent); }
.modecard .mn { font-size: 30px; font-weight: 900; }
.modecard .md { color: var(--dim); font-size: 13px; margin: 6px 0 12px; line-height: 1.7; }
.links { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.lk { display: flex; gap: 14px; align-items: flex-start; text-decoration: none; color: inherit; background: var(--panel); border: 1px solid var(--line2); border-radius: 10px; padding: 14px 16px; }
.lk:hover { border-color: var(--accent); }
.lk .no { font-family: var(--mono); font-size: 22px; font-weight: 900; color: var(--dim2); width: 30px; }
.lk b { font-size: 15px; }
.lk small { display: block; color: var(--dim); font-size: 12px; line-height: 1.6; margin-top: 3px; }
.checklist { counter-reset: c; list-style: none; }
.checklist li { position: relative; padding: 7px 0 7px 34px; border-bottom: 1px solid #23272d; font-size: 13px; line-height: 1.65; }
.checklist li::before { counter-increment: c; content: counter(c); position: absolute; left: 0; top: 7px; width: 22px; height: 22px; border-radius: 50%; background: #2b3038; text-align: center; font-weight: 900; font-size: 12px; line-height: 22px; }
.checklist li b { color: #fff; }
.steps { margin-left: 18px; font-size: 13px; line-height: 1.9; color: #d5dade; }

/* 記録と書き出し */
.rectbl td .un { color: var(--wait); font-weight: 800; }
.rectbl tr.goal td { background: rgba(224, 49, 49, .05); }
.rectbl tr.prog td { color: #9fe0b0; }
.rectbl select { font-size: 12px; padding: 3px 4px; max-width: 220px; }
.prevframe { position: relative; width: 100%; aspect-ratio: 16 / 9; background: repeating-conic-gradient(#2a2d33 0 25%, #1c1f24 0 50%) 0 0 / 20px 20px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line2); }
.prevframe .stagebox { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; transform-origin: 0 0; }
textarea.report { width: 100%; min-height: 300px; font-family: var(--mono); font-size: 12px; line-height: 1.7; }
.tabs { display: inline-flex; border: 1px solid var(--line2); border-radius: 7px; overflow: hidden; }
.tabs button { padding: 6px 14px; font-size: 12.5px; font-weight: 700; color: var(--dim); background: #1a1e23; }
.tabs button.on { background: #2c4f7a; color: #fff; }
.tabs button + button { border-left: 1px solid var(--line2); }

/* プレビュー */
.pvbox { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; border: 2px solid var(--line2); background: #000; }
.pvbox iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* D200 */
.d200 { display: inline-grid; grid-template-columns: repeat(5, 104px); grid-template-rows: repeat(3, 104px); gap: 10px; padding: 18px; background: #1f2226; border-radius: 22px; border: 3px solid #33373d; box-shadow: inset 0 2px 0 rgba(255,255,255,.05), 0 18px 40px rgba(0,0,0,.45); }
.dk { position: relative; border-radius: 12px; background: #2a2e34; border: 2px solid #3d434b; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 6px; font-size: 13px; font-weight: 900; line-height: 1.25; color: #e8eaed; cursor: pointer; }
.dk:hover { filter: brightness(1.15); }
.dk small { font-size: 10px; font-weight: 700; color: #cfd4da; margin-top: 3px; }
.dk .kz { position: absolute; left: 5px; top: 4px; font-size: 9px; font-weight: 800; color: #9aa2ab; }
.dk.common { box-shadow: 0 0 0 3px #4f8ef7; }
.dk.on { background: #b3160f; border-color: #ff6b63; color: #fff; }
.dk.wait { background: #8a5a12; border-color: #ffc94d; color: #fff; }
.dk.team { background: color-mix(in srgb, var(--tc) 70%, #1a1a1a); border-color: var(--tc); }
.dk.dim { background: #1a1d21; border-color: #2c3036; color: #5f666f; }
.dk.dim small { color: #5f666f; }
.dk.ready { background: #8a5a12; border-color: #ffc94d; animation: nextpulse 1.1s ease-in-out infinite; }
.dk.lit { background: #3a3a0c; border-color: #ffd43b; }
.dk.status { grid-column: span 2; cursor: default; background: #0d0f12; border-color: #262a30; color: #9aa2ab; font-weight: 700; }
.dk.status .clk { font-family: var(--mono); font-size: 26px; font-weight: 900; color: #e8eaed; }
.d200wrap { display: flex; gap: 28px; flex-wrap: wrap; align-items: flex-start; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; margin: 10px 0; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 16px; height: 16px; border-radius: 4px; display: inline-block; }

/* ================= v1.1 ================= */
/* 得点の数字＝押すと「点数を直す」 */
.tsc button.score { position: relative; color: var(--text); cursor: pointer; }
/* 「直す」の小さな字は擬似要素（数字だけが中身＝読み上げ・コピー・テストで数字がそのまま取れる） */
.tsc button.score::after { content: '直す'; position: absolute; left: 0; right: 0; bottom: 2px; font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif; font-size: 10px; font-weight: 700; line-height: 1.2; color: var(--dim2); letter-spacing: .1em; }
.tsc button.score:hover { border-color: #6a737f; background: #14171b; }
.tsc button.score:hover::after { color: #8fb8ff; }
/* 使い切りの帯（得点者・交代）: 空＝押すと選ぶ（点線）／準備済み＝押すと出る（青） */
.dbtn.empty { border-style: dashed; background: #181b20; }
.dbtn.empty .nm { color: #c6ccd3; }
.dbtn.empty .st { display: block; background: transparent; color: #8fb8ff; border: 1px dashed #4f8ef7; }
.dbtn.ready { border-color: #4f8ef7; background: #152640; box-shadow: inset 0 0 0 1px #4f8ef7; }
.dbtn.ready .nm { color: #fff; } .dbtn.ready .sub { color: #b9d3ff; }
.dbtn.ready .st { display: block; background: #4f8ef7; color: #fff; }
/* 「もう一度」: 小さく・離して置く（キーなし） */
.again { flex: 0 0 52px; align-self: center; height: 40px; margin: 0 4px 0 -1px; border-radius: 6px; border: 1px solid var(--line2); background: #1a1e23; color: var(--dim); font-size: 10.5px; font-weight: 800; line-height: 1.15; }
.again:hover { color: #fff; border-color: #6a737f; }
.again.dis { opacity: .32; cursor: not-allowed; }
/* 選ぶ画面: 出さずに記録だけ／点数を直すテンキー・回 */
.chk.silent { align-self: center; }
.picker .kp { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 4px; }
.picker .kpb { height: 44px; border-radius: 7px; background: #2a2416; border: 2px solid #5c4a24; font-family: var(--mono); font-size: 20px; font-weight: 900; color: #ffd98a; }
.picker .kpb:hover { border-color: #f0c060; }
.picker .kpb.wide { grid-column: span 5; font-family: inherit; font-size: 13.5px; height: 40px; }
.picker .kpb.go { background: #1c4a2a; border-color: #2f9e44; color: #e8eaed; }
.picker .fixnow { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 12px; padding: 6px 4px; }
.picker .fixnow b { font-family: var(--mono); font-size: 40px; font-weight: 900; color: #fff; }
.picker .fixnow span { font-size: 12px; color: #f1d9a8; }
.picker .inns { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 5px; }
.picker .innb { min-width: 50px; height: 40px; padding: 0 6px; border-radius: 6px; background: #2a2416; border: 2px solid #5c4a24; font-size: 12px; font-weight: 800; color: #f1d9a8; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.picker .innb b { font-family: var(--mono); font-size: 16px; color: #fff; }
.picker .innb.sel { border-color: #fff; background: #4a3b16; }
.rectbl tr.void td { text-decoration: line-through; opacity: .5; }
.rectbl tr.fixr td { color: #ffd98a; }

/* ================= v1.2 ================= */
/* 送出卓の上: いまの見た目（読むだけ・変えるのは試合の準備） */
.top .pchip { display: flex; align-items: center; gap: 6px; padding: 0 12px; border-left: 1px solid var(--line); font-size: 11px; color: var(--dim); white-space: nowrap; cursor: help; }
.top .pchip .pk { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 5px; background: #2f9e44; color: #fff; font-size: 13px; font-weight: 900; }
.top .pchip .pn { color: #e8eaed; font-weight: 800; font-size: 12px; }
.top .tb#tbAuto { color: #9fd3ff; }
.top .tb#tbAuto.on { background: #16283a; color: #cfe8ff; }
/* 自動で消える物の残り時間（ボタンの下に減っていくバー・「いま出ている物」に減っていく輪） */
.dbtn > .abar { position: absolute; left: 6px; right: 6px; bottom: 3px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .14); overflow: hidden; pointer-events: none; }
.dbtn > .abar > i { display: block; height: 100%; width: 100%; background: #ffd43b; transition: width .15s linear; }
.dbtn > .abar.wt > i { background: #ffb31a; opacity: .55; }
.oc .rg { width: 14px; height: 14px; border-radius: 50%; flex: 0 0 auto; background: conic-gradient(#fff calc(var(--p) * 360deg), rgba(255, 255, 255, .25) 0); }
.oc .rs { font-style: normal; font-size: 10.5px; font-weight: 800; opacity: .95; }
.autopop { background: #13202c; border: 1px solid #2c5373; border-radius: 8px; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); padding: 0 0 10px; width: 430px; right: 150px; }
.autopop .wh { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid #2c5373; font-size: 12.5px; }
.autopop .arow, .autopop .note { padding: 0 12px; }
.autopop .arow { display: flex; align-items: center; gap: 8px; padding-top: 8px; font-size: 12.5px; }
.autopop .arow .an { flex: 1; font-weight: 800; }
.autopop .arow .av { min-width: 70px; text-align: center; font-size: 14px; color: #ffe29a; }
.cbtn.dis small { color: #ffb4a8; }
/* 準備画面: 見た目を選ぶ（A〜F）と見本 */
.pset { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.pbtn { display: grid; grid-template-columns: 30px 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; text-align: left; padding: 7px 9px; border-radius: 7px; border: 1px solid var(--line2); background: #1b1f25; cursor: pointer; }
.pbtn b { grid-row: 1 / 3; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 6px; background: #2b3038; font-size: 16px; font-weight: 900; }
.pbtn span { font-size: 12.5px; font-weight: 800; }
.pbtn small { font-size: 10.5px; color: var(--dim); }
.pbtn.on { border-color: #2f9e44; background: #16281c; box-shadow: 0 0 0 1px #2f9e44 inset; }
.pbtn.on b { background: #2f9e44; color: #fff; }
.pbtn:disabled { opacity: .5; cursor: not-allowed; }
.pvcv { width: 480px; height: 270px; border-radius: 6px; background: repeating-conic-gradient(#2a2d33 0 25%, #1c1f24 0 50%) 0 0 / 24px 24px; display: block; }
/* 試合一覧: 各試合の見た目 */
.mcard .mh .pvch { font-size: 10.5px; color: var(--dim); white-space: nowrap; }
.mcard .mh .pvch b { display: inline-grid; place-items: center; min-width: 16px; height: 16px; border-radius: 3px; background: #2f9e44; color: #fff; font-size: 11px; padding: 0 2px; }

/* ================= v1.3 ================= */
/* AT の窓（押した数字がそのまま出る）・スコアバグの時計の表示／非表示・PK のマスを押して直す */
.tp-hd { min-height: 28px; gap: 8px; }
.tp-hd .sp, .tp-time .sp { flex: 1; }
/* 時計の表示／非表示は設定寄りの切り替え（本番中に連打する物ではない）＝小さいボタン（補助 20px 以上） */
.console .btn.tgl { position: relative; height: 28px; padding: 0 30px 0 10px; font-size: 11.5px; display: inline-flex; align-items: center; gap: 3px; }
.btn.tgl .kb { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); font-size: 9.5px; padding: 0 4px; }
.btn.tgl b { color: #ffb4a8; }
.btn.tgl.on { border-color: #2f9e44; }
.btn.tgl.on b { color: #b8f0c8; }
.tp-time .cbtn.sm { flex: 0 0 auto; height: 40px; min-width: 70px; align-self: center; }
.tp-atrow { gap: 4px; }
.tp-atl { font-size: 12px; font-weight: 900; color: var(--dim); width: 20px; flex: 0 0 auto; }
.cbtn.atn { flex: 1 1 0; min-width: 0; height: 40px; padding: 0 2px; font-size: 15px; font-family: var(--mono); font-weight: 900; }
.cbtn.atn.on { background: #3a1413; border-color: var(--live); color: #fff; }
.cbtn.atn.clr { font-family: inherit; font-size: 12px; flex: 1.3 1 0; }
.cbtn.atn.clr.dis { opacity: .45; }
.cbtn.atn.ten { font-family: inherit; font-size: 12px; flex: 1.9 1 0; padding-right: 16px; }
.pkr .marks .pkm { width: 28px; height: 28px; padding: 0; border-radius: 4px; background: var(--well); border: 1px solid var(--line2); display: grid; place-items: center; font-weight: 900; font-size: 14px; cursor: pointer; color: inherit; flex: 0 0 auto; }
.pkr .marks .pkm.o { color: #51cf66; } .pkr .marks .pkm.x { color: #ff6b6b; } .pkr .marks .pkm.sd { border-color: #7d3a36; }
.pkr .marks .pkm:hover { border-color: #ffd43b; }
.pkr .marks .pkm.fx { box-shadow: inset 0 -3px 0 #ffd43b; }
/* D200: いま表示中のページ */
.d200wrap > div.cur .d200 { box-shadow: 0 0 0 3px #2f9e44; }
.tpanel { gap: 6px; }
.tpanel .cbtn.big { height: 44px; }
.tpanel .tp-clock { font-size: 46px; }
/* v1.3: 送出卓からスタメンを登録（送出卓に重ねる画面・出力は変わらない） */
.lrcta { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; width: calc(100% - 20px); margin: 10px; padding: 11px 14px; min-height: 58px; border-radius: 9px; background: #16304f; border: 2px solid #3d76c6; color: #fff; text-align: left; cursor: pointer; }
.lrcta b { font-size: 15.5px; font-weight: 900; }
.lrcta small { font-size: 11px; color: #a9c8ff; font-weight: 600; line-height: 1.4; }
.lrcta:hover { background: #1d3c63; border-color: #74a7ff; }
.lrbg { position: absolute; inset: 0; z-index: 190; display: grid; place-items: center; background: rgba(0,0,0,.62); }
.lrbg.hide { display: none; }
.lrp { width: 1240px; max-width: 95%; height: 800px; max-height: 94%; display: flex; flex-direction: column; background: var(--panel); border: 2px solid #3d76c6; border-top: 6px solid var(--tc, #3d76c6); border-radius: 12px; box-shadow: 0 30px 80px rgba(0,0,0,.65); overflow: hidden; }
.lrh { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.lrh .sw { width: 16px; height: 16px; border-radius: 4px; background: var(--tc, #888); }
.lrh .tt { font-size: 19px; font-weight: 900; }
.lrh .tm { font-size: 14px; color: var(--dim); font-weight: 700; }
.lrh .cnt { font-size: 14px; color: #cfe3f7; } .lrh .cnt b { font-size: 20px; color: #fff; }
.lrh .sp { flex: 1; }
.lrh .btn { height: 38px; font-size: 13.5px; position: relative; padding-right: 34px; }
.lrh .btn .kb { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font-size: 9.5px; }
.lrh .btn.go { padding: 0 18px; font-size: 15px; }
.lrh .btn.go:disabled { opacity: .4; }
.lrnote { padding: 7px 14px; font-size: 12px; color: #b9c7d6; background: #152233; border-bottom: 1px solid var(--line); line-height: 1.55; }
.lrnote b { color: #fff; }
.lrbody { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 470px; gap: 0; }
.lrl { min-height: 0; overflow: auto; padding: 10px 14px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.lrr { min-height: 0; overflow: auto; padding: 10px 14px; display: flex; flex-direction: column; gap: 8px; }
.lrsec { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 800; color: #cfd4da; }
.lrsec b { color: #ffd43b; } .lrsec .sp { flex: 1; }
.lrsec select { height: 30px; font-size: 13px; }
.lrgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.lrpb { position: relative; display: flex; align-items: center; gap: 7px; height: 44px; padding: 0 10px; border-radius: 7px; background: var(--panel2); border: 2px solid var(--line2); color: inherit; text-align: left; cursor: pointer; min-width: 0; }
.lrpb .no { font-family: var(--mono); font-size: 17px; font-weight: 900; min-width: 28px; }
.lrpb .pn { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lrpb .pp { font-size: 11px; color: var(--dim); }
.lrpb .bd { position: absolute; top: -7px; right: -5px; min-width: 22px; height: 18px; padding: 0 5px; border-radius: 9px; background: #ffd43b; color: #111; font-size: 11px; font-weight: 900; font-style: normal; display: grid; place-items: center; }
.lrpb.on { background: #173a26; border-color: #2f9e44; }
.lrpb.new { border-style: dashed; }
.lrpb:hover { border-color: #74a7ff; }
.lrempty { padding: 12px; font-size: 12.5px; color: var(--dim); background: var(--well); border-radius: 7px; line-height: 1.6; }
.lrempty b { color: #fff; }
.lradd { display: flex; gap: 6px; align-items: center; }
.lradd input { height: 38px; font-size: 15px; }
.lradd #lrNo { width: 110px; font-family: var(--mono); font-weight: 800; }
.lradd #lrName { flex: 1; min-width: 0; }
.lradd .btn { height: 38px; position: relative; padding-right: 50px; }
.lradd .btn .kb { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font-size: 9.5px; }
.lrpaste summary { cursor: pointer; font-size: 12px; color: #a9c8ff; }
.lrpaste textarea { width: 100%; margin: 6px 0; font-size: 13px; }
.lrsl { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.lrsl li { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 8px; border-radius: 6px; background: var(--well); }
.lrsl .n { width: 20px; color: var(--dim); font-size: 12px; } .lrsl .no { font-family: var(--mono); font-weight: 900; min-width: 34px; }
.lrsl .pn { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 700; }
.lrpos { min-width: 46px; height: 28px; border-radius: 5px; background: #20304a; border: 1px solid #3d5a86; color: #cfe3f7; font-weight: 800; cursor: pointer; }
.lrr .x, .lrsl .x { width: 28px; height: 28px; border-radius: 5px; background: transparent; border: 1px solid #7d3a36; color: #f3aaa4; cursor: pointer; }
.lrord { width: 100%; border-collapse: separate; border-spacing: 0 3px; }
.lrord tr { background: var(--well); cursor: pointer; }
.lrord tr.cur { outline: 2px solid #ffd43b; outline-offset: -2px; background: #2a2410; }
.lrord td { padding: 3px 6px; height: 34px; }
.lrord td.n { width: 30px; text-align: center; font-weight: 900; font-size: 15px; }
.lrord td.pl { font-weight: 700; } .lrord .ph { color: var(--dim); font-weight: 600; }
.lrord select { height: 28px; font-size: 14px; width: 62px; }
.lrord tr.pit td.n { color: #ffd43b; }
.lrord tr.pit.auto { cursor: default; }
.lrdh { font-weight: 700; font-size: 12.5px; display: flex; align-items: center; gap: 5px; cursor: pointer; }
.lrwarn { min-height: 34px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 7px 14px; border-top: 1px solid var(--line); font-size: 12.5px; }
.lrwarn .ok { color: #b8f0c8; } .lrwarn .bad { color: #ffb4a8; font-weight: 800; }
.lrwarn .wn { color: #ffd43b; } .lrwarn .nt { color: var(--dim); }
.lrord td.tg { font-size: 11px; color: #ffd43b; font-weight: 800; width: 62px; text-align: center; }
.lrord td.pl small { color: var(--dim); font-weight: 600; margin-left: 4px; }
.rs-h > b { white-space: nowrap; }
