/* Football Tactician — 기획서와 같은 색 체계.
   네이비 보드 위에 에메랄드 액센트, 중계 화면의 대비를 목표로 한다. */

:root {
  --navy-900: #0A1220;
  --navy-800: #0F1A2E;
  --navy-700: #162540;
  --navy-600: #1D3050;
  --navy-500: #27405F;
  --line:     #24364F;
  --line-soft:#1B2A42;

  --emerald:   #3DDCA3;
  --emerald-d: #22B384;
  --amber:     #F2A33C;
  --coral:     #E4573D;
  --sky:       #4FA9E8;
  --violet:    #9B7BE0;

  --text:      #E8EEF6;
  --text-dim:  #9FB0C6;
  --text-mute: #6B7F99;

  --radius: 10px;
  --radius-lg: 14px;
  --shadow: 0 10px 30px rgba(0,0,0,.35);

  --font-display: 'Oswald', 'Gothic A1', system-ui, sans-serif;
  --font-body: 'IBM Plex Sans KR', 'Gothic A1', system-ui, -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Mono', monospace;
}

* { box-sizing: border-box; }

/*
  글씨 크기의 기준점. 화면의 거의 모든 치수가 rem 이라 **이 한 줄이 전체를 늘린다**.
  (rem 은 body 가 아니라 html 의 크기를 따른다. 예전에는 body 에만 15px 를 적어 두어서
   본문만 작고 표·배지는 16px 기준으로 계산되는 엇갈림이 있었다.)

  사람마다 화면이 달라 하나로 맞출 수 없으므로, 설정에서 세 단계를 고르게 했다.
  고른 값은 html 의 class 로 붙고 브라우저에 저장된다 — js/ui.js · UiPrefs.cs
*/
html { font-size: 16px; }
html.ui-lg { font-size: 17.5px; }
html.ui-xl { font-size: 19px; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--navy-900);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: .01em;
  margin: 0 0 .5rem;
}
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }

a { color: var(--emerald); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── 사이드바 아래 설정 ─────────────────────────────────────────── */

.side-foot {
  margin-top: auto;
  padding: .7rem 1.1rem 1rem;
  border-top: 1px solid var(--line-soft);
}
.side-foot-label {
  font-size: .72rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-mute); margin-bottom: .35rem;
}
.side-foot-ver {
  margin-top: .5rem; font-family: var(--font-mono);
  font-size: .72rem; color: var(--text-mute);
}

