/* 휴먼vs스켈레톤 코딩 전투 화면 (2026-11-13 Gilbert). 생산 화면(자원 줄·명령 칸·초상)은 숨긴다 */
body.cb #top, body.cb #console, body.cb #game-tools, body.cb #attack-alert, body.cb #coach, body.cb #modes { display: none !important; }
#cb-panel, #cb-menu .cb-box, #cb-result .cb-box { background: rgba(9, 14, 21, .95); border: 1px solid #2a4157; border-radius: 12px; color: #e6edf4; font: 13px/1.5 var(--font, system-ui, "Apple SD Gothic Neo", sans-serif); box-shadow: 0 10px 30px rgba(0,0,0,.45); }
#cb-panel { position: fixed; left: 12px; top: 12px; bottom: 12px; width: 420px; z-index: 40; overflow-y: auto; overscroll-behavior: contain; padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 14px; }
#cb-panel.running { bottom: auto; }
#cb-panel[hidden], #cb-menu[hidden], #cb-result[hidden] { display: none; }
#cb-panel header small, #cb-panel h3 { color: #8fa3b8; font-size: 12px; font-weight: 700; letter-spacing: .2px; margin: 0; }
#cb-panel h2 { margin: 2px 0 4px; font-size: 18px; color: #fff; }
#cb-panel header p { margin: 4px 0 0; }
#cb-panel .learn { color: #c9d6e3; }
#cb-panel .hint, #cb-result .hint { color: #ffd479; }
#cb-panel .stars, #cb-panel .muted, #cb-result .muted { color: #8fa3b8; font-size: 12px; }
#cb-panel section { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid #1d3044; padding-top: 12px; }
#cb-panel .row, #cb-result .row, #cb-menu .row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#cb-panel .chips { display: flex; flex-wrap: wrap; gap: 6px; }
#cb-panel button, #cb-menu button, #cb-result button, #cb-panel select, #cb-panel input { font: inherit; color: #eef3f8; background: #121c28; border: 1px solid #2a4157; border-radius: 8px; }
#cb-panel button, #cb-menu button, #cb-result button { min-height: 34px; padding: 0 12px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
#cb-panel button:hover:not([disabled]), #cb-menu button:hover:not([disabled]) { border-color: #59b4ff; }
#cb-panel button[disabled], #cb-menu button[disabled] { opacity: .4; cursor: default; }
#cb-panel .chip { padding: 0 10px 0 4px; }
#cb-panel .chip img, #cb-panel .trait img, #cb-panel .cnt img { width: 28px; height: 28px; object-fit: contain; flex: none; }
#cb-panel .chip.on { border-color: #59b4ff; background: #17304a; }
#cb-panel .chip.foe.on { border-color: #ff6b6b; background: #3a1a1f; }
#cb-panel .chip i { font-style: normal; font-size: 11px; color: #9fd0ff; display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 4px; background: #0d2236; }
#cb-panel .trait { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; background: #0f1823; border: 1px solid #1d3044; }
#cb-panel .trait.foe { border-color: #4a2228; }
#cb-panel .trait img { width: 40px; height: 40px; }
#cb-panel .trait div { display: flex; flex-direction: column; gap: 2px; }
#cb-panel .trait b { color: #fff; }
#cb-panel .trait span { color: #cfd9e3; font-size: 12px; }
#cb-panel .trait small { color: #8fa3b8; font-size: 12px; }
#cb-panel .cards { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
#cb-panel .cards li { display: flex; gap: 8px; align-items: center; padding: 8px; border-radius: 10px; background: #0f1823; border: 1px solid #23394f; }
#cb-panel .cards .n { flex: none; width: 22px; height: 22px; border-radius: 6px; background: #1f6fbf; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; }
#cb-panel .cards .sent { flex: 1; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
#cb-panel .cards .w { color: #8fa3b8; font-size: 12px; display: inline-flex; align-items: center; height: 30px; }
#cb-panel select { height: 30px; padding: 0 6px; max-width: 100%; }
#cb-panel .ops { display: flex; flex-direction: column; gap: 4px; }
#cb-panel .ic { width: 28px; min-height: 28px; padding: 0; font-size: 11px; }
#cb-panel details.code summary { cursor: pointer; display: flex; align-items: center; min-height: 28px; color: #9fd0ff; font-weight: 600; }
#cb-panel pre, #cb-panel textarea { margin: 6px 0; padding: 10px; border-radius: 8px; background: #060b11; border: 1px solid #1d3044; color: #d6f0ff; font: 12px/1.55 ui-monospace, Menlo, monospace; white-space: pre-wrap; word-break: break-all; }
#cb-panel textarea { width: 100%; min-height: 200px; resize: vertical; box-sizing: border-box; }
#cb-panel .err { color: #ff8f8f; margin: 0; font-size: 12px; }
#cb-panel .ok { color: #7ee2a8; margin: 0; font-size: 12px; }
#cb-panel .note { margin: 0; color: #9fd0ff; }
#cb-panel .seg { display: flex; gap: 0; }
#cb-panel .seg button { border-radius: 0; min-width: 80px; }
#cb-panel .seg button:first-child { border-radius: 8px 0 0 8px; }
#cb-panel .seg button:last-child { border-radius: 0 8px 8px 0; border-left: 0; }
#cb-panel .seg button[aria-pressed="true"] { background: #1f6fbf; border-color: #3a95f0; color: #fff; }
#cb-panel .rows { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
#cb-panel .rows label, #cb-panel .row label { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
#cb-panel footer { display: flex; gap: 8px; border-top: 1px solid #1d3044; padding-top: 12px; position: sticky; bottom: -16px; background: rgba(9, 14, 21, .98); padding-bottom: 4px; }
#cb-panel .go, #cb-result .go { background: #e9c46a; border-color: #e9c46a; color: #1b1405; font-weight: 800; padding: 0 18px; }
#cb-panel .live { font-size: 15px; color: #fff; }
#cb-panel .lab h3 { margin-top: 8px; }
#cb-panel .cnts { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 8px; }
#cb-panel .cnt { display: flex; align-items: center; gap: 6px; }
#cb-panel .cnt span { flex: 1; font-size: 12px; }
#cb-panel .cnt input { width: 52px; height: 28px; padding: 0 6px; text-align: center; }
#cb-menu, #cb-result { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; background: rgba(4, 7, 11, .45); }
#cb-menu .cb-box { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow-y: auto; overscroll-behavior: contain; padding: 22px 24px; display: flex; flex-direction: column; gap: 12px; }
#cb-menu h1 { margin: 0; font: 400 34px/1.1 'Kenney Future', var(--font); color: #e9c46a; text-align: center; }
#cb-menu .sub { margin: 0; text-align: center; color: #c9d6e3; }
#cb-menu .stages { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
#cb-menu .stages button { width: 100%; justify-content: flex-start; gap: 12px; padding: 8px 12px; min-height: 52px; text-align: left; }
#cb-menu .stages b { flex: none; width: 30px; height: 30px; border-radius: 8px; background: #1f6fbf; color: #fff; display: flex; align-items: center; justify-content: center; }
#cb-menu .stages span { flex: 1; display: flex; flex-direction: column; }
#cb-menu .stages small { color: #8fa3b8; }
#cb-menu .stages em { font-style: normal; color: #e9c46a; letter-spacing: 2px; }
#cb-menu .score { margin-left: auto; color: #e9c46a; font-weight: 700; }
#cb-result .cb-box { width: min(420px, calc(100vw - 32px)); padding: 24px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
#cb-result .big { font-size: 30px; }
#cb-result .big.win { color: #e9c46a; } #cb-result .big.lose { color: #ff8f8f; }
#cb-result .stars { margin: 0; font-size: 30px; color: #e9c46a; letter-spacing: 4px; }
#cb-result p { margin: 0; }

