/* 레이아웃: 커리어 화면은 HUD · 시즌 진행 바 · 피드(아래에서 위로 쌓임) · 도크가 한 화면에 고정된다 */
:root {
  --bg: #f2f5f1;
  --surface: #ffffff;
  --surface-2: #f7f9f6;
  --text: #17201b;
  --muted: #66736c;
  --line: #dfe6e0;
  --accent: #0f7b4a;
  --accent-ink: #ffffff;
  --up: #0f8a4f;
  --down: #c8402f;
  --gold: #c99a1a;
  --cond: #e05a4f;
  --morale: #8b5cf6;
  --trust: #2f7de1;
  --fame: #e8a317;
  --pitch: #2f8f5b;
  --pitch-line: rgba(255, 255, 255, .55);
  --scrim: rgba(10, 20, 14, .45);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1311;
    --surface: #171f1b;
    --surface-2: #1d2621;
    --text: #e6eee8;
    --muted: #93a39a;
    --line: #29342e;
    --accent: #2fb373;
    --accent-ink: #06150d;
    --up: #4cd18d;
    --down: #ff7a68;
    --gold: #f0c24b;
    --pitch: #1f5e3d;
    --pitch-line: rgba(255, 255, 255, .35);
    --scrim: rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1311;
  --surface: #171f1b;
  --surface-2: #1d2621;
  --text: #e6eee8;
  --muted: #93a39a;
  --line: #29342e;
  --accent: #2fb373;
  --accent-ink: #06150d;
  --up: #4cd18d;
  --down: #ff7a68;
  --gold: #f0c24b;
  --pitch: #1f5e3d;
  --pitch-line: rgba(255, 255, 255, .35);
  --scrim: rgba(0, 0, 0, .6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Malgun Gothic", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-tap-highlight-color: transparent;
}
#app {
  max-width: 520px;
  margin: 0 auto;
  padding-block: 16px 24px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
#app.screen-career {
  height: 100%;
  padding: 0;
  display: flex;
  flex-direction: column;
}
[hidden] { display: none !important; }

