/* =========================================================
   투회말 구아웃 (Nine Outs) — 스타일
   테마: html[data-theme] = ground(기본) | night | day | classic | team
   글자 크기: html[data-font] = s(12.5px) | m(14px) | l(16px) — 글자 크기는 rem(1rem = 14px 기준)으로 써서 설정을 따른다   ·  밀도: html[data-density] = cozy | compact
   ========================================================= */

/* ---------- 테마 토큰 ---------- */
:root, [data-theme="ground"] {
  --bg: #0d1712; --bg2: #0a120e; --panel: #142019; --panel2: #1a2a21; --hover: #20342a; --line: #263c30; --line2: #1e3027;
  --text: #e6efe9; --muted: #8ea698; --faint: #5f7468;
  --accent: #3ccf7a; --on-accent: #052012; --accent2: #f2c94c; --bad: #ff6b6b; --info: #6cc4ff;
  --sidebar: #08100c; --sunken: #0a130e; --shadow: 0 1px 2px rgba(0,0,0,.35), 0 6px 18px rgba(0,0,0,.18);
  --r1: #e07070; --r2: #d8b45a; --r3: #cfe8de; --r4: #62d896; --r5: #45e6ff;
  --award-fg: #ffd77a; --award-bg: #2a2410; --award-line: #8a6d1d;
  color-scheme: dark;
}
/* === 명장면 도감 카드 아트 === */
.moment-art { position: relative; height: 112px; margin: -12px -12px 10px; overflow: hidden; border-radius: 10px 10px 4px 4px; background: radial-gradient(circle at 70% 30%, color-mix(in srgb, var(--team) 42%, transparent), transparent 42%), linear-gradient(145deg, color-mix(in srgb, var(--team) 32%, #101725), #0b101a); }
.moment-art svg { width: 100%; height: 100%; }
.moment-art span { position: absolute; right: 10px; bottom: 7px; color: rgba(255,255,255,.78); font-size: .64em; font-weight: 900; letter-spacing: .2em; }
.ma-field { fill: color-mix(in srgb, var(--team) 18%, transparent); stroke: rgba(255,255,255,.3); stroke-width: 2; }
.ma-lines, .ma-trail, .ma-streak { fill: none; stroke: rgba(255,255,255,.72); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.ma-trail { stroke-dasharray: 6 5; }
.ma-ball { fill: #f7f3e7; stroke: #d75353; stroke-width: 2; filter: drop-shadow(0 2px 5px rgba(0,0,0,.45)); }
.ma-crown { fill: #ffd35a; stroke: #fff0aa; stroke-width: 2; filter: drop-shadow(0 0 9px rgba(255,211,90,.55)); }
.ma-star { fill: #ffd35a; stroke: #fff0aa; stroke-width: 2; }
.ma-streak { stroke: #7ff5c1; stroke-width: 5; filter: drop-shadow(0 0 5px rgba(127,245,193,.45)); }
.mcard.r-legend .moment-art { box-shadow: inset 0 -2px 0 #ffd35a; }
.mcard.r-hero .moment-art { box-shadow: inset 0 -2px 0 #bc82ff; }

[data-theme="night"] {
  --bg: #0a0f1d; --bg2: #070b16; --panel: #111a2e; --panel2: #172238; --hover: #1d2a45; --line: #24314f; --line2: #1b2742;
  --text: #e7ecf8; --muted: #8b99b9; --faint: #5d6a88;
  --accent: #4c8dff; --on-accent: #fff; --accent2: #ffcf4d; --bad: #ff6b7a; --info: #7fd1ff;
  --sidebar: #060a14; --sunken: #0b1222; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 22px rgba(0,0,0,.25);
  --r1: #ff7d8a; --r2: #e8be5c; --r3: #d5ddf0; --r4: #6fd7a0; --r5: #6fc8ff;
  --award-fg: #ffd77a; --award-bg: #2a2410; --award-line: #8a6d1d;
  color-scheme: dark;
}
[data-theme="classic"] {
  --bg: #1a1c21; --bg2: #15171b; --panel: #23262d; --panel2: #2b2f37; --hover: #333844; --line: #393e49; --line2: #2f333c;
  --text: #eceef2; --muted: #9ba2ae; --faint: #6c7380;
  --accent: #f2a12b; --on-accent: #241500; --accent2: #5bc0eb; --bad: #ff6b6b; --info: #5bc0eb;
  --sidebar: #131519; --sunken: #17191d; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 18px rgba(0,0,0,.2);
  --r1: #ef7a7a; --r2: #e1b65d; --r3: #e3e6eb; --r4: #79d39b; --r5: #63d2ff;
  --award-fg: #ffd77a; --award-bg: #2e2612; --award-line: #8a6d1d;
  color-scheme: dark;
}
[data-theme="day"] {
  --bg: #eef2ef; --bg2: #e6ebe7; --panel: #ffffff; --panel2: #f3f6f4; --hover: #e9f0eb; --line: #d8e0db; --line2: #e6ece8;
  --text: #17231c; --muted: #5f7067; --faint: #94a29a;
  --accent: #178a4a; --on-accent: #fff; --accent2: #b97d00; --bad: #d23d3d; --info: #1b6fb8;
  --sidebar: #102018; --sunken: #f6f8f7; --shadow: 0 1px 2px rgba(20,40,30,.06), 0 6px 18px rgba(20,40,30,.06);
  --r1: #c43c3c; --r2: #b07a00; --r3: #40524a; --r4: #128a46; --r5: #0a6fc2;
  --award-fg: #7a5600; --award-bg: #fff3d1; --award-line: #e6c56a;
  color-scheme: light;
}
[data-theme="team"] {
  --bg: #111316; --bg2: #0c0e10; --panel: #191c21; --panel2: #20242a; --hover: #282d35; --line: #2f343c; --line2: #252930;
  --text: #eef0f3; --muted: #99a1ac; --faint: #6b727d;
  --accent: var(--team); --on-accent: #fff; --accent2: #f2c94c; --bad: #ff6b6b; --info: #6cc4ff;
  --sidebar: #0a0b0d; --sunken: #0e1013; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 18px rgba(0,0,0,.22);
  --r1: #ef7a7a; --r2: #e1b65d; --r3: #e3e6eb; --r4: #79d39b; --r5: #63d2ff;
  --award-fg: #ffd77a; --award-bg: #2a2410; --award-line: #8a6d1d;
  color-scheme: dark;
}
:root {
  --team: #3ccf7a;
  --radius: 12px; --radius-s: 8px;
  --pad: 16px; --cell-y: 6px; --cell-x: 8px;
  --fs: 14px;
  --tint: color-mix(in srgb, var(--accent) 12%, transparent);
  --tint2: color-mix(in srgb, var(--accent) 22%, transparent);
  --team-tint: color-mix(in srgb, var(--team) 18%, transparent);
  font-family: "Pretendard", "Pretendard Variable", "Malgun Gothic", "Apple SD Gothic Neo", system-ui, -apple-system, "Segoe UI", sans-serif;
}
[data-font="s"] { --fs: 12.5px; }
[data-font="l"] { --fs: 16px; }
[data-density="compact"] { --pad: 12px; --cell-y: 3px; --cell-x: 6px; }

/* ---------- 기본 ---------- */
* { box-sizing: border-box; }
html { background: var(--bg); }
html { font-size: var(--fs); }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 1rem; line-height: 1.45; -webkit-font-smoothing: antialiased; word-break: keep-all; overflow-wrap: break-word; }
::selection { background: var(--tint2); }
h1, h2, h3 { margin: 0 0 12px; letter-spacing: -0.01em; }
h1 { font-weight: 800; }
h2 { font-size: 1.22em; font-weight: 750; }
h3 { font-size: 1.02em; font-weight: 650; color: var(--muted); }
a { color: var(--accent); }
.small { font-size: .86em; }
code { background: var(--sunken); border: 1px solid var(--line2); padding: 1px 5px; border-radius: 5px; font-size: .9em; }

/* 스크롤바 */
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--line); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--faint); background-clip: padding-box; border: 2px solid transparent; }
*::-webkit-scrollbar-track { background: transparent; }

/* ---------- 컨트롤 ---------- */
button { font: inherit; cursor: pointer; border: 1px solid var(--line); background: var(--panel2); color: var(--text); padding: 6px 12px; border-radius: var(--radius-s); transition: background .15s, border-color .15s, transform .05s, box-shadow .15s; }
button:hover:not(:disabled) { border-color: var(--accent); background: var(--hover); }
button:active:not(:disabled) { transform: translateY(1px); }
button:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
button:disabled { opacity: .55; cursor: default; }
button.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 700; box-shadow: 0 2px 10px var(--tint2); }
button.primary:hover:not(:disabled) { background: var(--accent); filter: brightness(1.08); }
button.danger { border-color: color-mix(in srgb, var(--bad) 55%, var(--line)); color: var(--bad); background: transparent; }
button.danger:hover:not(:disabled) { background: color-mix(in srgb, var(--bad) 12%, transparent); border-color: var(--bad); }
button.small { padding: 2px 9px; font-size: .86em; border-radius: 6px; }
select, input, textarea { font: inherit; background: var(--sunken); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 5px 9px; transition: border-color .15s; }
select:hover, input:hover, textarea:hover { border-color: var(--faint); }
input[type=color] { padding: 2px; width: 44px; height: 32px; cursor: pointer; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 15px; height: 15px; vertical-align: -2px; }
input[type=range] { accent-color: var(--accent); padding: 0; border: 0; background: transparent; }
textarea { resize: vertical; }
label { cursor: pointer; }

/* ---------- 레이아웃 ---------- */
.layout { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.sidebar { background: var(--sidebar); border-right: 1px solid var(--line2); padding: 16px 10px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
/* 왼쪽 메뉴 접기 · 펼치기 */
.layout { transition: grid-template-columns .18s ease; }
.side-toggle { align-self: flex-end; border: 0; background: rgba(255,255,255,.06); color: #c9d4ce; border-radius: var(--radius-s); width: 28px; height: 24px; padding: 0; line-height: 1; margin: -8px -2px 4px 0; }
.side-toggle:hover:not(:disabled) { background: rgba(255,255,255,.14); border: 0; }
.layout.side-min { grid-template-columns: 60px 1fr; }
.side-min .sidebar { padding: 16px 6px; }
.side-min .side-toggle { align-self: center; margin: -8px 0 8px; }
.side-min .brand { justify-content: center; padding: 4px 0 14px; }
.side-min .brand > div, .side-min .nl { display: none; }
.side-min .nav button { justify-content: center; padding: 8px 0; font-size: 1.15em; }
.side-min .nav button.active::before { left: -6px; }
.side-min .nav .pill { position: absolute; top: 0; right: 0; margin: 0; font-size: 0.714rem; padding: 0 5px; }
.side-min .live-nav { margin-bottom: 4px; }
.side-min .side-foot { padding: 12px 0 0; }
.side-min .side-foot button { padding: 6px 0; }
.brand { display: flex; gap: 10px; align-items: center; padding: 4px 8px 18px; margin-bottom: 8px; border-bottom: 1px solid var(--line2); }
.brand b { display: block; font-size: 1.05em; color: #fff; }
[data-theme="day"] .brand b { color: #fff; }
.brand small { color: #9fb0a7; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav button { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: 0; border-radius: var(--radius-s); background: none; padding: 8px 12px; color: #c9d4ce; position: relative; }
[data-theme="night"] .nav button { color: #c4cde2; }
[data-theme="classic"] .nav button, [data-theme="team"] .nav button { color: #cfd3da; }
.nav button:hover:not(:disabled) { background: rgba(255,255,255,.06); border: 0; }
.nav button.active { background: color-mix(in srgb, var(--team) 26%, transparent); color: #fff; font-weight: 700; }
.nav button.active::before { content: ''; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--team); }
.side-foot { margin-top: auto; padding: 12px 6px 0; border-top: 1px solid var(--line2); display: flex; gap: 6px; flex-wrap: wrap; }
.side-foot button { flex: 1; font-size: .85em; background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.08); color: #c9d4ce; }
.pill { background: color-mix(in srgb, var(--bad) 72%, #000); color: #fff; border-radius: 10px; padding: 0 7px; font-size: 0.786rem; margin-left: auto; font-weight: 700; }
.main { padding: 0 28px 48px; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 0; border-bottom: 1px solid var(--line2); margin-bottom: 18px; position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.topbar .info { flex: 1; min-width: 260px; }
.topbar .info b { font-size: 1.12em; }
.topbar .info span { color: var(--muted); margin-left: 10px; white-space: nowrap; display: inline-block; }
.money-pv { font-size: .82em; color: var(--muted); min-width: 64px; display: inline-block; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); }
.grid.grid-wide { grid-template-columns: repeat(auto-fit, minmax(min(100%, 540px), 1fr)); } /* 설명이 긴 표 두 장: 좁으면 위아래로 */
.grid3 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line2); border-radius: var(--radius); padding: var(--pad); margin-bottom: 0; box-shadow: var(--shadow); }
.card + .card { margin-top: 0; }
.card.wide { grid-column: 1 / -1; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card > h3:first-child { text-transform: none; font-size: .95em; letter-spacing: .01em; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.muted { color: var(--muted); }
.spacer { flex: 1; }
.b { font-weight: 700; }
.W { color: var(--accent); font-weight: 700; } .L { color: var(--bad); font-weight: 700; } .T { color: var(--muted); }
.ok { color: var(--accent); } .err { color: var(--bad); }

/* ---------- 배지 · 엠블럼 ---------- */
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 0.786rem; font-weight: 600; background: var(--panel2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.badge.f { color: var(--accent2); border-color: color-mix(in srgb, var(--accent2) 60%, transparent); background: color-mix(in srgb, var(--accent2) 10%, transparent); }
.badge.inj { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 60%, transparent); background: color-mix(in srgb, var(--bad) 10%, transparent); }
.badge.ok { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 60%, transparent); background: var(--tint); }
.badge.dim { opacity: .5; }
.badge.award { color: var(--award-fg); border-color: var(--award-line); background: var(--award-bg); margin: 2px; }
.teamdot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.emblem { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; border: 3px solid; flex: none; box-shadow: 0 0 0 2px rgba(0,0,0,.25), 0 3px 10px rgba(0,0,0,.25); }
.emblem.mini { width: 22px; height: 22px; font-size: 12px; line-height: 1; border-width: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.2); margin-right: 6px; vertical-align: middle; }
td .emblem.mini { margin-top: -2px; }
.num { display: inline-block; min-width: 36px; padding: 2px 8px; margin-right: 8px; border-radius: 8px; background: var(--team); color: #fff; text-align: center; font-weight: 800; text-shadow: 0 1px 2px rgba(0,0,0,.35); }

/* ---------- 홈 ---------- */
.banner { background: linear-gradient(110deg, color-mix(in srgb, var(--accent2) 18%, var(--panel)), var(--panel) 70%); border: 1px solid color-mix(in srgb, var(--accent2) 55%, transparent); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; box-shadow: var(--shadow); }
.hero { margin-bottom: 16px; position: relative; overflow: hidden; background: linear-gradient(115deg, color-mix(in srgb, var(--team) 32%, var(--panel)) 0%, var(--panel) 62%); border-color: color-mix(in srgb, var(--team) 40%, var(--line2)); }
.hero::after { content: ''; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--team) 25%, transparent), transparent 70%); pointer-events: none; }
.hero h1 { font-size: 1.7em; }
.kpis { display: flex; gap: 10px; flex-wrap: wrap; position: relative; z-index: 1; }
.kpis div { text-align: right; background: color-mix(in srgb, var(--bg) 55%, transparent); border: 1px solid var(--line2); border-radius: 10px; padding: 8px 12px; min-width: 104px; }
.kpis small { display: block; color: var(--muted); font-size: 0.786rem; }
.kpis b { font-size: 1.22em; }
.todo { margin-bottom: 16px; border-color: color-mix(in srgb, var(--accent2) 60%, transparent); }
/* 받은 편지함 메시지 카드 */
.msg { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 12px; padding: 12px 14px; margin-top: 8px; background: var(--sunken); border: 1px solid var(--line2); border-left: 3px solid var(--line); border-radius: var(--radius-s); }
.msg.pending { border-left-color: var(--accent2); }
.msg.done { opacity: .85; }
.msg-ic { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--panel2); color: var(--muted); font-size: 18px; }
.msg.pending .msg-ic { color: var(--accent2); background: color-mix(in srgb, var(--accent2) 14%, var(--panel)); }
.msg-ic svg.ic { width: 20px; height: 20px; vertical-align: 0; }
.msg-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.msg-title { font-size: 1.02em; }
.msg-tag { font-size: 0.786rem; padding: 1px 8px; border-radius: 999px; background: var(--panel2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.msg-tag.warn { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 50%, transparent); }
.msg-due { font-size: 0.786rem; font-weight: 700; color: var(--accent2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.msg-due.urgent { color: var(--bad); }
.msg-date { font-size: 0.857rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.msg-body { margin-top: 4px; white-space: pre-line; color: var(--text); line-height: 1.55; }
.msg-choices { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.msg-choices button { padding: 7px 14px; border-radius: 10px; }
.msg-choices button:hover { border-color: var(--accent); }
.msg-result { margin-top: 8px; padding: 6px 10px; border-radius: 8px; background: var(--tint); color: var(--text); font-size: .93em; }
@media (max-width: 700px) { .msg { grid-template-columns: 30px minmax(0, 1fr); gap: 10px; padding: 10px; } .msg-ic { width: 30px; height: 30px; font-size: 15px; } .msg-choices button { flex: 1 1 auto; } }
.newslist div { padding: 6px 0; border-bottom: 1px solid var(--line2); }
.newslist div:last-child { border-bottom: 0; }
.newslist div.mine { color: var(--text); font-weight: 600; }
.newslist div:not(.mine) { color: var(--muted); }
.vs { font-size: 1.3em; gap: 10px; }
.decision { background: color-mix(in srgb, var(--accent2) 12%, var(--panel)); border: 1px solid color-mix(in srgb, var(--accent2) 60%, transparent); border-radius: var(--radius); padding: 12px 14px; margin-top: 12px; }

/* ---------- 탭 (세그먼트) ---------- */
.tabs { display: inline-flex; gap: 2px; flex-wrap: wrap; margin-bottom: 14px; padding: 3px; background: var(--sunken); border: 1px solid var(--line2); border-radius: 10px; }
.tabs button { border: 0; border-radius: 8px; background: transparent; color: var(--muted); padding: 5px 13px; }
.tabs button:hover:not(:disabled) { background: var(--hover); border: 0; color: var(--text); }
.tabs button.active { background: var(--panel); color: var(--text); font-weight: 700; box-shadow: 0 1px 3px rgba(0,0,0,.18), inset 0 -2px 0 var(--team); }
.radio { display: inline-flex; gap: 6px; align-items: center; margin-right: 14px; }
.small-list { margin: 6px 0 0; padding-left: 18px; font-size: .86em; color: var(--muted); }
.small-list li { margin: 2px 0; }
.timeline div { padding: 6px 0 6px 12px; border-left: 2px solid var(--team); margin-left: 4px; position: relative; }
.timeline div::before { content: ''; position: absolute; left: -5px; top: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--team); }
.retired-num { display: flex; gap: 10px; align-items: center; padding: 4px 0; }
.retired-num b { font-size: 1.714rem; color: var(--accent2); min-width: 44px; text-align: center; font-weight: 900; }

/* ---------- 등급 ---------- */
.grade { display: inline-block; min-width: 28px; text-align: center; padding: 1px 5px; border-radius: 6px; font-weight: 800; font-size: 0.857rem; letter-spacing: .02em; }
.g-s { background: linear-gradient(135deg, #8a3cf0, #5b25c4); color: #fff; } .g-a { background: #1f8f4e; color: #fff; } .g-b { background: #2d6fb5; color: #fff; } .g-c { background: #77733c; color: #fff; } .g-d { background: #6a3030; color: #f1dada; }

/* ---------- 표 ---------- */
table { width: 100%; border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; }
th, td { padding: var(--cell-y) var(--cell-x); border-bottom: 1px solid var(--line2); text-align: right; white-space: nowrap; }
th { color: var(--muted); font-weight: 650; font-size: .82em; position: sticky; top: 0; background: var(--panel); z-index: 1; border-bottom: 1px solid var(--line); letter-spacing: .02em; }
td.l, th.l { text-align: left; }
tbody tr:nth-child(even) td, table tr:nth-child(even) td { background: color-mix(in srgb, var(--panel2) 45%, transparent); }
table tr:hover td { background: var(--hover); }
tr.me td { background: var(--team-tint) !important; }
tr.me td:first-child { box-shadow: inset 3px 0 0 var(--team); }
tr.cutline td { border-bottom: 2px solid color-mix(in srgb, var(--accent2) 70%, transparent); }
tr.click { cursor: pointer; }
.tablewrap { overflow-x: auto; border-radius: var(--radius-s); }
.r1 { color: var(--r1); } .r2 { color: var(--r2); } .r3 { color: var(--r3); } .r4 { color: var(--r4); } .r5 { color: var(--r5); font-weight: 800; }
.link { color: var(--text); cursor: pointer; text-decoration: underline dotted color-mix(in srgb, var(--muted) 70%, transparent); text-underline-offset: 3px; }
.link:hover { color: var(--accent); text-decoration-color: var(--accent); }
.bar { height: 8px; background: var(--sunken); border: 1px solid var(--line2); border-radius: 6px; overflow: hidden; width: 110px; display: inline-block; vertical-align: middle; margin-left: 6px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 70%, transparent), var(--accent)); border-radius: 6px; }
.small-bar { width: 50px; }

/* ---------- 시작 화면 ---------- */
.start { max-width: 1080px; margin: 0 auto; padding: 48px 20px; }
.start h1 { font-size: 2.3em; background: linear-gradient(90deg, var(--text), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.start > p { font-size: 1.05em; }
.start .card { margin-bottom: 16px; }
.teams { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin: 12px 0; }
.teamcard { text-align: left; padding: 12px; border-radius: var(--radius); border: 2px solid var(--line2); background: var(--panel2); transition: transform .12s, border-color .15s, box-shadow .15s; }
.teamcard:hover:not(:disabled) { transform: translateY(-2px); box-shadow: var(--shadow); }
.teamcard.sel { border-color: var(--accent); background: var(--tint); box-shadow: 0 0 0 3px var(--tint); }
.teamcard b { display: block; font-size: 1.05em; }
.theme-mini { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- 테마 선택 ---------- */
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 8px 0 14px; }
.themecard { padding: 0; overflow: hidden; text-align: left; border: 2px solid var(--line2); background: var(--panel2); border-radius: var(--radius); }
.themecard.sel { border-color: var(--accent); box-shadow: 0 0 0 3px var(--tint); }
.themecard .sw { display: grid; grid-template-columns: 26px 1fr; height: 62px; }
.themecard .sw i { display: block; }
.themecard .sw .pv { padding: 8px; display: flex; flex-direction: column; gap: 5px; }
.themecard .sw .pv span { display: block; height: 7px; border-radius: 4px; }
.themecard b { display: block; padding: 7px 10px 0; }
.themecard small { display: block; padding: 0 10px 8px; color: var(--muted); }
.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--sunken); border: 1px solid var(--line2); border-radius: 10px; }
.seg button { border: 0; background: transparent; color: var(--muted); padding: 4px 12px; border-radius: 8px; }
.seg button.on { background: var(--panel); color: var(--text); font-weight: 700; box-shadow: 0 1px 3px rgba(0,0,0,.18); }
.seg.fx-themes { display: flex; flex-wrap: wrap; width: fit-content; max-width: 100%; }
.seg.fx-themes button { flex: 0 0 auto; }

/* ---------- 설정: 진행 · 중계 공통 옵션 레이아웃 ---------- */
.settings-grid { align-items: start; gap: 14px; }
.settings-card { padding: 0; overflow: hidden; }
.settings-card > h2 { display: flex; align-items: center; gap: 8px; margin: 0; padding: 14px 16px 12px; border-bottom: 1px solid var(--line2); background: color-mix(in srgb, var(--panel2) 42%, transparent); font-size: 1.05em; }
.settings-card > h2 .ic { color: var(--team); }
.settings-intro { margin: 0; padding: 11px 16px 12px; border-bottom: 1px solid var(--line2); color: var(--muted); line-height: 1.5; }
.setting-list { display: grid; }
.setting-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 16px; min-height: 58px; padding: 11px 16px; border-top: 1px solid var(--line2); }
.setting-list > .setting-item:first-child { border-top: 0; }
.setting-copy { min-width: 0; }
.setting-copy > b, .setting-copy > small { display: block; }
.setting-copy > b { font-size: .94em; }
.setting-copy > small { margin-top: 3px; color: var(--muted); font-size: .82em; line-height: 1.4; }
.setting-control { display: flex; align-items: center; justify-content: flex-end; max-width: 100%; }
.setting-control select { max-width: min(100%, 320px); }
.setting-check { cursor: pointer; }
.setting-check > input { width: 18px; height: 18px; accent-color: var(--team); }
.settings-note, .settings-foot { margin: 0; padding: 10px 16px; border-top: 1px solid var(--line2); background: var(--sunken); color: var(--muted); font-size: .82em; line-height: 1.45; }
.settings-foot code { color: var(--text); }
.setting-block { padding: 12px 16px 14px; }
.setting-block + .setting-list { border-top: 1px solid var(--line2); }
.setting-block-title { display: block; margin-bottom: 9px; font-size: .9em; }
.setting-radio-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; }
.setting-radio-grid .radio { align-items: flex-start; gap: 8px; margin: 0; padding: 9px 10px; border: 1px solid var(--line2); border-radius: 8px; background: var(--sunken); cursor: pointer; }
.setting-radio-grid .radio:has(input:checked) { border-color: var(--team); background: color-mix(in srgb, var(--team) 10%, var(--sunken)); }
.setting-radio-grid .radio span, .setting-radio-grid .radio b, .setting-radio-grid .radio small { display: block; }
.setting-radio-grid .radio small { margin-top: 2px; color: var(--muted); font-size: .78em; line-height: 1.35; }
.setting-talk { border-top: 1px solid var(--line2); }
.setting-talk .talk-mode-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 16px; min-height: 58px; margin: 0; padding: 11px 16px; }
.setting-talk .talk-mode-row > .muted { color: var(--text); font-size: .94em; font-weight: 700; }
.setting-talk > small { display: block; margin: -8px 16px 11px; color: var(--muted); font-size: .82em; line-height: 1.4; }
.settings-guide { margin: 0; padding: 10px 16px 12px 34px; border-top: 1px solid var(--line2); background: var(--sunken); }
.scorebug-settings .sbp-grid { margin: 0; }
.settings-card .fx-preview-grid { margin: 0; }
@media (max-width: 700px) {
  .settings-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .settings-card > h2 { padding: 12px 13px 10px; }
  .settings-intro, .settings-note, .settings-foot { padding-left: 13px; padding-right: 13px; }
  .setting-item { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 11px 13px; }
  .setting-control { width: 100%; justify-content: flex-start; }
  .setting-control > .seg { display: grid; grid-auto-flow: column; width: 100%; }
  .setting-control > .seg button { min-width: 0; padding-left: 8px; padding-right: 8px; }
  .setting-control select { width: 100%; max-width: none; }
  .setting-check { grid-template-columns: minmax(0, 1fr) auto; }
  .setting-block { padding: 11px 13px 13px; }
  .setting-radio-grid { grid-template-columns: minmax(0, 1fr); }
  .setting-talk .talk-mode-row { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 11px 13px; }
  .setting-talk .talk-mode-row .seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
  .setting-talk .talk-mode-row .seg button { min-width: 0; padding-left: 6px; padding-right: 6px; }
  .setting-talk > small { margin-left: 13px; margin-right: 13px; }
  .settings-guide { padding-left: 31px; padding-right: 13px; }
}

/* ---------- 설정: 4D 연출 미리보기 ---------- */
.fx-preview-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 10px; margin: 12px 0 4px; }
.fx-preview { display: block; min-width: 0; height: auto; padding: 0; overflow: hidden; text-align: left; white-space: normal; color: var(--text); border: 1px solid var(--line2); border-radius: var(--radius); background: var(--panel2); }
.fx-preview:hover:not(:disabled) { border-color: color-mix(in srgb, var(--fx-b) 72%, var(--line)); transform: translateY(-1px); box-shadow: 0 8px 22px color-mix(in srgb, var(--fx-b) 13%, transparent); }
.fx-preview.selected { border-color: var(--fx-b); box-shadow: 0 0 0 2px color-mix(in srgb, var(--fx-b) 30%, transparent); }
.fx-preview-scene { position: relative; display: block; height: 92px; overflow: hidden; background: radial-gradient(circle at 72% 38%, color-mix(in srgb, var(--fx-c) 24%, transparent), transparent 28%), linear-gradient(145deg, #121c32, #050812 72%); }
.fx-preview-scene::after { content: ''; position: absolute; inset: auto -10% -42% 35%; height: 85%; border: 1px solid color-mix(in srgb, var(--fx-b) 45%, transparent); border-radius: 50%; transform: rotate(-8deg); box-shadow: 0 0 16px color-mix(in srgb, var(--fx-b) 14%, transparent); }
.fx-stars { position: absolute; inset: 0; opacity: .55; background-image: radial-gradient(circle, #fff 0 1px, transparent 1.4px), radial-gradient(circle, var(--fx-b) 0 1px, transparent 1.4px); background-position: 7px 12px, 28px 5px; background-size: 34px 27px, 51px 39px; }
.fx-field { position: absolute; right: 15%; bottom: -21px; width: 72px; height: 72px; border: 1px solid color-mix(in srgb, var(--fx-a) 38%, transparent); transform: rotate(45deg) skew(-8deg, -8deg); }
.fx-trail { position: absolute; left: 16%; top: 53%; width: 57%; height: 4px; border-radius: 999px; transform: rotate(-19deg); transform-origin: right center; background: linear-gradient(90deg, transparent, var(--fx-c) 26%, var(--fx-b) 72%, var(--fx-a)); box-shadow: 0 0 6px var(--fx-b), 0 0 15px color-mix(in srgb, var(--fx-c) 70%, transparent); animation: fxTrail 1.8s ease-in-out infinite; }
.fx-ball { position: absolute; left: 68%; top: 31%; width: 7px; height: 7px; border-radius: 50%; background: var(--fx-a); box-shadow: 0 0 5px 2px var(--fx-b), 0 0 14px 5px color-mix(in srgb, var(--fx-c) 58%, transparent); animation: fxBall 1.8s ease-in-out infinite; }
.fx-impact { position: absolute; right: 17%; top: 19%; width: 28px; height: 28px; border: 2px solid var(--fx-c); border-radius: 50%; box-shadow: 0 0 9px var(--fx-b), inset 0 0 8px color-mix(in srgb, var(--fx-b) 55%, transparent); animation: fxImpact 1.8s ease-out infinite; }
.fx-bot { position: absolute; bottom: 12px; z-index: 2; width: 14px; height: 18px; border: 2px solid var(--fx-a); border-radius: 4px 4px 2px 2px; background: color-mix(in srgb, var(--fx-b) 30%, #101827); box-shadow: 0 0 7px color-mix(in srgb, var(--fx-b) 62%, transparent); }
.fx-bot::before { content: ''; position: absolute; left: 3px; top: 4px; width: 4px; height: 2px; border-radius: 2px; background: var(--fx-c); box-shadow: 0 0 4px var(--fx-c); }
.fx-bot-a { left: 12%; }.fx-bot-b { right: 12%; transform: scale(.82); opacity: .75; }
.fx-preview-copy { display: block; padding: 9px 10px 10px; }
.fx-preview-copy b { display: flex; align-items: center; gap: 5px; }
.fx-preview-copy b .ic { color: var(--fx-b); }
.fx-preview-copy small { display: block; margin-top: 2px; color: var(--muted); font-weight: 500; line-height: 1.35; }
.fx-glitch .fx-trail, .fx-glitch .fx-ball { animation-timing-function: steps(4, end); }
.fx-glitch .fx-preview-scene { background-image: repeating-linear-gradient(0deg, transparent 0 7px, rgba(255,255,255,.035) 8px), radial-gradient(circle at 72% 38%, color-mix(in srgb, var(--fx-c) 24%, transparent), transparent 28%), linear-gradient(145deg, #121c32, #050812 72%); }
.fx-cosmic .fx-stars { animation: fxStars 3.4s linear infinite; }
.fx-frost .fx-preview-scene { background: radial-gradient(circle at 72% 38%, color-mix(in srgb, var(--fx-a) 28%, transparent), transparent 30%), linear-gradient(145deg, #18334b, #07111f 72%); }
.fx-frost .fx-trail { height: 6px; filter: blur(.4px); animation-duration: 2.35s; }
.fx-frost .fx-impact { border-style: double; animation-duration: 2.25s; }
.fx-volt .fx-trail { height: 3px; transform: rotate(-19deg) skewX(-18deg); animation-duration: 1.05s; animation-timing-function: steps(6, end); }
.fx-volt .fx-ball, .fx-volt .fx-impact { animation-duration: 1.05s; animation-timing-function: steps(6, end); }
.fx-volt .fx-impact { box-shadow: 0 0 5px var(--fx-a), 0 0 17px var(--fx-b), inset 0 0 8px var(--fx-c); }
.fx-retro .fx-preview-scene { background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(145deg, #172333, #080b12 72%); background-size: 9px 9px, 9px 9px, auto; }
.fx-retro .fx-trail, .fx-retro .fx-ball, .fx-retro .fx-impact { animation-timing-function: steps(5, end); }
.fx-retro .fx-trail { height: 7px; border-radius: 0; box-shadow: 7px 0 0 var(--fx-c), 14px 0 0 var(--fx-b); }
.fx-retro .fx-ball { width: 8px; height: 8px; border-radius: 1px; }
.fx-retro .fx-impact { border-radius: 2px; transform: rotate(45deg); }
.fx-off .fx-trail, .fx-off .fx-impact { display: none; }
.fx-off .fx-ball { left: 52%; top: 45%; opacity: .55; box-shadow: none; animation: none; }
.fx-off .fx-preview-scene { filter: saturate(.35); }
@keyframes fxBall { 0%, 15% { transform: translate(-68px, 28px) scale(.75); opacity: 0; } 28% { opacity: 1; } 70%, 100% { transform: translate(0, 0) scale(1); } }
@keyframes fxTrail { 0%, 15% { opacity: 0; clip-path: inset(0 0 0 100%); } 35% { opacity: 1; } 72% { clip-path: inset(0 0 0 0); } 100% { opacity: 0; } }
@keyframes fxImpact { 0%, 65% { transform: scale(.15); opacity: 0; } 72% { opacity: 1; } 100% { transform: scale(1.7); opacity: 0; } }
@keyframes fxStars { to { background-position: 41px 12px, 79px 5px; } }
@media (max-width: 700px) { .fx-preview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .fx-preview-scene { height: 80px; } .fx-preview-copy { padding: 8px; } }
@media (max-width: 390px) { .fx-preview-grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .fx-preview *, .fx-preview:hover { animation: none !important; transition: none !important; } }

/* ---------- 로봇 모듈 · 수리 ---------- */
.robot-module-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.robot-module { min-width: 0; padding: 10px; border: 1px solid var(--line2); border-radius: 9px; background: var(--sunken); }
.robot-module > b, .robot-module > span, .robot-module > small { display: block; }
.robot-module > span { margin-top: 4px; color: var(--accent); font-weight: 700; }
.robot-module > small { min-height: 2.7em; margin: 3px 0 8px; color: var(--muted); line-height: 1.35; }
.robot-module > div { display: flex; flex-wrap: wrap; gap: 4px; }
.robot-module button { height: auto; min-height: 28px; padding: 3px 7px; white-space: normal; }
.robot-repair { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line2); }
.robot-repair > small { flex-basis: 100%; }
@media (max-width: 760px) { .robot-module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 390px) { .robot-module-grid { grid-template-columns: 1fr; } }

/* ---------- 4D 배터리 · 코어 발열 HUD ---------- */
.f3d-card { position: relative; }
.robot-power-hud { position: absolute; z-index: 7; top: 12px; left: 12px; display: grid; grid-template-columns: auto minmax(130px, 1fr) minmax(130px, 1fr); align-items: center; gap: 7px; max-width: calc(100% - 80px); padding: 7px 9px; color: #eaf8ff; border: 1px solid rgba(100,220,255,.3); border-radius: 8px; background: rgba(4,10,20,.78); backdrop-filter: blur(7px); pointer-events: none; }
.robot-env { padding-right: 8px; color: #75e8ff; font-size: .78em; font-weight: 800; white-space: nowrap; }
.robot-hud-unit { display: grid; grid-template-columns: auto minmax(30px, 1fr); gap: 2px 5px; align-items: center; min-width: 0; font-size: .68em; }
.robot-hud-unit b { grid-column: 1 / -1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1.05em; }
.robot-hud-unit > span { color: #a9bac8; white-space: nowrap; }
.robot-hud-unit > i { display: block; width: 54px; height: 4px; overflow: hidden; border-radius: 3px; background: #253242; }
.robot-hud-unit > i em { display: block; height: 100%; background: linear-gradient(90deg, #29c7ff, #70ffcc); box-shadow: 0 0 5px #29c7ff; }
.robot-hud-unit > i.heat em { background: linear-gradient(90deg, #ffd44f, #ff4b36); box-shadow: 0 0 5px #ff6b40; }
.robot-hud-unit.warn { color: #ffad70; animation: robotWarn 1s ease-in-out infinite; }
@keyframes robotWarn { 50% { opacity: .65; } }
/* 기체 전력 표시는 중계 화면·투수·타자 줄을 가리지 않게 그 위에 따로 놓는다 (전체 화면 포함) */
.f3d-card .robot-power-hud { position: static; max-width: none; margin: 0 0 8px; }
.f3d-full .robot-power-hud { align-self: center; width: min(100%, 760px); margin-bottom: 6px; }
/* 전체 화면: 전력 표시가 차지하는 높이만큼 중계 화면을 줄여 아래 버튼이 밀려나지 않게 한다 */
.f3d-full:has(.robot-power-hud) .f3d-wrap { max-width: min(100%, calc((100vh - 200px) * 16 / 9)); max-width: min(100%, calc((100dvh - 200px) * 16 / 9)); }
/* 화면이 낮아 다 들어가지 않을 때 위쪽이 잘리지 않게 하고(스크롤), 세로로 짧은 휴대폰에서는 코어 온도 줄을 접는다 */
.f3d-full:has(.robot-power-hud) { justify-content: safe center; overflow-y: auto; }
@media (orientation: portrait) and (max-height: 700px) {
  .f3d-full .robot-power-hud { padding: 3px 7px; gap: 2px 7px; margin-bottom: 4px; }
  .f3d-full .robot-hud-unit > span:nth-of-type(2), .f3d-full .robot-hud-unit > i.heat { display: none; }
}
/* 가로로 눕힌 휴대폰 전체 화면: 높이가 모자라므로 한 줄로 납작하게 */
@media (orientation: landscape) and (max-height: 520px) {
  .f3d-full .robot-power-hud { grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr); padding: 3px 9px; margin-bottom: 3px; }
  .f3d-full .robot-env { grid-column: auto; padding-right: 8px; }
  .f3d-full .robot-hud-unit { display: flex; align-items: center; gap: 6px; }
  .f3d-full .robot-hud-unit b { max-width: 9em; }
  .f3d-full:has(.robot-power-hud) .f3d-wrap { max-width: min(100%, calc((100vh - 160px) * 16 / 9)); max-width: min(100%, calc((100dvh - 160px) * 16 / 9)); }
}
@media (max-width: 700px) { .robot-power-hud { top: 7px; left: 7px; grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: calc(100% - 54px); padding: 5px 7px; } .robot-env { grid-column: 1 / -1; padding: 0; } .robot-hud-unit > i { width: 38px; } }
@media (prefers-reduced-motion: reduce) { .robot-hud-unit.warn { animation: none; } }

/* ---------- 유니폼 미리보기 ---------- */
.uniform { display: flex; gap: 16px; margin-top: 16px; }
.jersey { width: 120px; height: 130px; border-radius: 20px 20px 10px 10px; background: var(--c2); border: 4px solid var(--c1); display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--c1); box-shadow: var(--shadow); }
.jersey.away { background: var(--c1); color: var(--c2); border-color: var(--c2); }
.jersey span { font-weight: 800; font-size: 14px; }
.jersey b { font-size: 34px; }

/* ---------- 경기 ---------- */
.scoreboard { border-radius: var(--radius-s); overflow: hidden; }
.scoreboard td, .scoreboard th { text-align: center; padding: 5px 7px; }
.scoreboard td.l, .scoreboard th.l { text-align: left; }
.scoreboard td.cur { outline: 2px solid var(--accent2); outline-offset: -2px; }
.livegrid { display: grid; grid-template-columns: 340px 1fr; gap: 16px; }
.diamond { position: relative; width: 160px; height: 160px; margin: 10px auto; }
.diamond .b { position: absolute; width: 30px; height: 30px; transform: rotate(45deg); border: 2px solid var(--muted); background: transparent; border-radius: 3px; transition: background .2s; }
.diamond .b.on { background: var(--accent2); border-color: var(--accent2); box-shadow: 0 0 12px color-mix(in srgb, var(--accent2) 60%, transparent); }
.diamond .b1 { right: 10px; top: 65px; } .diamond .b2 { left: 65px; top: 10px; } .diamond .b3 { left: 10px; top: 65px; }
.diamond .home { left: 65px; top: 120px; border-color: var(--text); }
.outs span { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--bad); margin-right: 4px; }
.outs span.on { background: var(--bad); }
.log { max-height: 560px; overflow-y: auto; font-size: .93em; }
.log div { padding: 4px 2px; border-bottom: 1px dashed var(--line2); }
.log .score { color: var(--accent2); font-weight: 700; }
.log .inning { color: var(--accent); font-weight: 700; margin-top: 6px; }
.log .change { color: var(--info); }
.log .event { color: #c58cf0; }
.log .final, .log .head { color: var(--text); font-weight: 800; }
.log .inning-end { color: var(--muted); }

/* ---------- 시각 QA 보정 ---------- */
/* 빈 목록 안내(한 칸짜리 행)는 줄바꿈 허용 */
td:only-child { white-space: normal; color: var(--muted); padding-top: 12px; padding-bottom: 12px; }
/* 왼쪽 정렬 텍스트 칸은 좁으면 줄바꿈 (이름·엠블럼·배지 칸은 한 줄 유지) */
td.l { white-space: normal; }
/* 줄바꿈 정리: 표의 첫 칸(항목 이름·구장 이름 등)은 한 줄로, 이름+배지·숫자 묶음은 갈라지지 않게 */
td.l:first-child:not(:only-child):not(:has(br, div, p)) { white-space: nowrap; }
.pl, .nw, .link { white-space: nowrap; }
.row.vs b { white-space: nowrap; }
td.l:has(> .link), td.l:has(> .emblem), td.l:has(> select), td.l:has(> input), td.l:has(> .grade) { white-space: nowrap; }
select { max-width: 100%; text-overflow: ellipsis; }
label.row { flex-wrap: nowrap; align-items: flex-start; }
label.row > input[type=checkbox] { margin-top: 2px; flex: none; }
table + h3, .tablewrap + h3, table + .muted + h3 { margin-top: 18px; }
.modal h3 { margin-top: 4px; }
input[type=file] { padding: 3px; color: var(--muted); max-width: 100%; }
input[type=file]::file-selector-button { font: inherit; border: 1px solid var(--line); background: var(--panel2); color: var(--text); padding: 4px 10px; border-radius: 6px; margin-right: 8px; cursor: pointer; }
input[type=file]::file-selector-button:hover { border-color: var(--accent); }
.fit-bad { color: var(--bad); font-weight: 700; }
.fit-warn { color: var(--accent2); }
.hint { font-size: .86em; color: var(--muted); }
.livegrid { grid-template-columns: minmax(340px, 380px) 1fr; }

/* ---------- UX: 상단 도구 · 진행 버튼 · 시뮬레이션 진행 · 정렬 · 용어 ---------- */
.topbar .tools { display: inline-flex; gap: 6px; align-items: center; }
.topbar .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; width: 100%; justify-content: flex-end; }
.topbar .actions:empty { display: none; }
@media (min-width: 1300px) { .topbar .actions { width: auto; } }
button.go { padding: 7px 18px; font-size: 1.02em; }
button.attn { border-color: color-mix(in srgb, var(--accent2) 70%, transparent); color: var(--accent2); background: color-mix(in srgb, var(--accent2) 10%, transparent); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 transparent; } 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent2) 22%, transparent); } }
.save-ind { font-size: .8em; color: var(--faint); min-width: 92px; text-align: right; }
/* 경기 진행 중 다른 메뉴 열람 */
.live-away { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 14px; border-radius: var(--r3, 10px); border: 1px solid var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--panel)); position: sticky; top: 0; z-index: 5; }
/* 클리닝타임 감독 한마디 */
/* ---------- 클리닝타임 덕아웃 한마디 ---------- */
.talk { --tc: var(--accent); display: flex; flex-direction: column; gap: 14px; }
.talk-hero h2 { margin: 2px 0 4px; font-size: 1.5em; display: flex; align-items: center; gap: 8px; }
.talk-hero p { margin: 0; color: var(--muted); }
.talk-kicker { font-size: 0.786rem; font-weight: 800; letter-spacing: .14em; color: var(--accent2); }
.talk-stats { display: grid; grid-template-columns: 1.5fr 1fr 1.2fr; gap: 10px; }
.talk-stat { background: var(--sunken, var(--panel2)); border: 1px solid var(--line2); border-radius: 12px; padding: 10px 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.talk-stat small { color: var(--muted); font-size: 0.786rem; font-weight: 700; letter-spacing: .04em; }
.talk-stat b { font-size: 1.2em; white-space: nowrap; }
.talk-score { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.talk-score span { font-size: .72em; font-weight: 600; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.talk-score em { font-style: normal; font-size: 1.15em; font-variant-numeric: tabular-nums; }
.talk-score i { font-style: normal; color: var(--muted); }
.talk-meter { display: block; height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--muted) 22%, transparent); overflow: hidden; }
.talk-meter i { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.talk-meter.m1 i { background: var(--bad); } .talk-meter.m2 i { background: var(--accent2); } .talk-meter.m4 i { background: var(--info); }
.talk-pers { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .88em; }
.talk-lab { font-size: .82em; font-weight: 700; color: var(--muted); margin-right: 4px; white-space: nowrap; }
.talk-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; background: var(--panel2); border: 1px solid var(--line); white-space: nowrap; }
.talk-chip b { font-variant-numeric: tabular-nums; }
.talk-chip small { color: var(--muted); }
.talk-chip.up { border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: color-mix(in srgb, var(--accent) 12%, var(--panel)); }
.talk-chip.down { border-color: color-mix(in srgb, var(--bad) 55%, transparent); background: color-mix(in srgb, var(--bad) 10%, var(--panel)); }
.talk-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.talk-opt { display: flex; gap: 12px; align-items: flex-start; text-align: left; padding: 14px; white-space: normal; height: auto; border-radius: 12px; border: 1px solid var(--line); border-left: 4px solid var(--tc); background: color-mix(in srgb, var(--tc) 6%, var(--panel2)); }
.talk-opt:hover:not(:disabled) { border-color: var(--tc); background: color-mix(in srgb, var(--tc) 14%, var(--panel2)); box-shadow: 0 4px 16px color-mix(in srgb, var(--tc) 20%, transparent); }
.talk-ico { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; font-size: 20px; background: color-mix(in srgb, var(--tc) 18%, transparent); }
.talk-ico.big { width: 44px; height: 44px; font-size: 24px; }
.talk-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.talk-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.talk-top b { font-size: 1.05em; }
.talk-tag { padding: 0 7px; border-radius: 999px; font-size: 0.786rem; font-weight: 800; color: var(--tc); border: 1px solid color-mix(in srgb, var(--tc) 55%, transparent); }
.talk-worn { padding: 0 7px; border-radius: 999px; font-size: 0.786rem; font-weight: 700; color: var(--accent2); background: color-mix(in srgb, var(--accent2) 14%, transparent); }
.talk-say { font-size: .97em; }
.talk-hint { font-size: .84em; color: var(--muted); line-height: 1.4; }
.talk-opt.quiet { align-items: center; padding: 10px 14px; background: transparent; border-style: dashed; border-left-style: solid; opacity: .85; }
.talk-opt.quiet .talk-ico { width: 30px; height: 30px; font-size: 16px; }
.talk-opt.quiet .talk-body { flex-direction: row; align-items: center; gap: 10px; flex-wrap: wrap; }
.talk-foot { margin: 0; font-size: .84em; color: var(--muted); }
.t-calm { --tc: #4aa3ff; } .t-fire { --tc: #ff5a4f; } .t-rally { --tc: #ff9f43; } .t-guard { --tc: #2bc4b4; }
.t-praise { --tc: #3ccf7a; } .t-real { --tc: #f2c94c; } .t-review { --tc: #a07cff; } .t-silent { --tc: #8a94a6; }
.talk-quote { margin: 0; padding: 12px 16px; border-left: 4px solid var(--tc); border-radius: 0 10px 10px 0; background: color-mix(in srgb, var(--tc) 8%, var(--panel2)); font-size: 1.05em; line-height: 1.5; }
.talk-react { display: flex; flex-direction: column; gap: 6px; }
.talk-react > div { display: flex; flex-wrap: wrap; gap: 6px; }
.talk-react.up .talk-lab { color: var(--accent); } .talk-react.down .talk-lab { color: var(--bad); }
.talk-actions { display: flex; justify-content: flex-end; }
.talk-actions .primary { padding: 10px 26px; font-size: 1.05em; }
.talk-countwrap { font-size: .85em; opacity: .8; margin-left: 4px; font-variant-numeric: tabular-nums; }
@media (max-width: 700px) { .talk-stats { grid-template-columns: 1fr 1fr; } .talk-stat:first-child { grid-column: 1 / -1; } .talk-opts { grid-template-columns: 1fr; } }
.log .talk { color: var(--accent2); font-weight: 600; border-left: 3px solid var(--accent2); padding-left: 6px; }
.nav .live-nav { color: var(--accent); font-weight: 700; border: 1px dashed var(--accent); margin-bottom: 4px; }
.simrun { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 25; background: var(--panel); border: 1px solid var(--accent); border-radius: 14px; padding: 10px 14px; box-shadow: 0 12px 36px rgba(0,0,0,.4); animation: popIn .18s ease-out; }
.simrun-in { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
th { cursor: pointer; user-select: none; }
.scoreboard th, table.nosort th { cursor: default; }
th.sorted { color: var(--accent); }
th.sorted::after { content: ' ▾'; font-size: .8em; }
th.sorted[data-sort="asc"]::after { content: ' ▴'; }
th.gl { text-decoration: underline dotted color-mix(in srgb, var(--muted) 60%, transparent); text-underline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { button.attn { animation: none; } }

/* ---------- 모달 · 토스트 ---------- */
.overlay { position: fixed; inset: 0; background: rgba(4, 8, 6, .55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); display: flex; align-items: flex-start; justify-content: center; padding: 32px 16px; overflow-y: auto; z-index: 20; animation: fadeIn .15s ease-out; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 22px; width: min(980px, 100%); position: relative; box-shadow: 0 20px 60px rgba(0,0,0,.45); animation: popIn .18s ease-out; }
.modal.wide { width: min(1180px, 100%); }
.modal .close { position: absolute; right: 14px; top: 14px; border-radius: 50%; width: 32px; height: 32px; padding: 0; z-index: 2; background: var(--panel2); }
/* 닫기 버튼 자리 확보: 모달의 첫 줄(제목·버튼 행)이 ✕와 겹치지 않게 */
.modal > .close + * { padding-right: 46px; }
.modal > .close + .row { min-height: 32px; }
/* ---------- 확인 대화상자 ---------- */
.dlg-overlay { position: fixed; inset: 0; z-index: 40; background: rgba(4, 8, 6, .5); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; padding: 16px; animation: fadeIn .12s ease-out; }
.dlg { width: min(440px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 24px 70px rgba(0,0,0,.5); animation: popIn .16s ease-out; overflow: hidden; }
.dlg-head { display: flex; gap: 10px; align-items: center; padding: 18px 20px 6px; }
.dlg-head h2 { margin: 0; font-size: 1.15em; }
.dlg-icon { font-size: 1.5em; line-height: 1; }
.dlg-body { padding: 4px 20px 6px; }
.dlg-body p { margin: 6px 0; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px 18px; }
.dlg-foot button { min-width: 84px; }
button.danger-solid { background: var(--bad); border-color: var(--bad); color: #fff; font-weight: 700; }
button.danger-solid:hover:not(:disabled) { background: var(--bad); filter: brightness(1.08); }
#toast { position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 12px); background: var(--accent); color: var(--on-accent); padding: 11px 20px; border-radius: 12px; font-weight: 700; opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none; z-index: 30; max-width: 90vw; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .overlay, .modal, .dlg, .dlg-overlay { animation: none; } #toast, button, .teamcard { transition: none; } }

/* ---------- 모바일 ---------- */
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 0; z-index: 10; height: auto; flex-direction: row; overflow-x: auto; padding: 6px; }
  .brand, .side-foot, .side-toggle { display: none; }
  .layout.side-min { grid-template-columns: 1fr; }
  .side-min .nl { display: inline; }
  .side-min .nav button { padding: 8px 12px; font-size: 1em; }
  .nav { flex-direction: row; }
  .nav button { white-space: nowrap; }
  .nav button.active::before { left: 8px; right: 8px; top: auto; bottom: 0; width: auto; height: 3px; border-radius: 3px 3px 0 0; }
  .main { padding: 0 12px 40px; }
  .topbar { position: static; }
  .livegrid { grid-template-columns: 1fr; }
  .card:has(> table) { overflow-x: auto; } /* 좁은 화면: 넓은 표는 카드 안에서 가로 스크롤 */
  .kpis { width: 100%; }
  .kpis div { flex: 1; min-width: 46%; }
}

/* ---------- v0.3: 살아 움직이는 야구 세계 (b.md) ---------- */
:root { --r-common: #8fa89a; --r-rare: #4aa3ff; --r-hero: #b77cff; --r-legend: #ffb627; }
.r-common { --rc: var(--r-common); } .r-rare { --rc: var(--r-rare); } .r-hero { --rc: var(--r-hero); } .r-legend { --rc: var(--r-legend); }
.momentgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 12px; }
.mslot { border: 1px solid var(--rc); border-radius: 10px; padding: 8px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; background: var(--panel2); transition: transform .12s; }
.mslot:hover { transform: translateY(-2px); }
.mslot small { color: var(--rc); font-size: 0.786rem; }
.mslot span { color: var(--muted); font-size: 0.857rem; }
.mslot.locked { border-style: dashed; background: transparent; }
.mslot.locked b { color: var(--muted); font-weight: 500; }
.mslot.sel { box-shadow: 0 0 0 2px var(--rc); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 16px; }
.mcard { border: 2px solid var(--rc); border-radius: var(--radius); padding: 12px; background: linear-gradient(160deg, var(--panel2), var(--panel)); display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow); }
.mcard .badge { color: var(--rc); border-color: var(--rc); }
.r-legend.mcard { box-shadow: 0 0 14px rgba(255, 182, 39, .35); }
.doccard h1 { font-size: 1.714rem; }
ol.doc { margin: 0; padding-left: 20px; line-height: 1.7; }
.timeline.chron { max-height: 260px; overflow-y: auto; border-left: 2px solid var(--line); padding-left: 10px; }
.timeline.chron div { padding: 2px 0; border-left: 0; }
.timeline.chron div::before { display: none; }
.digest div { padding: 4px 0; border-bottom: 1px solid var(--line2); }
@media (max-width: 700px) { .momentgrid { grid-template-columns: repeat(2, 1fr); } .cards { grid-template-columns: 1fr; } }

/* ---------- v0.3: 2D 중계 ---------- */
.f2d-wrap { position: relative; max-width: 640px; margin: 0 auto; }
.f2d { width: 100%; height: auto; display: block; border-radius: 12px; background: #1d3b26; box-shadow: var(--shadow); }
.f2d text { font-family: inherit; }
.f2d-pos { font-size: 6.5px; font-weight: 700; fill: #fff; pointer-events: none; }
.f2d-name { font-size: 8px; fill: #fff; paint-order: stroke; stroke: #000; stroke-width: 2px; pointer-events: none; }
.f2d-fence { font-size: 8px; fill: #d9d2b6; }
.f2d-hud { font-size: 11px; font-weight: 700; fill: #fff; paint-order: stroke; stroke: #000; stroke-width: 3px; }
.f2d-end-t { font-size: 20px; font-weight: 900; fill: #ffd34d; }
.f2d-end-s { font-size: 15px; font-weight: 800; fill: #fff; }
.f2d-end-w { font-size: 11px; font-weight: 700; fill: rgba(255,255,255,0.75); }
.f2d-big { font-size: 34px; font-weight: 900; fill: #ffd34d; paint-order: stroke; stroke: #3a2400; stroke-width: 5px; transform-box: fill-box; transform-origin: center; }
.f2d-on { fill: #ffd34d; }
.f2d-cap { text-align: center; padding: 8px 4px 0; min-height: 22px; }
.f2d-score-flash { position: absolute; left: 50%; top: 45%; z-index: 3; display: grid; grid-template-columns: minmax(0,1fr) auto auto auto minmax(0,1fr); align-items: center; gap: clamp(6px,2vw,18px); width: min(92%,580px); padding: 18px 22px; border: 1px solid rgba(255,255,255,.28); border-radius: 16px; background: rgba(5,9,18,.9); color: #fff; box-shadow: 0 16px 42px rgba(0,0,0,.48); opacity: 0; pointer-events: none; font-variant-numeric: tabular-nums; }
.f2d-score-flash span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: clamp(14px,3vw,24px); font-weight: 800; }
.f2d-score-flash span:first-child { text-align: right; } .f2d-score-flash span:last-child { text-align: left; }
.f2d-score-flash b { font-size: clamp(34px,8vw,64px); line-height: 1; } .f2d-score-flash i { font-size: clamp(26px,6vw,48px); font-style: normal; color: rgba(255,255,255,.65); }
.f2d-score-flash b.scoring { color: #ffd34d; animation: scoreBlink .36s steps(1,end) infinite; }
@keyframes scoreBlink { 50% { opacity: .28; filter: brightness(1.6); } }
@media (prefers-reduced-motion: reduce) { .f2d * { animation: none !important; } }

/* ---------- 3D 중계 ---------- */
.f3d-wrap { max-width: 960px; margin: 0 auto; }
.f3d { width: 100%; aspect-ratio: 16 / 9; height: auto; display: block; border-radius: 10px; background: #2a7a3c; }
/* 대결 정보: 선수·기록이 바뀌어도 높이·위치가 흔들리지 않도록 한 줄 고정 */
.f3d-vs { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px; padding: 0 4px 10px; }
.f3d-side { display: flex; align-items: center; gap: 8px; min-width: 0; height: 26px; flex-wrap: nowrap; overflow: hidden; }
.f3d-name { overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; }
.f3d-chips { flex-wrap: nowrap !important; flex: none; }
.f3d-chip.num { min-width: 48px; justify-content: center; }
.f3d-side.p { justify-content: flex-end; text-align: right; }
.f3d-side.b { justify-content: flex-start; }
.f3d-side.p .f3d-chips { order: -1; } /* 투수 칸은 칩 → 이름 순으로 가운데(VS) 쪽에 이름이 붙게 */
.f3d-side.p .f3d-role { order: -2; }
.f3d-side.b .f3d-role { order: 2; } /* 타자 칸은 이름 → 칩 → 역할 (투수 칸과 좌우 대칭) */
.f3d-role { font-size: 0.786rem; font-weight: 700; color: var(--muted); letter-spacing: .02em; white-space: nowrap; }
.f3d-name { font-size: 1.143rem; font-weight: 800; white-space: nowrap; }
.f3d-chips { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.f3d-x { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 24px; border-radius: 999px; font-weight: 900; font-size: 0.786rem; letter-spacing: .04em; color: var(--muted); background: var(--panel2); border: 1px solid var(--line); }
.f3d-chip { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 0.857rem; font-weight: 700; line-height: 1; white-space: nowrap; color: var(--text); background: var(--panel2); border: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.f3d-chip.hand { color: #fff; border-color: transparent; }
/* 숫자 칩: 값이 바뀌어도 폭이 흔들리지 않게 최소 폭만 두고, 전역 .num(등번호 배지)의 오른쪽 여백·색은 쓰지 않는다 */
.f3d-chip.num { margin-right: 0; padding: 0 8px; border-radius: 999px; justify-content: center; font-weight: 700; text-shadow: none; }
.f3d-chip.num:not(.warm):not(.hot) { background: var(--panel2); color: var(--text); }
.f3d-chip.hand.l, .f3d-chip.hand.r, .f3d-chip.hand.s { color: var(--side-ink, #fff); background: var(--side-color, #738094); }
.f3d-chip.flag { color: var(--muted); background: transparent; }
.f3d-chip.warm { color: var(--accent2); border-color: color-mix(in srgb, var(--accent2) 60%, transparent); }
.f3d-chip.hot { color: #fff; background: var(--bad); border-color: var(--bad); }
.f3d-cap { display: flex; align-items: center; justify-content: center; gap: 8px; padding-top: 10px; }
.f3d-inn { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 0.857rem; font-weight: 800; background: var(--panel2); border: 1px solid var(--line); color: var(--accent2); white-space: nowrap; }
.f3d-cap-text { min-width: 0; }
/* 카드 모드: 오른쪽 위 도구 버튼이 대결 정보 줄과 겹치지 않게 그 줄 위에 따로 둔다 (전체 화면 모드는 그대로 떠 있음) */
.f3d-card:not(.f3d-full) .f3d-tools { position: static; justify-content: flex-end; margin: 0 0 8px; }
@media (max-width: 700px) {
  .f3d-vs { grid-template-columns: 1fr; gap: 6px; }
  .f3d-side.p, .f3d-side.b { justify-content: center; text-align: center; }
  .f3d-side .f3d-chips, .f3d-side .f3d-role { order: 0 !important; }
  .f3d-x { justify-self: center; }
}

/* ---------- 경기 중 큰 점수판 ---------- */
.livescore { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; margin: 12px 0 10px; padding: 12px 16px; background: var(--sunken); border: 1px solid var(--line2); border-radius: var(--radius); }
.ls-team { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ls-team.home { flex-direction: row-reverse; }
.ls-name { font-size: 1.15em; font-weight: 700; white-space: nowrap; }
.ls-run { font-size: 2.6em; line-height: 1; font-weight: 900; font-variant-numeric: tabular-nums; min-width: 1.2ch; text-align: center; color: var(--muted); }
.ls-team.lead .ls-run { color: var(--accent2); }
.ls-colon { font-size: 2em; font-weight: 900; color: var(--muted); }
.ls-state { display: flex; align-items: center; gap: 12px; margin-left: 18px; padding-left: 18px; border-left: 1px solid var(--line); font-size: 1.05em; }
.ls-final { color: var(--accent); }
.ls-outs { display: inline-flex; gap: 4px; }
.ls-outs i { width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--muted); }
.ls-outs i.on { background: var(--bad); border-color: var(--bad); }
.ls-bases { position: relative; width: 34px; height: 26px; }
.ls-bases i { position: absolute; width: 10px; height: 10px; transform: rotate(45deg); border: 2px solid var(--muted); }
.ls-bases i.on { background: var(--accent2); border-color: var(--accent2); }
.ls-bases .b2 { left: 12px; top: 0; } .ls-bases .b1 { right: 0; top: 12px; } .ls-bases .b3 { left: 0; top: 12px; }
.sb-wrap { overflow-x: auto; }
.scoreboard.live { width: auto; min-width: min(100%, 560px); margin: 0 auto; font-size: 1.05em; }
.scoreboard.live td, .scoreboard.live th { min-width: 30px; padding: 6px 8px; }
.scoreboard.live td.l { min-width: 110px; }
.scoreboard.live .rhe { border-left: 2px solid var(--line); }
.scoreboard.live td.rhe b { color: var(--accent2); font-size: 1.15em; }
@media (max-width: 700px) { .ls-run { font-size: 2em; } .ls-state { margin-left: 0; padding-left: 0; border-left: 0; width: 100%; justify-content: center; } }

/* ---------- 직접 지휘 조작 패널: 높이 고정 · 구획 정리 ---------- */
.lc, .lc-logcard { height: 720px; display: flex; flex-direction: column; min-height: 0; }
.lc-logcard .log { flex: 1; max-height: none; min-height: 0; }
.lc-head { flex: none; }
.lc .diamond { width: 130px; height: 130px; margin: 2px auto 6px; }
.lc .diamond .b1 { right: 8px; top: 50px; } .lc .diamond .b2 { left: 50px; top: 8px; } .lc .diamond .b3 { left: 8px; top: 50px; } .lc .diamond .home { left: 50px; top: 92px; }
.lc-match { height: 46px; margin: 6px 0 8px; font-size: .95em; line-height: 23px; }
.lc-ell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lc-run { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.lc-run button, .lc-grid3 button, .lc-grid2 button { padding: 7px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.lc-wide { width: 100%; }
.lc-sit { display: flex; gap: 8px; align-items: center; height: 34px; margin-top: 8px; padding: 0 10px; border-radius: var(--radius-s); background: var(--panel2); border: 1px solid var(--line); font-size: .9em; white-space: nowrap; overflow: hidden; }
.lc-sit span { overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.lc-sit.key { background: color-mix(in srgb, var(--accent2) 14%, var(--panel)); border-color: color-mix(in srgb, var(--accent2) 60%, transparent); }
.lc-sit.key b { color: var(--accent2); }
.lc-body { flex: 1; min-height: 0; overflow-y: auto; margin: 10px -6px 0; padding: 0 6px; scrollbar-gutter: stable; }
.lc-sec { padding: 10px 0; border-top: 1px solid var(--line2); }
.lc-sec:first-child { border-top: 0; padding-top: 2px; }
.lc-sec h4 { margin: 0 0 8px; font-size: .9em; color: var(--muted); font-weight: 700; display: flex; gap: 8px; align-items: baseline; white-space: nowrap; overflow: hidden; }
.lc-sec h4 small { font-weight: 400; overflow: hidden; text-overflow: ellipsis; }
.lc-sec summary { cursor: pointer; font-size: .92em; }
.lc-sec table { font-size: .85em; margin-top: 8px; }
.lc-sec table select { max-width: 130px; }
.lc-grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.lc-grid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.lc-desc { min-height: 2.6em; margin: 6px 0 0; line-height: 1.3; }
.lc-line { display: flex; gap: 6px; align-items: center; margin-top: 6px; min-width: 0; }
.lc-line:first-of-type { margin-top: 0; }
.lc-line.dim { opacity: .5; }
.lc-lab { flex: none; width: 28px; font-weight: 700; font-size: .9em; }
.lc-who { flex: none; max-width: 110px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .9em; }
.lc-grow { flex: 1; min-width: 0; }
.lc-line select.lc-grow { width: 0; }
.lc-line button { flex: none; }
.lc-foot { flex: none; padding-top: 10px; margin-top: 6px; border-top: 1px solid var(--line); font-size: .88em; }
.lc-foot-t { display: block; font-size: .85em; font-weight: 700; color: var(--muted); letter-spacing: .02em; margin-bottom: 6px; }
.auto-togs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.auto-tog { position: relative; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 7px 6px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--sunken); cursor: pointer; white-space: nowrap; user-select: none; transition: background .15s, border-color .15s, color .15s; color: var(--muted); }
.auto-tog:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.auto-tog input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.auto-tog .sw { position: relative; flex: none; width: 28px; height: 16px; border-radius: 8px; background: color-mix(in srgb, var(--muted) 45%, transparent); transition: background .15s; }
.auto-tog .sw::after { content: ''; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform .15s; }
.auto-tog:has(input:checked) { background: color-mix(in srgb, var(--accent) 14%, transparent); border-color: color-mix(in srgb, var(--accent) 55%, transparent); color: var(--text); font-weight: 700; }
.auto-tog input:checked + .sw { background: var(--accent); }
.auto-tog input:checked + .sw::after { transform: translateX(12px); }
.auto-tog input:focus-visible + .sw { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .auto-tog, .auto-tog .sw, .auto-tog .sw::after { transition: none; } }
@media (max-width: 860px) { .lc, .lc-logcard { height: 640px; } .lc-logcard { height: 420px; } }
.lc-run { grid-template-columns: 1.4fr 1fr 1fr; }
.lc-run .primary { font-weight: 700; }
/* 자동 진행: 자주 누르는 버튼이라 한 줄 전체 · 크게 */
.live-auto-btn { font-weight: 800; border-color: color-mix(in srgb, var(--accent2) 60%, var(--line)); }
.live-auto-btn.on { background: var(--accent2); border-color: var(--accent2); color: #111; }
.live-auto-btn.on:hover:not(:disabled) { background: var(--accent2); filter: brightness(1.08); }
.lc-run .lc-auto { grid-column: 1 / -1; padding: 12px 8px; font-size: 1.1em; }
.f3d-tools .f3d-auto { padding: 8px 18px; font-size: 1em; min-width: 9em; }
.f3d-bar .f3d-auto { padding: 10px 22px; font-size: 1.08em; min-width: 9.5em; }
.live-auto-btn { white-space: nowrap; font-variant-numeric: tabular-nums; }
/* 전체 화면 아이콘: 경기 화면 오른쪽 아래 */
.f3d-stage { position: relative; }
.live-screen-toggle { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.live-screen-toggle:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.live-toggle-pop { position: absolute; left: 50%; top: 50%; z-index: 8; display: grid; place-items: center; width: 76px; height: 76px; border-radius: 50%; background: rgba(0,0,0,.62); color: #fff; font: 900 34px/1 system-ui,sans-serif; opacity: 0; transform: translate(-50%,-50%) scale(.78); pointer-events: none; text-shadow: 0 2px 5px rgba(0,0,0,.5); }
.live-toggle-pop.show { animation: liveTogglePop .68s ease-out both; }
@keyframes liveTogglePop { 0% { opacity: 0; transform: translate(-50%,-50%) scale(.7); } 18% { opacity: 1; transform: translate(-50%,-50%) scale(1); } 72% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%,-50%) scale(1.08); } }
.f3d-fsbtn { position: absolute; right: 10px; bottom: 10px; width: 40px; height: 40px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; border: 0; background: rgba(0,0,0,.42); color: #fff; opacity: .8; }
.f3d-fsbtn:hover:not(:disabled) { background: rgba(0,0,0,.65); border: 0; opacity: 1; }
/* 공격 중인 팀 */
.scoreboard tr.atbat td.l { font-weight: 800; }

/* 3D 중계 전체 화면 */
.f3d-card { position: relative; }
.f3d-tools { position: absolute; top: 10px; right: 10px; z-index: 1; display: flex; gap: 6px; }
.f3d-full .f3d-tools { top: 14px; right: 14px; }
.f3d-full { position: fixed; inset: 0; z-index: 15; margin: 0 !important; border-radius: 0; border: 0; background: #05080b; display: flex; flex-direction: column; justify-content: center; padding: 10px 12px; color: #e8eef0; }
.f3d-full .f3d-wrap { width: 100%; max-width: min(100%, calc((100vh - 130px) * 16 / 9)); max-width: min(100%, calc((100dvh - 130px) * 16 / 9)); }
.f3d-full .f3d-vs .muted, .f3d-full .f2d-cap { color: #c9d4ce; }
.f3d-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; width: 100%; max-width: 960px; margin: 8px auto 0; }
.f3d-bar .spacer { flex: 1; }
body:has(.f3d-full) { overflow: hidden; }
@media (max-width: 700px) { .f3d-tools { position: static; justify-content: flex-end; margin: 0 0 8px; } .f3d-bar button { flex: 1 1 40%; } .f3d-bar .spacer { display: none; } }

/* 팬 채팅 */
.livegrid.with-chat { grid-template-columns: minmax(340px, 380px) 1fr 320px; }
.fc-card { height: 720px; display: flex; flex-direction: column; min-height: 0; padding-bottom: 10px; }
.fc-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.fc-head h3 { margin: 0; }
.fc-list { flex: 1; min-height: 0; overflow-y: auto; font-size: .92em; display: flex; flex-direction: column; gap: 3px; padding-right: 4px; }
.fc-msg { line-height: 1.45; word-break: break-all; animation: fcIn .2s ease-out; }
.fc-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.fc-nick { margin-right: 6px; font-weight: 700; }
@keyframes fcIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .fc-msg { animation: none; } }
@media (max-width: 1439px) { .livegrid.with-chat { grid-template-columns: minmax(340px, 380px) 1fr; } .livegrid.with-chat .fc-card { grid-column: 1 / -1; height: 380px; } }
@media (max-width: 860px) { .livegrid.with-chat { grid-template-columns: 1fr; } }
/* 3D 전체 화면: 왼쪽 아래 반투명 미니 채팅 */
.f3d-full .fc-mini { position: absolute; left: 16px; bottom: 70px; width: min(340px, 40vw); background: rgba(5,8,11,.55); border-radius: 10px; padding: 6px 10px 8px; color: #e8eef0; z-index: 1; }
.f3d-full .fc-mini.off { width: auto; padding: 0; background: transparent; }
/* 좁은 화면: 미니 팬 채팅이 중계 화면·진행 버튼을 덮지 않게 버튼 아래로 내린다 */
@media (max-width: 700px) {
  .f3d-full .fc-mini { position: static; order: 10; width: 100%; max-width: 960px; margin: 8px auto 0; }
  .f3d-full .fc-list.mini { max-height: 22vh; }
}
.fc-mini-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .8em; font-weight: 700; color: #c9d4ce; padding-bottom: 4px; margin-bottom: 4px; border-bottom: 1px solid rgba(255,255,255,.12); }
.fc-mini-head button, .fc-mini.off button { background: rgba(5,8,11,.6); color: #e8eef0; border-color: rgba(255,255,255,.25); }
.f3d-full .fc-list.mini { max-height: 40vh; overflow: hidden; pointer-events: none; font-size: .88em; justify-content: flex-end; }
.f3d-full .fc-list.mini .fc-nick { filter: brightness(1.35); }

/* ---------- 디펜딩 챔피언 엠블럼 (금색 테두리) ---------- */
.emblem.champ { border-color: #f5c542 !important; box-shadow: 0 0 0 2px #8a6a12, 0 0 10px rgba(245,197,66,.65), 0 3px 10px rgba(0,0,0,.25); position: relative; }
.emblem.mini.champ { box-shadow: 0 0 0 1px #8a6a12, 0 0 6px rgba(245,197,66,.7); }

/* ---------- 우승 화면 ---------- */
.champ-screen { text-align: center; position: relative; overflow: hidden; padding: 8px 4px 4px; }
.champ-screen .champ-emblem { display: flex; justify-content: center; margin: 6px 0 10px; }
.champ-screen:not(.other) .champ-emblem .emblem { animation: champPop .7s cubic-bezier(.2,1.6,.4,1) both; }
.champ-title { font-size: 3.286rem; margin: 2px 0 4px; color: #f5c542; text-shadow: 0 2px 0 #8a6a12, 0 0 24px rgba(245,197,66,.45); letter-spacing: 2px; }
.champ-sub { color: var(--text); margin: 6px 0; }
.champ-perks { display: inline-flex; flex-direction: column; gap: 4px; text-align: left; background: var(--award-bg); border: 1px solid var(--award-line); color: var(--award-fg); border-radius: var(--radius-s); padding: 10px 14px; margin-top: 6px; }
.champ-perks .gold { color: #f5c542; }
.champ-screen .bracket { margin-top: 10px; text-align: left; }
.confetti { position: absolute; inset: 0; pointer-events: none; }
.confetti i { position: absolute; top: -14px; width: 8px; height: 14px; border-radius: 2px; opacity: .9; animation: confFall 3s linear infinite; }
@keyframes confFall { 0% { transform: translateY(-20px) rotate(0); } 100% { transform: translateY(560px) rotate(540deg); opacity: .2; } }
@keyframes champPop { 0% { transform: scale(.3) rotate(-20deg); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .confetti { display: none; } .champ-screen .champ-emblem .emblem { animation: none; } }

/* ---------- 포스트시즌 대진표 (계단식) ---------- */
.bracket { display: flex; align-items: flex-end; gap: 4px; overflow-x: auto; padding: 6px 2px 4px; }
.bk-col { flex: 1 1 0; min-width: 150px; margin-bottom: calc(var(--step) * 34px); }
.bracket.compact .bk-col { min-width: 128px; margin-bottom: calc(var(--step) * 22px); }
.bk-arrow { align-self: center; color: var(--faint); font-size: 1.571rem; padding: 0 2px; }
.bk-box { background: var(--sunken); border: 1px solid var(--line2); border-radius: var(--radius-s); padding: 6px 8px; }
.bk-box.live { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.bk-head { display: flex; justify-content: space-between; gap: 6px; font-size: 0.857rem; margin-bottom: 4px; flex-wrap: wrap; }
.bk-head .muted { font-size: 0.786rem; }
.bk-team { display: flex; align-items: center; gap: 2px; padding: 3px 4px; border-radius: 6px; font-size: 0.929rem; }
.bk-team .bk-seed { width: 14px; color: var(--muted); font-size: 0.786rem; text-align: center; flex: none; }
.bk-team .bk-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-team .bk-w { min-width: 16px; text-align: right; }
.bk-team.win { background: var(--tint); font-weight: 700; }
.bk-team.lose { color: var(--muted); }
.bk-team.lose .emblem { opacity: .5; }
.bk-team.mine .bk-name { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.bk-state { font-size: 0.786rem; color: var(--muted); margin-top: 3px; }
.bk-champ { border-color: #b8922a; }
.bk-champ.done { background: var(--award-bg); }
.bracket.compact .bk-head .muted, .bracket.compact .bk-state { display: none; }

/* ---------- 규정 ---------- */
.rules-list { margin: 0; padding-left: 18px; line-height: 1.7; }
.rules-list li { margin: 2px 0; }

/* ---------- 경기 시각 · 빨리감기 ---------- */
.ls-clock { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 2px 8px; font-size: .9em; }
.log .log-clk { color: var(--faint); font-size: 0.786rem; font-variant-numeric: tabular-nums; font-weight: 400; }
button.ff-on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 700; }
.ff-seg button { padding: 4px 8px; font-size: 0.857rem; }

/* ---------- 팬 채팅: 관리자가 가린 메시지 ---------- */
.fc-text.fc-censored { color: var(--faint); font-style: italic; background: var(--sunken); border-radius: 4px; padding: 0 6px; }

/* ---------- 인터뷰 추천 답 ---------- */
button.rec { border-color: var(--accent2); box-shadow: inset 0 0 0 1px var(--accent2); }
.rec-why { margin-top: 4px; color: var(--muted); }
.rec-why b { color: var(--text); }

/* ---------- 시작 화면 구단 정체성 미리보기 ---------- */
.id-preview { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px; background: var(--sunken); border: 1px solid var(--line2); border-radius: 999px; }

/* ---------- 선수 시각화 ---------- */
.pviz { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.pviz .pv-card { background: var(--sunken); border: 1px solid var(--line2); border-radius: var(--radius-s); padding: 10px 12px; min-width: 0; }
.pviz .pv-card.wide { grid-column: span 2; }
@media (max-width: 760px) { .pviz .pv-card.wide { grid-column: auto; } }
.pviz h4 { margin: 0 0 6px; }
.pv-svg { width: 100%; max-width: 280px; height: auto; display: block; margin: 0 auto; overflow: visible; }
.pv-svg.wide { max-width: 100%; }
.pv-svg.pz { max-width: 230px; }
.pv-grid { fill: none; stroke: var(--line); stroke-width: 1; }
.pv-area { fill: color-mix(in srgb, var(--accent) 22%, transparent); stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.pv-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.pv-dot { fill: var(--accent); stroke: var(--sunken); stroke-width: 2; }
.pv-dot.cur { fill: var(--sunken); stroke: var(--accent); }
.pv-hit:hover .pv-dot { r: 6; }
.pv-hit:hover rect[rx] { stroke: var(--text); stroke-width: 2; }
.pv-lab { fill: var(--muted); font-size: 11px; }
.pv-val { fill: var(--text); font-weight: 700; font-size: 11px; }
.pv-tick { fill: var(--faint); font-size: 10px; font-variant-numeric: tabular-nums; }
.pz-num { fill: #fff; font-size: 10.5px; font-weight: 700; paint-order: stroke; stroke: rgba(0,0,0,.35); stroke-width: 2px; font-variant-numeric: tabular-nums; pointer-events: none; }
.pz-frame { stroke: var(--text); stroke-width: 2; }
.pz-plate { fill: var(--panel); stroke: var(--muted); stroke-width: 1.5; }
.pz-legend { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 0.786rem; color: var(--muted); margin-top: 4px; }
.pz-legend i { width: 110px; height: 8px; border-radius: 4px; display: inline-block; }
.lc-run .ff-seg { grid-column: 1 / -1; display: flex; }
.lc-run .ff-seg button { flex: 1; }
.lc-run button.ff-on { grid-column: span 2; }
.f3d-bar .ff-seg { margin-left: 4px; }

/* ---------- 아이콘 (통일된 선 아이콘, 글자색을 따름) ---------- */
svg.ic { width: 1.15em; height: 1.15em; vertical-align: -0.2em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; overflow: visible; }
.nav button svg.ic { width: 18px; height: 18px; margin-right: 4px; opacity: .9; }
.nav button.active svg.ic { opacity: 1; }
h1 svg.ic, h2 svg.ic { vertical-align: -0.15em; }
.champ-title svg.ic { stroke-width: 2.4; }
.lc-run { grid-template-columns: 1.1fr 1fr 1fr; }
.lc-run .ff-btn { font-size: .9em; padding-left: 2px; padding-right: 2px; letter-spacing: -.2px; }
.lc-run .ff-btn svg.ic { width: 1em; height: 1em; margin-right: 1px; }

/* ---------- 경기 화면 흔들림 방지 ---------- */
/* 이닝 점수표의 공격 표시(🏏)는 자리만 남기고 숨김 → 공수 교대 때 칸 너비가 그대로 */
.sb-atbat.off { visibility: hidden; }
.ls-state { min-height: 26px; }
.ls-state > b { min-width: 4.8em; text-align: center; font-variant-numeric: tabular-nums; }
.lc .outs { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 700px) {
  /* 큰 점수판: [원정 | 점수 | 홈] 3칸 고정 + 아래 줄에 시각·이닝·아웃·주자. 글자 길이와 상관없이 줄바꿈 위치가 바뀌지 않는다 */
  .livescore { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 6px 6px; padding: 10px 10px 8px; }
  .ls-team { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto 22px; grid-template-areas: "em run" "nm run"; justify-items: center; align-items: center; gap: 2px 6px; min-width: 0; }
  .ls-team.home { flex-direction: initial; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "run em" "run nm"; }
  .ls-team > .emblem { grid-area: em; width: 30px !important; height: 30px !important; font-size: 16px !important; }
  .ls-name { grid-area: nm; max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-size: .95em; line-height: 22px; }
  .ls-name small { display: none; }
  .ls-team.mine .ls-name { color: var(--accent); }
  .ls-run { grid-area: run; font-size: 2.3em; min-width: 1.4ch; }
  .ls-colon { font-size: 1.6em; }
  .ls-state { grid-column: 1 / -1; flex-wrap: nowrap; gap: 10px; white-space: nowrap; font-size: .95em; }
  /* 투수·타자 정보 줄: 가운데 정렬이면 글자 길이에 따라 좌우로 움직이므로 왼쪽 정렬 */
  .f3d-side.p, .f3d-side.b { justify-content: flex-start; text-align: left; }
  .f3d-vs .f3d-x { display: none; }
}
/* 경기 화면 열은 내용(긴 한 줄 텍스트) 때문에 넓어지지 않는다 — 글자는 칸 안에서 말줄임 */
.livegrid > * { min-width: 0; }
@media (max-width: 860px) { .livegrid, .livegrid.with-chat { grid-template-columns: minmax(0, 1fr); } }
/* 문장 전체가 링크인 경우(뉴스 등)는 줄바꿈 허용 — .link 기본값(nowrap)은 선수 이름용 */
.link.txt { white-space: normal; }
.newslist div { overflow-wrap: anywhere; }

/* ---------- 스크롤바가 생기고 사라질 때 화면이 좌우로 흔들리지 않게: 스크롤바 자리를 항상 확보 ---------- */
html { scrollbar-gutter: stable; }
.log, .fc-list, .timeline.chron, .overlay, .sidebar, .tablewrap[style*="overflow-y"] { scrollbar-gutter: stable; }
/* 선발 로테이션 표: 좁은 카드에서도 '다음' 버튼이 잘리지 않게 */
.rot-tbl select { max-width: 160px; }
.rot-tbl td { padding-left: 4px; padding-right: 4px; }
.rot-tbl button { white-space: nowrap; }

/* ---------- 4D 중계 (WebGL) ---------- */
.f4d-slot { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #0b1322; }
.f4d-box { position: absolute; inset: 0; }
.f4d-box canvas.f4d { width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; background: #0b1322; }
.f4d-hud { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.f4d-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; color: #c9d4ce; font-size: .95em; padding: 16px; text-align: center; }
/* 기체 상세 창의 3D 모형 미리보기 */
.robot-pv { position: relative; width: 100%; height: clamp(260px, 42vh, 340px); border-radius: 10px; overflow: hidden; background: radial-gradient(120% 90% at 50% 25%, #6c7f9b 0%, #33425a 55%, #1a2333 100%); }
.robot-pv-box { position: absolute; inset: 0; }
.robot-pv-box canvas { display: block; width: 100%; height: 100%; }
.robot-pv-cap { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-top: 6px; font-size: .857rem; }
.robot-pv-cap span { color: var(--muted); }
/* 동작 미리보기 탭: 투구 · 타격 · 주루 */
.rpv-tabs { display: flex; gap: 6px; margin-bottom: 6px; }
.rpv-tabs button { flex: 1; }
.rpv-tabs[hidden] { display: none; }
@media (max-width: 640px) { .robot-pv { height: 200px; } }
/* 파일 선택 칸: 좁은 화면·큰 글자에서도 넘치지 않게 줄바꿈 */
label:has(> input[type=file]) { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; max-width: 100%; }
input[type=file] { max-width: 100%; }

/* ---------- 배포용: 소개·개인정보처리방침 페이지 ---------- */
.doc-page { max-width: 760px; margin: 0 auto; padding: 24px 16px 48px; }
.doc-page h2 { margin-top: 28px; }
.doc-page li { margin: 6px 0; }
.site-links { margin-top: 16px; text-align: center; }
.site-links a { margin: 0 6px; }
.doc-page { line-height: 1.7; }
.doc-page h1 { line-height: 1.35; }
.doc-page h3 { margin-top: 20px; }
.doc-page .lead { font-size: 1.05em; }
.doc-page table { margin: 10px 0 14px; font-size: .92em; }
.doc-page th, .doc-page td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.doc-page th { color: var(--muted); font-weight: 600; white-space: nowrap; }
.doc-page .tablewrap { overflow-x: auto; }
.doc-page .tip { margin: 14px 0; padding: 10px 14px; border-left: 3px solid var(--accent); background: var(--panel2); border-radius: 4px; }
.guide-nav { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 10px 0 12px; margin-bottom: 8px; border-bottom: 1px solid var(--line); font-size: .9em; }
.guide-nav a { text-decoration: none; }
.guide-nav a[aria-current] { color: var(--text); font-weight: 600; }
.guide-list { list-style: none; padding: 0; }
.guide-list li { margin: 0; padding: 12px 0; border-bottom: 1px solid var(--line2); }
.guide-list a { font-weight: 600; }
.guide-list p { margin: 4px 0 0; color: var(--muted); font-size: .92em; }
.guide-pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 32px; padding-top: 14px; border-top: 1px solid var(--line); }
.doc-footer { margin-top: 28px; }

/* ---------- 하단 고정 광고 (src/ui/ads.js · 광고 설정이 있을 때만) ---------- */
html.has-ad { --ad-h: 96px; }
html.has-ad body { padding-bottom: var(--ad-h); }
#ad-bar { position: fixed; left: 0; right: 0; bottom: 0; height: var(--ad-h); z-index: 12; background: var(--panel); border-top: 1px solid var(--line2); display: flex; align-items: center; justify-content: center; overflow: hidden; }
#ad-bar .ad-box { width: min(728px, 100%); height: 90px; }
#ad-bar .ad-tag { position: absolute; left: 8px; top: 4px; font-size: 0.714rem; color: var(--muted); }
html.has-ad #toast, html.has-ad .simrun { bottom: calc(22px + var(--ad-h)); }
@media (min-width: 861px) { html.has-ad .sidebar { height: calc(100vh - var(--ad-h)); } }
@media (max-width: 700px) {
  html.has-ad { --ad-h: 58px; }
  #ad-bar .ad-box { width: 320px; height: 50px; }
  #ad-bar .ad-tag { display: none; }
}

/* =========================================================
   2026 UI refresh — command center / broadcast / data workspace
   ========================================================= */
/* 기본(그라운드) 테마 색만 바꾼다 — :root 로 쓰면 앞에 선언된 나이트·클래식·데이·구단 컬러 테마 변수를 덮어쓴다 */
:root:not([data-theme]), [data-theme="ground"] {
  --bg: #07100c; --bg2: #050b08; --panel: #101b16; --panel2: #15231c; --hover: #1a2c23;
  --line: #294137; --line2: #1c3027; --text: #f1f6f3; --muted: #91a79c; --faint: #60766b;
  --accent: #55d98a; --on-accent: #06140c; --accent2: #f3c85b; --sidebar: #050b08; --sunken: #09130e;
  --shadow: 0 1px 0 rgba(255,255,255,.025), 0 14px 32px rgba(0,0,0,.18);
  --radius: 10px; --radius-s: 7px;
}
body { background: radial-gradient(circle at 48% -20%, color-mix(in srgb, var(--team) 8%, transparent), transparent 32rem), var(--bg); }
button { min-height: 32px; font-weight: 620; }
button.primary { box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 18%, transparent); }
select, input, textarea { min-height: 32px; }

/* 앱 셸 */
.layout { grid-template-columns: 232px minmax(0, 1fr); }
.sidebar { padding: 14px 12px 18px; border-right-color: rgba(255,255,255,.07); background: linear-gradient(180deg, color-mix(in srgb, var(--team) 7%, #050b08), #050b08 28%); }
.product-mark { display: flex; align-items: center; gap: 10px; padding: 3px 8px 13px; color: #fff; }
.product-mark .product-ball { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid color-mix(in srgb, var(--team) 55%, #fff); border-radius: 8px; background: color-mix(in srgb, var(--team) 18%, transparent); }
.product-mark b { display: block; font-size: .86em; letter-spacing: .14em; }
.product-mark small { display: block; margin-top: 1px; color: #789084; font-size: .57em; letter-spacing: .12em; }
.brand { margin-bottom: 5px; padding: 12px 8px; border: 1px solid rgba(255,255,255,.07); border-radius: 9px; background: rgba(255,255,255,.025); }
.brand b { font-size: .98em; }
.brand small { display: block; margin-top: 2px; font-size: .78em; }
.nav { gap: 1px; }
.nav-group { padding: 16px 12px 5px; color: #53685e; font-size: .65em; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.nav button { min-height: 36px; padding: 8px 10px; color: #a9b9b1; }
.nav button.active { background: linear-gradient(90deg, color-mix(in srgb, var(--team) 20%, transparent), color-mix(in srgb, var(--team) 7%, transparent)); }
.nav button.active::before { left: -12px; top: 7px; bottom: 7px; width: 3px; }
.live-nav { border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent) !important; background: color-mix(in srgb, var(--bad) 8%, transparent) !important; }
.live-dot { width: 7px; height: 7px; margin-left: auto; border-radius: 50%; background: var(--bad); box-shadow: 0 0 0 4px color-mix(in srgb, var(--bad) 13%, transparent); animation: livePulse 1.6s ease-in-out infinite; }
@keyframes livePulse { 50% { opacity: .45; } }
.layout.side-min { grid-template-columns: 64px minmax(0, 1fr); }
.side-min .product-mark { justify-content: center; padding-inline: 0; }
.side-min .brand { border: 0; background: transparent; }
.side-min .nav-group { display: none; }

.main { max-width: 1840px; width: 100%; margin: 0 auto; padding: 0 30px 54px; }
.topbar { min-height: 66px; margin-bottom: 22px; padding: 10px 0; background: color-mix(in srgb, var(--bg) 88%, transparent); border-bottom-color: color-mix(in srgb, var(--text) 8%, transparent); }
.topbar .info { display: flex; align-items: center; flex-wrap: wrap; }
.topbar .info .top-kicker { flex-basis: 100%; display: block; margin-bottom: 2px; color: var(--accent); font-size: .64em; font-weight: 800; letter-spacing: .13em; }
.topbar .info b { font-size: 1.08em; }
.topbar .tools button { background: transparent; border-color: transparent; color: var(--muted); }
.topbar .tools button:hover { background: var(--panel2); }
.side-foot { border-top-color: rgba(255,255,255,.07); }

/* 공통 컴포넌트 */
.card { border-color: color-mix(in srgb, var(--text) 8%, transparent); background: linear-gradient(180deg, color-mix(in srgb, var(--panel2) 24%, var(--panel)), var(--panel)); box-shadow: var(--shadow); }
.card > h2, .card > .row > h2 { letter-spacing: -.025em; }
.card > h3:first-child { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: .86em; font-weight: 760; letter-spacing: .025em; }
.card > h3:first-child::before { content: ''; width: 3px; height: 13px; border-radius: 3px; background: var(--team); }
.tabs { padding: 3px; border-color: color-mix(in srgb, var(--text) 8%, transparent); background: var(--sunken); }
.tabs button.active { box-shadow: 0 1px 5px rgba(0,0,0,.28), inset 0 -2px 0 var(--team); }
th { padding-top: 8px; padding-bottom: 8px; background: var(--panel); color: var(--muted); font-size: .76em; text-transform: uppercase; letter-spacing: .045em; }
td { height: 35px; }
tbody tr:nth-child(even) td, table tr:nth-child(even) td { background: color-mix(in srgb, var(--panel2) 28%, transparent); }
table tr:hover td { background: color-mix(in srgb, var(--team) 8%, var(--hover)); }
.badge { border-radius: 5px; }

/* A — 감독 상황실 */
.home-command { max-width: 1500px; margin: 0 auto; }
.home-command .hero { min-height: 152px; padding: 24px; background:
  linear-gradient(100deg, color-mix(in srgb, var(--team) 22%, var(--panel)), color-mix(in srgb, var(--panel) 96%, transparent) 68%),
  repeating-linear-gradient(135deg, transparent 0 24px, rgba(255,255,255,.015) 24px 25px); }
.home-command .hero::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--team); }
.hero-kicker { position: relative; z-index: 1; display: block; margin: 0 0 14px 76px; color: color-mix(in srgb, var(--team) 75%, var(--text)); font-size: .67em; font-weight: 850; letter-spacing: .14em; }
.home-command .hero h1 { font-size: 2.05em; letter-spacing: -.035em; }
.home-command .hero .emblem { box-shadow: 0 0 0 5px rgba(0,0,0,.17), 0 12px 24px rgba(0,0,0,.25); }
.home-command .kpis { margin-left: auto; gap: 7px; }
.home-command .kpis div { min-width: 118px; padding: 10px 12px; border-color: color-mix(in srgb, var(--text) 8%, transparent); border-radius: 7px; background: color-mix(in srgb, var(--bg) 55%, transparent); }
.home-command .kpis small { text-align: left; text-transform: uppercase; letter-spacing: .04em; }
.home-command .kpis b { display: block; margin-top: 2px; font-size: 1.24em; }
.home-command > .grid { grid-template-columns: minmax(390px, 1.15fr) minmax(320px, .85fr); }
.home-command .next-game { border-color: color-mix(in srgb, var(--team) 35%, var(--line2)); background: linear-gradient(145deg, color-mix(in srgb, var(--team) 10%, var(--panel)), var(--panel)); }
.next-game > h3:first-child { justify-content: space-between; }
.next-game > h3 small { color: var(--muted); font-size: .85em; font-weight: 500; letter-spacing: 0; }
.next-game .vs { justify-content: center; padding: 18px 8px 12px; }
.next-game .vs b { font-size: 1.18em; }
.next-game .row:last-child { padding-top: 8px; }
.home-command .todo { border-left: 3px solid var(--accent2); }
.home-command .newslist div { padding: 9px 4px; }

/* B — 중계 스튜디오 */
.view-live .main { max-width: 1900px; }
.broadcast-studio { max-width: 1660px; margin: 0 auto; }
.broadcast-studio .live-scorecard { padding: 14px 18px 16px; border-top: 2px solid color-mix(in srgb, var(--bad) 70%, transparent); background: linear-gradient(180deg, #111b17, #0c1511); }
.live-meta { min-height: 31px; }
.on-air { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border: 1px solid color-mix(in srgb, var(--bad) 55%, transparent); border-radius: 4px; color: var(--bad); font-size: .72em; font-weight: 850; letter-spacing: .1em; }
.on-air i { width: 6px; height: 6px; border-radius: 50%; background: var(--bad); }
.broadcast-studio .livescore { margin: 12px -3px 10px; padding: 13px 18px; border-color: color-mix(in srgb, var(--text) 8%, transparent); border-radius: 7px; background: var(--sunken); }
.broadcast-studio .ls-run { font-size: 3em; }
.broadcast-studio .ls-team { gap: 11px; }
.broadcast-studio .ls-name { min-width: 92px; font-size: 1.08em; }
.broadcast-studio .scoreboard.live { font-size: .96em; }
.broadcast-studio .f3d-card { overflow: hidden; padding: 12px; border-color: rgba(255,255,255,.09); background: #080d0b; }
.broadcast-studio .f4d-slot, .broadcast-studio .f3d { border-radius: 6px; }
.broadcast-studio .livegrid { grid-template-columns: minmax(350px, 390px) minmax(420px, 1fr); gap: 12px; }
.broadcast-studio .livegrid.with-chat { grid-template-columns: minmax(350px, 390px) minmax(420px, 1fr) 300px; }
.broadcast-studio .lc, .broadcast-studio .lc-logcard, .broadcast-studio .fc-card { border-radius: 8px; box-shadow: none; }
.broadcast-studio .lc { border-top: 2px solid var(--team); }
.broadcast-studio .lc-logcard { border-top: 2px solid #506a5d; }
.broadcast-studio .fc-card { border-top: 2px solid #3b7760; }
.broadcast-studio .lc-sec h4 { color: var(--muted); text-transform: uppercase; font-size: .78em; letter-spacing: .05em; }
.broadcast-studio .lc-run button { border-radius: 5px; }

/* C — 데이터 워크스페이스 */
.view-squad .main, .view-scouting .main, .view-history .main, .view-league .main { max-width: 1920px; }
.data-workspace { max-width: 1680px; margin: 0 auto; }
.workspace-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin: 3px 0 17px; padding-bottom: 14px; border-bottom: 1px solid var(--line2); }
.workspace-heading span { display: block; margin-bottom: 4px; color: var(--accent); font-size: .67em; font-weight: 850; letter-spacing: .14em; }
.workspace-heading h1 { margin: 0; font-size: 1.62em; letter-spacing: -.035em; }
.workspace-heading p { margin: 0; color: var(--muted); font-size: .88em; }
.data-workspace .card { border-radius: 8px; box-shadow: 0 8px 25px rgba(0,0,0,.12); }
.roster-sheet { padding: 18px; }
.roster-sheet > .row:first-child { margin-bottom: 7px; }
.roster-status { margin-bottom: 14px; padding: 10px; border: 1px solid var(--line2); border-radius: 6px; background: var(--sunken); }
.roster-counts { display: grid; grid-template-columns: repeat(4, minmax(78px, 1fr)); gap: 6px; }
.roster-counts > span { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; padding: 7px 9px; border: 1px solid color-mix(in srgb, var(--line2) 72%, transparent); border-radius: 6px; background: color-mix(in srgb, var(--panel) 55%, transparent); }
.roster-counts small { min-width: 0; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.roster-counts b { flex: none; color: var(--text); font-variant-numeric: tabular-nums; }
.roster-controls { display: grid; grid-template-columns: minmax(190px, 1fr) minmax(260px, 1.5fr) auto; align-items: stretch; gap: 7px; margin-top: 8px; }
.roster-toggle { display: flex; align-items: center; gap: 7px; min-width: 0; padding: 7px 9px; border: 1px solid var(--line2); border-radius: 6px; background: var(--panel2); color: var(--text); line-height: 1.3; cursor: pointer; }
.roster-toggle input { flex: none; margin: 0; }
.roster-toggle span { min-width: 0; }
.roster-auto { min-width: 10.5em; white-space: nowrap; }
.roster-note { margin: 8px 2px 0; }
.data-workspace .tablewrap { border: 1px solid var(--line2); border-radius: 6px; }
.data-workspace .tablewrap table { min-width: 960px; }
.data-workspace .tablewrap th { top: 0; background: var(--panel); }
.data-workspace > .grid { grid-template-columns: minmax(0, 1fr); }
.data-workspace > .grid > .card:first-child { background: color-mix(in srgb, var(--panel2) 42%, var(--panel)); }
.data-workspace select, .data-workspace input { border-radius: 5px; background: var(--sunken); }

@media (max-width: 1439px) {
  .broadcast-studio .livegrid.with-chat { grid-template-columns: minmax(340px, 390px) minmax(0, 1fr); }
  .broadcast-studio .livegrid.with-chat .fc-card { grid-column: 1 / -1; }
}
@media (max-width: 1050px) {
  .home-command .hero .row { align-items: flex-start; }
  .home-command .kpis { flex-basis: 100%; margin-top: 12px; }
  .home-command > .grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .layout, .layout.side-min { grid-template-columns: minmax(0, 1fr); }
  .product-mark, .nav-group { display: none; }
  .sidebar { padding: 6px; }
  .main { padding: 0 12px 40px; }
  .topbar { min-height: auto; margin-bottom: 14px; }
  .topbar .info .top-kicker { display: none; }
  .hero-kicker { margin-left: 0; }
  .home-command .hero { padding: 18px; }
  .home-command .kpis div { min-width: calc(50% - 4px); }
  .broadcast-studio .livegrid, .broadcast-studio .livegrid.with-chat { grid-template-columns: minmax(0, 1fr); }
  .workspace-heading { align-items: flex-start; flex-direction: column; gap: 7px; }
}
@media (max-width: 700px) {
  .roster-sheet { padding: 12px; }
  .roster-sheet > .row:first-child { display: grid; grid-template-columns: minmax(0, 1fr) minmax(130px, 48%); gap: 8px; align-items: center; }
  .roster-sheet > .row:first-child .spacer { display: none; }
  .roster-sheet > .row:first-child select { width: 100%; }
  .roster-status { padding: 8px; }
  .roster-counts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .roster-counts > span { min-height: 42px; }
  .roster-controls { grid-template-columns: minmax(0, 1fr); }
  .roster-toggle { min-height: 44px; }
  .roster-auto { width: 100%; min-width: 0; white-space: normal; }
  .roster-sheet > .tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
  .roster-sheet > .tabs button { min-width: 0; padding-left: 4px; padding-right: 4px; white-space: normal; }
}
@media (max-width: 560px) {
  .home-command .hero > .row > .emblem { width: 48px !important; height: 48px !important; font-size: 24px !important; }
  .home-command .hero h1 { font-size: 1.5em; }
  .home-command .kpis div { min-width: 100%; }
  .next-game .vs { justify-content: flex-start; }
  .broadcast-studio .live-scorecard { padding: 10px; }
  .live-meta .tabs { width: 100%; }
}
@media (max-width: 380px) {
  /* 320px 기기에서는 전역 grid의 330px 최소 열 폭이 본문보다 커지므로 한 열을 유동 폭으로 축소한다. */
  .grid, .grid.grid-wide, .grid3 { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }

/* 모바일 × 특수 테마 호환 보정 */
/* 중계 스튜디오의 고정 암색 배경이 밝은 테마 글자색과 충돌하지 않게 테마 패널을 따른다. */
.broadcast-studio .live-scorecard,
.broadcast-studio .f3d-card { background: var(--panel); color: var(--text); }
.home-command .next-game { background: var(--panel); }

@media (max-width: 860px) {
  /* 가로 메뉴는 그대로 스와이프할 수 있게 두되 브라우저 스크롤바가 UI처럼 보이지 않게 한다. */
  .sidebar { scrollbar-width: none; overscroll-behavior-x: contain; }
  .sidebar::-webkit-scrollbar { display: none; }
  .nav button { scroll-snap-align: start; }
  .nav { scroll-snap-type: x proximity; }
  /* 신문 테마의 전역 카드 패딩(2px)이 홈 히어로 내용까지 가장자리에 붙이지 않도록 복원한다. */
  [data-theme="newspaper"] .home-command .hero { padding: 18px; }
  /* 밝은 특수 테마의 실시간 중계 카드 내부 보조 글자도 패널 명도에 맞춘다. */
  html:is([data-theme="scorebook"], [data-theme="broadcast"], [data-theme="newspaper"], [data-theme="retro"])
    .broadcast-studio :is(.live-scorecard, .f3d-card) .muted { color: var(--muted); }
}

/* ---------- 풀 경기 모드: 공 하나하나 (src/ui/views/pitches.js) ---------- */
.f3d-count { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 6px; background: rgba(255,255,255,.12); font-size: 0.857em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pseq { display: inline-flex; flex-wrap: wrap; gap: 2px; margin-left: 6px; vertical-align: 1px; }
.pseq .pq { font-style: normal; font-size: 0.714rem; line-height: 1; padding: 2px 3px; border-radius: 4px; background: var(--sunken); color: var(--muted); border: 1px solid var(--line); }
.pseq .pq.B { color: #3fbf6f; border-color: rgba(63,191,111,.45); }
.pseq .pq.S, .pseq .pq.W { color: #e0a800; border-color: rgba(224,168,0,.45); }
.pseq .pq.F { color: var(--info); border-color: rgba(108,196,255,.4); }
.pseq .pq.X, .pseq .pq.H { color: var(--text); border-color: var(--line2); font-weight: 700; }

/* === 모바일 상단 바 · 접이식 메뉴 (app.js mnav) === */
.mnav-btn, .mnav-backdrop, .mnav-extra { display: none; }
@media (max-width: 860px) {
  /* 메뉴 나열은 접어 두고 ☰ 로 펼친다. 상단에는 날짜·일차와 진행 버튼만 고정 */
  .layout > .sidebar { display: none; }
  .layout.mnav-open > .sidebar { display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; width: min(290px, 84vw); height: auto; z-index: 60; overflow-x: hidden; overflow-y: auto; padding: 14px 12px 24px; box-shadow: 0 0 40px rgba(0,0,0,.45); }
  .layout.mnav-open > .mnav-backdrop { display: block; position: fixed; inset: 0; z-index: 59; background: rgba(0,0,0,.45); }
  .layout.mnav-open .brand { display: flex; margin-bottom: 8px; }
  .layout.mnav-open .nav-group { display: block; }
  .layout.mnav-open .nav { flex-direction: column; scroll-snap-type: none; }
  .layout.mnav-open .nav button { white-space: normal; }
  .layout.mnav-open .nav button.active::before { left: -12px; right: auto; top: 7px; bottom: 7px; width: 3px; height: auto; border-radius: 0 4px 4px 0; }
  .layout.mnav-open .mnav-extra { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line2); }
  .layout.mnav-open .mnav-extra > span { flex-basis: 100%; font-size: .9em; }
  .mnav-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; min-height: 40px; padding: 0 10px; font-size: 1.25em; line-height: 1; }
  .topbar { position: sticky; top: 0; z-index: 30; min-height: auto; padding: 6px 0; margin-bottom: 10px; background: var(--bg); gap: 6px; flex-wrap: wrap; }
  .topbar .info { min-width: 0; flex: 1 1 0; }
  .topbar .info b { font-size: 1em; }
  .topbar .info span { margin-left: 6px; }
  .topbar .info .top-rec { display: none; }
  .topbar .tools > :not(.attn) { display: none; }
  .topbar .actions { width: 100%; flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; gap: 6px; scrollbar-width: none; }
  .topbar .actions::-webkit-scrollbar { display: none; }
  .topbar .actions button, .topbar .actions .seg { flex: 0 0 auto; white-space: nowrap; }
}

/* === 난이도 설정 표 (system.js) === */
.diff-table td.on { font-weight: 700; color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.diff-table th, .diff-table td { white-space: nowrap; }
.diff-card .tablewrap { overflow-x: auto; }

/* === 경기 화면 UI · 박스스코어 · 팬 채팅 (중계 탭 · 자동 진행 속도 · 전체 화면 문자 중계 · 스코어보드 스타일) === */
/* 중계 탭(📝 문자 / 🏟️ 2D / 🧊 3D / 🎬 4D): 좁은 화면에서도 한 줄 */
.live-meta .tabs { flex-wrap: nowrap; max-width: 100%; }
.live-meta .tabs button { white-space: nowrap; }
@media (max-width: 700px) {
  .live-meta .tabs { display: flex; width: 100%; }
  .live-meta .tabs button { flex: 1 1 0; min-width: 0; padding: 5px 4px; overflow: hidden; text-overflow: ellipsis; }
}
/* 자동 진행 속도 (느리게 · 보통 · 빠르게) */
.lc-run .lc-autorow { grid-column: 1 / -1; display: flex; gap: 6px; align-items: stretch; min-width: 0; }
.lc-run .lc-autorow .lc-auto { flex: 1 1 auto; min-width: 0; }
.auto-seg { flex: none; align-items: center; }
.lc-run .auto-seg button, .f3d-bar .auto-seg button { padding: 6px 7px; font-size: .82em; flex: 0 0 auto; min-width: 0; }
/* 빨리감기 배속: '이닝 끝까지' 전용 */
.ff-seg .ff-lab { align-self: center; padding: 0 6px 0 4px; font-size: .78em; color: var(--muted); white-space: nowrap; flex: none; }
.lc-run .ff-seg .ff-lab { flex: none; }
.lc-run button.ff-on { grid-column: span 1; }
.f3d-bar .seg button { flex: 0 0 auto; }
.f3d-full .ff-seg .ff-lab { color: #c9d4ce; }
@media (max-width: 700px) { .f3d-bar .ff-seg .ff-lab { display: none; } }

/* 전체 화면 문자 중계 오버레이: 오른쪽 위 (팬 채팅은 왼쪽 아래) */
.f3d-full .f3d-log { position: absolute; right: 16px; top: 64px; width: min(340px, 36vw); max-height: min(46vh, calc(100% - 210px)); display: flex; flex-direction: column; background: rgba(5,8,11,.66); border-radius: 10px; padding: 6px 10px 8px; color: #e8eef0; z-index: 2; }
.f3d-log-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .8em; font-weight: 700; color: #c9d4ce; padding-bottom: 4px; margin-bottom: 4px; border-bottom: 1px solid rgba(255,255,255,.12); }
.f3d-log-head button { background: rgba(5,8,11,.6); color: #e8eef0; border-color: rgba(255,255,255,.25); }
.f3d-full .f3d-log .log { max-height: none; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; -webkit-overflow-scrolling: touch; font-size: .84em; }
.f3d-full .f3d-log .log div { border-bottom-color: rgba(255,255,255,.08); padding: 3px 2px; }
.f3d-full .f3d-log .log :is(.final, .head) { color: #fff; }
.f3d-full .f3d-log .log .inning-end, .f3d-full .f3d-log .log .log-clk { color: #a9b6b0; }

/* 전체 화면 미니 채팅: 터치·휠로 이전 채팅을 스크롤해 볼 수 있게 (예전에는 pointer-events:none + overflow:hidden + flex-end 로 스크롤 불가) */
.f3d-full .fc-list.mini { max-height: min(30vh, 260px); overflow-y: auto; pointer-events: auto; overscroll-behavior: contain; touch-action: pan-y; -webkit-overflow-scrolling: touch; justify-content: flex-start; }
.f3d-full .fc-list.mini > :first-child { margin-top: auto; }
.fc-list { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
@media (max-width: 700px) {
  /* 좁은 화면: 문자 중계·채팅을 진행 버튼 아래로 쌓고, 화면이 넘치면 전체 화면 안에서 스크롤 */
  .f3d-full { justify-content: safe center; overflow-y: auto; overscroll-behavior: contain; }
  .f3d-full .f3d-log { position: static; order: 9; width: 100%; max-width: 960px; max-height: none; margin: 8px auto 0; }
  .f3d-full .f3d-log .log { max-height: 24vh; }
  .f3d-full .fc-list.mini { max-height: 24vh; }
}

/* 박스스코어 모달: 좁은 화면에서 표가 영역 밖으로 나가지 않고 가로 스크롤 */
.boxscore { min-width: 0; }
.boxscore .tablewrap { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.boxscore .scoreboard { overflow: visible; }
.boxscore .box-line th.l { white-space: normal; min-width: 9em; }
.boxscore .box-other { margin-top: 14px; border: 1px solid var(--line2); border-radius: var(--radius-s); padding: 8px 10px; }
.boxscore .box-other > summary { cursor: pointer; }
.boxscore .box-other[open] > summary { margin-bottom: 8px; }
.box-mvp { color: #f5c542; }
.modal:has(.boxscore) { min-width: 0; max-width: 100%; }
@media (max-width: 700px) {
  .overlay:has(.boxscore) { padding: 12px 8px; }
  .modal:has(.boxscore) { padding: 16px 12px; }
}


/* === 트레이드 제안 의견 (home.js tradeAdvice) === */
.trade-advice { display: grid; gap: 6px; margin: 8px 0; padding: 8px 10px; border: 1px solid var(--line2); border-radius: var(--radius-s, 7px); background: var(--sunken, var(--panel2)); }
.trade-advice .ta-row { display: grid; grid-template-columns: minmax(0, auto) auto; gap: 2px 8px; align-items: center; }
.trade-advice .ta-who { min-width: 0; }
.trade-advice .ta-stance { justify-self: end; font-weight: 800; font-size: .85em; padding: 1px 8px; border-radius: 999px; border: 1px solid currentColor; }
.trade-advice .ta-stance.ok { color: #3fbf6f; } .trade-advice .ta-stance.no { color: #e5534b; } .trade-advice .ta-stance.mid { color: var(--muted); }
.trade-advice .ta-why { grid-column: 1 / -1; font-size: .92em; color: var(--text); }

/* === 중계 재생 계획·큰 글씨·HUD 문구 === */
/* 대결 정보 뱃지: 타순 · 투수 역할 (줄 높이가 바뀌지 않게 고정 높이, 이름이 먼저 말줄임) */
.f3d-chip.badge { height: 22px; padding: 0 7px; font-size: 0.8rem; font-weight: 800; color: var(--text); background: var(--panel2); border-color: var(--line); flex: none; }
.f3d-chip.badge.sp { color: #fff; background: #2f7d5b; border-color: transparent; }
.f3d-chip.badge.rp { color: #fff; background: #5f6b7a; border-color: transparent; }
.f3d-chip.badge.su { color: #fff; background: #8a5bd1; border-color: transparent; }
.f3d-chip.badge.cl { color: #fff; background: #c8452f; border-color: transparent; }
.f3d-chip.badge.order { color: var(--accent2); border-color: color-mix(in srgb, var(--accent2) 55%, transparent); }
.lc-badge { display: inline-block; vertical-align: middle; height: 18px; line-height: 18px; padding: 0 6px; margin: -2px 2px 0; border-radius: 999px; font-size: .78em; font-weight: 800; white-space: nowrap; color: var(--text); background: var(--panel2); border: 1px solid var(--line); }
.lc-badge.sp { color: #fff; background: #2f7d5b; border-color: transparent; }
.lc-badge.rp { color: #fff; background: #5f6b7a; border-color: transparent; }
.lc-badge.su { color: #fff; background: #8a5bd1; border-color: transparent; }
.lc-badge.cl { color: #fff; background: #c8452f; border-color: transparent; }
@media (max-width: 700px) {
  .f3d-side { height: 26px; }
  .f3d-side .f3d-chip.num[title="구속"] { display: none; } /* 좁은 화면: 뱃지 자리를 위해 구속 칩은 숨김 (투구 때 화면에 구속 표시) */
  .f3d-chip.badge { padding: 0 5px; font-size: 0.75rem; }
}
/* 투수·타자 정보: 이름을 우선하고 역할·손·기록은 방송용 축약 칩으로 고정한다. */
.f3d-side, .f3d-side.p, .f3d-side.b {
  display: grid; grid-template-columns: clamp(48px, 6vw, 58px) minmax(80px, 1fr) 120px; align-items: center;
  justify-content: stretch; text-align: left; column-gap: 6px;
}
.f3d-side .f3d-role, .f3d-side .f3d-name, .f3d-side .f3d-chips { order: initial !important; min-width: 0; }
.f3d-side .f3d-role { overflow: hidden; white-space: nowrap; }
.f3d-side .f3d-name { width: 100%; text-overflow: ellipsis; }
.f3d-side .f3d-chips { display: grid; grid-template-columns: 42px 26px 46px; gap: 3px; width: 120px; }
.f3d-side .f3d-chip { width: 100%; min-width: 0; padding: 0 2px; justify-content: center; overflow: hidden; text-overflow: clip; font-size: .72rem; }
.f3d-side .f3d-chip small { margin-left: 1px; font-size: .66em; font-weight: 800; opacity: .72; }
.f3d-chip.hand.s { border-color: transparent; }
.f3d-side .f3d-chip.num[title] { display: inline-flex; }
@media (max-width: 700px) {
  .f3d-side, .f3d-side.p, .f3d-side.b { grid-template-columns: 25px minmax(80px, 1fr) 116px; column-gap: 4px; }
  .f3d-side .f3d-role > span { display: none; }
  .f3d-side .f3d-chips { grid-template-columns: 42px 24px 44px; gap: 3px; width: 116px; }
  .f3d-side .f3d-name { font-size: 1.03rem; }
  .f3d-side .f3d-chip { font-size: .68rem; }
}
/* 2D 중계: 교체 알림 · 판정 · 투구 속도 */
.f2d-sub2 { font-size: 12px; font-weight: 800; fill: #fff; paint-order: stroke; stroke: rgba(5,9,18,.85); stroke-width: 4px; }
.f2d-call { font-size: 27px; transform-box: fill-box; transform-origin: center; }
.f2d-call.B { fill: #7ef0a0; stroke: #0d3a1e; } .f2d-call.F { fill: #fff; }
.f2d-spd { font-size: 12px; fill: #ffd34d; }
/* 2D 득점 점수판: 팀 엠블럼 + 점수 칸 여백 (두 자리 점수도 이름과 붙지 않게) */
.f2d-score-flash { grid-template-columns: minmax(0,1fr) auto auto auto auto auto minmax(0,1fr); }
.f2d-score-flash b { min-width: 1.3ch; text-align: center; font-variant-numeric: tabular-nums; }
.f2d-emb { display: inline-flex; align-items: center; justify-content: center; width: clamp(24px,5vw,40px); height: clamp(24px,5vw,40px); border-radius: 50%; border: 2px solid #fff; font-style: normal; font-size: clamp(13px,2.8vw,22px); line-height: 1; flex: none; }

/* ---------- 모달 겹침 수정: 모바일 sticky 상단바(z 30)보다 위에 ---------- */
.overlay { z-index: 50; }
.dlg-overlay { z-index: 55; }
#toast { z-index: 70; }
@media (max-width: 700px) {
  .overlay { padding: 12px 10px 24px; }
  .modal { padding: 16px 14px; border-radius: 14px; }
  .modal .close { right: 10px; top: 10px; width: 40px; height: 40px; font-size: 1.05em; }
  .modal > .close + * { padding-right: 48px; min-height: 40px; }
}

/* ---------- 시작 화면 ---------- */
.start { max-width: 920px; padding: 44px 20px 48px; }
.st-hero { margin-bottom: 20px; }
.st-hero h1 { margin: 0; line-height: 1.15; }
.st-ver { display: inline-block; margin-top: 8px; padding: 2px 10px; border: 1px solid var(--line2); border-radius: 999px; color: var(--muted); font-size: .78em; font-weight: 700; letter-spacing: .08em; }
.st-lead { margin: 12px 0 0; max-width: 640px; color: var(--muted); font-size: 1.05em; line-height: 1.6; }
.st-cont { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; border-color: var(--accent); }
.st-cont > div { flex: 1; min-width: 0; }
.st-cont b, .st-cont small { display: block; }
.st-cont small { margin-top: 2px; }
.start .st-card { padding: 0; margin: 0; }
.st-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin: 0; padding: 18px 20px; border-bottom: 1px solid var(--line2); }
.st-title small { font-size: .62em; font-weight: 600; }
.st-step { padding: 18px 20px; border-bottom: 1px solid var(--line2); }
.st-step > h3 { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; margin: 0 0 12px; font-size: 1.05em; }
.st-h3sub { font-weight: 500; }
.st-num { display: inline-grid; place-items: center; flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-style: normal; font-size: .78em; font-weight: 800; }
.st-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.st-opt { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1.5px solid var(--line2); border-radius: var(--radius); background: var(--panel2); transition: border-color .15s, background .15s; }
.st-opt:hover { border-color: var(--faint); }
.st-opt input { flex: 0 0 auto; margin: 2px 0 0; }
.st-opt b { display: block; font-size: .95em; }
.st-opt small { display: block; margin-top: 2px; color: var(--muted); font-size: .82em; line-height: 1.4; }
.st-opt:has(input:checked) { border-color: var(--accent); background: var(--tint); }
.st-opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.st-field { display: block; margin-top: 16px; }
.st-step > h3 + .st-field { margin-top: 0; }
.st-lab { display: block; margin-bottom: 6px; color: var(--muted); font-size: .86em; font-weight: 700; }
.st-lab small { font-weight: 500; }
.st-field > input, .st-field > select { width: 100%; max-width: 420px; }
.st-rule { margin: 8px 0 0; }
.st-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 12px; align-items: end; }
.st-form label { display: flex; flex-direction: column; align-items: stretch; gap: 6px; color: var(--muted); font-size: .86em; font-weight: 700; }
.st-form select, .st-form input { width: 100%; font-weight: 400; }
.st-form input[type=color] { height: 36px; }
.st-form .st-wide { grid-column: span 2; }
.st-idrow { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.st-step .muted.small { line-height: 1.5; }
.st-more { margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--line2); }
.st-more summary, .st-fold summary { cursor: pointer; color: var(--muted); font-weight: 700; }
.st-more[open] summary { margin-bottom: 12px; }
.st-go { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 16px 20px; background: var(--panel2); border-radius: 0 0 var(--radius) var(--radius); }
.st-go .primary { min-width: 200px; padding: 11px 22px; font-size: 1.05em; }
.start .st-fold { margin: 12px 0 0; padding: 14px 20px; }
.st-fold[open] summary { margin-bottom: 12px; }
.st-future { padding: 4px 0; }
.st-note { margin: 22px auto 0; max-width: 640px; text-align: center; line-height: 1.6; }

@media (max-width: 700px) {
  .start { padding: 24px 14px 32px; }
  .start h1 { font-size: 1.8em; }
  .st-lead { font-size: .95em; }
  .st-cont { flex-wrap: wrap; }
  .st-cont .primary { flex: 1 1 100%; padding: 10px; }
  .st-title, .st-step { padding: 14px; }
  .st-opts { grid-template-columns: 1fr; gap: 6px; }
  .st-opt { padding: 9px 11px; }
  .start .teams { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; }
  .start .teamcard { padding: 9px; }
  .start .teamcard .row { flex-wrap: nowrap; gap: 8px; }
  .start .teamcard .row > div { min-width: 0; }
  .start .teamcard b { font-size: .95em; overflow-wrap: anywhere; }
  .start .teamcard .tc-sub { display: none; }
  .st-form { grid-template-columns: 1fr 1fr; }
  .st-form > label:first-child, .st-form .st-wide { grid-column: 1 / -1; }
  .st-field > input, .st-field > select { max-width: none; }
  /* 시작 버튼: 폼을 스크롤하는 동안 화면 아래에 고정 */
  .st-go { position: sticky; bottom: 0; z-index: 8; padding: 12px 14px; border-top: 1px solid var(--line2); box-shadow: 0 -8px 20px rgba(0,0,0,.18); }
  html.has-ad .st-go { bottom: var(--ad-h); }
  .st-go .primary { flex: 1 1 100%; min-width: 0; }
  .st-go .hint { flex: 1 1 100%; text-align: center; order: -1; }
  .start .st-fold { padding: 12px 14px; }
}

/* 시작 화면 간소화 (마무리 단계 2칸 · 세이브 가져오기 링크) */
.st-form-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.st-import { display: inline; cursor: pointer; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.st-import input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.st-import:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.start .site-links { margin-top: 20px; line-height: 2; }
@media (max-width: 700px) {
  .st-form-2 { grid-template-columns: 1fr; }
  .start .st-form-2 > label:first-child { grid-column: auto; }
}

/* === 중계 화면 LIVE 표시 · 점수판 스타일 미리보기 · 전체 화면 토글 === */
/* 중계 화면 오른쪽 위 LIVE (parkstyle.bcastLogoHtml) */
.bcast-logo.live-badge { position: absolute; top: 10px; right: 10px; z-index: 3; display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 4px; background: #d7263d; color: #fff; pointer-events: none; user-select: none; box-shadow: 0 1px 4px rgba(0,0,0,.35); font: 900 11px/1 "Pretendard", "Noto Sans KR", system-ui, sans-serif; letter-spacing: .08em; white-space: nowrap; }
.bcast-logo.live-badge .lb-dot { width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: lbBlink 1.4s ease-in-out infinite; }
@keyframes lbBlink { 50% { opacity: .25; } }
.bcast-logo.live-badge.f2d { top: 7%; right: 8px; gap: 3px; height: 18px; padding: 0 5px; font-size: 9.5px; letter-spacing: .04em; }
.bcast-logo.live-badge.f2d .lb-dot { width: 5px; height: 5px; }
.f3d-full .bcast-logo.live-badge { top: 14px; right: 14px; height: 26px; font-size: 13px; }
@media (max-width: 560px) { .bcast-logo.live-badge { top: 6px; right: 6px; height: 17px; padding: 0 6px; font-size: 9px; gap: 4px; } .bcast-logo.live-badge .lb-dot { width: 5px; height: 5px; } }
@media (prefers-reduced-motion: reduce) { .bcast-logo.live-badge .lb-dot { animation: none; } }
/* 설정 > 중계 화면 점수판 미리보기 (sbstyle.js — 실제 중계와 같은 캔버스 그리기) */
.sbp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 42vw), 1fr)); gap: 10px; }
.sbp-item { display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 1px solid var(--line2); border-radius: var(--radius-s, 8px); background: var(--panel2, var(--panel)); }
.sbp-item.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.sbp-cv { width: 100%; height: auto; aspect-ratio: 8 / 3; border-radius: 6px; display: block; }
.sbp-meta { display: flex; flex-direction: column; gap: 2px; min-height: 2.6em; }
/* 전체 화면: 모바일 상단 바(z 30)보다 위, 대화상자(40)·모달(50)보다 아래. 토스트는 전체 화면 위로 */
.f3d-full { z-index: 35; }
#toast { z-index: 45; }
/* 전체 화면 조작 줄 양옆 토글: 왼쪽 끝 팬 채팅 · 오른쪽 끝 문자 중계 (같은 모양) */
.f3d-bar { max-width: none; }
.f3d-bar .f3d-tog { background: rgba(5,8,11,.6); color: #e8eef0; border-color: rgba(255,255,255,.25); white-space: nowrap; }
.f3d-bar .f3d-tog.on { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.55); }
.f3d-bar .f3d-tog.tog-l { margin-right: auto; }
.f3d-bar .f3d-tog.tog-r { margin-left: auto; }
.f3d-bar .f3d-break { display: none; }
.f3d-full .f3d-log { top: 104px; } /* 오른쪽 위 LIVE 표시 아래 */
@media (max-width: 700px) { .f3d-bar .f3d-break { display: block; order: 19; flex: 0 0 100%; height: 0; } .f3d-bar .f3d-tog { order: 20; flex: 1 1 calc(50% - 4px); margin: 0; } }
.f2d-call { font-size: 21px; }

/* 시작 화면 언어 선택 */
.st-hero { position: relative; }
.st-lang { position: absolute; top: 0; right: 0; }
.st-lang .seg button { padding: 4px 10px; font-size: .82em; }
@media (max-width: 700px) { .st-lang { position: static; display: flex; justify-content: flex-end; margin-bottom: 10px; } }
@media (max-width: 560px) { .f3d-full .bcast-logo.live-badge { top: 6px; right: 6px; height: 18px; padding: 0 6px; font-size: 9.5px; gap: 4px; } }
/* 모바일 메뉴 서랍: 검색·도움말을 메뉴 항목과 같은 줄 모양으로 (도구 묶음), 성적·자금 줄은 맨 아래 작게 */
@media (max-width: 860px) { .layout.mnav-open .mnav-extra { border-top: 0; padding-top: 0; margin-top: 0; } .layout.mnav-open .mnav-extra .mnav-tools { flex-basis: 100%; order: -1; } .layout.mnav-open .mnav-extra > span { order: 1; margin: 10px 12px 0; } }
/* 경기 화면 이닝 점수표: 우리 팀 줄에 아주 얇은 팀 컬러 표시 */
.scoreboard.live tr.mine td.l { box-shadow: inset 3px 0 0 color-mix(in srgb, var(--team) 80%, transparent); }
/* 중계 화면을 눌러 멈추면 가운데 ❚❚ 를 다시 재생할 때까지 계속 보여 준다 (match.js setHeld) */
.f3d-card.is-held .live-toggle-pop { animation: liveToggleHold .25s ease-out both; }
.f3d-card.is-held .live-toggle-pop:empty::before { content: '❚❚'; }
@keyframes liveToggleHold { 0% { opacity: 0; transform: translate(-50%,-50%) scale(.7); } 100% { opacity: 1; transform: translate(-50%,-50%) scale(1); } }

/* === 중계 표시 (점수판·자막·투구 수·배지) === */
/* 경기 종료 플레이 재생 중 진행 버튼 ↔ '결과 확정' 버튼을 바꿔 끼우는 자리: 레이아웃에는 끼어들지 않는다 */
.live-ctl { display: contents; }
/* 타순 뱃지('N번')를 투수 역할 뱃지(선발·불펜·셋업·마무리)와 같은 모양·톤으로: 채운 알약 · 흰 글씨 */
.f3d-chip.badge.order, .lc-badge.ord { color: #fff; background: #93661a; border-color: transparent; }
/* 문자 중계는 채팅처럼 최신 줄이 맨 아래. 모바일 전체 화면에서는 문자 패널이 남은 높이를 채워 맨 아래(최신 줄)가 화면 밖으로 밀리지 않게 */
@media (max-width: 700px) {
  .f3d-full .f3d-log { flex: 1 1 0; min-height: 110px; }
  .f3d-full .f3d-log .log { max-height: none; flex: 1; min-height: 0; }
}

/* === 홈: 처리할 업무 선택지 효과 힌트 · 팬 게시판 · 덕아웃 한마디 설정 === */
.msg-choices.with-hints button { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; }
.choice-hint { font-size: .78em; font-weight: 600; opacity: .9; }
.choice-hint { color: var(--muted); }
.choice-hint b.up { color: var(--accent); }
.choice-hint b.dn { color: var(--bad); }
.choice-hint.weak b.up { color: color-mix(in srgb, var(--accent) 55%, var(--muted)); }
.choice-hint.neg { color: color-mix(in srgb, var(--bad) 70%, var(--muted)); }
.talk-rec { font-size: .78em; font-weight: 700; color: var(--accent2); margin-left: 6px; }
.talk-mode-row { margin-top: 10px; gap: 8px; flex-wrap: wrap; }
.fanboard .fb-badge { margin-left: 8px; padding: 1px 8px; border-radius: 999px; font-size: .78em; font-weight: 700; background: var(--bad); color: #fff; }
.fb-list { margin-top: 8px; max-height: 460px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding-right: 4px; }
.fb-day { position: sticky; top: 0; z-index: 1; margin: 8px 0 4px; padding: 2px 0; font-size: .78em; font-weight: 700; color: var(--muted); background: var(--panel); }
.fb-post { padding: 8px 10px; margin-bottom: 6px; border: 1px solid var(--line2); border-left: 3px solid var(--line); border-radius: var(--radius-s); background: var(--sunken); }
.fb-post.m-up { border-left-color: var(--accent); }
.fb-post.m-down { border-left-color: var(--bad); }
.fb-post.new { box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent2) 55%, transparent); }
.fb-head { display: flex; align-items: center; gap: 6px; font-size: .84em; }
.fb-tag { padding: 0 6px; border-radius: 6px; font-size: .86em; background: color-mix(in srgb, var(--text) 10%, transparent); color: var(--muted); }
.fb-post.k-hot .fb-tag { color: var(--accent2); }
.fb-post.k-cyn .fb-tag { color: var(--bad); }
.fb-post.k-ana .fb-tag { color: var(--info); }
.fb-nick { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46%; }
.fb-new { font-size: .72em; font-weight: 800; color: #fff; background: var(--bad); border-radius: 4px; padding: 0 4px; }
.fb-up, .fb-cn { color: var(--muted); white-space: nowrap; }
.fb-text { margin-top: 4px; line-height: 1.45; word-break: keep-all; overflow-wrap: anywhere; }
.fb-cmts { margin-top: 5px; padding-left: 10px; border-left: 2px solid var(--line2); font-size: .82em; color: var(--muted); }
.fb-cnick { font-weight: 700; color: var(--text); opacity: .8; }
.fb-more { width: 100%; margin-top: 4px; }
@media (max-width: 700px) { .fb-list { max-height: 380px; } .msg-choices.with-hints button { flex: 1 1 100%; } }

/* === 가이드·규정 · 경기 전 상대 리포트 · 라이벌 사유 === */
.rules-fold { align-self: start; }
.rules-fold > summary { cursor: pointer; font-weight: 700; font-size: 1.02rem; padding: 2px 0 6px; list-style-position: inside; }
.rules-fold:not([open]) > summary { padding-bottom: 0; }
.rules-fold > .rules-list { margin-top: 4px; }
.rules-hint { margin: 0 0 8px; }
.rival-why { margin-top: 2px; line-height: 1.4; white-space: normal; }
.staff-effects { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px 16px; }
.staff-effects ul { margin-top: 2px; }
.opp-report .or-sec { padding: 8px 0; border-bottom: 1px solid var(--line2); }
.opp-report .or-sec:last-of-type { border-bottom: 0; }
.opp-report h4 { margin: 0 0 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.opp-report h4 .badge { font-weight: 400; font-size: .78em; }
.opp-report p { margin: 3px 0; }
.or-streak { display: inline-flex; gap: 2px; vertical-align: middle; }
.or-streak i { font-style: normal; font-size: .78em; min-width: 1.4em; text-align: center; border-radius: 4px; padding: 0 2px; background: var(--panel2); }
.or-streak i.W { color: var(--accent); } .or-streak i.L { color: var(--bad); } .or-streak i.T { color: var(--muted); }
.or-foot { margin-top: 8px; line-height: 1.5; }
.opp-line { margin: 6px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.opp-report-card > summary { cursor: pointer; }
@media (max-width: 700px) { .opp-report .tablewrap { overflow-x: auto; } .staff-effects { grid-template-columns: 1fr; } }

/* === 도감 · 항성일 === */
/* 항성일(SD) 날짜: SD 숫자는 고정폭, 지구식 날짜는 작게 뒤에 */
.sd-date { white-space: nowrap; }
.sd-date .sd { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.sd-date .sd-earth { color: var(--muted); font-size: .8em; font-weight: 400; }
.sd-tag { font-variant-numeric: tabular-nums; white-space: nowrap; }
td.nowrap { white-space: nowrap; }
.topbar .info span .sd-date, .topbar .info span .sd-date * { margin-left: 0; display: inline; }
.topbar .info span .sd-date b.sd { font-size: 1em; color: var(--text); font-weight: 700; }
@media (max-width: 560px) { .topbar .info span .sd-date .sd-earth { display: none; } }
/* 📚 도감 */
.codex .codex-card h3 { margin-top: 0; }
.codex-table td { vertical-align: top; }
.codex-table td.l.small { min-width: 12em; }
.codex .rules-list li { margin-bottom: 4px; }
@media (max-width: 700px) { .codex-table td.l.small { min-width: 9em; } }

/* === 작전 즉시 적용 (공격·수비 작전 안내) === */
.lc-sec h4 small.lc-apply.now { color: #f5b301; font-weight: 600; }

/* === 모바일 조작 안정성: 상태·문구가 바뀌어도 버튼 위치와 폭을 유지 === */
.live-auto-btn { min-width: 9.6em; text-align: center; }
.lc-grid3 > button, .lc-grid2 > button { width: 100%; min-width: 0; min-height: 38px; }
.lc-run > button, .lc-autorow > button { min-height: 40px; }
.ls-run, .ls-clock, [data-pc], .scoreboard, .kpis b { font-variant-numeric: tabular-nums; }
.ls-run { width: 2ch; text-align: center; }
.finance-warning { border-color: color-mix(in srgb, var(--bad) 62%, transparent); background: color-mix(in srgb, var(--bad) 9%, var(--panel)); }
@media (hover: none) { button:active:not(:disabled) { transform: none; } }
@media (max-width: 700px) {
  button { min-height: 44px; }
  button.small { min-height: 40px; padding-top: 6px; padding-bottom: 6px; }
  .lc-grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: minmax(44px, auto); }
  .lc-grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(44px, auto); }
  .lc-grid3 > button, .lc-grid2 > button { height: 100%; padding-left: 4px; padding-right: 4px; line-height: 1.2; }
  .lc-run { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lc-run > button { width: 100%; min-width: 0; }
  .lc-run .lc-autorow { min-height: 44px; }
  .lc-run .live-auto-btn { min-width: 0; }
  .topbar .actions { min-height: 44px; align-items: stretch; }
  .topbar .actions button, .topbar .actions .seg { min-height: 40px; }
  .topbar .actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; }
  .topbar .actions > button { width: 100%; min-width: 0; white-space: normal; line-height: 1.2; }
  .topbar .actions > .seg { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; min-width: 0; }
  .topbar .actions > .seg button { width: 100%; min-width: 0; padding-left: 4px; padding-right: 4px; }
  .topbar .actions > .err { grid-column: 1 / -1; }
  .live-meta .tabs button { min-height: 40px; }
  .f3d-bar [data-action="live-step"], .f3d-bar [data-action="live-auto"], .f3d-bar .ff-btn { min-width: 9.6em; text-align: center; }
  .msg-choices button { min-width: min(100%, 9em); }
}

/* === 도감 시각 자료 === */
.codex-photo { position: relative; grid-column: 1 / -1; min-height: clamp(250px, 38vw, 430px); margin: 0; overflow: hidden; border: 1px solid color-mix(in srgb, var(--line2) 72%, transparent); border-radius: 16px; background: #09111c; box-shadow: 0 16px 44px rgba(0,0,0,.2); isolation: isolate; }
.codex-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; transition: transform .45s ease; }
.codex-photo:hover img { transform: scale(1.018); }
.codex-photo-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(4,9,15,.92) 0%, rgba(4,9,15,.66) 38%, rgba(4,9,15,.12) 72%), linear-gradient(0deg, rgba(3,8,14,.88), transparent 48%); }
.codex-photo figcaption { position: absolute; z-index: 1; left: clamp(18px, 4vw, 48px); right: clamp(18px, 4vw, 48px); bottom: clamp(18px, 4vw, 42px); max-width: 620px; color: #f4f7fb; text-shadow: 0 2px 14px rgba(0,0,0,.7); }
.codex-photo figcaption > small { display: block; margin-bottom: 8px; color: #a9d8ff; font-size: .7em; font-weight: 900; letter-spacing: .16em; }
.codex-photo figcaption > b { display: block; font-size: clamp(1.45em, 3vw, 2.45em); line-height: 1.08; letter-spacing: -.025em; }
.codex-photo figcaption p { max-width: 56ch; margin: 10px 0 14px; color: rgba(244,247,251,.82); line-height: 1.55; }
.codex-photo figcaption div { display: flex; flex-wrap: wrap; gap: 7px; }
.codex-photo figcaption div span { padding: 5px 9px; border: 1px solid rgba(255,255,255,.24); border-radius: 999px; background: rgba(7,14,24,.52); color: #fff; font-size: .72em; font-weight: 800; backdrop-filter: blur(8px); }
.frame-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 10px; margin: 14px 0 18px; }
.frame-tile { min-width: 0; padding: 10px; border: 1px solid var(--line2); border-radius: 12px; background: linear-gradient(145deg, color-mix(in srgb, var(--panel2) 82%, transparent), var(--sunken)); }
.frame-tile b, .frame-tile small, .frame-tile .frame-size { display: block; }
.frame-tile > small { color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.frame-size { margin-top: 5px; color: var(--muted); font-size: .72em; font-variant-numeric: tabular-nums; }
.frame-mods { margin-top: 5px; min-height: 2.5em; font-size: .72em; line-height: 1.25; }
.frame-visual { height: 122px; display: grid; place-items: center; margin: -3px 0 4px; border-radius: 9px; background: radial-gradient(circle at 50% 70%, color-mix(in srgb, var(--accent) 15%, transparent), transparent 58%); overflow: hidden; }
.frame-svg { width: 96px; height: 120px; fill: color-mix(in srgb, var(--text) 72%, var(--panel)); stroke: color-mix(in srgb, var(--text) 42%, transparent); stroke-width: 3; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.frame-svg .core { fill: var(--accent2); stroke: color-mix(in srgb, var(--accent2) 45%, white); }
.frame-svg .glow { fill: color-mix(in srgb, var(--accent) 18%, transparent); stroke: var(--accent); }

.solar-map { margin: 12px 0 16px; padding: 10px; border: 1px solid var(--line2); border-radius: 14px; overflow: hidden; background: radial-gradient(circle at 14% 50%, rgba(255,177,49,.12), transparent 28%), linear-gradient(145deg, #080e1b, #101a2e); }
.solar-map svg { display: block; width: 100%; max-height: 330px; }
.solar-map .sun { fill: url(#sunGlow); }
.solar-map .orbit { fill: none; stroke: rgba(183,211,255,.16); stroke-width: 1; }
.solar-map .world-pin > circle:nth-child(2) { fill: none; stroke-width: 1.5; opacity: .5; }
.solar-map .world-pin text { fill: #e8eef9; font-size: 10px; font-weight: 700; text-anchor: middle; paint-order: stroke; stroke: #08101e; stroke-width: 3px; }
.solar-legend { display: flex; justify-content: flex-end; gap: 14px; color: #b9c5d8; font-size: .76em; }
.solar-legend i { display: inline-block; width: 9px; height: 9px; margin-right: 5px; border-radius: 50%; background: var(--accent); }
.solar-legend .dome { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }

.pa-flow { display: grid; grid-template-columns: repeat(9, auto); align-items: center; gap: 8px; margin-top: 8px; }
.pa-node { min-width: 105px; min-height: 82px; display: flex; flex-direction: column; justify-content: center; padding: 10px; border: 1px solid var(--line2); border-top: 4px solid var(--muted); border-radius: 11px; text-align: center; background: var(--sunken); }
.pa-node small { margin-top: 5px; color: var(--muted); line-height: 1.25; }
.pa-node.duel { border-top-color: var(--info); }.pa-node.k { border-top-color: var(--accent2); }.pa-node.bb { border-top-color: #62c987; }.pa-node.hr { border-top-color: #e86d5a; }.pa-node.bip { border-top-color: var(--accent); }
.pa-arrow { color: var(--muted); font-size: 1.25em; }
.pa-flow p { grid-column: 1 / -1; margin: 4px 0 0; color: var(--muted); font-size: .84em; }

.robot-anatomy { position: relative; min-height: 300px; margin: 10px 0 16px; border: 1px solid var(--line2); border-radius: 14px; background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--accent) 15%, transparent), transparent 40%), var(--sunken); overflow: hidden; }
.anatomy-bot { position: absolute; inset: 24px calc(50% - 65px); display: grid; place-items: center; }
.anatomy-bot .frame-svg { width: 130px; height: 240px; }
.an-call { position: absolute; width: 30%; padding: 7px 10px; border: 1px solid var(--line2); border-radius: 9px; background: color-mix(in srgb, var(--panel) 90%, transparent); }
.an-call::after { content: ""; position: absolute; top: 50%; width: 48px; border-top: 1px dashed var(--accent); }
.an-call b, .an-call span { display: block; }.an-call span { margin-top: 2px; color: var(--muted); font-size: .78em; }
.an-call.c1 { left: 3%; top: 12%; }.an-call.c2 { left: 3%; top: 64%; }.an-call.c3 { right: 3%; top: 10%; }.an-call.c4 { right: 3%; top: 42%; }.an-call.c5 { right: 3%; top: 73%; }
.an-call.c1::after, .an-call.c2::after { left: 100%; }.an-call.c3::after, .an-call.c4::after, .an-call.c5::after { right: 100%; }

.energy-viz { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 10px 0 14px; }
.energy-panel { padding: 12px; border: 1px solid var(--line2); border-radius: 12px; background: var(--sunken); }
.ev-head { display: flex; justify-content: space-between; gap: 8px; }.ev-head span { color: var(--muted); font-size: .78em; }
.ev-track { position: relative; display: flex; height: 18px; margin: 18px 0 26px; overflow: visible; border-radius: 999px; background: var(--panel2); }
.ev-track > i { display: block; height: 100%; }.ev-track .safe { width: 70%; background: #48bd78; border-radius: 999px 0 0 999px; }.ev-track .warn { width: 8%; background: #f0b849; }.ev-track .danger { width: 22%; background: #dc5c55; border-radius: 0 999px 999px 0; }
.energy-panel.charge .ev-track { transform: scaleX(-1); }.energy-panel.charge .ev-track mark { transform: translateX(-50%) scaleX(-1); }
.ev-track mark { position: absolute; top: 22px; padding: 0; color: var(--muted); background: none; font-size: .72em; transform: translateX(-50%); }
.energy-panel p { margin: 0; color: var(--muted); font-size: .8em; }

.lineage-map { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; margin: 10px 0 16px; }
.lineage-node { position: relative; padding: 10px; border-left: 3px solid var(--accent); border-radius: 7px; background: var(--sunken); }
.lineage-node b, .lineage-node span, .lineage-node small { display: block; }.lineage-node span { margin-top: 3px; color: var(--accent2); font-size: .78em; }.lineage-node small { margin-top: 4px; color: var(--muted); line-height: 1.25; }

.env-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; margin: 12px 0 18px; }
.env-card { overflow: hidden; border: 1px solid var(--line2); border-radius: 12px; background: var(--sunken); }
.env-art { position: relative; height: 82px; display: flex; align-items: flex-end; padding: 12px; background: linear-gradient(145deg, #17253d, #0c1423); overflow: hidden; }
.env-art::before, .env-art::after, .env-art i { content: ""; position: absolute; border-radius: 50%; }
.env-art::before { width: 120px; height: 120px; right: -30px; top: -55px; background: color-mix(in srgb, var(--accent) 28%, transparent); box-shadow: 0 0 35px color-mix(in srgb, var(--accent) 22%, transparent); }
.env-art::after { width: 4px; height: 4px; left: 22%; top: 25%; background: #fff; box-shadow: 45px 12px #fff, 100px -7px #fff, 155px 21px #fff, 210px 1px #fff; opacity: .7; }
.env-art i { width: 65%; height: 18px; left: -8%; top: 38%; border: 2px solid color-mix(in srgb, var(--accent2) 55%, transparent); transform: rotate(-8deg); }
.env-art b { position: relative; z-index: 1; color: #fff; text-shadow: 0 2px 8px #000; }
.env-plasma .env-art { background: linear-gradient(135deg, #431b2d, #1e142d); }.env-cold .env-art { background: linear-gradient(135deg, #173d58, #101c35); }.env-nebula .env-art { background: linear-gradient(135deg, #302050, #11152d); }.env-gravity .env-art { background: linear-gradient(135deg, #253650, #101722); }
.env-meters { padding: 9px 10px 4px; }.env-meters span { display: grid; grid-template-columns: 48px 1fr 42px; align-items: center; gap: 6px; margin-bottom: 5px; font-size: .72em; }
.env-meters em { color: var(--muted); font-style: normal; }.env-meters span > i { height: 5px; border-radius: 9px; background: linear-gradient(90deg, var(--accent) var(--v), var(--panel2) var(--v)); }.env-meters b { text-align: right; font-variant-numeric: tabular-nums; }
.env-card p { margin: 2px 10px 10px; color: var(--muted); font-size: .76em; }

@media (max-width: 860px) {
  .pa-flow { grid-template-columns: 1fr 20px 1fr; }
  .pa-flow .pa-node:nth-of-type(3), .pa-flow .pa-node:nth-of-type(4), .pa-flow .pa-node:nth-of-type(5) { }
  .pa-flow p { grid-column: 1 / -1; }
  .energy-viz { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .codex-photo { min-height: 340px; border-radius: 13px; }
  .codex-photo img { object-position: 58% center; }
  .codex-photo-shade { background: linear-gradient(0deg, rgba(3,8,14,.96) 0%, rgba(3,8,14,.68) 55%, rgba(3,8,14,.08) 100%); }
  .codex-photo figcaption { left: 16px; right: 16px; bottom: 16px; }
  .codex-photo figcaption > b { font-size: 1.5em; }
  .codex-photo figcaption p { margin: 8px 0 11px; font-size: .83em; line-height: 1.42; }
  .frame-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .frame-tile { padding: 8px; }.frame-visual { height: 108px; }.frame-svg { height: 106px; }
  .pa-flow { display: flex; flex-direction: column; align-items: stretch; }.pa-arrow { transform: rotate(90deg); text-align: center; line-height: .8; }.pa-node { min-height: 64px; }
  .robot-anatomy { min-height: 420px; }.anatomy-bot { inset: 100px calc(50% - 55px); }.anatomy-bot .frame-svg { width: 110px; height: 210px; }
  .an-call { width: 43%; }.an-call::after { display: none; }.an-call.c1 { top: 3%; }.an-call.c3 { top: 3%; }.an-call.c2 { top: auto; bottom: 3%; }.an-call.c4 { top: auto; bottom: 3%; right: 28%; }.an-call.c5 { top: 46%; }
  .solar-map { padding: 4px; }.solar-map svg { min-width: 520px; transform: translateX(-72px); }.solar-legend { justify-content: flex-start; flex-wrap: wrap; padding: 4px 6px; }
}