/* 생산 화면이 없으니 캔버스는 화면 전체 */
body.cb canvas#game { top: 0 !important; bottom: 0 !important; height: 100vh !important; height: 100dvh !important; }

/* 수학 스테이지: 병력 사기 */
#cb-menu .stages .sep { color: #8fa3b8; font-size: 12px; font-weight: 700; padding: 6px 2px 0; }
#cb-panel .shop { display: flex; flex-direction: column; gap: 6px; }
#cb-panel .buy { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; background: #0f1823; border: 1px solid #1d3044; }
#cb-panel .buy img { width: 32px; height: 32px; object-fit: contain; flex: none; }
#cb-panel .buy span { flex: 1; display: flex; flex-direction: column; }
#cb-panel .buy small { color: #8fa3b8; font-size: 12px; }
#cb-panel .buy em { font-style: normal; min-width: 44px; height: 28px; display: flex; align-items: center; justify-content: center; font-weight: 800; color: #fff; }
#cb-panel .bar-row { display: flex; align-items: center; gap: 10px; }
#cb-panel .bar-row .rn { flex: none; width: 74px; font-weight: 700; color: #e9c46a; }
#cb-panel .bar { flex: 1; height: 30px; display: flex; border-radius: 8px; background: #0b1a12; border: 1px solid #2c5a3e; overflow: hidden; }
#cb-panel .bar.over { border-color: #ff6b6b; overflow: visible; }
#cb-panel .seg { display: flex; align-items: center; justify-content: center; min-width: 0; height: 100%; font-style: normal; font-size: 11px; font-weight: 700; color: #08111a; overflow: hidden; white-space: nowrap; border-right: 1px solid rgba(0,0,0,.35); }
#cb-panel .seg.c0 { background: #7fb8ff; } #cb-panel .seg.c1 { background: #8fe0b0; } #cb-panel .seg.c2 { background: #f5c97a; } #cb-panel .seg.c3 { background: #c7a6ff; }
#cb-panel .seg.ov { background: #ff5a5a; color: #fff; }
#cb-panel .asks { display: flex; flex-direction: column; gap: 6px; }
#cb-panel .ask { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
#cb-panel .ask input { width: 110px; height: 32px; padding: 0 8px; text-align: center; font-size: 15px; }