/* 원형 국기 (flags.js) */
.flag-ic { display: inline-block; width: 1.15em; height: 1.15em; flex: none; border-radius: 50%; overflow: hidden; vertical-align: -0.2em; box-shadow: 0 0 0 1px rgba(0, 0, 0, .14); }
.flag-ic svg { display: block; width: 100%; height: 100%; }
.nat .flag .flag-ic { width: 22px; height: 22px; vertical-align: middle; }
.c-flag .flag-ic { width: 24px; height: 24px; }
.e-icon .flag-ic { width: 20px; height: 20px; vertical-align: -0.15em; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
button:disabled { cursor: not-allowed; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.primary, .secondary, .ghost { width: 100%; padding: 15px; border-radius: 14px; font-weight: 700; font-size: 16px; }
.primary { background: var(--accent); color: var(--accent-ink); }
.primary:disabled { opacity: .4; }
.primary.big { font-size: 18px; padding: 18px; }
.secondary { background: var(--surface); border: 2px solid var(--accent); }
.ghost { color: var(--muted); }
.save-career { margin-bottom: 8px; }
.save-career.done { border-color: var(--line); color: var(--up); }
.chip { display: inline-block; padding: 1px 8px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12px; font-weight: 600; white-space: nowrap; }
.hint, .muted { color: var(--muted); font-size: 13px; }
.hint { margin: 0 0 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.fade { animation: fade .35s ease both; }
@keyframes fade { from { opacity: .3; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.trend { font-weight: 700; white-space: nowrap; }
.trend.up { color: var(--up); }
.trend.down { color: var(--down); }
.trend.flat { color: var(--muted); }

/* ───── 타이틀 ───── */
.title { display: flex; flex-direction: column; gap: 22px; padding-top: 5vh; }
.title-top { text-align: center; }
.lang { align-self: center; display: flex; gap: 4px; padding: 4px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); }
.lang button { padding: 7px 16px; border-radius: 99px; font-weight: 700; font-size: 14px; color: var(--muted); }
.lang button.sel { background: var(--text); color: var(--bg); }
.ball { font-size: 56px; line-height: 1; }
.title h1 { font-size: clamp(38px, 11vw, 52px); line-height: 1.1; margin: 12px 0 8px; letter-spacing: -0.02em; text-wrap: balance; }
.title h1 .t99 { color: var(--accent); font-variant-numeric: tabular-nums; }
.tagline { color: var(--muted); margin: 0; font-size: 15px; }
.rules { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.rules h2 { font-size: 13px; color: var(--muted); margin: 0 0 6px; letter-spacing: .04em; }
.rules ul { margin: 0; padding-left: 18px; font-size: 13px; color: var(--muted); }
.rules li { margin: 4px 0; }
.rules b { color: var(--text); }
.title-actions { display: flex; flex-direction: column; gap: 10px; }

/* ───── 선수 생성 (정체성 · 국적 · 포지션 세 칸) ───── */
#app.screen-create { max-width: 1120px; }
.create { display: flex; flex-direction: column; gap: 14px; }
.create-title { margin: 0; font-size: 24px; letter-spacing: -0.01em; }
.grid { display: grid; gap: 8px; }
.create-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 900px) { .create-grid { grid-template-columns: 1fr 1.15fr 1fr; align-items: start; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.panel h2 { margin: 0; font-size: 16px; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.panel h2 em { font-style: normal; font-size: 13px; font-weight: 700; color: var(--accent); }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); min-width: 0; }
.field > span { font-weight: 700; letter-spacing: .04em; }
.field input, .search input { font: inherit; font-size: 16px; padding: 11px 13px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface-2); color: var(--text); width: 100%; min-width: 0; }
.field input:focus, .search input:focus { outline: none; border-color: var(--accent); }
.hint.small { margin: -4px 0 0; font-size: 12px; }

.kit { position: relative; width: min(200px, 60%); margin: 4px auto 0; }
.kit svg { display: block; width: 100%; height: auto; }
.kit-body { fill: var(--kit, #f4f5f2); stroke: rgba(0, 0, 0, .14); stroke-width: 1.5; transition: fill .25s; }
.kit-trim { fill: var(--kit-accent, #c8102e); transition: fill .25s; }
.kit-text { position: absolute; inset: 22% 0 0; display: flex; flex-direction: column; align-items: center; color: var(--kit-accent, #c8102e); pointer-events: none; transition: color .25s; }
.kit-text span { font-size: clamp(12px, 3.6vw, 16px); font-weight: 800; letter-spacing: .06em; max-width: 56%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kit-text b { font-size: clamp(44px, 14vw, 62px); line-height: 1; font-weight: 900; font-variant-numeric: tabular-nums; }
.id-row { display: grid; grid-template-columns: 1fr 88px; gap: 10px; }
.num-field input { text-align: center; }
.toggle { display: flex; gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; }
.toggle button { flex: 1; padding: 9px 4px; border-radius: 9px; font-weight: 700; font-size: 14px; color: var(--muted); }
.toggle button.sel { background: var(--text); color: var(--bg); }

.search { position: relative; display: block; }
.search span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 14px; opacity: .6; }
.search input { padding-left: 36px; }
.nat-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; max-height: 340px; overflow-y: auto; padding: 2px; }
.nat { display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: 12px; border: 2px solid transparent; background: var(--surface-2); color: var(--text); font-size: 14px; font-weight: 600; text-align: left; line-height: 1.25; min-width: 0; }
.nat .flag { font-size: 22px; line-height: 1; flex: none; }
.nat .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nat .check { opacity: 0; font-weight: 800; color: var(--accent); }
.nat.sel { border-color: var(--text); }
.nat.sel .check { opacity: 1; }

.pitch { position: relative; aspect-ratio: 3 / 3.4; width: 100%; background: repeating-linear-gradient(180deg, var(--pitch) 0 12.5%, color-mix(in srgb, var(--pitch) 88%, #000) 12.5% 25%); border-radius: 14px; overflow: hidden; }
.pitch-lines i { position: absolute; border: 2px solid var(--pitch-line); }
.pitch-lines .half { left: 0; right: 0; top: 50%; border-width: 2px 0 0; }
.pitch-lines .circle { left: 50%; top: 50%; width: 26%; aspect-ratio: 1; border-radius: 50%; transform: translate(-50%, -50%); }
.pitch-lines .box { left: 25%; width: 50%; height: 13%; }
.pitch-lines .box.top { top: -2px; }
.pitch-lines .box.bottom { bottom: -2px; }
.pp { position: absolute; transform: translate(-50%, -50%); min-width: 50px; padding: 7px 9px; border-radius: 99px; background: rgba(8, 40, 24, .72); color: #e7f5ec; font-weight: 800; font-size: 13px; border: 1px solid rgba(255, 255, 255, .18); }
.pp.sel { background: #fff; color: #0b2a1a; box-shadow: 0 0 14px rgba(255, 255, 255, .55); }
.pos-desc { margin: 0; color: var(--muted); font-size: 13px; }

.create-actions { display: flex; justify-content: space-between; gap: 10px; }
.create-actions .outline { padding: 13px 26px; border-radius: 99px; border: 2px solid var(--text); font-weight: 700; }
.create-actions .primary { width: auto; padding: 13px 30px; border-radius: 99px; }
/* ───── 커리어 HUD ───── */
.hud { flex: none; padding: 10px max(16px, env(safe-area-inset-right, 0px)) 8px max(16px, env(safe-area-inset-left, 0px)); background: var(--bg); border-bottom: 1px solid var(--line); }
.hud-row { display: flex; align-items: center; gap: 12px; }
.ovr { width: 62px; height: 66px; flex: none; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .15); }
.ovr b { font-size: 30px; line-height: 1; font-weight: 800; font-variant-numeric: tabular-nums; }
.ovr span { font-size: 10px; letter-spacing: .12em; font-weight: 700; opacity: .9; margin-top: 2px; }
.ovr.bronze { background: linear-gradient(160deg, #b07a4f, #8a5a35); }
.ovr.silver { background: linear-gradient(160deg, #9aa6ad, #6f7b83); }
.ovr.gold { background: linear-gradient(160deg, #e2b33c, #b88a12); }
.ovr.icon { background: linear-gradient(160deg, #1f9e6a, #0b5e8a); }
.who { flex: 1; min-width: 0; line-height: 1.35; }
.who-name { font-weight: 800; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shirt { margin-left: 6px; font-size: 13px; font-weight: 800; color: var(--accent); }
.who-sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-sub2 { font-size: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 2px; }
.hud-tag { white-space: nowrap; padding: 0 7px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); font-size: 11px; line-height: 18px; }
.hud-tag b { color: var(--text); font-variant-numeric: tabular-nums; }
.hud-tag.warn { border-color: var(--down); color: var(--down); }
.hud-tag.warn b { color: var(--down); }
.role-starter { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.role-sub, .role-none, .role-army { color: var(--down); border-color: currentColor; }
.icon-btn { width: 38px; height: 38px; flex: none; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); font-size: 18px; }
.meters { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 8px; }
.meter .m-top { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); }
.meter .m-top b { color: var(--text); font-variant-numeric: tabular-nums; }
.meter.low .m-top b { color: var(--down); }
.bar { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; margin-top: 3px; }
.bar i { display: block; height: 100%; border-radius: 99px; transition: width .4s ease; }
.fill-cond { background: var(--cond); }
.fill-morale { background: var(--morale); }
.fill-trust { background: var(--trust); }
.fill-fame { background: var(--fame); }
.season-line { margin-top: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ───── 시즌 진행 바 ───── */
.progress { flex: none; padding: 8px max(16px, env(safe-area-inset-right, 0px)) 6px max(16px, env(safe-area-inset-left, 0px)); background: var(--surface); border-bottom: 1px solid var(--line); }
.prog-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.prog-label { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prog-ctrl { display: flex; gap: 6px; flex: none; }
.mini { padding: 4px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); font-size: 12px; font-weight: 700; min-width: 36px; }
.prog-track { position: relative; display: flex; gap: 2px; height: 12px; border-radius: 6px; overflow: hidden; }
.prog-track .seg { flex-basis: 0; background: var(--line); }
.prog-track .seg.win { background: color-mix(in srgb, var(--fame) 35%, var(--line)); }
.prog-track .seg.off { background: color-mix(in srgb, var(--muted) 25%, var(--line)); }
.prog-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--accent); opacity: .85; border-radius: 6px; mix-blend-mode: normal; }
.prog-months { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted); margin-top: 3px; }

/* ───── 피드 (최신이 맨 위, 이전 기록은 아래로 밀려남) ───── */
.feed {
  flex: 1; min-height: 0; overflow-y: auto;
  display: flex; flex-direction: column; gap: 8px;
  padding: 12px max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px));
}
.divider { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; font-size: 12px; font-weight: 800; color: var(--muted); letter-spacing: .04em; }
.divider::before { content: ''; order: 1; flex: 1; height: 1px; background: var(--line); }
.divider span:last-child { order: 2; }
.entry { display: flex; gap: 9px; padding: 8px 11px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
/* 자잘한 기록은 한 줄짜리 회색 글씨로 */
.entry.quiet { background: transparent; border: none; color: var(--muted); padding: 1px 11px; font-size: 12px; }
.entry.quiet .e-icon { font-size: 12px; width: 16px; }
.entry.quiet .e-text { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entry.big { border-left: 4px solid var(--accent); }
.entry.good { border-left: 4px solid var(--gold); background: color-mix(in srgb, var(--gold) 8%, var(--surface)); }
.entry.bad { border-left: 4px solid var(--down); }
.entry.season { background: var(--surface-2); font-weight: 600; }
.entry.event { border-left: 4px solid var(--morale); }
.enter { animation: rise .45s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
.e-icon { font-size: 18px; line-height: 1.4; width: 22px; text-align: center; flex: none; }
.e-body { flex: 1; min-width: 0; }
.e-title { font-weight: 800; font-size: 14px; }
.e-choice { font-size: 13px; color: var(--muted); margin: 1px 0 2px; }
.roll { font-weight: 700; font-size: 12px; }
.roll.ok { color: var(--up); }
.roll.no { color: var(--down); }
.e-text { font-size: 13.5px; line-height: 1.4; }
.deltas { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.delta { font-size: 11.5px; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: var(--surface-2); }
.delta.up { color: var(--up); }
.delta.down { color: var(--down); }
.delta.flat { color: var(--muted); }
.delta.d-ovr { border: 1px solid currentColor; }

/* ───── 하단 도크 ───── */
.dock {
  flex: none;
  padding: 8px max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px));
  background: var(--bg); border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 8px;
}
.seg-ctrl { display: flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.seg-label { font-size: 12px; color: var(--muted); padding: 0 8px; font-weight: 700; }
.seg-ctrl button { flex: 1; padding: 7px 0; border-radius: 9px; font-size: 13px; color: var(--muted); font-weight: 600; }
.seg-ctrl button.on { background: var(--accent); color: var(--accent-ink); }
.request { width: 100%; padding: 11px; border-radius: 12px; font-weight: 700; font-size: 14px; background: color-mix(in srgb, var(--fame) 22%, var(--surface)); border: 2px solid var(--fame); animation: pulse 1s ease-in-out infinite alternate; }
@keyframes pulse { from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--fame) 40%, transparent); } to { box-shadow: 0 0 0 5px transparent; } }

/* ───── 선택 시트 · 팝업 ───── */
.sheet-wrap { position: fixed; inset: 0; z-index: 10; background: var(--scrim); display: flex; align-items: flex-end; justify-content: center; animation: fadeIn .2s ease; }
.sheet-wrap.center { align-items: center; padding: 16px; }
.sheet-wrap.center .sheet { border-radius: 22px; max-width: 480px; max-height: calc(100% - 32px); padding-bottom: 18px; animation: pop .28s cubic-bezier(.2, .9, .3, 1.2); }

/* 트로피 팝업: 화면 중앙에 잠깐 떴다가 사라진다. 아래 화면 조작은 막지 않는다 */
#toast { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; pointer-events: none; opacity: 0; }
#toast.show { animation: toastIn .2s cubic-bezier(.2, .9, .3, 1.3) forwards; }
#toast.hide { animation: toastOut .2s ease forwards; }
.toast-card.multi { gap: 10px; padding: 18px 22px; max-width: min(340px, calc(100% - 40px)); }
.toast-head { font-weight: 900; font-size: 18px; color: var(--gold); }
.toast-list { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.toast-item { display: flex; align-items: center; gap: 10px; text-align: left; font-weight: 800; font-size: 15px; }
.ti-ic { flex: none; display: grid; place-items: center; width: 34px; height: 34px; font-size: 26px; }
.toast-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 20px 28px; max-width: min(320px, calc(100% - 48px)); border-radius: 20px; background: color-mix(in srgb, var(--surface) 94%, transparent); border: 2px solid var(--gold); box-shadow: 0 12px 40px rgba(0, 0, 0, .3); text-align: center; }
.toast-icon { font-size: 52px; line-height: 1; }
.toast-text { font-weight: 800; font-size: 17px; text-wrap: balance; }
@keyframes toastIn { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: none; } }
@keyframes toastOut { from { opacity: 1; transform: none; } to { opacity: 0; transform: scale(.92) translateY(-10px); } }
.sheet {
  width: 100%; max-width: 520px; max-height: 88vh; overflow-y: auto;
  background: var(--bg); border-radius: 22px 22px 0 0;
  padding: 18px max(16px, env(safe-area-inset-right, 0px)) calc(18px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  animation: up .25s ease;
}
.sheet-tag { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .08em; color: var(--accent); margin-bottom: 4px; }
.sheet h3 { margin: 0 0 6px; font-size: 20px; text-wrap: balance; }
.sheet-text { margin: 0 0 14px; font-size: 15px; }
.choices { display: flex; flex-direction: column; gap: 8px; }
.choice { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; text-align: left; padding: 13px 14px; border-radius: 14px; background: var(--surface); border: 2px solid var(--line); transition: border-color .15s, transform .08s; }
.choice:hover:not(:disabled) { border-color: var(--accent); }
.choice:active:not(:disabled) { transform: scale(.985); }
.choice:disabled { opacity: .4; }
.c-main { display: flex; flex-direction: column; min-width: 0; position: relative; }
.choice.offer .c-main { padding-left: 48px; min-height: 54px; justify-content: center; }
.c-flag { position: absolute; left: 0; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; align-items: center; gap: 3px; width: 38px; line-height: 1; }
.c-flag .cf-nat .flag-ic { width: 15px; height: 15px; }
.c-t { font-weight: 700; font-size: 15px; }
.c-main small { color: var(--muted); font-size: 12px; margin-top: 1px; }
.odds { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.odd { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 10px; font-size: 13px; font-weight: 600; }
.odd b { flex: none; min-width: 40px; padding: 1px 6px; border-radius: 6px; text-align: center; font-size: 12px; font-variant-numeric: tabular-nums; }
.odd.good { background: color-mix(in srgb, var(--up) 14%, transparent); color: var(--up); }
.odd.good b { background: color-mix(in srgb, var(--up) 22%, transparent); }
.odd.bad { background: color-mix(in srgb, var(--down) 13%, transparent); color: var(--down); }
.odd.bad b { background: color-mix(in srgb, var(--down) 22%, transparent); }
.choice .c-main { flex: 1; }
.sheet.records { display: flex; flex-direction: column; gap: 12px; }
.season-pop { border-radius: 22px; max-width: 440px; display: flex; flex-direction: column; gap: 10px; text-align: center; padding-bottom: 18px; animation: pop .3s cubic-bezier(.2, .9, .3, 1.2); }
.season-pop h3 { font-size: 24px; margin: 0; }
.sp-club { margin: 0; color: var(--muted); }
.sp-ovr { display: flex; align-items: baseline; justify-content: center; gap: 8px; font-variant-numeric: tabular-nums; }
.sp-ovr span { font-size: 12px; font-weight: 800; color: var(--muted); letter-spacing: .1em; }
.sp-ovr b { font-size: 34px; }
.sp-ovr i { font-style: normal; color: var(--muted); }
.sp-ovr em { font-style: normal; font-weight: 800; font-size: 16px; }
.sp-ovr.up em { color: var(--up); }
.sp-ovr.down em { color: var(--down); }
.sp-ovr.flat em { color: var(--muted); }
.sp-money { display: flex; justify-content: center; gap: 14px; margin: 0; font-size: 14px; }
.season-pop .trophies { justify-content: center; }

/* 아이콘: 트로피·엠블럼 */
.tro-ic { display: inline-block; vertical-align: middle; flex: none; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .25)); }
.crest { display: inline-block; vertical-align: -0.25em; flex: none; }
.e-icon .tro-ic, .e-icon .crest { vertical-align: -3px; }
.chip.trophy { display: inline-flex; align-items: center; gap: 4px; }

/* 시즌 결산: 트로피 진열 + 리그 순위표 */
.sp-club { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; }
.sp-trophies { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.sp-tro { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 92px; padding: 8px 4px; border-radius: 12px; background: color-mix(in srgb, var(--gold) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--gold) 40%, var(--line)); }
.sp-tro b { font-size: 11.5px; line-height: 1.25; text-wrap: balance; }
.ltable { text-align: left; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.ltable summary { cursor: pointer; padding: 8px 12px; font-weight: 800; font-size: 13px; }
.lt-legend { display: flex; flex-wrap: wrap; gap: 4px 10px; padding: 0 12px 6px; font-size: 11px; color: var(--muted); }
.lt-key::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; background: var(--zc, var(--line)); }
/* 한 줄 24px × 7줄 = 7위까지 한눈에, 나머지는 스크롤 */
.lt-list { position: relative; list-style: none; margin: 0 0 8px; padding: 0 6px; max-height: 168px; overflow-y: auto; }
.lt-row { display: flex; align-items: center; gap: 7px; height: 24px; box-sizing: border-box; padding: 0 6px; border-radius: 7px; font-size: 12.5px; border-left: 3px solid var(--zc, transparent); }
.lt-row.me { background: color-mix(in srgb, var(--accent) 16%, transparent); font-weight: 800; }
.lt-n { width: 18px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.lt-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lt-pts { font-variant-numeric: tabular-nums; }
.z-champ { --zc: var(--gold); }
.z-ucl { --zc: #3d6fd6; }
.z-up { --zc: var(--up); }
.z-po { --zc: #e39b2d; }
.z-down { --zc: var(--down); }

/* 상단: 이번 시즌 숫자 배지 */
.season-line { display: flex; align-items: center; gap: 5px; overflow-x: auto; scrollbar-width: none; }
.season-line::-webkit-scrollbar { display: none; }
.sl-tag { flex: none; font-size: 11px; font-weight: 700; color: var(--muted); margin-right: 2px; }
.pill { flex: none; display: inline-flex; align-items: baseline; gap: 3px; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); }
.pill i { font-style: normal; font-size: 11px; }
.pill b { font-size: 14px; color: var(--text); font-variant-numeric: tabular-nums; }
.pill small { font-size: 10.5px; color: var(--muted); }
.pill.lock { margin-left: auto; }

/* 시즌별 기록·거쳐 간 구단의 엠블럼 */
.st-club { white-space: nowrap; }
.st-club .crest, .club-step .crest { margin-right: 4px; }
.club-step { white-space: nowrap; }

/* 구단 이름 편집 */
.ce-list { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 12px; }
.ce-row { display: flex; align-items: center; gap: 10px; }
.ce-row input { flex: 1; min-width: 0; font: inherit; font-size: 15px; padding: 9px 12px; border-radius: 10px; border: 2px solid var(--line); background: var(--surface-2); color: var(--text); }
.ce-row input:focus { outline: none; border-color: var(--accent); }
.club-edit .primary, .club-edit .ghost { margin-bottom: 6px; }

/* 발롱도르 투표 결과 */
.vote { font-size: 13px; padding: 8px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.vote b { color: var(--text); }
.vote.win { border-color: var(--gold); }
.vote.win b { color: var(--gold); }
.vote small { color: var(--muted); font-size: 12px; }

/* 난이도 */
.diff-desc { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: 0; }
.diff-tag { margin: 0 0 6px; text-align: center; font-size: 13px; font-weight: 700; color: var(--muted); }

/* 저장 관리 */
.bk-card { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.bk-card h3 { margin: 0; font-size: 16px; }
.bk-card .hint { margin: 0; }
.bk-code { width: 100%; min-height: 84px; resize: vertical; font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; padding: 10px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface-2); color: var(--text); word-break: break-all; }
.bk-code:focus { outline: none; border-color: var(--accent); }
.bk-file { display: block; text-align: center; cursor: pointer; }
.bk-msg { margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; font-size: 14px; font-weight: 600; }
.bk-msg.ok { color: var(--up); background: var(--surface-2); }
.bk-msg.bad { color: var(--down); background: var(--surface-2); }

/* 언론·팬 반응 */
.press { text-align: left; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.press-news { display: flex; flex-direction: column; gap: 2px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.press-src { font-size: 11px; font-weight: 700; color: var(--muted); }
.press-news b { font-size: 14px; line-height: 1.35; }
.press-cmt { display: flex; align-items: baseline; gap: 6px; font-size: 13px; line-height: 1.35; }
.press-who { flex: none; font-weight: 700; color: var(--accent); font-size: 12px; }
.press-text { flex: 1; min-width: 0; }
.press-like { flex: none; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* 발롱도르 수상 장면 */
.ballon-pop { text-align: center; display: flex; flex-direction: column; gap: 8px; background: radial-gradient(circle at 50% 0%, rgba(240, 194, 75, .28), transparent 65%), var(--surface); }
.ballon-pop h3 { font-size: 28px; margin: 0; color: var(--gold); }
.ballon-glow { font-size: 76px; line-height: 1; margin-top: 6px; animation: ballonPulse 1.6s ease-in-out infinite; }
@keyframes ballonPulse { 0%, 100% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(240, 194, 75, 0)); } 50% { transform: scale(1.08); filter: drop-shadow(0 0 18px rgba(240, 194, 75, .7)); } }
.ballon-n { margin: 0; font-size: 18px; }
.ballon-n b { color: var(--gold); font-size: 26px; }
.ballon-name { margin: 0 0 6px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 6px; }
@media (prefers-reduced-motion: reduce) { .ballon-glow { animation: none; } }

/* 랭킹 */
.rk-tabs { display: flex; gap: 6px; margin-bottom: 12px; overflow-x: auto; }
.rk-tabs button { flex: 1 0 auto; padding: 8px 12px; border-radius: 99px; font-size: 13px; font-weight: 700; background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.rk-tabs button.sel { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.rk-confetti { font-size: 44px; line-height: 1; text-align: center; }
.rk-sub { margin: -4px 0 12px; text-align: center; }

/* 오늘의 선수 */
.daily-btn { margin-top: 8px; }
.daily-player { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.daily-flag .flag-ic { width: 52px; height: 52px; }
.daily-flag .flag-ic svg { width: 52px; height: 52px; }
.daily-meta { display: flex; flex-direction: column; gap: 3px; text-align: left; }
.daily-meta b { font-size: 18px; }
.daily-meta small { color: var(--muted); font-size: 13px; }
.daily-form, .daily-result { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.daily-result { text-align: center; }
.daily-result h3 { margin: 0; }
.daily-form .hint { margin: 0; }
.daily-select { font: inherit; font-size: 16px; padding: 11px 13px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface-2); color: var(--text); width: 100%; }
.emoji-line { margin: 0; font-size: 20px; letter-spacing: 1px; line-height: 1.4; word-break: break-all; }
.daily-end { display: flex; flex-direction: column; gap: 8px; align-items: center; margin-bottom: 4px; }
.daily-end .primary { max-width: 360px; }
.rk-entry { padding-top: 6vh; max-width: 480px; margin: 0 auto; }
.rk-entry .rk-sheet { padding: 22px 18px; }
.rk-diffs { display: flex; gap: 4px; margin: -4px 0 12px; padding: 3px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.rk-diffs button { flex: 1; padding: 6px 8px; border-radius: 9px; font-size: 13px; font-weight: 700; color: var(--muted); }
.rk-diffs button.sel { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.rk-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.rk-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.rk-row.me { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.rk-n { flex: none; width: 30px; text-align: center; font-weight: 800; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rk-list .rk-row:nth-child(-n+3) .rk-n { color: var(--gold); }
.rk-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rk-main b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-main b em { font-style: normal; font-size: 11px; padding: 0 6px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); vertical-align: 2px; }
.rk-main small { color: var(--muted); font-size: 12px; line-height: 1.4; word-break: keep-all; overflow-wrap: anywhere; }
.rk-score { flex: none; font-size: 17px; font-variant-numeric: tabular-nums; min-width: 52px; text-align: right; }
.rk-side { flex: none; display: flex; align-items: center; gap: 10px; }
/* 휴대폰: 등급 배지를 점수 위에 쌓아 선수 정보 칸을 넓힌다 */
@media (max-width: 480px) {
  .rk-row { gap: 8px; padding: 10px; }
  .rk-n { width: 22px; }
  .rk-side { flex-direction: column; align-items: flex-end; gap: 3px; }
  .rk-side .grade { font-size: 11px; padding: 0 7px; }
  .rk-score { font-size: 16px; min-width: 0; }
}
.rk-msg { text-align: center; padding: 24px 0; }
.rk-sheet { display: flex; flex-direction: column; gap: 10px; text-align: center; }
.rk-sheet h3 { margin: 0; font-size: 22px; }
.rk-input { font: inherit; font-size: 16px; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface-2); color: var(--text); width: 100%; }
.rk-input:focus { outline: none; border-color: var(--accent); }
.rk-err { margin: 0; color: var(--down); font-size: 13px; font-weight: 700; }
.rk-place { margin: 0; font-size: 18px; }
.rk-place b { color: var(--gold); font-size: 30px; }

/* 공유 카드 */
.share-btn { margin-bottom: 8px; }
.share-sheet { display: flex; flex-direction: column; gap: 10px; text-align: center; overflow-y: auto; }
.share-img { width: 100%; max-width: 360px; align-self: center; border-radius: 14px; box-shadow: 0 6px 24px rgba(0, 0, 0, .35); }
.share-btns { display: flex; flex-direction: column; gap: 8px; }
.share-sheet .hint { margin: 0; }
@keyframes up { from { transform: translateY(30px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes pop { from { transform: scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ───── 기록 · 엔딩 ───── */
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 4px 0; }
.stats-grid div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 6px; text-align: center; display: flex; flex-direction: column; }
.stats-grid b { font-size: 20px; font-variant-numeric: tabular-nums; }
.stats-grid span { font-size: 11.5px; color: var(--muted); }
.trophies { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; }
.trophies small { color: var(--muted); font-weight: 500; }
.chip.trophy { position: relative; cursor: help; padding: 4px 10px; font-size: 13px; }
.chip.trophy b { color: var(--gold); margin-left: 2px; }
.chip.trophy::after {
  content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%);
  width: max-content; max-width: 240px; white-space: normal; padding: 6px 10px; border-radius: 8px;
  background: var(--text); color: var(--bg); font-size: 12px; font-weight: 600; line-height: 1.4; text-align: center;
  opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 5;
}
.chip.trophy:hover::after, .chip.trophy:focus::after { opacity: 1; }
.clubs { font-size: 13px; color: var(--muted); margin: 8px 0; }
.table-wrap { overflow-x: auto; margin-top: 8px; }
table { border-collapse: collapse; width: 100%; font-size: 12.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
th, td { padding: 6px 8px; text-align: right; border-bottom: 1px solid var(--line); }
th:nth-child(-n+2), td:nth-child(-n+2) { text-align: left; }
th { color: var(--muted); font-weight: 600; }
.table-title { margin: 14px 0 0; font-size: 15px; }
.season-table td small { display: block; color: var(--muted); font-size: 11px; }
.season-table tfoot td { font-weight: 800; border-bottom: 0; border-top: 2px solid var(--line); }

.ending { display: flex; flex-direction: column; gap: 12px; text-align: center; padding-top: 4vh; }
.ending .card { text-align: left; }
.ending-emoji { font-size: 68px; line-height: 1; }
.ending h1 { margin: 0; font-size: 32px; }
.ending-desc { margin: 0 0 6px; color: var(--muted); }
.new-tag { margin: 0; color: var(--gold); font-weight: 800; letter-spacing: .06em; }
.who-line { margin: 0; }

.collection { display: flex; flex-direction: column; gap: 14px; }
.col-head { display: flex; align-items: center; gap: 10px; }
.col-head h2 { flex: 1; margin: 0; font-size: 20px; }
.count { color: var(--muted); font-weight: 600; }
.endings { grid-template-columns: repeat(2, 1fr); }
.ending-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.ending-card strong { display: block; font-size: 14.5px; }
.ending-card p { margin: 4px 0 0; font-size: 12px; color: var(--muted); line-height: 1.45; }
.e-emoji { font-size: 26px; }
.ending-card.locked { opacity: .6; }

/* 지난 커리어 보관함 */
.arch-list { display: flex; flex-direction: column; gap: 8px; }
.arch-item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.arch-item:hover { border-color: var(--accent); }
.arch-emoji { font-size: 28px; line-height: 1; flex: none; }
.arch-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.arch-main b { font-size: 15px; }
.arch-title { font-size: 13px; font-weight: 700; color: var(--accent); }
.arch-main small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.arch-date { flex: none; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.arch-head { justify-content: space-between; }
.arch-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.arch-score { font-size: 17px; font-variant-numeric: tabular-nums; }

/* 종합 점수 */
.score-box { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 10px 0 4px; }
.score-label { font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--muted); }
.score-num { font-size: 56px; line-height: 1.05; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--text); }
.score-rank { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--muted); }
.grade { display: inline-block; padding: 1px 9px; border-radius: 99px; font-size: 13px; font-weight: 800; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
.grade.g-SSS { background: linear-gradient(135deg, #8b3dff, #c86bff); border-color: #8b3dff; color: #fff; box-shadow: 0 0 8px rgba(139, 61, 255, .45); }
.grade.g-SS { background: var(--gold); border-color: var(--gold); color: #1a1405; }
.grade.g-S { border-color: var(--gold); color: var(--gold); }
.grade.g-A { border-color: var(--accent); color: var(--accent); }
.arch-side .grade { font-size: 11px; padding: 0 7px; }
.ghost.danger { color: var(--down); }

@media (max-width: 380px) {
  .meters { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