/* 붙어 있는 선택 단추. 셋 중 하나만 켜진다. */
.seg { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg-btn {
  flex: 1; padding: .3rem .2rem; cursor: pointer;
  background: transparent; color: var(--text-dim);
  border: none; border-right: 1px solid var(--line);
  font-family: var(--font-body); font-size: .76rem; white-space: nowrap;
}
.seg-btn:last-child { border-right: none; }
.seg-btn:hover { background: rgba(61,220,163,.07); color: var(--text); }
.seg-btn.on { background: var(--emerald); color: #06241A; font-weight: 600; }

/* ── 레이아웃 ───────────────────────────────────────────────────── */

.shell { display: flex; min-height: 100vh; }

.sidebar {
  /* rem 으로 둔다 — 글씨를 키우면 메뉴 칸도 같이 넓어져야 글자가 겹치지 않는다. */
  width: 14.8rem;
  flex: 0 0 14.8rem;
  background: linear-gradient(180deg, var(--navy-800), var(--navy-900));
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  padding: 1.1rem 1.1rem .9rem;
  border-bottom: 1px solid var(--line-soft);
}
.brand-mark {
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text);
}
.brand-mark b { color: var(--emerald); }
.brand-sub { font-size: .72rem; color: var(--text-mute); letter-spacing: .04em; }

.club-chip {
  display: flex; align-items: center; gap: .6rem;
  padding: .85rem 1.1rem;
  border-bottom: 1px solid var(--line-soft);
}
.kit {
  width: 26px; height: 26px; border-radius: 6px; flex: 0 0 26px;
  border: 1px solid rgba(255,255,255,.14);
}
.club-chip-name { font-size: .94rem; font-weight: 600; line-height: 1.2; }
.club-chip-sub { font-size: .78rem; color: var(--text-mute); }

.nav { padding: .6rem 0; flex: 1; }
.nav-group-title {
  font-size: .68rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-mute); padding: .7rem 1.1rem .3rem;
}
.nav a {
  display: flex; align-items: center; gap: .6rem;
  padding: .52rem 1.1rem;
  color: var(--text-dim);
  font-size: .95rem;
  border-left: 2px solid transparent;
  transition: background .12s, color .12s, border-color .12s;
}
.nav a:hover { background: rgba(61,220,163,.06); color: var(--text); text-decoration: none; }
.nav a.active {
  color: var(--emerald);
  background: rgba(61,220,163,.10);
  border-left-color: var(--emerald);
  font-weight: 600;
}
.nav-badge {
  margin-left: auto; font-size: .7rem; background: var(--coral); color: #fff;
  border-radius: 999px; padding: 0 .4rem; min-width: 18px; text-align: center;
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; gap: 1rem;
  padding: .7rem 1.4rem;
  background: var(--navy-800);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar-date {
  font-family: var(--font-mono); font-size: .9rem; color: var(--text-dim);
  padding: .25rem .6rem; border: 1px solid var(--line); border-radius: 6px;
}
.topbar-spacer { flex: 1; }

/* 넓은 화면에서 오른쪽이 통째로 비지 않게 폭을 넓히고 가운데에 둔다.
   1240px 로 묶여 있어 1,568px 화면에서 330px 가 빈 채로 남았다. */
.content { padding: 1.4rem 1.6rem; max-width: 1520px; width: 100%; margin: 0 auto; }

@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .sidebar {
    width: 100%; flex: none; height: auto; position: static;
    flex-direction: row; overflow-x: auto; align-items: center;
  }
  .brand, .club-chip { border-bottom: none; border-right: 1px solid var(--line-soft); }
  .nav { display: flex; padding: 0; }
  .nav-group-title { display: none; }
  .nav a { border-left: none; border-bottom: 2px solid transparent; white-space: nowrap; }
  .nav a.active { border-left: none; border-bottom-color: var(--emerald); }
  .content { padding: 1rem; }
}

/*
   상단 바는 한 줄에 다 들어가지 않는다. 날짜·다음 경기 뒤에 이사회 배지와 단추 서넛이
   줄줄이 붙는데, 폰 너비에서는 단추들이 화면 밖으로 밀려 나가 *모든 화면*이 가로로
   스크롤됐다. 늘어나기만 하던 빈 칸을 한 줄 통째로 차지하게 만들어 단추를 아랫줄로 접는다.
*/
@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; gap: .5rem .7rem; padding: .6rem .9rem; }
  .topbar .nowrap { white-space: normal; }
  .topbar-spacer { flex-basis: 100%; height: 0; }

  /*
     구단 화면의 작은 경기 표. 구단 이름 칸이 nowrap 이라 폰 너비에서 표가 카드보다
     몇 px 넓어졌다 — 긴 이름 하나에 오른쪽 끝이 잘렸다. 좁을 때는 이름을 접는다.
  */
  table.ft.compact td { padding: .4rem .35rem; }
  table.ft.compact td.nowrap { white-space: normal; }
}

/* ── 카드 ───────────────────────────────────────────────────────── */

.card {
  background: var(--navy-800);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.2rem;
  margin-bottom: 1rem;
}
.card-head {
  display: flex; align-items: center; gap: .6rem;
  margin: -.2rem 0 .9rem;
}
.card-head h2, .card-head h3 { margin: 0; }
.card-head .spacer { flex: 1; }

.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }

/* ── 통계 타일 ──────────────────────────────────────────────────── */

.stat {
  background: var(--navy-700);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .8rem .9rem;
}
.stat-label {
  font-size: .8rem; letter-spacing: .03em;
  color: var(--text-dim);
}
.stat-value {
  font-family: var(--font-display); font-size: 1.5rem; line-height: 1.2;
  color: var(--text);
}
.stat-value.accent { color: var(--emerald); }
.stat-sub { font-size: .82rem; color: var(--text-dim); }

/* ── 표 ─────────────────────────────────────────────────────────── */