/* ===== 규칙 블록 (2026-11-13 Yui): 스크래치·엔트리처럼 위에서부터 검사하는 블록 더미 ===== */
#cb-panel { --cond: #F2C744; --cond-d: #B8901C; --cond-t: #2A1F00; --hit: #F28C55; --hit-d: #B4501F; --hit-t: #2B0F00; --move: #2F6FD6; --move-d: #1D4E9E; --def: #5B6675; --def-d: #3A434F; --hat: #E9C46A; --hole: #0a0f16; transition: width .2s ease; }
#cb-panel.wide { width: min(900px, calc(100vw - 24px)); }
#cb-panel .blk-grid { display: grid; grid-template-columns: minmax(0, 1fr); row-gap: 0; }
#cb-panel .blk-grid.with-code { grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); column-gap: 14px; }
#cb-panel .gh { color: #8fa3b8; font-size: 12px; font-weight: 700; padding-bottom: 6px; display: flex; align-items: center; min-height: 20px; }
#cb-panel .blk { position: relative; border-radius: 8px; font-size: 14px; font-weight: 700; line-height: 1.3; }
/* 위 홈(앞 블록의 돌기가 끼는 자리)과 아래 돌기 */
#cb-panel .blk::before { content: ""; position: absolute; left: 18px; top: 0; width: 24px; height: 6px; border-radius: 0 0 6px 6px; background: var(--hole); z-index: 1; }
#cb-panel .blk::after { content: ""; position: absolute; left: 18px; bottom: -6px; width: 24px; height: 6px; border-radius: 0 0 6px 6px; background: var(--bc); z-index: 2; }
#cb-panel .blk.hat { --bc: var(--hat); background: var(--hat); color: #1b1405; border-radius: 22px 22px 8px 8px; padding: 14px 12px 10px; margin-top: 4px; display: flex; align-items: center; min-height: 26px; box-shadow: inset 0 -3px 0 rgba(0,0,0,.18); }
#cb-panel .blk.hat::before { display: none; }
#cb-panel .blk.hat b { font-weight: 900; }
#cb-panel .blk.def { --bc: var(--def); background: var(--def); color: #fff; padding: 12px 12px 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 26px; box-shadow: inset 0 -3px 0 rgba(0,0,0,.22); border-radius: 8px 8px 12px 12px; }
#cb-panel .blk.def::after { display: none; }
#cb-panel .blk.def .w { color: #E3E8EE; height: auto; font-size: 14px; }
#cb-panel .blk.def .dv { display: inline-flex; align-items: center; height: 30px; padding: 0 10px; border-radius: 6px; background: rgba(0,0,0,.22); }
/* 만약 ~ 이면: C 자로 행동 블록을 감싼다 */
#cb-panel .blk.c { --bc: var(--cond); color: var(--cond-t); }
#cb-panel .blk.c::before { z-index: 3; }
#cb-panel .c-top { position: relative; display: flex; align-items: center; gap: 8px; padding: 12px 8px 8px 10px; background: var(--cond); border-radius: 8px 8px 0 0; }
#cb-panel .c-top::after { content: ""; position: absolute; left: 34px; bottom: -6px; width: 24px; height: 6px; border-radius: 0 0 6px 6px; background: var(--cond); z-index: 2; }
#cb-panel .c-top .sent { flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
#cb-panel .blk .w { color: inherit; font-size: 14px; font-weight: 800; display: inline-flex; align-items: center; height: 32px; }
#cb-panel .blk .n { flex: none; width: 26px; height: 26px; border-radius: 6px; background: var(--cond-t); color: var(--cond); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 900; }
#cb-panel .c-mouth { border-left: 16px solid var(--cond); padding: 6px 0 6px; }
#cb-panel .c-bot { height: 14px; background: var(--cond); border-radius: 0 0 8px 8px; box-shadow: inset 0 -3px 0 rgba(0,0,0,.18); }
#cb-panel .blk.act { --bc: var(--hit); background: var(--hit); color: var(--hit-t); padding: 10px 10px 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; box-shadow: inset 0 -3px 0 rgba(0,0,0,.18); }
#cb-panel .blk.act::after { display: none; }
#cb-panel .blk.act.move { --bc: var(--move); background: var(--move); color: #fff; }
#cb-panel .blk select { appearance: none; -webkit-appearance: none; height: 32px; padding: 0 30px 0 10px; border-radius: 6px; border: 1px solid rgba(0,0,0,.28); background: #FFFDF6 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23333' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 11px center; color: #1A1A1A; font-size: 14px; font-weight: 700; line-height: 30px; max-width: 100%; cursor: pointer; }
#cb-panel .blk select:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
#cb-panel .blk .ops { flex: none; display: flex; flex-direction: row; gap: 4px; align-self: flex-start; }
#cb-panel .blk .ic { width: 30px; min-height: 30px; height: 30px; padding: 0; border: 0; border-radius: 6px; background: rgba(42,31,0,.82); color: var(--cond); font-size: 12px; }
#cb-panel .blk .ic[disabled] { opacity: .3; }
#cb-panel .blk.c[draggable="true"] { cursor: grab; }
#cb-panel .blk.dragging { opacity: .4; }
#cb-panel .blk.drop-before { margin-top: 14px; }
#cb-panel .blk.drop-before::before { display: block; top: -10px; left: 0; width: 100%; height: 4px; border-radius: 2px; background: #59b4ff; }
#cb-panel .blk-grid .blk.c + .blk, #cb-panel .blk-grid .blk.c + .cc + .blk { margin-top: 0; }
/* 블록과 나란한 코드 */
#cb-panel pre.cc { margin: 0; padding: 8px 10px; border: 0; border-left: 4px solid var(--k, #2a4157); border-radius: 0; background: #060b11; font: 12.5px/1.55 ui-monospace, Menlo, monospace; white-space: pre-wrap; word-break: break-word; box-shadow: inset 0 1px 0 #14212e; }
#cb-panel .blk.hat + pre.cc { --k: var(--hat); border-radius: 8px 8px 0 0; }
#cb-panel .blk.c + pre.cc { --k: var(--cond); }
#cb-panel .blk.def + pre.cc { --k: var(--def); border-radius: 0 0 8px 8px; }
#cb-panel .codebar { margin-top: 12px; }
#cb-panel [data-codetoggle][aria-pressed="true"] { border-color: #59b4ff; background: #17304a; }
/* 블록 꾸러미 */
#cb-panel .palette { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 10px; background: #0f1823; border: 1px dashed #2a4157; }
#cb-panel .palette h3 { margin: 0; }
#cb-panel .pal-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
#cb-panel .pal-k { flex: none; width: 36px; color: #8fa3b8; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; height: 32px; }
#cb-panel .pb { min-height: 32px; padding: 0 10px; border: 0; border-radius: 6px; font-size: 13px; font-weight: 700; box-shadow: inset 0 -3px 0 rgba(0,0,0,.2); cursor: grab; }
#cb-panel .pb.cond { background: var(--cond); color: var(--cond-t); }
#cb-panel .pb.hit { background: var(--hit); color: var(--hit-t); }
#cb-panel .pb.move { background: var(--move); color: #fff; }
#cb-panel .pb:hover:not([disabled]) { filter: brightness(1.08); border: 0; }
/* 포메이션 줄 배치(이동)는 파랑 블록 */
#cb-panel .formation .rows label { background: var(--move); color: #fff; padding: 6px 6px 6px 10px; border-radius: 6px; font-weight: 700; box-shadow: inset 0 -3px 0 rgba(0,0,0,.2); }
#cb-panel .formation .rows select { background-color: #FFFDF6; color: #1A1A1A; }
#cb-panel .blk.c::before { z-index: 1; }
#cb-panel .c-mouth { padding: 0; }
#cb-panel .c-top { align-items: flex-start; }
#cb-panel .c-top .n { margin-top: 3px; }
#cb-panel .blk select { field-sizing: content; min-width: 64px; }
#cb-panel .c-bot { margin-top: 0; }
#cb-panel pre.cc { word-break: keep-all; overflow-wrap: anywhere; }
#cb-panel .pb { font-size: 14px; }
#cb-panel .blk .ic { font-size: 14px; }
#cb-panel .formation select { appearance: none; -webkit-appearance: none; height: 32px; padding: 0 30px 0 10px; border-radius: 6px; border: 1px solid rgba(0,0,0,.28); background: #FFFDF6 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23333' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 11px center; color: #1A1A1A; font-weight: 700; }

