/* 팀암비스트 대진 — 팔씨름 경기대 팔레트
   레이아웃: 위 메뉴(넓은 화면)·아래 탭(휴대폰) + 한 줄 카드 흐름, 대진표만 가로 스크롤
   색: 초크 묻은 철제 경기대 바탕 · 레드 패드(강조·내 쪽) · 블루 패드(비교·상대 쪽) */
:root {
  --bg: #eef1f4;
  --surface: #ffffff;
  --surface-2: #e5eaf0;
  --line: #cdd5df;
  --ink: #121820;
  --muted: #586474;
  --accent: #c8102e;
  --accent-ink: #ffffff;
  --cmp: #1d4ed8;
  --up: #15803d;
  --down: #b91c1c;
  --gold: #a87508;
  --chip: #dce2ea;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 0 rgba(18, 24, 32, 0.04), 0 8px 22px -16px rgba(18, 24, 32, 0.35);
  --font: 'Gothic A1', system-ui, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  --display: 'Black Han Sans', 'Gothic A1', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0e1217;
    --surface: #161c24;
    --surface-2: #1e2630;
    --line: #2d3743;
    --ink: #e8edf3;
    --muted: #94a1b2;
    --accent: #ef3b4f;
    --accent-ink: #ffffff;
    --cmp: #6b95ff;
    --up: #4ade80;
    --down: #f87171;
    --gold: #e3b341;
    --chip: #27313d;
    --shadow: 0 10px 30px -18px rgba(0, 0, 0, 0.8);
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #0e1217;
  --surface: #161c24;
  --surface-2: #1e2630;
  --line: #2d3743;
  --ink: #e8edf3;
  --muted: #94a1b2;
  --accent: #ef3b4f;
  --accent-ink: #ffffff;
  --cmp: #6b95ff;
  --up: #4ade80;
  --down: #f87171;
  --gold: #e3b341;
  --chip: #27313d;
  --shadow: 0 10px 30px -18px rgba(0, 0, 0, 0.8);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html, body { min-height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.55;
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(64px + env(safe-area-inset-bottom));
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
h1, h2 { text-wrap: balance; }
h1 { font-family: var(--display); font-weight: 400; font-size: clamp(1.6rem, 5vw, 2.2rem); letter-spacing: -0.01em; }
h2 { font-size: 1.05rem; font-weight: 800; }
h3 { font-size: 0.95rem; font-weight: 800; margin: 14px 0 8px; }
h4 { font-size: 0.75rem; font-weight: 700; color: var(--muted); letter-spacing: 0.04em; }
p { margin: 0; }
ul, ol { margin: 0; padding-left: 1.2em; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
small { font-size: 0.8em; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85em; }
.pre { white-space: pre-wrap; }
.r { text-align: right; }
.up { color: var(--up); }
.down { color: var(--down); }
.grow { flex: 1; min-width: 0; }
.display { font-family: var(--display); }

/* ── 틀 ── */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: 10px max(16px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { font-family: var(--display); font-size: 1.3rem; color: var(--ink); white-space: nowrap; }
.brand small { color: var(--accent); font-size: 0.8em; }
.brand:hover { text-decoration: none; }
.topnav { display: none; gap: 2px; flex: 1; }
.topnav a, .bottomnav a { color: var(--muted); font-weight: 700; }
.topnav a { padding: 6px 12px; border-radius: 999px; font-size: 0.92rem; }
.topnav a .ico { display: none; }
.topnav a.on { color: var(--accent-ink); background: var(--accent); }
.topnav a:hover, .bottomnav a:hover { text-decoration: none; color: var(--ink); }
.who { margin-left: auto; font-weight: 700; font-size: 0.9rem; white-space: nowrap; }
.who a { color: var(--ink); }
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: space-around;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
  background: var(--surface); border-top: 1px solid var(--line);
}
.bottomnav a { display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 0.72rem; padding: 4px 8px; border-radius: 10px; min-width: 52px; }
.bottomnav a .ico { font-size: 1.15rem; filter: grayscale(0.7); }
.bottomnav a.on { color: var(--accent); }
.bottomnav a.on .ico { filter: none; }
@media (min-width: 820px) {
  body { padding-bottom: 32px; }
  .topnav { display: flex; }
  .bottomnav { display: none; }
}
.view { max-width: 1100px; margin: 0 auto; padding: 18px 16px 40px; outline: none; }
.loading { padding: 40px; text-align: center; color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }

/* ── 카드 · 버튼 · 입력 ── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.card-title { display: flex; align-items: center; gap: 8px; }
.empty { color: var(--muted); padding: 18px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  font: inherit; font-weight: 800; cursor: pointer; white-space: nowrap;
}
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--muted); }
.btn.danger { background: var(--down); border-color: var(--down); color: #fff; }
.btn.ghost.danger { background: transparent; color: var(--down); border-color: color-mix(in srgb, var(--down) 50%, var(--line)); }
.btn.sm { min-height: 30px; padding: 4px 10px; font-size: 0.82rem; }
.icon-btn { background: transparent; border: 1px solid var(--line); color: var(--ink); border-radius: 8px; min-width: 32px; min-height: 32px; cursor: pointer; font: inherit; }
.icon-btn:disabled { opacity: 0.35; }
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 9px 11px; min-height: 40px; max-width: 100%;
}
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea { width: 100%; resize: vertical; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > span { font-size: 0.82rem; font-weight: 700; color: var(--muted); }
.field.inline { flex-direction: row; align-items: center; gap: 8px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { min-height: auto; width: 18px; height: 18px; accent-color: var(--accent); }
.picker { display: flex; gap: 8px; }
.picker input { flex: 1; min-width: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--chip); border-radius: 999px; padding: 2px 10px; font-size: 0.8rem; font-weight: 700; }
.notice-box { background: color-mix(in srgb, var(--accent) 14%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); padding: 10px 12px; border-radius: var(--radius-sm); }
details summary { cursor: pointer; font-weight: 700; color: var(--muted); margin: 6px 0; }
.paste { display: flex; flex-direction: column; gap: 8px; }

/* 탭 */
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted); font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap; font-size: 0.9rem; }
.tab.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tab:hover { text-decoration: none; color: var(--ink); }
.tab.on:hover { color: var(--bg); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; align-self: center; }
.seg button { border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 700; padding: 6px 16px; border-radius: 999px; cursor: pointer; }
.seg button.on { background: var(--accent); color: var(--accent-ink); }

/* ── 목록 ── */
.list { list-style: none; padding: 0; display: flex; flex-direction: column; }
.list li { border-top: 1px solid var(--line); padding: 10px 0; }
.list li:first-child { border-top: 0; }
.row-link { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; color: var(--ink); }
.row-link .status { margin-left: auto; }
.status { white-space: nowrap; flex: none; font-size: 0.75rem; font-weight: 800; padding: 2px 9px; border-radius: 999px; background: var(--chip); color: var(--muted); }
.st-running { background: color-mix(in srgb, var(--up) 22%, transparent); color: var(--up); }
.st-draft { background: color-mix(in srgb, var(--gold) 22%, transparent); color: var(--gold); }
.notice { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.notice li { padding-left: 12px; border-left: 3px solid var(--accent); }
.photos { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.photos li { border-bottom: 1px solid var(--line); padding-bottom: 10px; }

/* 아바타 · 등급 · 선수 링크 */
.avatar { display: inline-grid; place-items: center; border-radius: 50%; flex: none; color: #fff; font-weight: 800; line-height: 1; }
.avatar.av-plain { color: var(--ink); }
.av-sm { width: 24px; height: 24px; font-size: 0.8rem; }
.av-md { width: 36px; height: 36px; font-size: 1.1rem; }
.av-lg { width: 56px; height: 56px; font-size: 1.8rem; }
.av-xl { width: 96px; height: 96px; font-size: 3.2rem; box-shadow: 0 0 0 4px var(--surface), 0 0 0 6px var(--pc, var(--accent)); }
.grade { display: inline-block; min-width: 30px; text-align: center; padding: 1px 7px; border-radius: 6px; font-size: 0.75rem; font-weight: 800; color: var(--gi, #fff); background: var(--g); vertical-align: middle; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.12); }
.grade.holo { background: linear-gradient(115deg, #FFF0B0, #F3D77A 30%, #ffd1f0 48%, #c8f3ff 62%, #F3D77A 80%, #FFF0B0); background-size: 220% 100%; animation: holo 4s linear infinite; }
.plink { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-weight: 600; }

/* 홈 */
.hero { padding: 8px 0 0; }
.hero h1 { font-size: clamp(2rem, 8vw, 3rem); text-wrap: balance; }
.hero h1 .pad-r { color: var(--accent); }
.hero h1 .pad-b { color: var(--cmp); }
.my-card { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--radius); background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, var(--surface)), var(--surface)); border: 1px solid var(--line); color: var(--ink); }
.my-card:hover { text-decoration: none; border-color: var(--accent); }
.my-card.cta { border-style: dashed; }
.my-name { font-family: var(--display); font-size: 1.4rem; }
.top { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.top li { display: grid; grid-template-columns: 30px 40px 1fr auto; align-items: center; gap: 6px; }
.rank { font-family: var(--display); font-size: 1.05rem; color: var(--muted); text-align: center; }
.top li:nth-child(-n + 3) .rank { color: var(--gold); }

/* 표 */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { font-size: 0.78rem; color: var(--muted); font-weight: 700; background: var(--surface-2); position: sticky; top: 0; }
tr:last-child td { border-bottom: 0; }
tr.me td { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.hall td { white-space: normal; font-size: 0.85rem; }
.sources input { min-height: 32px; padding: 4px 6px; }
@media (max-width: 560px) { .hide-sm { display: none; } }

/* ── 캐릭터 ── */
.char-card {
  position: relative; display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center;
  padding: 20px; border-radius: var(--radius);
  background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--pc) 35%, var(--surface)) 0%, var(--surface) 60%);
  border: 1px solid color-mix(in srgb, var(--pc) 40%, var(--line));
  overflow: hidden;
}
.char-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.char-title { color: var(--gold); font-weight: 800; font-size: 0.9rem; }
.char-name { font-size: clamp(1.7rem, 6vw, 2.4rem); }
.motto { font-style: italic; color: var(--muted); }
.power { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 8px; justify-content: flex-end; border-top: 1px solid var(--line); padding-top: 10px; }
.power small { color: var(--muted); font-weight: 700; }
.power b { font-family: var(--display); font-size: 2rem; color: var(--pc); font-weight: 400; }
@media (min-width: 640px) { .power { grid-column: auto; grid-row: 1; justify-self: end; flex-direction: column; align-items: flex-end; border: 0; padding: 0; position: absolute; right: 20px; top: 18px; } .char-main { padding-right: 120px; } }
.lvbar { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 0.85rem; }
.lvbar .bar { flex: 1; max-width: 220px; height: 8px; background: var(--chip); border-radius: 999px; overflow: hidden; }
.lvbar .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--gold)); }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.tile small { color: var(--muted); font-weight: 700; }
.tile b { font-family: var(--display); font-size: 1.5rem; font-weight: 400; }
.tile span { font-size: 0.82rem; }
.radar-box { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.hex { width: 100%; max-width: 320px; height: auto; overflow: visible; }
.hex-outer { fill: var(--surface-2); stroke: var(--line); stroke-width: 1.5; }
.hex-ring { fill: none; stroke: var(--line); stroke-width: 1; }
.hex-spoke { stroke: var(--line); }
.hex-label { fill: var(--ink); font-size: 12px; font-weight: 800; }
.hex-value { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.hex-shape { transition: all 0.25s ease; }
.legend { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; }
.dot.dash { background: transparent; border: 2px dashed var(--cmp); }
.axis-help { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: 0.8rem; color: var(--muted); margin: 0; width: 100%; max-width: 420px; }
.axis-help dt { font-weight: 800; color: var(--ink); }
.axis-help dd { margin: 0; }
.matches { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.matches li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 8px; border-radius: 8px; background: var(--surface-2); }
.matches .wl { font-weight: 800; width: 24px; text-align: center; border-radius: 6px; font-size: 0.8rem; padding: 1px 0; }
.matches li.w .wl { background: color-mix(in srgb, var(--up) 25%, transparent); color: var(--up); }
.matches li.l .wl { background: color-mix(in srgb, var(--down) 25%, transparent); color: var(--down); }
.matches .arm { font-size: 0.75rem; color: var(--muted); }
.rivals { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px; }
.rivals li { display: flex; align-items: center; gap: 8px; justify-content: space-between; padding: 6px 8px; background: var(--surface-2); border-radius: 8px; }
.vs td, .vs th { text-align: center; }
.vs td.r { text-align: right; }
.vs td:last-child { text-align: left; }

/* 캐릭터 꾸미기 */
.editor { display: flex; flex-direction: column; gap: 12px; }
.editor-grid { display: grid; gap: 16px; }
@media (min-width: 700px) { .editor-grid { grid-template-columns: 1fr 280px; align-items: start; } }
.editor-grid > div:first-child { display: flex; flex-direction: column; gap: 10px; }
.pick-row { display: flex; flex-wrap: wrap; gap: 6px; }
.pick { width: 40px; height: 40px; border-radius: 10px; border: 2px solid var(--line); background: var(--surface-2); cursor: pointer; font-size: 1.3rem; display: grid; place-items: center; padding: 0; }
.pick.on { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 40%, transparent); }
.swatch { width: 24px; height: 24px; border-radius: 50%; display: block; }
.sliders { display: flex; flex-direction: column; gap: 10px; }
.slider { display: grid; grid-template-columns: minmax(110px, 160px) 1fr 40px; align-items: center; gap: 10px; }
.slider > span { display: flex; flex-direction: column; line-height: 1.2; }
.slider input { accent-color: var(--accent); min-height: auto; padding: 0; background: transparent; border: 0; }
.slider output { text-align: right; font-weight: 800; }
@media (max-width: 480px) { .slider { grid-template-columns: 1fr 40px; } .slider > span { grid-column: 1 / -1; flex-direction: row; gap: 6px; align-items: baseline; } }

/* ── 대회 ── */
.t-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.entrants { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.entrants li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; background: var(--surface-2); border-radius: 8px; }
.entrants .handle { width: 22px; text-align: right; font-size: 0.8rem; }
.seed-in { width: 70px; min-height: 32px; padding: 4px 6px; }
.seed { display: inline-grid; place-items: center; min-width: 22px; height: 20px; border-radius: 5px; background: var(--chip); font-size: 0.72rem; font-weight: 800; color: var(--muted); margin-right: 6px; padding: 0 4px; }
.pairs, .seeds { padding-left: 1.6em; display: flex; flex-direction: column; gap: 4px; }
.pairs i { color: var(--muted); font-style: normal; font-size: 0.8rem; }
.sticky-actions { position: sticky; bottom: calc(70px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(8px); padding: 10px 0; z-index: 5; }
@media (min-width: 820px) { .sticky-actions { bottom: 0; } }
.sync-ways { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.sync-ways > div { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; background: var(--surface-2); padding: 12px; border-radius: var(--radius-sm); }
.sync-ways h3 { margin: 0; }
.log { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; font-size: 0.8rem; white-space: pre-wrap; max-height: 260px; overflow: auto; margin: 0; }
.log:empty { display: none; }
.dev-login { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; border-top: 1px dashed var(--line); padding-top: 12px; margin-top: 8px; }
.gbtn { min-height: 44px; }

/* 대진표 */
.bracket-scroll { overflow-x: auto; margin: 0 -16px; padding: 0 16px 8px; }
.bracket { display: flex; flex-direction: column; gap: 20px; min-width: min-content; }
.bracket h3 { margin: 0 0 8px; }
.bracket-cols { display: flex; gap: 14px; align-items: stretch; }
.bracket-col { display: flex; flex-direction: column; gap: 8px; width: 190px; flex: none; }
.bracket-col h4 { text-align: center; }
.bracket-col-body { display: flex; flex-direction: column; justify-content: space-around; gap: 10px; flex: 1; }
.bm { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 0; overflow: hidden; text-align: left; font: inherit; color: var(--ink); width: 100%; }
button.bm { cursor: pointer; }
button.bm:disabled { cursor: default; }
.bm-ready { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.bm-pending { opacity: 0.7; }
.bm-bye { opacity: 0.4; }
.bm-mine { box-shadow: 0 0 0 2px var(--gold); }
.bm-head { display: flex; justify-content: space-between; align-items: center; gap: 4px; font-size: 0.7rem; color: var(--muted); padding: 3px 8px; background: var(--surface-2); font-family: ui-monospace, monospace; }
.flag { font-family: var(--font); font-weight: 800; font-size: 0.68rem; }
.flag.go { color: var(--accent); }
.slot { display: flex; align-items: center; gap: 4px; padding: 6px 8px; border-top: 1px solid var(--line); min-height: 34px; font-size: 0.9rem; }
.slot .seed { margin-right: 2px; }
.slot-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot-score { font-weight: 800; font-variant-numeric: tabular-nums; }
.slot.win { font-weight: 800; background: color-mix(in srgb, var(--up) 14%, transparent); }
.slot.win .slot-score { color: var(--up); }
.slot.lose { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 60%, transparent); }
.slot.empty { color: var(--muted); font-style: italic; }
.slot.me .slot-name { color: var(--gold); }
.upnext ol { display: flex; flex-direction: column; gap: 6px; padding-left: 1.8em; }
.upnext li { padding: 6px 8px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); }
.upnext li.ready { border-color: var(--accent); }
.upnext li i { color: var(--muted); font-style: normal; }
.upnext-me { font-weight: 800; color: var(--gold); margin-bottom: 8px; }
.podium { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.pod { display: flex; align-items: center; gap: 8px; padding: 12px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); font-size: 1.05rem; }
.pod.p1 { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 16%, var(--surface)); }
.medal { font-size: 1.6rem; }

/* 결과 입력 */
.result-pad { display: flex; flex-direction: column; gap: 14px; }
.result-btns { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; }
.big-win { min-height: 110px; border-radius: var(--radius); border: 2px solid var(--line); background: var(--surface-2); color: var(--ink); font: inherit; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 10px; }
.big-win b { font-size: 1.25rem; font-family: var(--display); font-weight: 400; }
.big-win small { color: var(--muted); }
.big-win:hover, .big-win.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--surface-2)); }
.vs { font-family: var(--display); color: var(--muted); }
.result-pad input[type='number'] { width: 80px; }