table.ft { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.ft th {
  text-align: left; font-weight: 600; font-size: .78rem;
  letter-spacing: .08em; text-transform: uppercase; color: var(--text-mute);
  padding: .5rem .55rem; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--navy-800);
}
table.ft td {
  padding: .45rem .55rem;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
table.ft tbody tr:hover { background: rgba(61,220,163,.05); }
table.ft tr.me { background: rgba(61,220,163,.10); }
table.ft tr.me td { border-bottom-color: rgba(61,220,163,.22); }
table.ft .num { text-align: right; font-family: var(--font-mono); font-size: .88rem; }
table.ft th.num { font-family: var(--font-body); font-size: .78rem; }
table.ft th.center { text-align: center; }
table.ft .clickable { cursor: pointer; }

.zone-champ { box-shadow: inset 4px 0 0 var(--emerald); }
.zone-euro  { box-shadow: inset 4px 0 0 var(--sky); }
.zone-po    { box-shadow: inset 4px 0 0 var(--violet); }
.zone-safe  { box-shadow: inset 4px 0 0 var(--amber); }
.zone-releg { box-shadow: inset 4px 0 0 var(--coral); }

/* 범례 — 그 리그에 실제로 있는 구간만 그린다. */
.legend { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .8rem; color: var(--text-dim); margin-top: .7rem; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }
.legend .zone-champ, .legend .zone-euro, .legend .zone-po, .legend .zone-safe, .legend .zone-releg { box-shadow: none; }
.legend .zone-champ { background: var(--emerald); }
.legend .zone-euro  { background: var(--sky); }
.legend .zone-po    { background: var(--violet); }
.legend .zone-safe  { background: var(--amber); }
.legend .zone-releg { background: var(--coral); }

/* ── 배지와 칩 ──────────────────────────────────────────────────── */

.badge {
  display: inline-block; font-size: .76rem; font-weight: 600;
  padding: .1rem .45rem; border-radius: 5px;
  background: var(--navy-600); color: var(--text-dim);
  border: 1px solid var(--line);
}
.badge.pos { font-family: var(--font-mono); min-width: 34px; text-align: center; }
.badge.gk  { background: rgba(242,163,60,.16);  color: var(--amber);   border-color: rgba(242,163,60,.3); }
.badge.def { background: rgba(79,169,232,.16);  color: var(--sky);     border-color: rgba(79,169,232,.3); }
.badge.mid { background: rgba(61,220,163,.16);  color: var(--emerald); border-color: rgba(61,220,163,.3); }
.badge.att { background: rgba(228,87,61,.16);   color: var(--coral);   border-color: rgba(228,87,61,.3); }
.badge.warn{ background: rgba(242,163,60,.16);  color: var(--amber);   border-color: rgba(242,163,60,.3); }
.badge.bad { background: rgba(228,87,61,.18);   color: var(--coral);   border-color: rgba(228,87,61,.35); }
.badge.good{ background: rgba(61,220,163,.16);  color: var(--emerald); border-color: rgba(61,220,163,.3); }

.form-dot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 6px; margin-right: 3px;
  font-size: .74rem; font-weight: 700; color: #06131f;
}
.form-W { background: var(--emerald); }
.form-D { background: var(--text-mute); color: #fff; }
.form-L { background: var(--coral); color: #fff; }

/* ── 버튼 ───────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  font-family: var(--font-body); font-size: .92rem; font-weight: 600;
  padding: .5rem .95rem; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line);
  background: var(--navy-600); color: var(--text);
  transition: transform .1s, background .14s, border-color .14s, box-shadow .14s;
}
.btn:hover { background: var(--navy-500); border-color: var(--navy-500); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--emerald), var(--emerald-d));
  border-color: transparent; color: #06241A;
}
.btn-primary:hover {
  background: linear-gradient(135deg, #51E6B0, var(--emerald));
  box-shadow: 0 6px 18px rgba(61,220,163,.26);
}
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: rgba(255,255,255,.05); }
.btn-sm { font-size: .84rem; padding: .34rem .66rem; }
.btn-lg { font-size: .98rem; padding: .7rem 1.4rem; }

.btn-row { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ── 입력 ───────────────────────────────────────────────────────── */

input[type=text], input[type=number], select {
  background: var(--navy-700); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  padding: .5rem .62rem; font-family: var(--font-body); font-size: .94rem;
}
input:focus, select:focus { outline: none; border-color: var(--emerald); }

input[type=range] { accent-color: var(--emerald); width: 100%; }

label.field { display: block; margin-bottom: .8rem; }
label.field > span {
  display: block; font-size: .78rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-mute); margin-bottom: .25rem;
}

/* ── 막대 ───────────────────────────────────────────────────────── */

.bar { height: 6px; border-radius: 3px; background: var(--navy-600); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 3px; background: var(--emerald); }
.bar.warn > i { background: var(--amber); }
.bar.bad  > i { background: var(--coral); }

.attr-row { display: flex; align-items: center; gap: .5rem; font-size: .88rem; }
.attr-row .name { flex: 1; color: var(--text-dim); }
.attr-row .val { font-family: var(--font-mono); width: 1.6rem; text-align: right; }
.attr-row .bar { width: 72px; flex: 0 0 72px; }

/* ── 경기장 ─────────────────────────────────────────────────────── */

.pitch {
  position: relative;
  aspect-ratio: 68 / 105;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  border-radius: 12px;
  overflow: hidden;
  background:
    repeating-linear-gradient(0deg, #15402E 0 8.5%, #123A29 8.5% 17%);
  border: 1px solid var(--line);
}
.pitch .lines { position: absolute; inset: 0; }
.pitch .lines * { stroke: rgba(255,255,255,.22); fill: none; stroke-width: .6; }

.pitch-player {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 15%;
  text-align: center;
  cursor: pointer;
  transition: transform .18s cubic-bezier(.34,1.3,.64,1);
  /* button 기본 스타일을 지운다 */
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  display: block;
}
.pitch-player:focus-visible { outline: 2px solid var(--emerald); outline-offset: 3px; border-radius: 8px; }
.pitch-player:hover { transform: translate(-50%, -50%) scale(1.1); }
.pitch-player.selected .shirt { outline: 2px solid var(--emerald); outline-offset: 2px; }

.shirt {
  box-sizing: border-box;
  width: 36px; height: 36px; margin: 0 auto;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: .8rem;
  border: 1px solid rgba(255,255,255,.3);
  box-shadow: 0 3px 8px rgba(0,0,0,.4);
}
.pitch-name {
  font-size: .7rem; margin-top: .2rem; color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,.9);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: block; font-weight: 600;
}
/* 능력치는 셔츠 오른쪽 위의 작은 배지로 — 이름과 붙지 않게. */
.pitch-role {
  position: absolute; top: -6px; left: calc(50% + 10px);
  font-family: var(--font-mono); font-size: .62rem; font-weight: 700;
  padding: 0 .3rem; border-radius: 999px; line-height: 1.35;
  background: var(--navy-900); color: var(--text); border: 1px solid rgba(255,255,255,.25);
}

/* ── 스코어보드 ─────────────────────────────────────────────────── */

.scorebug {
  display: flex; align-items: stretch;
  background: var(--navy-900); border: 1px solid var(--line);
  border-radius: var(--radius-lg); overflow: hidden;
}
.scorebug .side {
  flex: 1; padding: .9rem 1rem; display: flex; align-items: center; gap: .7rem;
}
.scorebug .side.away { flex-direction: row-reverse; text-align: right; }
.scorebug .score {
  display: flex; align-items: center; gap: .6rem;
  padding: .9rem 1.2rem; background: var(--navy-800);
  border-left: 1px solid var(--line); border-right: 1px solid var(--line);
  font-family: var(--font-display); font-size: 1.8rem;
}
.scorebug .club { font-weight: 600; }
.scorebug .meta { font-size: .72rem; color: var(--text-mute); }

/* 점수 아래 득점자 · 점유율 막대 */
.scoreboard .scorers {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: .8rem; align-items: start;
  padding: .55rem 1rem .2rem; font-size: .84rem; color: var(--text-dim);
}
.scoreboard .scorers .right { text-align: right; }
.poss { display: flex; align-items: center; gap: .6rem; padding: .6rem .2rem 0; font-size: .82rem; }
.poss-bar { flex: 1; display: flex; gap: 3px; height: 8px; }
.poss-bar i { display: block; height: 100%; border-radius: 999px; min-width: 6px; }

/* 더 나은 쪽 숫자 */
.stat-win {
  display: inline-block; padding: 0 .45rem; border-radius: 999px;
  background: rgba(61,220,163,.18); color: var(--emerald); font-weight: 700;
}

/* ── 타임라인 ───────────────────────────────────────────────────── */

.timeline { display: flex; flex-direction: column; gap: .3rem; }
.tl-row {
  display: grid; grid-template-columns: 42px 1fr; gap: .6rem;
  font-size: .84rem; padding: .3rem .4rem; border-radius: 6px;
}
.tl-row:hover { background: rgba(255,255,255,.03); }
.tl-row.away { background: rgba(79,169,232,.05); }
.tl-min { font-family: var(--font-mono); color: var(--text-mute); font-size: .78rem; }
.tl-goal { color: var(--emerald); font-weight: 600; }
.tl-card { color: var(--amber); }
.tl-red  { color: var(--coral); }

/* ── 소식 ───────────────────────────────────────────────────────── */

.inbox-item {
  border-left: 3px solid var(--line);
  padding: .6rem .8rem; margin-bottom: .5rem;
  background: var(--navy-700); border-radius: 0 8px 8px 0;
}
.inbox-item.kind-Board { border-left-color: var(--amber); }
.inbox-item.kind-Match { border-left-color: var(--emerald); }
.inbox-item.kind-Injury { border-left-color: var(--coral); }
.inbox-item.kind-Transfer { border-left-color: var(--violet); }
.inbox-title { font-weight: 600; font-size: .96rem; }
.inbox-body { font-size: .88rem; color: var(--text-dim); }
.inbox-date { font-size: .7rem; color: var(--text-mute); font-family: var(--font-mono); }

/* ── 상태 ───────────────────────────────────────────────────────── */

.muted { color: var(--text-dim); }
.dim { color: var(--text-mute); }
.tiny { font-size: .82rem; }
.mono { font-family: var(--font-mono); }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mb0 { margin-bottom: 0; }
.mt1 { margin-top: .8rem; }

/* ── 국기 ─────────────────────────────────────────────────────── */

/* 폭을 em 으로 둔다 — 글씨 크기 설정을 따라 같이 커진다. */
.flag {
  width: 1.3em; height: auto; vertical-align: -0.18em;
  border-radius: 2px; box-shadow: 0 0 0 1px rgba(255,255,255,.12);
}
.flag.big { width: 1.8em; vertical-align: -0.3em; }

/* ── 나라 고르기 ───────────────────────────────────────────────── */

.pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
  gap: .4rem;
  margin-bottom: .4rem;
}
.pick {
  display: flex; flex-direction: column; align-items: flex-start; gap: .1rem;
  padding: .45rem .6rem; cursor: pointer; text-align: left;
  background: var(--navy-700); color: var(--text-dim);
  border: 1px solid var(--line); border-radius: 8px;
  font-family: var(--font-body); font-size: .9rem;
}
.pick:hover { border-color: var(--emerald); color: var(--text); }
.pick.on {
  background: rgba(61,220,163,.14); border-color: var(--emerald); color: var(--text);
  font-weight: 600;
}
.pick.on .dim { color: var(--emerald); }

