/* 2026-2 AI·SW 게임대회 운영 — 다크 스코어보드 테마 */
:root {
  --bg: #0b0d12; --bg-2: #0f1218;
  --panel: #13171e; --panel-2: #1a1f28; --panel-3: #222935;
  --line: #232a35; --line-2: #313a48;
  --ink: #eef1f6; --ink-2: #c3c9d4; --muted: #8b94a4; --faint: #5f6777;
  --accent: #c6ff3d; --accent-hover: #d6ff70; --accent-ink: #0b0d12; --accent-soft: rgba(198, 255, 61, .1); --accent-line: rgba(198, 255, 61, .35);
  --ok: #3ddc97; --ok-soft: rgba(61, 220, 151, .12); --ok-line: rgba(61, 220, 151, .35);
  --warn: #ffb547; --warn-soft: rgba(255, 181, 71, .12); --warn-line: rgba(255, 181, 71, .35);
  --bad: #ff5c6c; --bad-soft: rgba(255, 92, 108, .12); --bad-line: rgba(255, 92, 108, .4);
  --info: #5cc8ff; --info-soft: rgba(92, 200, 255, .12);
  --purple: #b58cff; --purple-soft: rgba(181, 140, 255, .14);
  --rec: #ff3b5c; --blue: #4c8dff; --red: #ff5c6c;
  --fc: #3ddc97; --lol: #f0b93c;
  --r: 8px; --r-sm: 6px;
  --mono: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
  --tb-h: 56px;
  color-scheme: dark;
  accent-color: var(--accent);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; background: var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
  word-break: keep-all; overflow-wrap: anywhere; -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent); color: var(--accent-ink); }
a { color: var(--accent); text-underline-offset: 3px; }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.3; letter-spacing: -.01em; }
h1 { font-size: 1.5rem; font-weight: 800; } h2 { font-size: 1.12rem; font-weight: 750; } h3 { font-size: 1rem; font-weight: 700; }
p { margin: .3em 0; }
ul { padding-left: 1.2em; margin: .4em 0; }
.boot { padding: 3rem 1rem; color: var(--muted); text-align: center; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 16px 16px 48px; }
.narrow { max-width: 720px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--panel-3); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

/* ── 워드마크 ── */
.wordmark { display: inline-flex; align-items: baseline; gap: 6px; text-decoration: none; color: var(--ink); flex: none; line-height: 1; }
.wordmark span { font-weight: 900; font-style: italic; letter-spacing: -.02em; font-size: 1.05rem; color: var(--accent); }
.wordmark i { font-style: normal; font-family: var(--mono); font-size: .72rem; font-weight: 700; color: var(--muted); }
.wordmark.big span { font-size: 2.4rem; }
.wordmark.big i { font-size: 1rem; }