/* 관전 카메라 · 코딩창 닫기 (2026-11-13 Gilbert, cam-ui.js) */
body.cb-closed #cb-panel { display: none !important; }
#cb-toggle, #cam-ctl button { font: 600 13px/1 var(--font, system-ui, "Apple SD Gothic Neo", sans-serif); color: #eef3f8; background: rgba(18, 28, 40, .95); border: 1px solid #2a4157; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
#cb-toggle { position: fixed; top: 12px; z-index: 41; height: 36px; padding: 0 12px; box-shadow: 0 6px 18px rgba(0,0,0,.4); }
#cb-toggle[hidden] { display: none; }
#cb-toggle .ar { font-size: 10px; color: #9fd0ff; }
#cb-toggle:hover, #cam-ctl button:hover { border-color: #59b4ff; }
#cam-ctl { position: fixed; right: 12px; bottom: 12px; z-index: 41; padding: 8px; border-radius: 12px; background: rgba(9, 14, 21, .9); border: 1px solid #2a4157; display: flex; flex-direction: column; gap: 6px; width: 268px; box-sizing: border-box; }
#cam-ctl .btns { display: flex; gap: 6px; }
#cam-ctl button { width: 36px; height: 36px; padding: 0; font-size: 16px; }
#cam-ctl button.wide { width: auto; flex: 1; font-size: 13px; padding: 0 10px; }
#cam-ctl .keys { margin: 0; color: #8fa3b8; font: 500 11.5px/1.45 var(--font, system-ui, "Apple SD Gothic Neo", sans-serif); word-break: keep-all; }
body:has(#cb-menu:not([hidden])) #cam-ctl, body:has(#cb-result:not([hidden])) #cam-ctl { display: none; }

/* 로딩 화면 (2026-11-13 Yui): 퍼센트 + 막대 + 지금 하는 일 한 줄 */
#loading-bar { width: min(320px, 70vw); height: 8px; border-radius: 4px; background: #1b2633; overflow: hidden; }
#loading-bar i { display: block; height: 100%; width: 0; background: #e9c46a; transition: width .2s linear; }
#loading-step { min-height: 20px; font-size: 14px; color: #8fa3b8; display: flex; align-items: center; justify-content: center; }
#loading-text { font-variant-numeric: tabular-nums; }
#loading-bar[hidden] { display: none; }

/* ===== 머리 줄 + 코딩창 닫기 단추 하나로 (2026-11-13 Yui, 충쌤 "이거 하나로 합치고") ===== */
#cb-panel .cb-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 32px; }
#cb-panel .cb-bar small { flex: 1; min-width: 0; color: #8fa3b8; font-size: 13px; font-weight: 700; display: flex; align-items: center; }
#cb-panel #cb-toggle { position: static; flex: none; height: 32px; min-height: 32px; padding: 0 10px; box-shadow: none; font-size: 13px; background: #121c28; }
#cb-toggle .ar { font-size: 10px; }
/* 닫으면: 창이 머리 줄만 남기고 접힌다 */
body.cb-closed #cb-panel:not([hidden]) { display: flex !important; bottom: auto; width: auto; min-width: 280px; max-width: 420px; gap: 0; overflow: hidden; padding-bottom: 12px; }
body.cb-closed #cb-panel > :not(header), body.cb-closed #cb-panel header > :not(.cb-bar):not(.bt-mini) { display: none !important; }
#cb-panel .bt-mini { display: none; margin: 0; }
body.cb-closed #cb-panel.running .bt-mini { display: flex; align-items: center; min-height: 24px; margin-top: 6px; font-size: 15px; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }

/* ===== 전투 현황판 (2026-11-13 Yui, '전투 현황판 uiuxup') ===== */
#cb-panel.running { gap: 12px; }
#cb-panel.running header { display: flex; flex-direction: column; gap: 8px; }
#cb-panel .bt-state { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px; border-radius: 8px; background: #10263d; border: 1px solid #1f4a73; }
#cb-panel .bt-state .dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: #59b4ff; box-shadow: 0 0 0 4px rgba(89,180,255,.18); animation: btpulse 1.6s ease-in-out infinite; }
#cb-panel .bt-state b { font-size: 16px; color: #fff; }
#cb-panel .bt-state span { margin-left: auto; font-size: 13px; color: #9fd0ff; }
#cb-panel .bt-state.late { background: #3a2a0d; border-color: #8a6416; }
#cb-panel .bt-state.late .dot { background: #f2b33d; box-shadow: 0 0 0 4px rgba(242,179,61,.2); }
#cb-panel .bt-state.late span { color: #ffd479; }
@keyframes btpulse { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { #cb-panel .bt-state .dot { animation: none; } }
#cb-panel .bt { display: flex; flex-direction: column; gap: 12px; }
#cb-panel .bt-vs { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
#cb-panel .bt-vs .vs { font-size: 13px; font-weight: 900; color: #5d7189; display: flex; align-items: center; }
#cb-panel .side { display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto auto auto; column-gap: 8px; row-gap: 4px; align-items: center; padding: 10px; border-radius: 10px; background: #0f1823; border: 1px solid #1d3044; }
#cb-panel .side.me { border-color: #1f4a73; } #cb-panel .side.foe { border-color: #5a2a31; }
#cb-panel .side .pic { grid-row: 1; width: 44px; height: 44px; border-radius: 8px; background: #16222f; display: flex; align-items: center; justify-content: center; overflow: hidden; }
#cb-panel .side .pic img { width: 40px; height: 40px; object-fit: contain; }
#cb-panel .side .num { display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap; }
#cb-panel .side .num .lbl { width: 100%; font-size: 13px; font-weight: 700; color: #8fa3b8; line-height: 1.2; }
#cb-panel .side .num b { font-size: 28px; line-height: 1; color: #fff; font-variant-numeric: tabular-nums; }
#cb-panel .side .num .of { font-size: 13px; color: #8fa3b8; }
#cb-panel .side .hp { grid-column: 1 / -1; height: 10px; border-radius: 5px; background: #1a2532; overflow: hidden; }
#cb-panel .side .hp i { display: block; height: 100%; width: 100%; border-radius: 5px; transition: width .9s linear; }
#cb-panel .side.me .hp i { background: #4ea3ff; } #cb-panel .side.foe .hp i { background: #ff6b6b; }
#cb-panel .side.low .hp i { background: #f2b33d; }
#cb-panel .side .hpt { grid-column: 1 / -1; font-size: 13px; color: #b8c7d6; font-variant-numeric: tabular-nums; min-height: 18px; display: flex; align-items: center; }
#cb-panel .bt-time { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; min-height: 28px; }
#cb-panel .bt-time .lbl { font-size: 13px; font-weight: 700; color: #8fa3b8; }
#cb-panel .bt-time .bar { height: 10px; border-radius: 5px; background: #1a2532; overflow: hidden; }
#cb-panel .bt-time .bar i { display: block; height: 100%; width: 0; background: #8fa3b8; transition: width .9s linear; }
#cb-panel .bt-time.late .bar i { background: #f2b33d; }
#cb-panel .bt-time .t { font-size: 14px; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; min-width: 92px; text-align: right; }
#cb-panel .bt-act { display: flex; }
#cb-panel .bt-act .stop { flex: 1; min-height: 44px; gap: 8px; font-size: 15px; font-weight: 800; background: #e9c46a; border-color: #e9c46a; color: #1b1405; }
#cb-panel .bt-act .stop:hover { filter: brightness(1.06); }
#cb-panel .bt-act .stop svg { width: 16px; height: 16px; fill: currentColor; flex: none; }
#cb-panel.running .err { font-size: 13px; }
#cb-toggle svg.ar { width: 12px; height: 12px; color: #9fd0ff; flex: none; }

/* ===== 스테이지 목록: 머리 줄 고정 + 목록만 스크롤 + 얇은 덧씌움 스크롤 막대 + 나가기 (2026-11-13 Yui) ===== */
#cb-menu .cb-box { overflow: hidden; display: flex; flex-direction: column; gap: 12px; }
#cb-menu .menu-head { flex: none; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: start; gap: 12px; }
#cb-menu .menu-head .ttl { grid-column: 2; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
#cb-menu .menu-x { grid-column: 3; justify-self: end; height: 36px; min-height: 36px; padding: 0 12px; gap: 6px; font-size: 14px; font-weight: 700; }
#cb-menu .menu-x svg { width: 14px; height: 14px; flex: none; }
#cb-menu .menu-list { position: relative; flex: 1 1 auto; min-height: 0; display: flex; }
#cb-menu .menu-list .stages { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; padding-right: 2px; }
#cb-menu .menu-list .stages::-webkit-scrollbar { display: none; }
#cb-menu .sthumb { position: absolute; right: -10px; top: 0; width: 4px; border-radius: 2px; background: rgba(200, 220, 240, .45); opacity: 0; transition: opacity .25s ease; pointer-events: none; }
#cb-menu .sthumb.on { opacity: 1; }
#cb-menu .menu-foot { flex: none; }
#cb-menu-open { position: fixed; left: 12px; top: 12px; z-index: 45; height: 40px; padding: 0 14px; gap: 8px; display: inline-flex; align-items: center; justify-content: center; font: 700 14px/1 var(--font, system-ui, "Apple SD Gothic Neo", sans-serif); color: #1b1405; background: #e9c46a; border: 1px solid #e9c46a; border-radius: 8px; cursor: pointer; box-shadow: 0 6px 18px rgba(0,0,0,.4); }
#cb-menu-open[hidden] { display: none; }
#cb-menu-open svg { width: 16px; height: 16px; flex: none; }
#cb-menu-open:hover { filter: brightness(1.06); }

/* ===== 스테이지 목록 포커스 테두리가 좌우·위아래에서 잘리지 않게 (2026-11-16 Yui, 충쌤 "활성화 빨간선 좌우 짤리내? 수정해")
   목록(.stages)은 스크롤 상자라 밖으로 나온 outline(2px + 띄움 3px = 5px)을 자른다. 안쪽 여백 6px을 주고 같은 만큼 바깥으로 넓혀 카드 자리는 그대로 */
#cb-menu .menu-list .stages { padding: 6px 8px 6px 6px; margin: -6px; scroll-padding-block: 6px; }
#cb-menu .stages button:focus-visible { outline-offset: 2px; }

/* ===== 제목 '휴먼vs스켈레톤'의 vs 양쪽 간격 맞춤 (2026-11-16 Yui, 충쌤 "여기 휴먼하고 vs 사이에 띄어쓰기도 수정해")
   Kenney Future 글자는 왼쪽 여백 0·오른쪽 여백 0.21em이라 '먼|v'는 붙고 's|스'만 벌어진다(34px에서 3.2px : 8.3px).
   v·V 두 글자만 0.15em 오른쪽으로 옮긴 글꼴(fonts/KenneyFuture-vs.ttf, 1.8KB)을 v·V 에만 씌움. 글자는 그대로, 간격 8.3px : 8.3px */
@font-face { font-family: 'Kenney Future VS'; src: url('fonts/KenneyFuture-vs.ttf') format('truetype'); unicode-range: U+0056, U+0076; font-display: swap; }
#cb-menu h1 { font-family: 'Kenney Future VS', 'Kenney Future', var(--font); }