/* ── 계약 협상 탁자 ─────────────────────────────────────────────── */

.negotiate { border-color: var(--emerald); }

/* 상대가 하는 말. 숫자 표 위에 사람 목소리를 한 줄 둔다. */
.say {
  margin: 0 0 .9rem;
  padding: .6rem .8rem;
  background: rgba(61,220,163,.07);
  border-left: 3px solid var(--emerald);
  border-radius: 0 8px 8px 0;
  font-size: .95rem;
}

/* 상대가 신경 쓰지 않는 항목은 눈에서 비켜 둔다 — 지워 버리면 왜 비었는지 모른다. */
table.ft tr.dim-row td { opacity: .45; }

.talk-log {
  margin-top: .7rem;
  padding-top: .6rem;
  border-top: 1px dashed var(--line);
}
.talk-line {
  font-size: .84rem; color: var(--text-mute);
  padding: .15rem 0;
}
.talk-line:first-child { color: var(--text-dim); }

.check {
  display: flex; align-items: center; gap: .45rem;
  margin: .2rem 0 .5rem; cursor: pointer; font-size: .9rem;
}
.check input { width: 1rem; height: 1rem; }

.empty {
  padding: 2.4rem 1rem; text-align: center; color: var(--text-mute);
  border: 1px dashed var(--line); border-radius: var(--radius-lg);
}