/* ── 상단 바 ── */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(11, 13, 18, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); }
.topbar-in { max-width: 1180px; margin: 0 auto; min-height: var(--tb-h); padding: 6px 16px; display: flex; align-items: center; gap: 14px; }
.topbar a { color: var(--ink); text-decoration: none; }
.topbar .wordmark span { color: var(--accent); }
.tb-back { width: 36px; height: 36px; border-radius: var(--r); display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line-2); font-size: 1.5rem; line-height: 1; flex: none; color: var(--ink); }
.tb-back:hover { border-color: var(--accent); color: var(--accent) !important; }
.tb-back span { margin-top: -3px; }
.topbar .title { font-weight: 750; font-size: .98rem; flex: 1; min-width: 0; line-height: 1.25; border-left: 1px solid var(--line-2); padding-left: 14px; }
.topbar .tb-back + .title { border-left: 0; padding-left: 0; }
.topbar .title a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .title small { display: block; font-weight: 450; color: var(--muted); font-size: .76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.tb-clock { font-family: var(--mono); font-weight: 700; font-size: .85rem; color: var(--ink-2); padding: 4px 8px; border: 1px solid var(--line-2); border-radius: var(--r-sm); display: inline-flex; align-items: center; gap: 6px; }
.tb-clock::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.tb-link { font-size: .82rem; font-weight: 700; padding: 6px 10px; border-radius: var(--r-sm); border: 1px solid var(--line-2); }
.tb-link:hover { border-color: var(--accent); color: var(--accent) !important; }
button.tb-user { min-height: 34px; padding: 2px 10px 2px 2px; border-radius: 999px; gap: 8px; background: var(--panel-2); border: 1px solid var(--line-2); color: var(--ink); font-size: .84rem; }
button.tb-user:hover { border-color: var(--accent); background: var(--panel-2); }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 900; flex: none; }
.avatar.admin { background: var(--warn); }
.tb-name { max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.crumbs { font-size: .8rem; color: var(--muted); margin: 0 0 10px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }

/* 섹션 머리: 방송 자막 느낌 */
.sec-h { display: flex; align-items: center; gap: 10px; margin: 22px 0 10px; font-size: .78rem; font-weight: 800; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; }
.sec-h::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.sec-h > span:first-child { color: var(--ink-2); }
.sec-count { font-family: var(--mono); color: var(--accent); order: 2; }
.sec-h::after { order: 1; }

/* ── 카드·레이아웃 ── */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin-bottom: 12px; }
.card.flat { background: transparent; }
.card h3 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card > h3:first-child, .card > h2:first-child { margin-bottom: .6em; }
section > h2 { margin: 26px 0 10px; display: flex; align-items: baseline; gap: 8px; }
.grid { display: grid; gap: 12px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); }
.grid.four { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 10px; }
.muted { color: var(--muted); } .small { font-size: .84rem; } .tiny { font-size: .74rem; }
.mono { font-family: var(--mono); }
.right { margin-left: auto; }
.hidden { display: none !important; }
hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.empty { text-align: center; padding: 40px 20px; border: 1px dashed var(--line-2); border-radius: var(--r); margin-top: 20px; }
.empty b { display: block; font-size: 1.1rem; margin-bottom: 4px; }
.empty .btn, .empty button { margin-top: 14px; }
.foot { text-align: center; margin-top: 28px; font-size: .78rem; color: var(--faint); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }

/* ── 버튼·입력 ── */
button, .btn {
  appearance: none; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--ink);
  border-radius: var(--r); padding: 9px 15px; font: inherit; font-weight: 700; cursor: pointer;
  min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none;
  touch-action: manipulation; transition: background-color .12s, border-color .12s, color .12s;
}
button:hover, .btn:hover { border-color: #4a5566; background: var(--panel-3); }
button:active, .btn:active { transform: translateY(1px); }
button:disabled, button:disabled:hover { opacity: .4; cursor: not-allowed; transform: none; }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.primary:hover, .btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button.ok { background: var(--ok); border-color: var(--ok); color: #04140c; }
button.danger { background: transparent; border-color: var(--bad-line); color: var(--bad); }
button.danger:hover { background: var(--bad-soft); border-color: var(--bad); }
.modal .actions button.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
button.rec { background: var(--rec); border-color: var(--rec); color: #fff; }
button.ghost, .btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
button.ghost:hover, .btn.ghost:hover { background: var(--panel-2); border-color: var(--line-2); color: var(--ink); }
button.link { background: none; border: 0; color: var(--muted); padding: 4px 2px; min-height: 0; font-weight: 600; }
button.link:hover { background: none; color: var(--accent); }
button.small, .btn.small { min-height: 34px; padding: 5px 11px; font-size: .84rem; border-radius: var(--r-sm); }
button.big, .btn.big { min-height: 54px; font-size: 1.05rem; padding: 12px 20px; }
.block { width: 100%; }
button.sel { border-color: var(--accent); color: var(--accent); }
a.btn { color: var(--ink); }
a.btn.primary { color: var(--accent-ink); }

.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; background: var(--bg-2); }
.seg button { border: 0; border-radius: 0; min-height: 40px; border-right: 1px solid var(--line); font-weight: 700; padding: 8px 12px; color: var(--muted); background: transparent; }
.seg button:last-child { border-right: 0; }
.seg button:hover { background: var(--panel-2); color: var(--ink); }
.seg button.on { background: var(--accent); color: var(--accent-ink); }
.seg button.on.present { background: var(--ok); color: #04140c; }
.seg button.on.absent { background: var(--bad); color: #fff; }
.seg button.on.forfeit { background: var(--purple); color: #140a24; }
.seg button.on.unknown { background: var(--panel-3); color: var(--ink); }
.seg button.on.blue { background: var(--blue); color: #fff; } .seg button.on.red { background: var(--red); color: #fff; }

input, select, textarea {
  font: inherit; border: 1px solid var(--line-2); border-radius: var(--r); padding: 9px 12px; background: var(--bg-2); color: var(--ink);
  min-height: 42px; max-width: 100%; transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input::placeholder, textarea::placeholder { color: var(--faint); }
input[type=checkbox], input[type=radio] { min-height: 0; width: 18px; height: 18px; padding: 0; }
textarea { width: 100%; min-height: 90px; line-height: 1.5; }
input.score { width: 4em; text-align: center; font-size: 1.5rem; font-weight: 800; font-family: var(--mono); padding: 6px; }
input[type=number]::-webkit-inner-spin-button { opacity: .4; }
label.field { display: grid; gap: 6px; font-size: .8rem; font-weight: 700; color: var(--muted); letter-spacing: .02em; }
label.field input, label.field select { width: 100%; }

.chip { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; font-weight: 800; padding: 2px 8px; border-radius: 4px; background: var(--panel-3); color: var(--ink-2); white-space: nowrap; line-height: 1.5; letter-spacing: .01em; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.brand { background: var(--accent-soft); color: var(--accent); }
.chip.purple { background: var(--purple-soft); color: var(--purple); }
.chip.blue { background: rgba(76, 141, 255, .16); color: #8cb5ff; } .chip.red { background: rgba(255, 92, 108, .16); color: #ff8c97; }
.chip.code { background: var(--accent); color: var(--accent-ink); font-family: var(--mono); }
.notice { border-radius: var(--r); padding: 10px 14px; background: var(--info-soft); color: #bfe8ff; font-size: .9rem; border-left: 3px solid var(--info); margin: 8px 0; }
.notice.warn { background: var(--warn-soft); color: #ffd79a; border-left-color: var(--warn); }
.notice.bad { background: var(--bad-soft); color: #ffb3bb; border-left-color: var(--bad); }
.notice.ok { background: var(--ok-soft); color: #a6f0cd; border-left-color: var(--ok); }
.notice b { color: inherit; }
.notice ul { margin: 6px 0 0; }

/* 탭: 밑줄형 */
.tabs { display: flex; position: sticky; top: calc(var(--tb-h) + env(safe-area-inset-top)); z-index: 15; margin: 0 0 6px; overflow-x: auto; background: var(--bg); border-bottom: 1px solid var(--line); }
.tabs button { flex: 1; min-width: 88px; background: transparent; border: 0; border-bottom: 2px solid transparent; border-radius: 0; color: var(--muted); min-height: 48px; font-weight: 800; }
.tabs button:hover { background: transparent; color: var(--ink); }
.tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }

/* ── 로그인 ── */
.login-page {
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  background:
    linear-gradient(rgba(198, 255, 61, .04) 1px, transparent 1px) 0 0 / 100% 32px,
    radial-gradient(700px 360px at 50% 0%, rgba(198, 255, 61, .08), transparent 70%),
    var(--bg);
}
.login-brand { text-align: center; }
.login-brand p { color: var(--muted); font-size: .84rem; margin-top: 8px; }
.login { width: min(400px, 100%); margin: 24px auto; background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; padding: 24px 22px 18px; }
.login-page .login { margin: 0; }
.login h1 { font-size: 1.3rem; margin-bottom: 4px; }
.login-sub { color: var(--muted); font-size: .88rem; margin-bottom: 18px; }
.login input { font-size: 1.1rem; min-height: 52px; }
.login-err { color: var(--bad); font-size: .86rem; min-height: 1.3em; margin: 6px 0 0; }
.login-foot { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; text-align: center; font-size: .86rem; }
.login-legal { max-width: 400px; text-align: center; font-size: .76rem; color: var(--faint); margin: 0; }

/* ── 홈 ── */
.home-head { padding: 18px 0 6px; }
.home-head h1 { font-size: 1.7rem; margin: 4px 0 2px; }
.home-head .row { margin-top: 14px; }
.kicker { font-family: var(--mono); font-size: .78rem; font-weight: 700; color: var(--accent); letter-spacing: .06em; margin: 0; }
.day { margin-top: 26px; }
.day.past { opacity: .55; }
.day-head { display: flex; align-items: baseline; gap: 10px; text-decoration: none; color: var(--ink); padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 10px; flex-wrap: wrap; }
.day-date { font-family: var(--mono); font-size: 1.9rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.day-dow { font-family: var(--mono); font-size: .8rem; font-weight: 800; color: var(--muted); }
.day-stage { font-weight: 800; font-size: 1.02rem; }
.day-gather { font-size: .8rem; color: var(--muted); }
.dday { margin-left: auto; font-family: var(--mono); font-size: .74rem; font-weight: 800; padding: 3px 8px; border-radius: 4px; border: 1px solid var(--line-2); color: var(--muted); align-self: center; }
.day.today .dday { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.day.today .day-date { color: var(--accent); }
.day.soon .dday { border-color: var(--accent-line); color: var(--accent); }

.games { display: grid; gap: 8px; }
.game { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); position: relative; overflow: hidden; transition: border-color .12s; }
.game::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--fc); }
.game.lol::before { background: var(--lol); }
.game:hover { border-color: var(--line-2); }
.game-main { display: flex; align-items: center; gap: 14px; padding: 14px 16px 10px 20px; color: var(--ink); text-decoration: none; }
.g-tag { font-family: var(--mono); font-weight: 900; font-size: .8rem; width: 44px; text-align: center; padding: 6px 0; border-radius: var(--r-sm); background: rgba(61, 220, 151, .12); color: var(--fc); flex: none; }
.game.lol .g-tag { background: rgba(240, 185, 60, .12); color: var(--lol); }
.g-text { flex: 1; min-width: 0; }
.g-text b { display: block; font-size: 1.05rem; }
.g-text small { display: block; color: var(--muted); font-size: .8rem; }
.g-time { font-family: var(--mono); font-weight: 800; font-size: 1.25rem; color: var(--ink); }
.g-go { font-size: 1.6rem; color: var(--faint); line-height: 1; }
.game:hover .g-go { color: var(--accent); }
.game-actions { display: flex; gap: 4px; padding: 0 12px 8px 16px; }
.gamebtn { display: block; padding: 16px; border-radius: var(--r); border: 1px solid var(--line); background: var(--panel); text-decoration: none; color: var(--ink); margin-bottom: 10px; }
.gamebtn:hover { border-color: var(--accent); }
.gamebtn b { font-size: 1.05rem; display: block; }
.gamebtn .url { font-size: .74rem; color: var(--faint); font-family: var(--mono); margin-top: 2px; }

/* ── 출석 ── */
.att { display: grid; gap: 0; padding: 4px 16px; }
.att-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.att > div:last-child .att-row, .att-row:last-child { border-bottom: 0; }
.att > div { border-bottom: 1px solid var(--line); }
.att > div:last-child { border-bottom: 0; }
.att > div > .att-row { border-bottom: 0; }
.att-name b { font-size: 1.02rem; }
.member { display: grid; grid-template-columns: 1fr auto; gap: 6px; align-items: center; padding: 6px 0 6px 12px; border-left: 2px solid var(--line-2); margin: 0 0 6px 4px; }
.member .rid { font-size: .78rem; color: var(--muted); }
.counts { display: flex; gap: 6px; flex-wrap: wrap; }

/* ── 경기 카드: 스코어보드 ── */
.match { padding: 0; overflow: hidden; }
.match > :not(.sb-head):not(.sb-board):not(.sb-meta) { margin-left: 14px; margin-right: 14px; }
.match > :last-child { margin-bottom: 14px; }
.sb-head { display: flex; align-items: center; gap: 10px; padding: 9px 14px; background: var(--panel-2); border-bottom: 1px solid var(--line); }
.sb-code { font-family: var(--mono); font-weight: 900; font-size: .85rem; background: var(--accent); color: var(--accent-ink); border-radius: 4px; padding: 1px 7px; }
.sb-label { font-weight: 800; flex: 1; min-width: 0; }
.sb-fmt { font-family: var(--mono); font-size: .72rem; font-weight: 800; color: var(--muted); border: 1px solid var(--line-2); border-radius: 4px; padding: 1px 6px; }
.sb-status { font-size: .74rem; font-weight: 800; display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.sb-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.sb-status.ready { color: var(--info); } .sb-status.ready::before { background: var(--info); }
.sb-status.in_progress { color: var(--warn); } .sb-status.in_progress::before { background: var(--warn); animation: pulse 1.2s infinite; }
.sb-status.done { color: var(--ok); } .sb-status.done::before { background: var(--ok); }
.sb-status.needs_decision { color: var(--bad); } .sb-status.needs_decision::before { background: var(--bad); }
.sb-board { background: var(--bg-2); }
.sb-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); position: relative; }
.sb-row:last-child { border-bottom: 0; }
.sb-side { font-family: var(--mono); font-weight: 800; font-size: .74rem; color: var(--faint); width: 14px; flex: none; }
.sb-team { flex: 1; min-width: 0; }
.sb-team b { display: block; font-size: 1.1rem; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-team small { display: block; font-size: .78rem; color: var(--muted); }
.sb-row.tbd .sb-team b { color: var(--faint); font-weight: 600; font-size: .95rem; font-style: italic; }
.sb-pk { font-family: var(--mono); font-size: .76rem; font-weight: 700; color: var(--muted); }
.sb-win { font-family: var(--mono); font-size: .7rem; font-weight: 900; color: var(--accent-ink); background: var(--accent); border-radius: 3px; padding: 1px 5px; letter-spacing: .04em; }
.sb-score { font-family: var(--mono); font-size: 1.9rem; font-weight: 800; min-width: 1.6em; text-align: right; line-height: 1; color: var(--ink-2); }
.sb-row.win::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); }
.sb-row.win .sb-score { color: var(--accent); }
.sb-row.win .sb-side { color: var(--accent); }
.sb-row.lose .sb-team b, .sb-row.lose .sb-score { color: var(--muted); }
.sb-meta { display: flex; gap: 12px; justify-content: space-between; flex-wrap: wrap; font-family: var(--mono); font-size: .74rem; color: var(--muted); padding: 7px 14px; border-top: 1px solid var(--line); background: var(--panel-2); }
.match.needs_decision { border-color: var(--bad-line); }
.match.in_progress { border-color: var(--warn-line); }
.setline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .9rem; font-family: inherit; }
.setline b { font-weight: 800; }
.setform { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r); padding: 12px; margin-top: 12px; }
.setform h4, .setform b:first-child { color: var(--ink); }
.scorerow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.scorerow .lbl { min-width: 84px; font-size: .85rem; color: var(--muted); }
.scoregrid { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px 10px; align-items: center; }
.scoregrid .nm { font-weight: 800; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scoregrid .hidden { visibility: hidden; display: inline !important; }
.scoregrid span.pk.hidden, .scoregrid .pk.hidden * { visibility: hidden; }
details > summary { cursor: pointer; font-weight: 700; padding: 8px 0; color: var(--muted); font-size: .86rem; }
details > summary:hover { color: var(--accent); }
details[open] > summary { color: var(--ink); }

/* ── 사진 ── */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; margin-top: 8px; }
.ph { position: relative; aspect-ratio: 1; border-radius: var(--r-sm); overflow: hidden; background: var(--panel-3); border: 1px solid var(--line-2); cursor: zoom-in; padding: 0; min-height: 0; }
.ph:hover { border-color: var(--accent); background: var(--panel-3); }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph .tag { position: absolute; left: 4px; bottom: 4px; font-size: .66rem; padding: 1px 5px; border-radius: 3px; background: rgba(0, 0, 0, .75); color: #fff; font-weight: 700; }
.ph .st { position: absolute; right: 4px; top: 4px; font-size: .66rem; padding: 1px 5px; border-radius: 3px; font-weight: 800; color: #04140c; }
.ph .st.ok { background: var(--ok); } .ph .st.up { background: var(--info); } .ph .st.fail { background: var(--bad); color: #fff; } .ph .st.wait { background: var(--warn); }
.queue-item { display: grid; grid-template-columns: 64px 1fr; gap: 10px; align-items: center; padding: 8px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--bg-2); margin-top: 8px; }
.queue-item img { width: 64px; height: 64px; object-fit: cover; border-radius: var(--r-sm); }
.progress { height: 4px; background: var(--panel-3); border-radius: 4px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .2s; }
.uploadbar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.uploadbar label.btn { position: relative; overflow: hidden; }
.uploadbar input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }

/* ── 라이트박스 ── */
.lightbox { position: fixed; inset: 0; background: #000; z-index: 100; display: flex; flex-direction: column; }
.lightbox .bar { display: flex; gap: 8px; padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top)); color: #fff; align-items: center; flex-wrap: wrap; border-bottom: 1px solid #1c1c1c; }
.lightbox .view { flex: 1; overflow: auto; touch-action: pinch-zoom pan-x pan-y; display: flex; }
.lightbox .view img { margin: auto; max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox .view.actual img { max-width: none; max-height: none; }

/* ── 모달·알림 ── */
.modal-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .65); backdrop-filter: blur(3px); z-index: 90; display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade .12s ease; }
.modal { background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; padding: 20px; width: min(520px, 100%); max-height: 90vh; overflow: auto; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); animation: pop .16s ease; }
.modal h3 { margin-bottom: 10px; font-size: 1.1rem; }
.modal p { color: var(--ink-2); }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.modal .actions button.ghost { order: -1; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(6px); opacity: 0; } }
#toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 120; display: grid; gap: 8px; width: min(520px, calc(100% - 24px)); pointer-events: none; }
.toast { background: var(--panel-3); border: 1px solid var(--line-2); border-left: 3px solid var(--info); color: var(--ink); padding: 11px 14px; border-radius: var(--r); font-size: .9rem; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); white-space: pre-line; animation: pop .18s ease; }
.toast.bad { border-left-color: var(--bad); } .toast.ok { border-left-color: var(--accent); }

/* ── 대진표 ── */
.bracket { display: flex; gap: 18px; overflow-x: auto; padding: 2px 2px 10px; }
.bcol { min-width: 196px; display: flex; flex-direction: column; gap: 12px; justify-content: space-around; }
.bcol h4 { font-size: .72rem; color: var(--muted); text-align: center; margin: 0; font-weight: 800; letter-spacing: .06em; }
.bbox { border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--bg-2); font-size: .86rem; overflow: hidden; }
.bbox .bh { background: var(--panel-2); padding: 4px 9px; font-size: .72rem; font-weight: 800; color: var(--muted); display: flex; justify-content: space-between; font-family: var(--mono); }
.bbox .bs { padding: 7px 9px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 6px; }
.bbox .bs span:last-child { font-family: var(--mono); font-weight: 800; }
.bbox .bs.win { color: var(--accent); font-weight: 800; box-shadow: inset 3px 0 0 var(--accent); }
.bbox .bs.pending { color: var(--faint); font-style: italic; }
.bbox.final { border-color: rgba(240, 185, 60, .45); } .bbox.final .bh { color: var(--lol); }
.bbox.draw .bh { color: var(--purple); }
.bbox .bs.reveal { animation: reveal .6s ease; }
@keyframes reveal { from { background: var(--accent-soft); } to { background: transparent; } }

/* ── 추첨 화면 ── */
.drawscreen { max-width: 1280px; margin: 0 auto; padding: 16px; }
.recbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-radius: var(--r); margin-bottom: 14px; flex-wrap: wrap; border: 1px solid var(--line-2); }
.recbar.off { background: var(--panel); color: var(--muted); }
.recbar.on { background: var(--rec); color: #fff; border-color: var(--rec); }
.recbar.ext { background: #7c2d12; color: #fff; border-color: #9a3412; }
.recbar .dot { width: 14px; height: 14px; border-radius: 50%; background: #fff; animation: blink 1s infinite; }
.recbar.off .dot { background: var(--faint); animation: none; }
@keyframes blink { 50% { opacity: .2; } }
.recbar .time { font-family: var(--mono); font-weight: 800; font-size: 1.1rem; }
.recbar button { background: rgba(0, 0, 0, .2); border-color: rgba(255, 255, 255, .35); color: #fff; }
.recbar.off button { background: var(--panel-2); border-color: var(--line-2); color: var(--ink); }
.recbar.off button.rec, .recbar.off button.primary { background: var(--rec); border-color: var(--rec); color: #fff; }
.step { display: grid; grid-template-columns: 40px 1fr; gap: 12px; }
.step .num { width: 32px; height: 32px; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--line-2); color: var(--muted); display: flex; align-items: center; justify-content: center; font-weight: 900; font-family: var(--mono); }
.step.active .num { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.step.done .num { background: transparent; border-color: var(--ok); color: var(--ok); }
.seedbox { font-family: var(--mono); font-size: 1.3rem; font-weight: 800; letter-spacing: .05em; background: #000; color: var(--accent); padding: 14px 16px; border-radius: var(--r); word-break: break-all; border: 1px solid var(--accent-line); text-shadow: 0 0 12px rgba(198, 255, 61, .35); }
.steps-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.steps-list li { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 9px 12px; border-radius: var(--r-sm); background: var(--bg-2); border: 1px solid var(--line); font-size: 1.02rem; margin: 0; }
.steps-list li .o { font-weight: 800; color: var(--muted); font-family: var(--mono); }
.steps-list li.new { animation: reveal .8s ease; border-color: var(--accent-line); }
.steps-list li .to { font-weight: 800; color: var(--accent); }
.lineup { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; }
.lineup div { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 10px; }
.lineup b { color: var(--muted); margin-right: 6px; font-family: var(--mono); }
video.player { width: 100%; max-height: 420px; background: #000; border-radius: var(--r); border: 1px solid var(--line); }

/* ── 표·지표·목록 ── */
table.tbl { width: 100%; border-collapse: collapse; font-size: .88rem; }
.tbl th, .tbl td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl th { font-size: .72rem; color: var(--muted); font-weight: 800; letter-spacing: .04em; white-space: nowrap; }
.tbl tbody tr:hover { background: var(--panel-2); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.scroll-x { overflow-x: auto; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; margin: 4px 0 10px; }
.kpi { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 10px; }
.kpi b { display: block; font-family: var(--mono); font-size: 1.45rem; font-weight: 800; line-height: 1.2; }
.kpi span { font-size: .72rem; color: var(--muted); font-weight: 700; }
.kpi.bad { border-color: var(--bad-line); } .kpi.bad b { color: var(--bad); }
.kpi.ok b { color: var(--ok); }
.todo { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.todo li { margin: 0; }
.todo a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--r-sm); background: var(--bg-2); border: 1px solid var(--line); border-left: 3px solid var(--bad); color: var(--ink); text-decoration: none; font-size: .9rem; }
.todo a:hover { border-color: var(--bad-line); border-left-color: var(--bad); background: var(--bad-soft); }
.todo a::after { content: "›"; margin-left: auto; color: var(--faint); font-size: 1.2rem; line-height: 1; }
.todo .chip { flex: none; font-family: var(--mono); }
.list { display: grid; gap: 6px; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }
.list-name { flex: 1; min-width: 0; font-size: 1rem; }
.list-row.off { opacity: .55; }
.list-row.off .avatar { background: var(--panel-3); color: var(--muted); }

@media (max-width: 640px) {
  :root { --tb-h: 52px; }
  .wrap { padding: 12px 12px 36px; }
  .topbar-in { padding: 6px 12px; gap: 10px; }
  .topbar .wordmark i { display: none; }
  .topbar .title { padding-left: 10px; }
  .tb-name, .tb-link { display: none; }
  .tb-clock { padding: 3px 6px; font-size: .78rem; }
  button.tb-user { padding: 2px; }
  .grid.two { grid-template-columns: 1fr; }
  .card { padding: 14px; }
  .match { padding: 0; }
  .att { padding: 2px 14px; }
  .home-head h1 { font-size: 1.4rem; }
  .day-date { font-size: 1.6rem; }
  .g-time { font-size: 1.05rem; }
  .att-row { grid-template-columns: 1fr; }
  .login { padding: 22px 18px 16px; }
}
@media print {
  :root { --bg: #fff; --panel: #fff; --ink: #000; }
  .topbar, .tabs, button { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