/* 대화창 · 알림 */
.modal-wrap { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, 0.55); display: grid; place-items: end center; padding: 0; }
@media (min-width: 640px) { .modal-wrap { place-items: center; padding: 20px; } }
.modal { width: 100%; max-width: 480px; max-height: 92vh; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 18px 18px 0 0; box-shadow: var(--shadow); }
@media (min-width: 640px) { .modal { border-radius: 18px; } }
.modal.wide { max-width: 860px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal-body { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.copy { font-family: ui-monospace, monospace; font-size: 0.8rem; }
#toast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 60; background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 700; transition: all 0.2s; max-width: calc(100vw - 32px); text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.error { background: var(--down); color: #fff; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* 업적 */
.badges { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.badge { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 12px 8px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); }
.badge.got { border-color: color-mix(in srgb, var(--gold) 60%, var(--line)); background: color-mix(in srgb, var(--gold) 12%, var(--surface-2)); }
.badge.locked { opacity: 0.55; }
.badge.locked .badge-ico { filter: grayscale(1); }
.badge-ico { font-size: 1.9rem; line-height: 1.2; }
.badge b { font-size: 0.9rem; }
.badge small { color: var(--muted); font-size: 0.75rem; }
.badge .bar { position: relative; width: 100%; height: 14px; background: var(--chip); border-radius: 999px; overflow: hidden; margin-top: 4px; }
.badge .bar i { display: block; height: 100%; background: var(--accent); opacity: 0.6; }
.badge .bar span { position: absolute; inset: 0; font-size: 0.65rem; font-weight: 800; line-height: 14px; }

/* 현장 화면 (TV·프로젝터) */
body.is-live { padding-bottom: 0; background: #0b0f14; color: #e8edf3; }
body.is-live .topbar, body.is-live .bottomnav { display: none; }
body.is-live .view { max-width: none; padding: clamp(12px, 2.5vw, 36px); }
.live { display: flex; flex-direction: column; gap: clamp(14px, 2.5vw, 32px); min-height: calc(100vh - 2 * clamp(12px, 2.5vw, 36px)); --chip: #2d3743; }
.live-head { display: flex; align-items: flex-start; gap: 16px; }
.live-head > div { flex: 1; }
.live-head h1 { font-size: clamp(1.8rem, 4.5vw, 4rem); color: #fff; }
.live-head p { color: #94a1b2; font-size: clamp(0.9rem, 1.6vw, 1.4rem); }
.live-clock { font-family: var(--display); font-size: clamp(1.4rem, 3.5vw, 3rem); color: #e9b949; }
.live-exit { color: #94a1b2; font-size: 1.4rem; padding: 4px 10px; }
.live h2 { font-size: clamp(1rem, 1.8vw, 1.6rem); color: #94a1b2; margin-bottom: 10px; letter-spacing: 0.05em; }
.live-now { display: flex; flex-direction: column; gap: 14px; }
.live-match { border-radius: 22px; padding: clamp(14px, 2.4vw, 32px); background: #161c24; border: 2px solid #2d3743; }
.live-match.first { border-color: #ef3b4f; background: linear-gradient(135deg, #3a1218, #161c24); }
.live-match.second { opacity: 0.75; }
.live-label { color: #ef3b4f; font-weight: 800; font-size: clamp(0.9rem, 1.6vw, 1.4rem); margin-bottom: 10px; }
.live-match.second .live-label { color: #94a1b2; }
.live-vs { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: clamp(8px, 2vw, 30px); }
.live-vs .vs { font-family: var(--display); font-size: clamp(1.4rem, 4vw, 3.6rem); color: #ef3b4f; }
.live-vs .live-who:last-child { flex-direction: row-reverse; text-align: right; }
.live-who { display: flex; align-items: center; gap: clamp(8px, 1.5vw, 20px); min-width: 0; }
.live-who b { font-family: var(--display); font-weight: 400; font-size: clamp(1.6rem, 5vw, 4.6rem); line-height: 1.05; display: block; overflow-wrap: anywhere; }
.live-who small { color: #94a1b2; font-size: clamp(0.8rem, 1.4vw, 1.3rem); }
.live-av { flex: none; display: grid; place-items: center; width: clamp(44px, 7vw, 110px); height: clamp(44px, 7vw, 110px); border-radius: 50%; font-size: clamp(1.4rem, 4vw, 3.6rem); }
.live-seed { color: #94a1b2; font-weight: 800; font-size: clamp(0.8rem, 1.4vw, 1.3rem); }
.live-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: clamp(14px, 2.5vw, 32px); }
.live-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: clamp(1rem, 2vw, 1.8rem); }
.live-list li { background: #161c24; border-radius: 12px; padding: 10px 16px; }
.live-list i { color: #94a1b2; font-style: normal; }
.live-list .mono { color: #94a1b2; }
.live-empty { font-size: clamp(1.2rem, 2.4vw, 2rem); color: #94a1b2; }
.live-podium { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.live-pod { display: flex; align-items: center; gap: 14px; padding: 20px; border-radius: 22px; background: #161c24; }
.live-pod.p1 { background: linear-gradient(135deg, #4a3a10, #161c24); border: 2px solid #e9b949; }
.live-medal { font-size: clamp(2rem, 5vw, 4.4rem); }

/* 프로필 사진 */
.avatar.av-photo { overflow: hidden; padding: 0; }
.avatar.av-photo img, .live-av img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }
.live-av { overflow: hidden; }
.char-photo { position: relative; justify-self: start; }
.photo-btns { position: absolute; right: -6px; bottom: -6px; display: flex; gap: 4px; }
.photo-btn { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--surface); background: var(--ink); color: var(--bg); font-size: 1rem; cursor: pointer; display: grid; place-items: center; padding: 0; box-shadow: var(--shadow); }
.photo-btn.sm { width: 28px; height: 28px; font-size: 0.75rem; align-self: flex-end; background: var(--surface-2); color: var(--ink); }
.av-xl { width: 112px; height: 112px; }
.face-preview { flex: none; }

/* 능력치 입력 · 표 */
.stat-grade { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--muted); font-size: 0.9rem; }
.stat-letter { font-family: var(--display); font-size: 1.6rem; color: var(--accent); min-width: 1.6em; text-align: center; }
.hex-live { width: 100%; display: flex; justify-content: center; }
.statpad { display: flex; flex-direction: column; gap: 12px; width: 100%; }
.stat-row { display: grid; grid-template-columns: minmax(120px, 190px) 1fr auto; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface-2); }
.stat-name { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.stat-name small { font-size: 0.72rem; }
.stat-range { accent-color: var(--accent); min-height: auto; padding: 0; background: transparent; border: 0; width: 100%; }
.stat-ins { display: flex; align-items: center; gap: 4px; }
.stat-num { width: 64px; text-align: right; font-weight: 800; min-height: 36px; padding: 4px 6px; }
.stat-kg { width: 72px; text-align: right; min-height: 36px; padding: 4px 6px; }
@media (max-width: 560px) {
  .stat-row { grid-template-columns: 1fr auto; }
  .stat-name { grid-column: 1 / -1; }
  .stat-name small { display: none; }
}
.stat-wrap { width: 100%; max-width: 460px; }
.stat-table th, .stat-table td { padding: 7px 8px; }
.hex { max-width: 340px; }
.stat-table th[scope='row'] { position: static; background: transparent; color: var(--ink); font-size: 0.9rem; }
.stat-bar { display: inline-block; vertical-align: middle; width: 80px; height: 8px; border-radius: 999px; background: linear-gradient(90deg, var(--c) var(--v), var(--chip) var(--v)); }
.axis-details { width: 100%; max-width: 460px; }
/* 현장 화면: 이름은 글자 단위로 끊지 않는다, 순위 칸에서는 조금 작게 */
.live-who b { overflow-wrap: normal; word-break: keep-all; }
.live-pod .live-who { flex: 1; min-width: 0; }
.live-pod .live-who b { font-size: clamp(1.4rem, 3.2vw, 2.8rem); }
.live-pod .live-av { width: clamp(40px, 5vw, 80px); height: clamp(40px, 5vw, 80px); font-size: clamp(1.2rem, 3vw, 2.6rem); }
/* 선수 로그인 · 대전 */
.auth { display: flex; flex-direction: column; gap: 12px; max-width: 420px; }
.auth-tabs { align-self: flex-start; }
.form-error { color: var(--down); font-size: 0.88rem; min-height: 1.2em; }
.me-chip { display: flex; align-items: center; min-height: 40px; }
.wl-win { font-size: 0.75rem; font-weight: 800; color: var(--up); }
.duel-list li { gap: 6px 8px; }
.people-hits { max-width: 420px; }
.stack.tight { gap: 8px; }

/* 상대 확인 */
.badge-dot { position: absolute; transform: translate(14px, -6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 0.7rem; font-weight: 800; line-height: 18px; text-align: center; }
.bottomnav a, .topnav a { position: relative; }
.topnav .badge-dot { position: static; transform: none; margin-left: 4px; }
.matches.pending li { flex-wrap: wrap; }
.matches li.to-confirm { background: color-mix(in srgb, var(--accent) 10%, var(--surface-2)); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.matches li.rejected { opacity: 0.75; text-decoration: line-through; text-decoration-color: var(--muted); }
.matches li.rejected button { text-decoration: none; }
.confirm-banner { display: block; color: var(--ink); }
.confirm-banner:hover { text-decoration: none; border-color: var(--accent); }

/* 지금 할 경기 · 다음 경기 */
.bm-now { border: 2px solid var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent), var(--shadow); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.bm-next { border-style: dashed; border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); }
.bm-now-tag, .bm-next-tag { display: flex; align-items: center; gap: 6px; padding: 4px 8px; font-size: 0.78rem; font-weight: 800; }
.bm-now-tag { background: var(--accent); color: var(--accent-ink); }
.bm-next-tag { background: color-mix(in srgb, var(--accent) 14%, var(--surface-2)); color: var(--accent); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.7); } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }
.upnext li.now { border-width: 2px; background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.now-chip { display: inline-block; background: var(--accent); color: var(--accent-ink); font-size: 0.72rem; font-weight: 800; padding: 1px 8px; border-radius: 999px; margin-right: 6px; }

.rate-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: var(--radius); border: 1px dashed var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.rate-box > div { flex: 1; min-width: 200px; }
.rate-box.rated { border-style: solid; border-color: var(--up); background: color-mix(in srgb, var(--up) 8%, var(--surface)); }

.choice { display: flex; gap: 6px; flex-wrap: wrap; }
.choice select { flex: 1; min-width: 120px; }
.choice input { flex: 1; min-width: 120px; }

/* 현장 화면: 여러 부문 · 대진표 (어두운 화면에 맞춘 색) */
.live { --bg: #0b0f14; --surface: #161c24; --surface-2: #1e2630; --line: #2d3743; --ink: #e8edf3; --muted: #94a1b2; --accent: #ef3b4f; --accent-ink: #fff; --up: #4ade80; --gold: #e3b341; --chip: #27313d; color: var(--ink); }
.live-divs { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: clamp(12px, 2vw, 24px); }
.live-divs .live-div { background: #12171e; border: 1px solid #2d3743; border-radius: 18px; padding: clamp(10px, 1.6vw, 20px); display: flex; flex-direction: column; gap: 10px; }
.live-divs .live-div h2 { color: #fff; font-size: clamp(1.1rem, 2vw, 1.8rem); margin: 0; }
.live-divs .live-match { padding: clamp(10px, 1.4vw, 18px); }
.live-divs .live-who b { font-size: clamp(1.2rem, 2.6vw, 2.4rem); }
.live-divs .live-av { width: clamp(36px, 4vw, 64px); height: clamp(36px, 4vw, 64px); font-size: clamp(1.1rem, 2.4vw, 2rem); }
.live-divs .live-vs .vs { font-size: clamp(1rem, 2.4vw, 2rem); }
.live-divs .live-podium { grid-template-columns: 1fr; }
.live-nextline { color: #94a1b2; font-size: clamp(0.9rem, 1.6vw, 1.3rem); }
.live-nextline i { font-style: normal; color: #ef3b4f; font-weight: 800; }
.live-div { display: flex; flex-direction: column; gap: 12px; }
.live-bracket-wrap { display: flex; flex-direction: column; gap: 10px; }
.live-bracket-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.live-bracket-head h2 { margin: 0; }
.live-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.live-tabs button, .live-focus { font: inherit; font-weight: 800; border-radius: 999px; padding: 6px 14px; border: 1px solid #2d3743; background: transparent; color: #94a1b2; cursor: pointer; font-size: clamp(0.85rem, 1.3vw, 1.1rem); }
.live-tabs button.on { background: #e8edf3; color: #0b0f14; border-color: #e8edf3; }
.live-focus { border-color: #e3b341; color: #e3b341; }
.live-hint { color: #94a1b2; font-size: 0.85rem; }
.live-bracket { overflow-x: auto; padding-bottom: 8px; }
.live-bracket .bracket-col { width: clamp(170px, 14vw, 240px); }
.live-bracket .slot { font-size: clamp(0.85rem, 1.1vw, 1.1rem); min-height: clamp(32px, 2.6vw, 44px); }
.live-bracket .slot-name { cursor: pointer; }
.live-bracket .bracket h3 { color: #fff; }
.live-bracket .bm-mine { box-shadow: 0 0 0 2px #e3b341; }
.live-bracket .slot.me { background: color-mix(in srgb, #e3b341 22%, transparent); }

/* 한 판 기록: 선수 A | VS | 선수 B */
.fo-arm { display: flex; align-items: center; gap: 10px; justify-content: center; }
.faceoff { display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; gap: 10px; }
.fo-side { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 10px; border: 2px solid var(--line); border-radius: var(--radius); background: var(--surface-2); min-width: 0; text-align: center; }
.fo-side input { width: 100%; text-align: center; }
.fo-side.fo-a { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.fo-side.fo-b { border-color: color-mix(in srgb, var(--cmp) 45%, var(--line)); }
.fo-side.won { border-color: var(--up); background: color-mix(in srgb, var(--up) 12%, var(--surface-2)); }
.fo-label { font-size: 0.75rem; font-weight: 800; color: var(--muted); }
.fo-name { font-family: var(--display); font-weight: 400; font-size: clamp(1.1rem, 4.5vw, 1.6rem); line-height: 1.15; overflow-wrap: anywhere; min-height: 1.2em; }
.fo-vs { align-self: center; font-size: 1.4rem; }
.fo-win { width: 100%; margin-top: auto; min-height: 44px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 800; cursor: pointer; }
.fo-win[aria-pressed='true'] { background: var(--up); border-color: var(--up); color: #fff; }
.fo-win:disabled { opacity: 0.45; cursor: default; }
.me-chip { justify-content: center; }
.center-text { text-align: center; }

/* 내 QR */
.qr-section summary { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; gap: 4px; align-items: baseline; }
.qr-section summary::-webkit-details-marker { display: none; }
.qr-body { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; margin-top: 12px; }
.qr-body ul { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 6px; }
.qr-card { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.qr { background: #fff; padding: 8px; border-radius: 12px; line-height: 0; }
.qr svg { max-width: 100%; height: auto; }
.qr-name { font-weight: 800; }

/* 사진첩 링크 · 명예의 전당 */
.album-link { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); }
.album-link:hover { text-decoration: none; border-color: var(--accent); }
.album-link span:last-child { display: flex; flex-direction: column; gap: 2px; }
.album-ico { font-size: 2rem; }
.hall-seasons { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.hall-season { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; background: var(--surface-2); }
.hall-season h3 { margin: 0 0 8px; }
.hall-podium { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.hall-podium li { display: grid; grid-template-columns: 1.6em 2.4em 2.6em minmax(0, 1fr) auto; align-items: center; gap: 6px; }
.hall-place { font-weight: 800; color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
.hall-grade { min-width: 0; }
.hall-name { font-weight: 800; min-width: 0; overflow-wrap: anywhere; }
.hall-score { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
.hall-contests { display: flex; flex-direction: column; gap: 14px; }
.hall-contest header { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.hall-contest h3 { margin: 0; font-size: 1rem; }
.hall-date { color: var(--muted); font-size: 0.85rem; font-weight: 700; }
.hall-table table { table-layout: fixed; width: 100%; font-size: 0.88rem; }
.hall-table th, .hall-table td { padding: 8px 6px; }
.hall-table th:nth-child(1), .hall-table td:nth-child(1) { width: 19%; }
.hall-table th:nth-child(2), .hall-table td:nth-child(2) { width: 23%; }
.hall-table th:nth-child(3), .hall-table td:nth-child(3) { width: 33%; }
.hall-table th:nth-child(4), .hall-table td:nth-child(4) { width: 25%; }
.hall-table td { white-space: normal; word-break: keep-all; overflow-wrap: anywhere; vertical-align: middle; }
.hall-rank { font-weight: 800; white-space: nowrap; }

/* 기록 탭 */
.rec-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.rec-head h2 { margin: 0; }
.rec-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rec-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--ink); }
.rec-row:hover { text-decoration: none; outline: 1px solid var(--accent); }
.rec-class { font-weight: 800; }
.rec-podium { display: flex; gap: 10px; flex-wrap: wrap; }
.rated { font-size: 0.72rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: var(--chip); color: var(--muted); }
.rated.yes { background: color-mix(in srgb, var(--up) 20%, transparent); color: var(--up); }
.rec-go { margin-left: auto; color: var(--accent); font-weight: 800; font-size: 0.85rem; }
.div-tabs { margin-top: -4px; }
/* 메뉴가 7개일 때 휴대폰에서 좁게 */
.bottomnav a { min-width: 0; flex: 1; padding: 4px 2px; font-size: 0.68rem; }

.stat-row { grid-template-columns: minmax(120px, 1fr) auto 72px; }
.stat-score { text-align: right; font-weight: 800; color: var(--accent); }
@media (max-width: 560px) { .stat-row { grid-template-columns: 1fr auto 64px; } .stat-name { grid-column: 1 / -1; } }
.staff-chip { font-size: 0.68rem; padding: 1px 7px; background: color-mix(in srgb, var(--cmp) 18%, transparent); color: var(--cmp); }
.name-suggest:empty { display: none; }
.name-suggest { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: var(--radius-sm); background: var(--surface-2); }

/* ── 홈: 내 선수 카드 (게임 선수 카드처럼 · 등급에 따라 금/은/동) ── */
.fut-card {
  --t1: #FFF0B0; --t2: #F3D77A; --t3: #b8963a; --tink: #2b1f04; --tsub: #5c4510; --tglass: rgba(255,255,255,0.45);
  position: relative; overflow: hidden; isolation: isolate; display: flex; flex-direction: column; gap: 8px;
  max-width: 440px; width: 100%; margin: 0 auto; padding: 18px 18px 14px;
  border-radius: 22px 22px 46px 46px; color: var(--tink);
  background: radial-gradient(120% 70% at 20% 0%, rgba(255,255,255,0.55), transparent 55%), linear-gradient(160deg, var(--t1), var(--t2) 55%, var(--t3));
  box-shadow: 0 18px 40px -22px rgba(0,0,0,0.6), inset 0 0 0 2px rgba(255,255,255,0.35);
}
/* 등급별 카드 색 */
.fut-card.tier-s { --t1: #f8d995; --t2: #E7AD42; --t3: #8f600f; --tink: #2a1a02; --tsub: #5e3d06; }
.fut-card.tier-a { --t1: #e2d4ff; --t2: #B18CFF; --t3: #5d3bb8; --tink: #1a0c3b; --tsub: #3b2779; }
.fut-card.tier-b { --t1: #cbeaff; --t2: #58B9FF; --t3: #17609c; --tink: #03203a; --tsub: #0c3d66; }
.fut-card.tier-c { --t1: #d0f5e1; --t2: #62D69A; --t3: #1e7c50; --tink: #052817; --tsub: #0f4b2f; }
.fut-card.tier-d { --t1: #e2e6ec; --t2: #8993A3; --t3: #4a5262; --tink: #10141b; --tsub: #2c333f; }
.fut-card.tier-e { --t1: #9a8070; --t2: #665044; --t3: #2f221b; --tink: #fff6ea; --tsub: #e5d3c2; --tglass: rgba(255,255,255,0.14); }
/* S+ : 샴페인 골드 + 홀로그램 */
.fut-card.tier-splus::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; mix-blend-mode: soft-light; opacity: 0.9;
  background: linear-gradient(115deg, transparent 20%, #ff9de2 35%, #9de7ff 45%, #b9ff9d 55%, #ffe39d 65%, transparent 80%);
  background-size: 250% 250%; animation: holo 6s linear infinite;
}
@keyframes holo { from { background-position: 0% 50%; } to { background-position: 220% 50%; } }
@media (prefers-reduced-motion: reduce) { .fut-card.tier-splus::before, .grade.holo { animation: none; } }
.fut-card::after { content: ''; position: absolute; inset: 6px; border-radius: 18px 18px 42px 42px; border: 1px solid rgba(255,255,255,0.45); pointer-events: none; }
.fut-top { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: start; }
.fut-ovr { display: flex; flex-direction: column; align-items: flex-end; text-align: right; gap: 4px; padding-top: 4px; min-width: 104px; }
.fut-ovr > b { white-space: nowrap; font-family: var(--display); font-weight: 400; font-size: clamp(2.1rem, 10vw, 2.8rem); line-height: 0.95; letter-spacing: -0.02em; }
.fut-ovr > small { font-weight: 800; font-size: 0.78rem; color: var(--tsub); }
.fut-tag { font-size: 0.74rem; font-weight: 800; padding: 1px 9px; border-radius: 999px; background: var(--g, var(--tglass)); color: var(--gi, var(--tink)); box-shadow: inset 0 0 0 1px rgba(0,0,0,0.15); }
.fut-tag.plain { background: var(--tglass); color: var(--tink); }
.fut-photo { justify-self: start; width: min(52vw, 220px); aspect-ratio: 1; border-radius: 50% 50% 18px 18px; overflow: hidden; display: grid; place-items: center; background: radial-gradient(circle at 50% 35%, rgba(255,255,255,0.6), color-mix(in srgb, var(--c) 45%, transparent)); box-shadow: inset 0 -30px 40px -30px rgba(0,0,0,0.35); }
.fut-photo img { width: 100%; height: 100%; object-fit: cover; }
.fut-emoji { font-size: 6rem; line-height: 1; }
.fut-name { text-align: center; border-top: 1px solid rgba(0,0,0,0.18); border-bottom: 1px solid rgba(0,0,0,0.18); padding: 6px 0; }
.fut-name b { display: block; font-family: var(--display); font-weight: 400; font-size: 1.9rem; line-height: 1.1; }
.fut-name small { color: var(--tsub); font-weight: 700; }
.fut-motto { text-align: center; font-size: 0.85rem; font-style: italic; color: var(--tsub); }
.fut-hex { position: relative; display: grid; place-items: center; }
.fut-cert { position: absolute; top: 2px; right: 2px; z-index: 1; }
.fut-legend { color: var(--tsub); font-weight: 700; font-size: 0.72rem; }
.fut-hex .hex { width: 100%; max-width: 330px; height: auto; }
.fut-card .hex-label { fill: var(--tink); font-weight: 800; }
.fut-card .hex-value { fill: var(--tsub); font-weight: 700; }
.fut-card .hex-outer { fill: var(--tglass); stroke: color-mix(in srgb, var(--tink) 40%, transparent); }
.fut-card .hex-ring, .fut-card .hex-spoke { stroke: color-mix(in srgb, var(--tink) 20%, transparent); }
.fut-card .hex-ring, .fut-card .hex-spoke { stroke: rgba(0,0,0,0.18); fill: none; }
.fut-empty { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 26px 12px; color: var(--tink); text-align: center; border: 2px dashed rgba(0,0,0,0.25); border-radius: 14px; width: 100%; }
.fut-empty small { color: var(--tsub); }
.fut-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; text-align: center; }
.fut-stat { display: flex; flex-direction: column; padding: 6px 2px; border-radius: 10px; background: var(--tglass); }
.fut-stat b { font-size: 1.15rem; font-weight: 900; }
.fut-stat small { font-size: 0.7rem; font-weight: 700; color: var(--tsub); }
.fut-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 8px; }
.fut-foot .lvbar { flex: 1; }
.fut-foot .lvbar .bar { background: rgba(0,0,0,0.15); }
.fut-foot .btn { background: var(--tink); color: var(--t1); border-color: transparent; }

/* ── 홈: 나의 기록실 ── */
.room-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.room-box { display: flex; flex-direction: column; gap: 1px; padding: 10px; border-radius: var(--radius-sm); background: var(--surface-2); min-width: 0; }
.room-box > small:first-child { font-weight: 700; color: var(--muted); font-size: 0.75rem; }
.room-box b { font-size: 1.2rem; font-weight: 900; }
.room-box small.muted { font-size: 0.72rem; }
.room-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.room-list li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.room-list li:last-child { border-bottom: 0; }
.room-who { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.room-who:has(.rank) { flex-direction: row; align-items: center; gap: 8px; }
.room-info { display: flex; flex-direction: column; min-width: 0; }
.room-info small { font-size: 0.74rem; }
@media (max-width: 420px) {
  .room-list li { grid-template-columns: minmax(0, 1fr) auto; }
  .room-info { grid-column: 1 / -1; grid-row: 2; }
}

/* 인증 마크 · 동명이인 표시 · 업적 */
.cert-mark { display: inline-flex; align-items: center; gap: 3px; font-size: 0.75rem; font-weight: 900; padding: 2px 9px; border-radius: 999px; background: #0f8a5f; color: #fff; white-space: nowrap; box-shadow: 0 2px 6px -2px rgba(0,0,0,0.4); }
.cert-mark.no { background: var(--chip); color: var(--muted); box-shadow: none; }
.fut-card .cert-mark.no { background: var(--tglass); color: var(--tsub); }
.dup-tag { margin-left: 3px; font-size: 0.72em; font-weight: 700; color: var(--muted); padding: 0 5px; border-radius: 999px; background: var(--chip); }
.choice-btns .btn { width: 100%; justify-content: center; white-space: normal; text-align: center; }
.name-suggest { display: flex; flex-direction: column; gap: 8px; }
.name-suggest:empty { display: none; }
.badge-date { font-size: 0.7rem; color: var(--muted); }
.ach-feed { list-style: none; padding: 0; display: flex; flex-direction: column; }
.ach-feed li { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.ach-feed li:last-child { border-bottom: 0; }
.ach-ico { font-size: 1.4rem; text-align: center; }
.ach-main { min-width: 0; }
.chip.sm { font-size: 0.68rem; padding: 0 6px; margin-left: 4px; }

/* ── 사용 현황 그래프 (한 계열 · 한 색) ── */
.chart { margin: 0; }
.bars { width: 100%; height: auto; display: block; }
.bars .grid { stroke: var(--line); stroke-width: 1; }
.bars .tick { fill: var(--muted); font-size: 11px; }
.bars .hit { fill: transparent; }
.bars .mark { fill: var(--accent); }
.bars .bar:hover .mark { fill: color-mix(in srgb, var(--accent) 75%, var(--ink)); }
.bars .bar:hover .hit { fill: color-mix(in srgb, var(--accent) 8%, transparent); }
.hbars { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.hbars li { display: grid; grid-template-columns: minmax(70px, 30%) 1fr auto; gap: 8px; align-items: center; font-size: 0.9rem; }
.hb-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-track { height: 10px; background: var(--chip); border-radius: 999px; overflow: hidden; }
.hb-track i { display: block; height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; }

/* ── 이용 안내 ── */
.home-foot { display: flex; flex-direction: column; gap: 10px; padding: 18px 4px 8px; margin-top: 8px; border-top: 1px solid var(--line); }
.home-foot h2 { font-size: 0.95rem; }
.home-foot ul { display: flex; flex-direction: column; gap: 4px; }
.guide-list, .guide-steps { display: flex; flex-direction: column; gap: 8px; }
.guide-steps li::marker { font-weight: 800; color: var(--accent); }
.guide-dl { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
.guide-dl dt { font-weight: 800; margin-top: 10px; }
.guide-dl dt:first-child { margin-top: 0; }
.guide-dl dd { margin: 0; color: var(--ink); }
details.claim { margin-top: 6px; }
details.claim form { margin-top: 6px; }

/* ── 참가 동의 ── */
.waiver { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; margin: 4px 0; display: flex; flex-direction: column; gap: 10px; background: var(--surface-2); min-width: 0; }
.waiver-text { display: flex; flex-direction: column; gap: 6px; font-size: 0.88rem; }
.waiver-text h3 { margin: 0; font-size: 0.95rem; }
.waiver-checks { display: flex; flex-direction: column; gap: 8px; }
.waiver-checks .check { display: grid; grid-template-columns: 22px 1fr; gap: 6px; align-items: start; font-size: 0.9rem; font-weight: 600; }
.waiver-checks input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
input::placeholder { color: var(--muted); opacity: 0.75; }

/* ── 시트로 내보내기 ── */
.export-tsv { width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.8rem; }
.export-table td, .export-table th { white-space: nowrap; }
.field.inline { flex-direction: row; align-items: center; gap: 8px; }
.plink.gone { color: var(--muted); }