.splash {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 2rem 1rem;
  background:
    radial-gradient(900px 500px at 50% -10%, rgba(61,220,163,.12), transparent 70%),
    var(--navy-900);
}
.splash-card { width: 100%; max-width: 560px; }

/* 나라 고르기와 구단 고르기는 표가 넓다. 560px 에 밀어 넣으면 머리글이 세로로 꺾인다. */
.splash-card.wide { max-width: 1000px; }

/* 시작 화면 — 저장된 판 */
.save-card {
  display: flex; align-items: center; gap: 1rem; justify-content: space-between;
  margin-top: 1rem; padding: .9rem 1rem; border-radius: var(--radius);
  background: rgba(61,220,163,.07); border: 1px solid rgba(61,220,163,.35);
}
.save-card-name { font-weight: 600; font-size: .95rem; }
.divider-label {
  display: flex; align-items: center; gap: .7rem; margin: 1.2rem 0 .4rem;
  font-size: .78rem; color: var(--text-mute);
}
.divider-label::before, .divider-label::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.notice-bad {
  margin: .7rem 0 0; padding: .6rem .8rem; border-radius: 8px; font-size: .86rem;
  background: rgba(228,87,61,.10); border: 1px solid rgba(228,87,61,.35); color: #F3B4A7;
}

