/* OBI コーンホールの点つけ。手本: テレビ中継の得点表示(ダーツ・テニス)/パレット: 朱赤(DESIGN.md 2-2)。1画面・スクロールなし */
:root{--bg:#fff;--face:#efeadd;--ink:#111;--gray:#5b5f66;--rule:#bdb9b0;--mid:#8d8b85;--a:#d4381c;--b:#2a4a7a;--warn:#b42f15;
--jp:"Noto Sans JP","Hiragino Sans",system-ui,sans-serif;--num:"Inter","Noto Sans JP",system-ui,sans-serif}
*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%}
body{background:var(--bg);color:var(--ink);font-family:var(--jp);font-size:14px;line-height:1.5;-webkit-text-size-adjust:100%;touch-action:manipulation}
button{font-family:inherit;cursor:pointer;color:inherit}
.app{height:100dvh;display:flex;flex-direction:column;max-width:1200px;margin:0 auto}
.top{display:flex;align-items:center;gap:12px;height:48px;padding:0 max(16px,env(safe-area-inset-left));border-bottom:2px solid var(--ink);flex:none}
.top b{font-weight:900;font-size:16px}
.top span{font-size:12px;color:var(--gray);font-weight:700;flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.top b{white-space:nowrap}
.lk{white-space:nowrap;flex:none}
.lk{height:32px;padding:0 12px;border:1px solid var(--ink);border-radius:4px;background:var(--bg);font-weight:700;font-size:12px}
.cols{flex:1;min-height:0;display:flex}
main{flex:1;min-width:0;display:flex;flex-direction:column}
aside{display:none}
/* 2つの側 */
.duo{flex:1;min-height:0;display:grid;grid-template-columns:1fr 1fr}
.sd{display:flex;flex-direction:column;padding:12px 12px 8px;min-width:0;--c:var(--a)}
.sd.b{--c:var(--b);border-left:1px solid var(--rule)}
.nm{display:flex;align-items:center;gap:8px;font-weight:900;font-size:16px;min-height:28px}
.nm i{flex:none;width:12px;height:12px;background:var(--c)}
.nm span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.nm em{font-style:normal;font-size:12px;font-weight:700;color:#fff;background:var(--ink);padding:0 6px;border-radius:4px;margin-left:auto;flex:none;visibility:hidden}
.sd.turn .nm em{visibility:visible}
.sc{font-family:var(--num);font-weight:900;font-size:72px;line-height:1;letter-spacing:-.02em;font-variant-numeric:tabular-nums;margin:4px 0 8px;display:flex;align-items:baseline;gap:8px}
.sc small{font-size:20px;color:var(--c);min-width:2.2em}
.slots{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;margin-bottom:12px}
.sl{height:40px;border:1px solid var(--rule);border-radius:4px;background:var(--bg);font-weight:900;font-size:14px;display:flex;align-items:center;justify-content:center}
.sl.h{background:var(--c);border-color:var(--c);color:#fff}
.sl.b{border:2px solid var(--c);color:var(--c)}
.sl.o{background:var(--face);color:var(--mid)}
.bt{flex:1;min-height:56px;max-height:96px;margin-bottom:8px;border:0;border-radius:4px;background:var(--c);color:#fff;font-weight:900;font-size:20px;display:flex;align-items:center;justify-content:space-between;padding:0 16px}
.bt b{font-family:var(--num);font-size:24px}
.bt.b1{background:var(--bg);color:var(--c);border:2px solid var(--c)}
.bt.b0{background:var(--face);color:var(--ink);font-size:16px;flex:.6;min-height:44px}
.bt:disabled{opacity:.3}
.foot{flex:none;display:grid;grid-template-columns:1fr 2fr;gap:8px;padding:8px max(12px,env(safe-area-inset-left)) max(12px,env(safe-area-inset-bottom));border-top:1px solid var(--rule)}
.fb{height:52px;border-radius:4px;border:1px solid var(--ink);background:var(--bg);font-weight:900;font-size:16px}
.fb.go{background:var(--ink);color:#fff}
.fb:disabled{opacity:.3}
.win{grid-column:1/-1;text-align:center;font-weight:900;font-size:20px;padding:4px 0}
/* 始める前 */
.setup{padding:24px 16px;max-width:480px;width:100%;margin:0 auto}
.setup h1{font-size:24px;font-weight:900;margin-bottom:16px}
.setup label{display:flex;align-items:center;gap:8px;font-weight:700;margin:16px 0 4px}
.setup label i{width:12px;height:12px}
.setup input{font:inherit;font-size:16px;width:100%;height:48px;border:1px solid var(--mid);border-radius:4px;padding:0 12px}
.setup .fb{width:100%;margin-top:24px}
/* つなぐ */
.sheet{position:fixed;inset:0;background:rgba(17,17,17,.5);display:flex;align-items:flex-end;justify-content:center;z-index:9}
.sheet div{background:var(--bg);width:100%;max-width:480px;padding:24px 16px max(24px,env(safe-area-inset-bottom));border-top:2px solid var(--ink)}
.sheet h2{font-size:20px;font-weight:900}
.sheet ol{margin:12px 0 0 20px;font-size:14px}
.sheet .code{font-family:var(--num);font-weight:900;font-size:40px;letter-spacing:.2em;text-align:center;width:100%;height:64px;border:2px solid var(--ink);border-radius:4px;margin:8px 0 4px}
.sheet .err{color:var(--warn);font-weight:700;font-size:14px;min-height:21px;margin-bottom:8px}
.lk.on{background:var(--ink);color:#fff}
.lk.ng{border-color:var(--warn);color:var(--warn)}
.sheet .url{font-family:var(--num);font-weight:700;background:var(--face);padding:8px 12px;border-radius:4px;margin:4px 0 8px;word-break:break-all}
/* パソコン・タブレット横: 右に配信の画面と記録 */
@media(min-width:900px){
  aside{display:flex;flex-direction:column;width:44%;border-left:2px solid var(--ink);padding:16px;gap:16px;min-height:0}
  aside h3{font-size:12px;letter-spacing:.08em;color:var(--gray);font-weight:700;margin-bottom:8px}
  .pv{position:relative;aspect-ratio:16/9;background:#3b4046;overflow:hidden}
  .pv iframe{position:absolute;left:0;top:0;width:1920px;height:1080px;border:0;transform-origin:left top}
  .log{flex:1;min-height:0;overflow:auto}
  table{width:100%;border-collapse:collapse;font-variant-numeric:tabular-nums}
  th,td{padding:6px 8px;border-bottom:1px solid var(--rule);text-align:center;font-size:14px}
  th{font-size:12px;color:var(--gray)}
  td.g{font-family:var(--num);font-weight:900}
  td.ga{color:var(--a)} td.gb{color:var(--b)}
  .sc{font-size:96px}
  .sd{padding:24px}
}