/* 화면 아래에 붙는 막대 — 긴 목록 끝까지 내려가지 않아도 단추가 보이게 */
.sticky-bar {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; align-items: center; gap: 1rem;
  margin: 1rem -1.2rem -1.1rem; padding: .8rem 1.2rem;
  background: rgba(15,26,46,.96); backdrop-filter: blur(6px);
  border-top: 1px solid var(--line); border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.sticky-bar .stat { flex: 1; margin: 0; }

/* 단추 글자는 꺾지 않는다 — 저장 카드의 '이어하기'가 '이어하/기' 로 갈라졌다. */
.btn { white-space: nowrap; }

@media (max-width: 640px) {
  .save-card { flex-direction: column; align-items: stretch; }
  .sticky-bar { flex-direction: column; align-items: stretch; gap: .6rem; }
  .scoreboard .scorers { font-size: .78rem; }
}
.splash h1 {
  font-size: 2.3rem; letter-spacing: .04em; text-transform: uppercase; margin-bottom: .2rem;
}
.splash h1 b { color: var(--emerald); }

/* ── 로딩 ───────────────────────────────────────────────────────── */

.loading-progress {
  position: absolute; display: block; width: 8rem; height: 8rem;
  top: calc(50vh - 4rem); left: calc(50vw - 4rem);
}
.loading-progress circle {
  fill: none; stroke: #18243A; stroke-width: .6rem;
  transform-origin: 50% 50%; transform: rotate(-90deg);
}
.loading-progress circle:last-child {
  stroke: var(--emerald);
  stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * .8) 500%;
  transition: stroke-dasharray .05s ease-in-out;
}
.loading-progress-text {
  position: absolute; text-align: center; font-family: var(--font-display);
  font-size: 1.1rem; color: var(--text-dim);
  top: calc(50vh - .7rem); width: 100%;
}
.loading-progress-text:after {
  content: var(--blazor-load-percentage-text, "불러오는 중");
}

#blazor-error-ui {
  background: var(--coral); color: #fff;
  bottom: 0; display: none; left: 0; position: fixed; width: 100%;
  padding: .7rem 1.2rem; z-index: 1000; font-size: .88rem;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 1rem; top: .7rem; }
#blazor-error-ui a { color: #fff; text-decoration: underline; }

/* ── 경기 시계 ──────────────────────────────────────────────────── */

.clock { margin-top: .9rem; }
.clock-bar {
  height: 8px; border-radius: 4px; background: var(--navy-700);
  overflow: hidden; margin-bottom: .3rem;
  border: 1px solid var(--line);
}
.clock-bar > i {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--emerald-d), var(--emerald));
  transition: width .35s ease;
}

.tl-sub { color: var(--sky); }

/* ── 기자회견 ───────────────────────────────────────────────── */
.press-options {
  display: flex;
  flex-direction: column;
  gap: .55rem;
}

.press-option {
  width: 100%;
  text-align: left;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .7rem .85rem;
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}

.press-option:hover {
  border-color: var(--emerald);
  background: var(--panel-3, var(--panel-2));
}

.press-text { line-height: 1.45; }

.press-meta {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin-top: .45rem;
  flex-wrap: wrap;
}

/* ── 전술 지시의 거래 ────────────────────────────────────────── */
.trade {
  display: block;
  font-size: .76rem;
  line-height: 1.4;
  color: var(--dim, #8b96a5);
  margin-top: .2rem;
}

.field .trade { margin-left: 0; }

/* ── 역할 선택 ───────────────────────────────────────────────── */
.role-pick {
  padding: .6rem .75rem;
  margin-bottom: .6rem;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.role-pick .field { margin-bottom: .45rem; }
.role-pick .btn-row { align-items: center; flex-wrap: wrap; gap: .35rem; }

/* ── 선수 개인 지시 ──────────────────────────────────────────── */
.pi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: .5rem;
  margin-top: .6rem;
  padding-top: .6rem;
  border-top: 1px solid var(--line);
}

.pi-grid .field { margin-bottom: 0; }

/* 이룬 목표의 진행 막대 */
.bar.good i { background: linear-gradient(90deg, var(--emerald-d), var(--emerald)); }

/* 스플릿 경계 — 위 조와 아래 조 사이. 승점만 보면 뒤집혀 보이므로 선을 그어 준다. */
tr.split-line td {
    border-top: 2px solid var(--amber);
    background: color-mix(in srgb, var(--amber) 10%, transparent);
    padding: .3rem .5rem;
    text-align: center;
    letter-spacing: .02em;
}

/* ── 선수 행동 (막대 · ⋯ 메뉴) ──────────────────────────────────── */

.act-bar { margin: .25rem 0 1rem; }
.act-menu { position: relative; display: inline-block; }
.act-trigger { padding: .2rem .55rem; line-height: 1; font-size: 1rem; }
.act-backdrop { position: fixed; inset: 0; z-index: 40; }
.act-list {
  position: fixed; z-index: 41;
  display: flex; flex-direction: column; min-width: 12rem;
  background: var(--navy-700); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: var(--shadow); padding: .25rem; text-align: left;
}
.act-item {
  display: flex; justify-content: space-between; align-items: baseline; gap: .75rem;
  background: transparent; border: 0; border-radius: 6px; color: var(--text);
  font: inherit; font-size: .88rem; padding: .45rem .6rem; cursor: pointer; white-space: nowrap;
}
.act-item:hover { background: var(--navy-600); }
.act-item:disabled { opacity: .45; cursor: not-allowed; }
.focus-anchor:focus { outline: none; }

/* ── 구단 링크 ─────────────────────────────────────────────────── */

a.club-link { color: inherit; text-decoration: none; border-bottom: 1px dotted transparent; }
a.club-link:hover { color: var(--emerald); border-bottom-color: currentColor; }
.kit-dot {
  display: inline-block; width: 12px; height: 12px; border-radius: 3px;
  vertical-align: -1px; margin-right: .4rem;
}
.kit-dot.lg { width: 20px; height: 20px; border-radius: 5px; vertical-align: 0; }

/* ── 능력치 3열 ─────────────────────────────────────────────────── */

.attr-grid {
  display: grid; gap: .25rem 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}
.attr-grid h4 {
  margin: 0 0 .3rem; font-size: .78rem; letter-spacing: .06em; color: var(--text-mute);
}
.attr-cell {
  display: flex; justify-content: space-between; align-items: center;
  font-size: .88rem; padding: .14rem .45rem; border-radius: 4px;
  border-left: 2px solid transparent;
}
.attr-cell .name { color: var(--text-dim); }
.attr-cell .val { font-family: var(--font-mono); font-weight: 600; min-width: 1.6rem; text-align: right; }
.attr-cell.key { background: rgba(61,220,163,.10); border-left-color: var(--emerald); }
.attr-cell.key .name { color: var(--text); }
.attr-key-swatch {
  display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: -1px;
  background: rgba(61,220,163,.25); border-left: 2px solid var(--emerald);
}
.val.g1 { color: var(--coral); }
.val.g2 { color: var(--amber); }
.val.g3 { color: var(--text); }
.val.g4 { color: var(--emerald); }

/* ── 스쿼드 보기 · 정렬 · 포지션 칩 ──────────────────────────────── */

.chip-row { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin: 0 0 .6rem; }
.chip {
  font: inherit; font-size: .82rem; padding: .22rem .65rem; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--text-dim); border: 1px solid var(--line);
}
.chip:hover { border-color: var(--navy-500); color: var(--text); }
.chip.on { background: rgba(61,220,163,.14); border-color: var(--emerald); color: var(--text); }
table.ft th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
table.ft th.sortable:hover { color: var(--text); }
table.ft th.sorted { color: var(--emerald); }
.sort-arrow { font-size: .65em; margin-left: .25rem; }

/* ── 받은 소식: 누르면 그 대상으로 ──────────────────────────────── */

.inbox-item.linked { cursor: pointer; transition: background .12s; }
.inbox-item.linked:hover, .inbox-item.linked:focus-visible { background: var(--navy-600); outline: none; }
.inbox-item.unread .inbox-title { color: var(--text); }
.inbox-item:not(.unread) .inbox-title { color: var(--text-dim); font-weight: 500; }
.unread-dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--emerald); margin-left: .35rem; vertical-align: 1px;
}
.inbox-go { font-size: .78rem; color: var(--emerald); margin-top: .15rem; }
.inbox-item.linked:not(:hover) .inbox-go { opacity: .7; }

/* ── 스크롤바 ───────────────────────────────────────────────────────
   어두운 화면에 브라우저 기본(흰) 스크롤바가 튀었다. 사이드바·표·구단 고르기 모두. */
* { scrollbar-width: thin; scrollbar-color: var(--navy-500) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--navy-500); border-radius: 999px; border: 2px solid var(--navy-900); }
*::-webkit-scrollbar-thumb:hover { background: var(--text-mute); }

/* ── 받은 소식: 목록 · 본문 ──────────────────────────────────────────
   왼쪽 목록은 화면 높이에 맞춰 혼자 스크롤하고, 오른쪽 본문은 그 옆에 붙어 있는다. */
.mail { display: grid; grid-template-columns: minmax(300px, 400px) 1fr; gap: 1rem; align-items: start; }
.mail .card { margin-bottom: 0; }
.mail-list {
  padding: .35rem; max-height: calc(100vh - 13rem); overflow-y: auto;
  display: flex; flex-direction: column; gap: 2px;
}
.mail-list:focus-visible { outline: 2px solid var(--emerald); outline-offset: 2px; }
.mail-row {
  display: block; width: 100%; text-align: left; cursor: pointer;
  background: transparent; border: 0; color: inherit; font: inherit;
  padding: .55rem .7rem .55rem .8rem; border-radius: 8px;
  border-left: 3px solid var(--line);
}
.mail-row:hover { background: rgba(255,255,255,.04); }
.mail-row.on { background: rgba(61,220,163,.10); }
.mail-row-top { display: flex; align-items: center; gap: .4rem; }
.mail-row-title {
  flex: 1; min-width: 0; font-size: .92rem; font-weight: 500; color: var(--text-dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mail-row.unread .mail-row-title { font-weight: 700; color: var(--text); }
.mail-row-meta { font-size: .72rem; color: var(--text-mute); font-family: var(--font-mono); }
.mail-row-preview {
  font-size: .8rem; color: var(--text-mute); margin-top: .1rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mail-row.kind-Board, .mail-kind.kind-Board { border-left-color: var(--amber); }
.mail-row.kind-Match, .mail-kind.kind-Match { border-left-color: var(--emerald); }
.mail-row.kind-Injury, .mail-kind.kind-Injury { border-left-color: var(--coral); }
.mail-row.kind-Transfer, .mail-kind.kind-Transfer { border-left-color: var(--violet); }
.mail-row.kind-Staff, .mail-kind.kind-Staff { border-left-color: var(--sky); }
.mail-kind { border-left-width: 3px; }

.mail-detail { position: sticky; top: 4.2rem; min-height: 14rem; }
.mail-detail-meta { display: flex; align-items: center; gap: .6rem; margin-bottom: .5rem; }
.mail-detail-title { font-size: 1.35rem; margin: 0 0 .7rem; }
.mail-detail-body { white-space: pre-line; color: var(--text-dim); line-height: 1.75; }
.mail-back { display: none; margin-bottom: .6rem; }

/* 폰 너비 — 한 번에 한쪽만 */
@media (max-width: 860px) {
  .mail { grid-template-columns: 1fr; }
  .mail-list { max-height: none; }
  .mail .mail-detail { display: none; position: static; }
  .mail.show-detail .mail-list { display: none; }
  .mail.show-detail .mail-detail { display: block; }
  .mail-back { display: inline-flex; }
}

