/* 모든 페이지 공통 스타일 (색, 버튼, 메뉴) */

/* 글꼴: 우리 서버(web/fonts)에 둔 파일 (모두 무료 · 상업적 이용 가능, SIL OFL)
   어디에 무슨 글꼴인지는 아래 :root의 --font · --font-ui · --font-title과 "글꼴 역할 (사이트 전체)" */
@import url("../fonts/fonts.css");

/* ─────────────────────────────────────────────
   ⚠️ 뼈대용 임시 스타일
   2단계(CSS 디자인)에서 새로 예쁘게 만들 거예요.
   지금은 21칸이 3줄 × 7칸으로 보이게만 해 둔 거예요.
   ───────────────────────────────────────────── */
/* hidden 속성이 붙은 요소는 어떤 CSS가 있어도 무조건 숨기기 */
[hidden] {
  display: none !important;
}
#team-grid {
  flex: 1;                                   /* 남은 화면을 전부 차지 */
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: repeat(3, 1fr);        /* 3줄 × 7칸 = 21칸 */
  gap: 16px;
  min-height: 0;
}

.team-box {
  font-size: clamp(16px, 1.8vw, 28px);
  font-weight: 600;
  cursor: pointer;
}

.team-box:disabled {
  cursor: not-allowed;
}

/* 칸을 누르면: 칸들이 자리를 직접 정하는 배치(.overlay)로 바뀌고, 누른 칸만 커져서 다른 칸 위에 올라와요 */
#team-grid {
  position: relative;
}
#team-grid.overlay .team-box {
  position: absolute;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
#team-grid.overlay .team-box.selected {
  z-index: 5;
  padding: 0 clamp(16px, 1.8vw, 32px);       /* 커진 칸 안쪽 여백 */
}
#team-grid.overlay .team-box.shrinking {
  z-index: 4;                                /* 줄어드는 동안에도 다른 칸 위에 */
}
.team-box {
  min-width: 0;
  min-height: 0;
}
.team-box .team-name {
  word-break: keep-all;     /* 이름이 단어 중간에서 끊기지 않게 */
}
.team-box .team-info {
  display: none;
}
.team-box.selected {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 clamp(16px, 1.8vw, 32px);
  text-align: left;
}
.team-box.selected .team-name {
  flex: 0 0 44%;
  min-width: 0;
  font-size: clamp(18px, 2vw, 34px);
  line-height: 1.25;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.team-box.selected .team-info {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  gap: 12px;
  font-size: clamp(12px, 1.1vw, 18px);
  font-weight: 400;
  line-height: 1.5;
  word-break: keep-all;
}
.team-hint {
  font-size: 0.8em;
}
/* 시작페이지 내용을 화면 가운데로 */
.start-page {
  display: flex;
  flex-direction: column;
  height: 100vh;      /* 화면 전체 높이 */
  box-sizing: border-box;
  padding: 32px;      /* 가장자리 여백 */
  text-align: center; /* 안내 문구·버튼 글자 가운데 정렬 */
}
body:has(.start-page) {
  margin: 0;          /* 기본 바깥 여백을 없애서 화면에 딱 맞게 */
  overflow: hidden;
}
/* ═════════════════════════════════════════════
   디자인 기본값 (색 · 글꼴 · 그림자) — 모든 디자인 테마가 같이 써요
   - 바탕은 흰색, 포인트는 사용자의 팀 색.
   - 팀 색은 JavaScript(applyTeamColor)가 --team · --team-rgb · --team-ink로 넣어줘요.
   - 아직 팀을 안 고른 페이지는 PL 보라색이 기본이에요.
   - 다크 모드는 html[data-theme="dark"]에서 같은 이름의 변수만 바꿔요.

   겉모습 (디자인 테마는 깔끔 하나 — 젤리 · 유리는 2026-11-22에 지웠어요)
   - 이 파일(common.css)에는 "뼈대"(배치 · 크기)가 있어요.
   - 겉모습(버튼 · 칸의 색 · 모양 · 움직임)은 css/skins/clean/에 있어요:
       css/skins/clean/common.css  ← 모든 페이지 공통 (버튼 .btn 등)
       css/skins/clean/<페이지>.css ← 그 페이지만
   - js/skin.js가 이 파일들을 불러와요
   ═════════════════════════════════════════════ */
:root {
  --pl: #3D195B;
  --team: var(--pl);
  --team-rgb: 61, 25, 91;
  --team-ink: #ffffff;

  --bg: #ffffff;             /* 메뉴 · 팝업 바탕: 흰색 */
  --page-bg: #fafafb;        /* 팀 페이지의 메뉴 아래 바탕: 아주 옅은 회색 (흰 칸이 살짝 떠 보이게) */
  --surface: #ffffff;        /* 칸 · 카드 바탕 */
  --surface-2: #f5f5f6;      /* 작은 바탕 · 조용한 칸 */
  --surface-3: #ececee;      /* 조용한 칸에 마우스를 올렸을 때 */
  --hover-bg: #f5f5f6;       /* 버튼에 마우스를 올렸을 때 바탕 (사이트 전체 통일: 연회색) */
  --text: #111214;
  --text-2: #3c3f45;
  --muted: #6f727a;          /* 흐린 글씨 (흰 바탕에서도 읽히는 정도) */
  --line: rgba(17, 18, 20, 0.08);
  --line-strong: rgba(17, 18, 20, 0.16);
  --shadow-soft: 0 1px 1px rgba(17, 18, 20, 0.03), 0 12px 32px -20px rgba(17, 18, 20, 0.22);
  --shadow-lift: 0 1px 1px rgba(17, 18, 20, 0.03), 0 24px 48px -24px rgba(17, 18, 20, 0.32);

  /* 글꼴 역할 4가지 (영어 화면은 아래 html[lang="en"]에서 바꿔요)
     --font: 내용 글 · --font-ui: 메뉴 · 버튼 · --font-title: 페이지 큰 제목 · 팀 이름 · --font-article: 기사 제목 */
  --font: "Pretendard Variable", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --font-ui: "SUIT Variable", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --font-title: var(--font);
  --font-article: "IBM Plex Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --radius-box: 24px;        /* 시작 · 팀 선택 페이지의 큰 칸 모서리 (팀 페이지는 아래 --radius-panel) */
  --radius-btn: 12px;        /* .btn 버튼 모서리 (시작 · 로그인 페이지) */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);        /* 부드럽게 멈추는 움직임 */
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);   /* 살짝 튕기는 움직임 */

  /* ── 팀 페이지(위쪽 메뉴가 있는 페이지)의 틀: 모든 페이지가 이 숫자 한 벌만 써요 ──
     내용의 양 끝 = 메뉴의 '파코어' 왼쪽 · '설정' 오른쪽 = 홈 4칸의 양 끝
     좁은 화면에서 바뀌는 값은 맨 아래 "작은 화면" 부분에 */
  --page-max: 1240px;        /* 내용 폭 (홈 4칸 폭) */
  --page-gutter: 32px;       /* 화면 양옆 여백 */
  --page-top: 24px;          /* 메뉴 아래 ~ 첫 칸 */
  --page-bottom: 48px;       /* 맨 아래 여백 (한 화면에 딱 맞추는 페이지는 그 페이지에서 따로) */
  --panel-gap: 20px;         /* 회색 판끼리 (홈 4칸 사이와 같아요) */
  --panel-pad: 20px;         /* 회색 판 안쪽 여백 (판 끝 ~ 흰 칸) */
  --card-gap: 12px;          /* 판 안의 흰 칸끼리 */
  --radius-panel: 16px;      /* 회색 판 · 홈 칸 · 팝업 */
  --radius-card: 12px;       /* 회색 판 안의 흰 칸 */
  --radius-ctl: 8px;         /* 버튼 · 입력칸 (알약 모양은 걸러 보기 · 켜기/끄기처럼 고르는 칩에만) */
}

html[data-theme="dark"] {
  --bg: #0e0f11;
  --page-bg: #16181c;        /* 아래쪽 "다크 테마" 묶음의 body 색과 같아요 */
  --surface: #17181b;
  --surface-2: #17181b;
  --surface-3: #1f2024;
  --hover-bg: #2a2c31;       /* 다크 모드에선 연회색이 칸 바탕과 같아서, 한 단계 밝은 회색 */
  --text: #f1f1f2;
  --text-2: #c9cbd0;
  --muted: #8b8f97;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.16);
  --shadow-soft: 0 1px 1px rgba(0, 0, 0, 0.4), 0 12px 32px -20px rgba(0, 0, 0, 0.8);
  --shadow-lift: 0 1px 1px rgba(0, 0, 0, 0.4), 0 24px 48px -24px rgba(0, 0, 0, 0.9);
}

/* 영어 화면: 영어 글꼴 뒤에 한국어 글꼴을 이어 둬요 (영어 화면에 한글이 섞여 나와도 같은 역할의 한국어 글꼴로) */
html[lang="en"] {
  --font: "Open Sans", "Pretendard Variable", "Malgun Gothic", system-ui, sans-serif;
  --font-ui: "Inter", "SUIT Variable", "Malgun Gothic", system-ui, sans-serif;
  --font-title: "Inter", "Pretendard Variable", "Malgun Gothic", system-ui, sans-serif;
  --font-article: "Newsreader", "IBM Plex Sans KR", "Malgun Gothic", Georgia, serif;
}

body {
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── 글꼴 역할 (사이트 전체) ──
   메뉴 · 버튼: 버튼마다 "font: inherit"이 많아서 !important로 확실하게 (버튼 안의 제목 · 팀 이름은 아래 목록이 이겨요)
   입력칸 · 고르는 칸(select)은 내용 글꼴 그대로 */
.top-menu,
button,
.btn,
input[type="button"],
input[type="submit"] {
  font-family: var(--font-ui) !important;
}

/* 페이지 큰 제목 · 팀 이름 (새로 생기면 여기에 더해요. 칸 안의 작은 제목은 내용 글꼴) */
.games-page > h2,
.note-editor-head h2,
.stats-title h2,
#fixture-title,
#round-title,
.profile-name,
.post-heading,
.user-name,
.auth-title,
.lp-final-title,
.lp-feature h3,
.team-name,
.team-switch-name,
.table-page td.col-team,
.fixture-teams,
.strip-name,
.home-podium-name,
.pick-teams {
  font-family: var(--font-title);
}

/* 기사 제목 (홈 기사 칸 · 뉴스 카드 · 경기 페이지 주요 기사 목록 · 펼쳐 읽기 · 크게 보기 창)
   경기 페이지의 칸 이름 '주요 기사'(.art-title)는 기사 제목이 아니라 내용 글꼴 */
.home-news-title-text,
.slide-title,
#art-dialog-title,
.art-reader-title,
.art-item-title {
  font-family: var(--font-article);
}

/* 팀 로고 자리(색 동그라미 + 약자)는 그림처럼: 어느 칸 안에 있어도 메뉴 · 버튼 글꼴 */
.team-badge {
  font-family: var(--font-ui);
}

/* 스크롤바: 사이트 전체에서 막대만 보이고 뒤 바탕(흰 줄)은 투명하게
   (scrollbar-color는 안쪽 칸들에게 저절로 이어져요 → 스크롤 칸마다 따로 적지 않아도 돼요) */
:root {
  scrollbar-color: var(--line-strong) transparent;
}

/* 버튼 .btn 의 공통 뼈대 (색 · 모양 · 움직임은 테마 파일에서)
   <button class="btn"> 또는 <a class="btn"> */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0.62em 1.3em;
  border: 0;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.btn:disabled,
.btn[aria-disabled="true"] {
  cursor: not-allowed;
}
/* 동그란 버튼 (아이콘 버튼) */
.btn-round {
  width: 2.5em;
  height: 2.5em;
  padding: 0;
}

/* ═════════════════════════════════════════════
   위쪽 메뉴 (모든 팀 페이지 공통)
   ═════════════════════════════════════════════ */
/* 메뉴가 있는 페이지는 바깥 여백을 없애서 모든 페이지에서 메뉴가 화면 끝까지 똑같이 보이게 해요 */
body:has(> #top-menu) {
  margin: 0;
}
/* 스크롤바 자리: 스크롤바는 스크롤이 있는 페이지에만 생겨요.
   스크롤바가 없는 페이지는 js(watchScrollbarSpace)가 <html>에 .no-scrollbar를 붙이고, 그 폭(--scrollbar-w)만큼
   body 오른쪽을 비워요 → '파코어' · 내용 위치는 어느 페이지에서나 같아요.
   비운 자리도 바탕(아래 html)이 칠해서 회색이 끊기지 않고, 위쪽 메뉴는 그 자리까지 이어져요. */
html.no-scrollbar:has(#top-menu) body {
  padding-right: var(--scrollbar-w);
}
html.no-scrollbar .top-menu {
  margin-right: calc(-1 * var(--scrollbar-w));
  padding-right: calc(max(var(--page-gutter), (100% - var(--page-max)) / 2) + var(--scrollbar-w));
}
/* 메뉴 아래 바탕(--page-bg)은 메뉴 색(--bg)과 달라서, 바탕은 화면 전체(스크롤바 뒤까지)에 칠해요:
   위(메뉴 높이)는 메뉴 색 · 아래는 페이지 색.
   (fixed = 화면에 붙어 있어서 스크롤해도 위쪽 띠가 늘 메뉴 자리에 있어요. body는 바탕을 칠하지 않아요)
   다크 모드 홈은 페이지도 --bg라 한 가지 색 */
html:has(#top-menu) {
  background: linear-gradient(var(--bg) 0 68px, var(--page-bg) 68px) fixed;
}
html:has(#top-menu) body {
  background: transparent;
}
html[data-theme="dark"]:has(body.home-body) {
  background: var(--bg);
}
@media (max-width: 640px) {
  html:has(#top-menu) {
    background: linear-gradient(var(--bg) 0 56px, var(--page-bg) 56px) fixed;   /* 휴대폰은 메뉴 높이 56px */
  }
  html[data-theme="dark"]:has(body.home-body) {
    background: var(--bg);
  }
}

/* 페이지 이동 (js: common.js의 setupPageChange · skin.js의 "맨 위 막대 이어받기")
   1. 메뉴 있는 페이지에서 사이트 안 링크를 누르는 순간: 메뉴 아래 내용을 비우고(.page-leaving) 맨 위 막대가 차오르기 시작,
      비운 자리에 갈 페이지 모양의 회색 뼈대(.page-skeleton)가 은은하게 반짝여요
   2. 새 페이지가 준비되면 바로 보이고, 막대는 이어서 페이지를 다 받으면 100% → 사라짐 */
html.page-leaving body > :not(#top-menu, .page-loader, .page-skeleton) {
  visibility: hidden;
}
/* 뼈대: 칸 자리 · 크기 · 색은 js가 (페이지 맨 위 기준 자리라 화면에 고정) */
.page-skeleton {
  position: fixed;
  inset: 0;
  z-index: 50;               /* 위쪽 메뉴(100) 밑 */
  overflow: hidden;
  pointer-events: none;
}
.page-skeleton i {
  position: absolute;
  /* 반짝임: 화면 전체에 걸친 한 줄기 빛이 왼쪽 → 오른쪽으로 지나가요 (모든 칸이 같은 빛을 나눠 가져요) */
  background-image: linear-gradient(100deg, transparent 40%, rgba(255, 255, 255, 0.45) 50%, transparent 60%);
  background-size: 200vw 100%;
  background-attachment: fixed;
  animation: skeleton-shine 1.2s linear infinite;
}
html[data-theme="dark"] .page-skeleton i {
  background-image: linear-gradient(100deg, transparent 40%, rgba(255, 255, 255, 0.06) 50%, transparent 60%);
}
html[data-motion="reduce"] .page-skeleton i {
  animation: none;
  background-image: none;
}
@keyframes skeleton-shine {
  from { background-position: 100vw 0; }
  to { background-position: -100vw 0; }
}
.page-loader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;             /* 위쪽 메뉴 · 팝업보다 위 */
  height: 3px;
  background: var(--team, #3d195b);   /* 팀 색이 없는 페이지는 PL 보라색 */
  transform: scaleX(0);      /* 차오르는 자리는 js가 정해요 */
  transform-origin: left center;
  pointer-events: none;
  transition: opacity 0.2s;
}
.page-loader.is-done {       /* 다 차면 스르르 사라져요 */
  opacity: 0;
}
/* 크롬 · 엣지: 새 페이지가 그려질 때까지 지금 화면(메뉴 + 막대)을 그대로 두고, 준비되면 움직임 없이 바로 바꿔요 (하얀 화면 깜빡임 없이)
   새 페이지 글꼴이 아직이면 그동안 지금 화면을 조금 더 보여 줘요 (js/skin.js) → 글꼴이 바뀌며 깜빡이지 않게 */
@view-transition {
  navigation: auto;
}
::view-transition-group(root),   /* 바깥 틀에도 브라우저 기본 움직임(0.25초)이 있어서 같이 꺼요 → 전환이 바로 끝나요 */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
}

.top-menu {
  position: sticky;          /* 스크롤해도 화면 맨 위에 붙어 있기 */
  top: 0;
  z-index: 100;              /* 내용이 메뉴 위로 올라오지 않게 */
  display: flex;
  align-items: center;
  gap: 28px;
  height: 68px;
  /* 메뉴 줄(바탕)은 화면 끝까지, 안의 '파코어' ~ '설정'는 내용 폭(--page-max)에 딱 맞게:
     화면이 넓으면 남는 폭의 반씩, 좁으면 페이지 옆 여백만큼 안쪽으로 */
  padding: 0 max(var(--page-gutter), (100% - var(--page-max)) / 2);
  box-sizing: border-box;
  /* 모양(색 · 선)은 css/skins/clean/common.css의 ".top-menu": 흰색 + 아래 얇은 선 한 줄 */
  border-bottom: 1px solid transparent;   /* 선 굵기는 테마와 상관없이 1px (색만 바뀌어요) */
}

/* 사이트 로고('파코어'): 버튼 틀 없이 글자 자체가 버튼 · 글자색은 팀 상징색 */
.top-menu .menu-logo {
  display: block;
  margin-left: -2px;         /* 아래 여백(2px)만큼 당겨서 글자 왼쪽 끝이 내용 왼쪽 끝과 딱 맞게 */
  padding: 4px 2px;          /* 누르는 자리를 글자보다 살짝 넓게 */
  color: var(--team);
  border-radius: 6px;
}
.top-menu .menu-logo:focus-visible {
  outline: 2px solid var(--team);
  outline-offset: 3px;
}
/* 파코어 로고 (기울어진 F + 공): 그림은 js/common.js의 SITE_LOGO_SVG(SVG), 글자색(currentColor = 팀 색)으로 칠해요 */
.top-menu .menu-logo-mark {
  display: block;
  height: 30px;
  aspect-ratio: 212.6 / 209.4;   /* 그림 크기 (가로 / 세로) */
}
.top-menu .menu-logo-mark svg {
  display: block;
  width: 100%;
  height: 100%;
}

.menu-divider {
  width: 1px;
  height: 18px;
  background: var(--line-strong);
  color: transparent;        /* 글자 "|" 대신 가는 선으로 */
  overflow: hidden;
  user-select: none;
}

.menu-links {
  display: flex;
  align-items: center;
  align-self: flex-start;
  gap: 4px;
  height: calc(100% + 1px);  /* 메뉴 아래 선(1px)까지 덮어서, 고른 페이지 표시 선이 메뉴 맨 아래 끝에 붙어요 */
  overflow-x: auto;          /* 좁은 화면에서는 옆으로 밀어서 보기 */
  scrollbar-width: none;
}
.menu-links::-webkit-scrollbar {
  display: none;
}

.top-menu .menu-links a {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 14px;
  color: var(--text-2);
  font-size: 0.95rem;
  font-weight: 550;
  letter-spacing: -0.01em;
  text-decoration: none;
  transition: color 0.15s;
}
/* 마우스를 올리면 글자가 진해져요 */
.top-menu .menu-links a:hover {
  color: var(--text);
}

/* 지금 보고 있는 페이지: 진한 글자 + 아래 팀 색 선 */
.top-menu .menu-links a.active {
  color: var(--text);
  font-weight: 700;
}
.top-menu .menu-links a::after {
  content: '';
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--team);
  transform: scaleX(0);
  transition: transform 0.35s var(--ease);
}
.top-menu .menu-links a.active::after {
  transform: scaleX(1);
}

.menu-small {
  margin-left: auto;         /* 남는 공간을 왼쪽에 몰아서 오른쪽 끝으로 */
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
}

/* ─── 메뉴 동그라미 버튼 (소리 · 알림 · 구독 · 공유 · 설정) ───
   버튼마다 색(--circle)이 하나씩: 바탕 = 그 색 (진하게), 아이콘 = 흰색.
   테마 · 라이트/다크와 상관없이 같은 색이에요. */
.menu-circle {
  --circle: #18181b;
  --lift-hover: rgba(255, 255, 255, 0.22);   /* 진한 바탕이라 올리면 살짝 밝게 */
  --lift-press: rgba(255, 255, 255, 0.5);
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--circle);
  cursor: pointer;
  transition: box-shadow 0.2s;
}
/* 아이콘 색 = 흰색 (.top-menu를 붙여서 다크 모드의 링크 글자색 규칙보다 힘이 세게) */
.top-menu .menu-circle {
  color: #fff;
}
.menu-circle svg {
  display: block;
  width: 20px;
  height: 20px;
}
.menu-circle:focus-visible {
  outline: 2px solid var(--team);
  outline-offset: 2px;
}
.menu-subscribe { --circle: #dc2626; }
.menu-share     { --circle: #2563eb; }
.menu-faq       { --circle: #16a34a; }
.menu-bell      { --circle: #eab308; }
.menu-settings  { --circle: #18181b; }
/* 지금 설정 · FAQ 페이지에 있으면 그 버튼 둘레에 얇은 고리 */
.menu-settings[aria-current="page"],
.menu-faq[aria-current="page"] {
  outline: 2px solid var(--circle);
  outline-offset: 2px;
}
/* 알림(종): 새 알림 = 오른쪽 위 빨간 점 / 긴급 = 빨간 동그라미 + 흰 느낌표 + 종이 마구 흔들려요
   점 둘레는 메뉴 바탕색 고리 → 버튼과 붙어 있어도 따로 보여요 */
.menu-bell {
  position: relative;
}
.menu-badge {
  position: absolute;
  top: -1px;
  right: -1px;
  display: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 2px var(--bg);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
}
.menu-bell.has-new .menu-badge {
  display: grid;
  place-items: center;
}
.menu-bell.is-urgent .menu-badge {
  top: -5px;
  right: -5px;
  width: 17px;
  height: 17px;
}
.menu-bell.is-urgent svg {
  transform-origin: 50% 12%;      /* 종 꼭지를 축으로 */
  animation: bell-shake 0.9s ease-in-out infinite;
}
@keyframes bell-shake {
  0%, 100% { rotate: 0deg; }
  8%  { rotate: 26deg; }
  16% { rotate: -24deg; }
  24% { rotate: 22deg; }
  32% { rotate: -20deg; }
  40% { rotate: 16deg; }
  48% { rotate: -12deg; }
  56% { rotate: 8deg; }
  64% { rotate: -4deg; }
  72% { rotate: 0deg; }
}
html[data-motion="reduce"] .menu-bell.is-urgent svg {
  animation: none;
}

/* 알림 창: 메뉴 바로 아래, 오른쪽 끝을 내용 오른쪽 끝(설정 버튼 끝)에 맞춰요
   알림 한 줄 60px × 5줄 높이, 그보다 많으면(최대 8개) 창 안에서 스크롤 */
.notice-panel {
  --notice-row: 60px;
  position: absolute;
  top: calc(100% + 8px);
  right: max(var(--page-gutter), (100% - var(--page-max)) / 2);
  width: min(360px, 100% - var(--page-gutter) * 2);
  padding: 14px 8px 8px;
  box-sizing: border-box;
  border-radius: var(--radius-panel);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 0 0 1px var(--line-strong), 0 24px 50px -18px rgba(17, 18, 20, 0.4);
}
.notice-panel[hidden] {
  display: none;
}
.notice-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 10px 10px;
}
.notice-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.notice-dev {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.75rem;
  text-decoration: underline;
  cursor: pointer;
}
.notice-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: calc(var(--notice-row) * 5 + 2px * 4);
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-y: auto;
  overscroll-behavior: contain;   /* 창 끝까지 스크롤해도 뒤 페이지는 안 움직여요 */
  scrollbar-width: thin;
}
.top-menu .notice-item {   /* .top-menu: 다크 모드의 링크 글자색 규칙보다 힘이 세게 */
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: center;
  column-gap: 10px;
  row-gap: 3px;
  height: var(--notice-row);
  padding: 0 10px;
  box-sizing: border-box;
  border-radius: var(--radius-ctl);
  color: var(--text);
  text-decoration: none;
}
.notice-item.unread {
  background: rgba(var(--team-rgb), 0.08);
}
html[data-theme="dark"] .notice-item.unread {
  background: rgba(255, 255, 255, 0.06);
}
.notice-title {
  overflow: hidden;
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.notice-urgent {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  vertical-align: 1px;
}
.notice-time {
  color: var(--muted);
  font-size: 0.75rem;
  white-space: nowrap;
}
.notice-text {
  grid-column: 1 / -1;
  overflow: hidden;
  color: var(--text-2);
  font-size: 0.8rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.notice-empty {
  padding: 28px 10px;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

/* 공유 팝업 (화면 가운데): 제목(공유 그림 + 공유) → 설명 → 주소 + 링크 복사 → 공유할 곳 (각 회사 로고, js: common.js의 SHARE_LOGOS) */
.match-dialog.share-dialog {
  width: min(420px, 90vw);
}
.share-dialog .dialog-header h2 {   /* 제목: 그림 + 굵은 큰 글자 (2026-11-24 크게) */
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-title);
  font-size: 1.6rem;
  font-weight: 900;
  line-height: 1.1;
}
.share-title-mark {
  display: grid;
  flex: none;
  width: 1.6rem;
  height: 1.6rem;
}
.share-title-mark svg {
  width: 100%;
  height: 100%;
}
.share-desc {
  margin: 6px 0 16px;
  color: var(--text-2);
  font-size: 0.9rem;
}
.share-link {
  display: flex;
  gap: 8px;
}
.share-link input {
  flex: 1;
  min-width: 0;
  padding: 0 12px;
  height: 40px;
  box-sizing: border-box;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-ctl);
  background: var(--surface-2);
  color: var(--text-2);
  font: inherit;
  font-size: 0.85rem;
}
.share-dialog .share-copy {   /* .share-dialog: 다크 모드의 버튼 글자색 규칙보다 힘이 세게 */
  flex: none;
  height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius-ctl);
  background: var(--text);
  color: var(--surface);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}
.share-targets {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 20px;
}
.share-dialog .share-target {   /* 좁은 휴대폰에서는 한 줄에 맞게 조금씩 좁아져요 */
  flex: 1 1 0;
  display: grid;
  justify-items: center;
  gap: 12px;                      /* 로고 둘레 빈 공간 = 로고 폭의 1/4 이상 (메타 로고 규칙) */
  min-width: 0;
  max-width: 76px;
  padding: 8px 0;
  border: 0;
  border-radius: var(--radius-card);
  background: none;
  color: var(--text-2);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.share-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  overflow: hidden;
  border-radius: 50%;
  background: #000;               /* X · 스레드: 공식 색은 검정 · 흰색뿐 */
  color: #fff;
}
.share-mark svg {
  width: 24px;
  height: 24px;
}
.share-logo {                     /* 로고 모양으로 오려 낸 칸 (파일 주소는 js가 mask-image로) */
  width: 24px;
  height: 24px;
  background: currentColor;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}
.share-x .share-logo {
  width: 21px;
}
.share-logo-full {                /* 페이스북: 파일 자체가 동그라미 로고 */
  display: block;
  width: 100%;
  height: 100%;
}
.share-native .share-mark   { background: #2563eb; }
.share-facebook .share-mark { background: none; }
html[data-theme="dark"] :is(.share-x, .share-threads) .share-mark {
  background: #fff;
  color: #000;
}

/* ─── 페이지 틀: 위쪽 메뉴가 있는 페이지의 본문(main)은 모두 같은 폭 ───
   양 끝이 메뉴의 '파코어' 왼쪽 · '설정' 오른쪽과 딱 맞아요 (숫자는 맨 위 :root의 --page-…).
   그래서 페이지마다 폭 · 옆 여백 · 위아래 여백을 따로 정하지 않아요.
   한 화면에 딱 맞추는 페이지(홈 · 다음 경기 · 승부예측 · 클럽소개)만 그 페이지에서 --page-bottom을 바꿔요.
   (관리자 페이지는 위쪽 메뉴가 없어서 여기에 해당하지 않아요) */
#top-menu ~ main {
  width: 100%;
  max-width: calc(var(--page-max) + var(--page-gutter) * 2);
  margin-inline: auto;
  padding: var(--page-top) var(--page-gutter) var(--page-bottom);
  box-sizing: border-box;
}

/* ═════════════════════════════════════════════
   팀 배지 (로고 자리 — common.js의 makeTeamBadge)
   버튼이 아니라서 단정한 엠블럼 느낌으로
   ═════════════════════════════════════════════ */
.team-badge {
  --badge: var(--team);
  --badge-ink: var(--team-ink);
  display: grid;
  place-items: center;
  width: 64px;
  aspect-ratio: 1;
  border-radius: 50%;
  color: var(--badge-ink);
  font-weight: 800;
  letter-spacing: 0.04em;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0) 50%),
    var(--badge);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.18),   /* 안쪽 가는 테두리 */
    0 0 0 4px var(--surface),                    /* 바탕과 띄우는 여백 링 */
    0 0 0 5px var(--line),
    0 14px 28px -16px rgba(0, 0, 0, 0.45);
}

.team-badge.has-logo {
  background: var(--surface);
}
.team-badge img {
  width: 72%;
  height: 72%;
  object-fit: contain;
}

/* ═════════════════════════════════════════════
   팀 메인 페이지 (home.html) — 뼈대 (배치 · 크기)
   칸의 색 · 모양 · 움직임은 css/skins/clean/home.css
   ⚠️ 칸 크기 · 간격 · 안쪽 여백 · 글자 크기는 여기서만 정해요 (모든 테마가 같은 틀)
   칸 안 글자색은 테마가 정하는 변수로: --fg(진한) · --fg-2 · --fg-3(흐린) · --fg-line(선)

   - 칸 이름(다음 경기 · 게시판 …)은 평소엔 숨어 있다가, 마우스를 올리면 왼쪽 아래에서 슥 올라와요.
     글자 뒤에는 모서리가 둥근 흐린 유리판을 깔아서, 뒤의 내용과 겹쳐도 잘 읽혀요.
   - 칸 내용은 모두 칸 가운데에.
   ═════════════════════════════════════════════ */
/* 큰 화면: "메뉴 + 나머지"로 나누고, 나머지를 4칸이 꽉 채워요 */
:root body.home-body {      /* :root를 붙여 다크 모드 기본 바탕 규칙보다 우선 */
  margin: 0;
  height: 100vh;
  height: 100dvh;            /* 화면 높이에 딱 맞추고, 스크롤은 만들지 않아요 */
  overflow: hidden;
  display: flex;
  flex-direction: column;    /* 위: 메뉴 / 아래: 2×2 */
  background: transparent;   /* 바탕은 html이 칠해요 (위쪽 "위쪽 메뉴" 부분) */
  color: var(--text);
}

.home-page {
  --page-bottom: 28px;       /* 한 화면에 딱 맞추는 페이지라 아래 여백은 조금 작게 (폭 · 옆 여백은 "페이지 틀") */
  flex: 1;                   /* 메뉴를 뺀 나머지 높이를 모두 차지 */
  display: flex;
  min-height: 0;
}

.home-grid {
  flex: 1;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;   /* 2칸 */
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);   /* 2줄 (화면 높이에 맞춰 줄어들어요) */
  gap: var(--panel-gap);
  min-height: 0;
}

.home-box {
  --fg: var(--text);
  --fg-2: var(--text-2);
  --fg-3: var(--muted);
  --fg-line: var(--line);
  --label-bg: color-mix(in srgb, var(--surface) 32%, transparent);   /* 칸 이름 뒤 유리판: 연하게 비치는 반투명 (테마가 바꿔요) */
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;   /* 내용은 칸 가운데에 */
  min-height: 0;
  padding: clamp(22px, 4vh, 34px) 36px;
  overflow: hidden;
  color: var(--fg);
}

/* 칸 안 아무 데나 눌러도 이동하게: 칸 이름 링크가 칸 전체를 덮어요 */
.home-box-link::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}
.home-box-link {
  color: inherit;
  text-decoration: none;
}
.home-box-link:focus-visible {
  outline: none;
}
.home-box:has(.home-box-link:focus-visible) {
  outline: 3px solid color-mix(in srgb, var(--team) 45%, transparent);
  outline-offset: 4px;
}

/* 칸 이름: 평소엔 숨어 있다가 마우스를 올리면(키보드로 와도) 왼쪽 아래에서 슥 올라와요.
   크게 보여서 뒤의 내용과 겹칠 수 있어서, 글자 뒤에 모서리가 둥근 흐린 유리판을 깔아요. */
.home-box-label {
  position: absolute;
  left: 22px;
  bottom: clamp(14px, 2.6vh, 22px);
  z-index: 3;
  padding: 0.08em 0.36em 0.12em;
  border-radius: 18px;
  background: var(--label-bg);
  -webkit-backdrop-filter: blur(5px) saturate(1.2);    /* 블러는 연하게: 뒤 내용이 살짝 비쳐요 */
  backdrop-filter: blur(5px) saturate(1.2);
  color: var(--fg);
  font-size: clamp(2.4rem, 3.6vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.15;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.3s var(--ease), transform 0.5s var(--ease);
  pointer-events: none;
}
.home-box:hover .home-box-label,
.home-box.hover-hold .home-box-label,
.home-box:focus-within .home-box-label {
  opacity: 1;
  transform: none;
}
/* 게시판 · 리그테이블 칸은 오른쪽 아래에서 올라와요 */
.home-box--board .home-box-label,
.home-box--table .home-box-label {
  left: auto;
  right: 22px;
}

.home-empty {
  margin: 0;
  color: var(--fg-2);
  font-size: 0.92rem;
  text-align: center;
}

/* 화면 읽기 프로그램에만 읽히는 글자 (화면에는 안 보여요) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ─── 다음 경기 칸: 로고 VS 로고만 ───
   마우스를 올리면 왼쪽(홈 팀) · 오른쪽(원정 팀)에서 두 팀의 색이 번지며 칸을 물들여요.
   올려 둔 동안에는 두 색이 끊임없이 일렁이며 움직여요 (glow-drift: translate · scale을 움직여서
   번지는 움직임(transform)과 따로 놀아요. 마우스를 떼면 그 자리에서 멈추고 서서히 사라져요).
   색은 home.js가 --home-color · --away-color로 넣어줘요. */
.home-match-glow {
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
}
.home-match-glow::before,
.home-match-glow::after {
  content: '';
  position: absolute;
  top: -45%;
  bottom: -45%;
  width: 90%;
  border-radius: 50%;
  filter: blur(26px);
  opacity: 0;
  transition: opacity 0.7s var(--ease), transform 1.1s var(--ease);
}
.home-match-glow::before {                 /* 홈 팀: 왼쪽 끝에서 번져 와요 */
  left: -40%;
  background: radial-gradient(closest-side, var(--home-color) 0%, color-mix(in srgb, var(--home-color) 55%, transparent) 55%, transparent 100%);
  transform: translateX(-30%) scale(0.4);
  transform-origin: 0% 50%;
  animation: glow-drift-home 4.2s ease-in-out infinite alternate paused;   /* 평소엔 멈춰 있어요 */
}
.home-match-glow::after {                  /* 원정 팀: 오른쪽 끝에서 번져 와요 */
  right: -40%;
  background: radial-gradient(closest-side, var(--away-color) 0%, color-mix(in srgb, var(--away-color) 55%, transparent) 55%, transparent 100%);
  transform: translateX(30%) scale(0.4);
  transform-origin: 100% 50%;
  animation: glow-drift-away 5.1s ease-in-out infinite alternate paused;
}
.home-box--match:hover .home-match-glow::before,
.home-box--match.hover-hold .home-match-glow::before,
.home-box--match:focus-within .home-match-glow::before,
.home-box--match:hover .home-match-glow::after,
.home-box--match.hover-hold .home-match-glow::after,
.home-box--match:focus-within .home-match-glow::after {
  opacity: 0.9;
  transform: none;
  animation-play-state: running;           /* 마우스를 올린 동안 계속 움직여요 */
}
/* 두 색 덩어리가 크게 떠다니며(translate) 커졌다 작아졌다(scale) 기울어요(rotate) → 눈에 보이게 일렁여요.
   두 덩어리의 시간을 다르게(4.2초 · 5.1초) 해서 같은 모양이 반복돼 보이지 않게 */
@keyframes glow-drift-home {
  0%   { translate: 0 0;      scale: 1;    rotate: 0deg; }
  25%  { translate: 34% -24%; scale: 1.32; rotate: 22deg; }
  50%  { translate: 52% 16%;  scale: 0.86; rotate: -14deg; }
  75%  { translate: 20% 30%;  scale: 1.22; rotate: 28deg; }
  100% { translate: 44% -10%; scale: 1.05; rotate: -20deg; }
}
@keyframes glow-drift-away {
  0%   { translate: 0 0;       scale: 1;    rotate: 0deg; }
  25%  { translate: -30% 26%;  scale: 0.88; rotate: -24deg; }
  50%  { translate: -50% -18%; scale: 1.34; rotate: 16deg; }
  75%  { translate: -22% -30%; scale: 1.1;  rotate: -30deg; }
  100% { translate: -42% 12%;  scale: 0.95; rotate: 18deg; }
}

.home-match {
  position: relative;
  z-index: 1;                /* 번지는 색 위에 */
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
  pointer-events: none;      /* 눌러도 칸 전체 링크(다음 경기 페이지)로 */
}

.home-match-teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
  max-width: 460px;
}

.home-match-team {
  display: flex;
  justify-content: center;
  min-width: 0;
}

.home-match .team-badge {
  width: clamp(68px, min(10vw, 17vh), 128px);
  font-size: clamp(1rem, 1.5vw, 1.45rem);
  text-shadow: none;
  transition: transform 0.6s var(--spring);
}
.home-box--match:hover .home-match .team-badge,
.home-box--match.hover-hold .home-match .team-badge {
  transform: scale(1.06);
}

.home-match-vs {
  color: var(--fg-3);
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.2em;
}

/* ─── 게시판 칸: 가운데에 인기 글 ─── */
.home-popular {
  width: 100%;
  max-width: 480px;
  min-width: 0;
}

.home-popular-list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: hot;
}

.home-popular-list li + li {
  border-top: 1px solid var(--fg-line);
}

/* 인기 글 한 줄: 칸 전체 링크보다 위에 올라와서 따로 눌려요 */
.home-box .home-popular-item {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 2px;
  color: var(--fg);
  text-decoration: none;
  counter-increment: hot;
  transition: padding 0.4s var(--ease);
}

.home-popular-item::before {
  content: counter(hot, decimal-leading-zero);
  flex: none;
  color: var(--fg-3);
  font-size: 0.8rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.home-popular-list li:first-child .home-popular-item::before {
  color: var(--fg);
  font-weight: 800;
}

.home-box .home-popular-item:hover {
  padding-left: 8px;
}
.home-box .home-popular-item:hover .home-popular-title {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.home-popular-flair {
  flex: none;
  color: var(--fg-3);
  font-size: 0.78rem;
  font-weight: 600;
}

.home-popular-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;   /* 긴 제목은 … 으로 */
  font-weight: 600;
  letter-spacing: -0.01em;
}

.home-popular-likes {
  flex: none;
  color: var(--fg-2);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

/* PL 팬: 게시판 칸 잠금 */
.home-box.locked {
  cursor: not-allowed;
}

/* ─── 뉴스센터 칸: 최근 뉴스 5개를 옆으로 넘겨요 (스와이프) ───
   뉴스들을 가로 띠(.home-news-track)에 나란히 놓고, 띠를 옆으로 밀어서 한 칸씩 보여줘요.
   마우스를 올리면 밑에 점이 떠서 몇 번째인지 알 수 있어요. */
.home-news {
  position: relative;
  z-index: 2;                /* 칸 전체 링크보다 위 → 뉴스를 누르면 그 뉴스로, 끌어서 넘기기도 */
  width: 100%;
  max-width: 500px;
  word-break: keep-all;      /* 한국어를 단어 중간에서 자르지 않게 */
  overflow-wrap: anywhere;
}

.home-news-viewport {
  overflow: hidden;
}
/* 뉴스 칸은 어디를 끌어도 옆으로 넘어가요 */
.home-box--news {
  touch-action: pan-y;       /* 손가락 위아래 움직임은 페이지에 맡기고, 옆으로 밀기만 우리가 받아요 */
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.home-box--news.dragging {
  cursor: grabbing;
}

.home-news-track {
  display: flex;
  transition: transform 0.65s var(--ease);
  will-change: transform;
}
.home-news-track.no-anim,
.home-news-track.no-anim .home-news-item {   /* 순간 이동할 때는 뉴스가 흐렸다가 또렷해지는 움직임도 없이 (첫 뉴스가 다시 나타나 보이던 버그) */
  transition: none;
}

.home-news-item {
  flex: 0 0 100%;
  box-sizing: border-box;
  padding: 2px 2px 4px;
  color: inherit;
  text-decoration: none;
  -webkit-user-drag: none;
  opacity: 0.15;
  transform: scale(0.92);
  transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
}
.home-news-item.is-current {           /* 지금 보이는 뉴스만 또렷하게, 넘어갈 때 옆 뉴스는 작아지며 흐려져요 */
  opacity: 1;
  transform: none;
}
.home-box--news.dragging .home-news-item {
  opacity: 1;                          /* 손으로 끄는 동안에는 옆 뉴스도 보이게 */
  transform: none;
}
.home-news-item .home-news-title-text:hover {   /* 제목 글자 위에서만 밑줄 (누르는 곳은 뉴스 전체 그대로) */
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.home-news-item:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--team) 55%, transparent);
  outline-offset: 2px;
  border-radius: 8px;
}

/* 몇 번째인지 보여주는 점 (인스타그램처럼): 마우스를 올리면 나타나요 */
.home-news-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 16px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.3s var(--ease), transform 0.4s var(--ease);
}
.home-box:hover .home-news-dots,
.home-box.hover-hold .home-news-dots,
.home-box:focus-within .home-news-dots {
  opacity: 1;
  transform: none;
}
.home-news-dot {
  width: 6px;
  height: 6px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--fg-3);
  opacity: 0.45;
  cursor: pointer;
  transition: opacity 0.3s, transform 0.3s var(--ease), background-color 0.3s;
}
.home-news-dot.active {
  background: var(--fg);
  opacity: 1;
  transform: scale(1.25);
}
.home-news-dot:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--team) 55%, transparent);
  outline-offset: 2px;
}

.home-news-title {
  margin: 0 0 10px;
  color: var(--fg);
  font-size: clamp(1.05rem, 1.35vw, 1.3rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.35;
  display: -webkit-box;      /* 제목은 2줄까지 */
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.home-news-summary {
  margin: 0;
  color: var(--fg-2);
  font-size: 0.95rem;
  line-height: 1.6;
  display: -webkit-box;      /* 요약은 3줄까지 */
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ─── 리그테이블 칸: 1 · 2 · 3위 올림픽 시상대 ───
   왼쪽 2위 · 가운데 1위(가장 높게) · 오른쪽 3위. 단 위에 팀 배지 · 이름 · 승점.
   마우스를 올리면 단이 살짝 솟고 1위 배지가 통통 튀어요. */
.home-podium {
  --step-h: clamp(64px, 15vh, 128px);      /* 1위 단 높이 (2위 · 3위는 이것보다 낮게) */
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  gap: 8px;
  width: 100%;
  max-width: 420px;
  margin: 0;
  padding: 0 0 0;
  list-style: none;
  border-bottom: 1px solid var(--fg-line);  /* 시상대 바닥 */
  pointer-events: none;                     /* 눌러도 칸 전체 링크(리그테이블)로 */
}

.home-podium-place {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}
.home-podium-place.place-2 { order: 1; }
.home-podium-place.place-1 { order: 2; }
.home-podium-place.place-3 { order: 3; }

.home-podium .team-badge {
  width: clamp(38px, 6vh, 50px);
  margin-bottom: 8px;
  font-size: 0.72rem;
  text-shadow: none;
  transition: transform 0.6s var(--spring);
}
.home-podium .place-1 .team-badge {
  width: clamp(46px, 7.4vh, 62px);
  font-size: 0.82rem;
}

.home-podium-name {
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--fg);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.home-podium-place.mine .home-podium-name {
  font-weight: 850;
}

.home-podium-points {
  margin: 2px 0 8px;
  color: var(--fg-2);
  font-size: 0.8rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* 시상대 단 */
.home-podium-step {
  display: grid;
  place-items: center;
  width: 100%;
  height: var(--step-h);
  border-radius: 10px 10px 0 0;
  background: color-mix(in srgb, var(--fg) 8%, transparent);
  transform-origin: 50% 100%;
  transition: transform 0.5s var(--spring);
}
.place-2 .home-podium-step { height: calc(var(--step-h) * 0.72); }
.place-3 .home-podium-step { height: calc(var(--step-h) * 0.52); }

.home-podium-rank {
  color: var(--fg);
  font-size: clamp(1.3rem, 3.4vh, 1.9rem);
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  opacity: 0.85;
}

.home-box--table:hover .place-1 .team-badge {
  animation: podium-hop 0.7s var(--ease);
}
@keyframes podium-hop {
  0%, 100% { transform: translateY(0); }
  35%      { transform: translateY(-9px); }
  60%      { transform: translateY(0); }
  78%      { transform: translateY(-3px); }
}

/* 설정 → 화면 → 움직임 "줄이기"를 고른 사람에게는 움직임 없이 */
html[data-motion="reduce"] .nm-box,
html[data-motion="reduce"] .match-info,
html[data-motion="reduce"] .home-box-label,
html[data-motion="reduce"] .home-news-track,
html[data-motion="reduce"] .home-news-dots,
html[data-motion="reduce"] .home-match-glow::before,
html[data-motion="reduce"] .home-match-glow::after,
html[data-motion="reduce"] .home-podium-step,
html[data-motion="reduce"] .home-news-item {
  transition: none;
}
html[data-motion="reduce"] .home-box--table:hover .place-1 .team-badge {
  animation: none;
}
html[data-motion="reduce"] .nm-box,
html[data-motion="reduce"] .swap-popup,
html[data-motion="reduce"] .home-match-glow::before,
html[data-motion="reduce"] .home-match-glow::after {
  animation: none;
}

/* 폭 1200px 아래 (작은 노트북 · 태블릿 · 휴대폰): 네 칸이 작아지기 시작하면 한 줄에 한 칸씩, 아래로 스크롤
   (위쪽 메뉴 · 휴대폰 여백은 맨 아래 "작은 화면" 부분) */
@media (max-width: 1200px) {
  :root body.home-body {
    height: auto;
    min-height: 100dvh;
    overflow: auto;
  }
  .home-grid {
    grid-template-columns: 1fr;   /* 폭은 메뉴 폭 그대로 (양 끝이 '파코어' · ☰와 맞아요) */
    grid-template-rows: none;
    grid-auto-rows: auto;
  }
  .home-box {
    min-height: clamp(240px, 46vw, 340px);   /* 화면이 좁아질수록 칸도 낮게 */
  }
}
@media (max-width: 640px) {
  .home-box {
    padding: 22px 22px 56px;   /* 아래쪽은 칸 이름이 올라올 자리 */
  }
  .home-box-label {
    left: 14px;
    bottom: 12px;
  }
}

/* ═════════════════════════════════════════════
   로그인 · 회원가입 (login.html) — 뼈대 (배치 · 크기 · 입력칸)
   화면 왼쪽 반 / 오른쪽 반. 오른쪽에 로그인 칸, 왼쪽은 📌 아직 무엇을 넣을지 정하지 않았어요.
   왼쪽 반의 색 · 모양은 css/skins/clean/login.css
   ⚠️ 배치 · 크기는 여기서만 정해요 (모든 테마가 같은 틀)
   ═════════════════════════════════════════════ */
/* 파코어 로고 (로그인 페이지 사이트 이름 옆, 그림은 js/common.js의 SITE_LOGO_SVG): 팀을 고르기 전이라 PL 보라색 */
.landing-mark {
  display: block;
  flex: none;
  height: 30px;
  aspect-ratio: 212.6 / 209.4;
  color: var(--team);
}
.landing-mark svg {
  display: block;
  width: 100%;
  height: 100%;
}
.auth-body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

.auth {
  display: grid;
  grid-template-columns: 1fr 1fr;   /* 왼쪽 반 / 오른쪽 반 */
  min-height: 100vh;
  min-height: 100dvh;
}

/* ─── 로그인 팝업 (2026-11-26): 손님 홈의 가운데 팝업 안(iframe)에서는 로그인 칸만 ─── */
.auth-in-popup .auth {
  display: block;
  min-height: 0;
}
.auth-in-popup .auth-side,
.auth-in-popup .auth .auth-brand--mobile {
  display: none;
}
.auth-in-popup .auth-main {
  display: block;
  padding: 28px 24px 20px;
}
.auth-in-popup .auth-panel {
  margin: 0 auto;
}
.auth-in-popup .auth-title {
  font-size: 1.75rem;
}

/* ─── 왼쪽 반 ─── */
.auth-side {
  position: sticky;            /* 회원가입처럼 오른쪽이 길어져도 왼쪽 반은 화면에 그대로 */
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  padding: clamp(24px, 4vw, 48px);
  box-sizing: border-box;
}

/* .auth를 앞에 붙여서, 다크 모드의 "모든 링크 파란색" 임시 규칙보다 먼저 */
.auth .auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.auth .auth-brand--mobile {
  display: none;               /* 넓은 화면에서는 왼쪽 반에 이미 있어서 숨겨요 */
}

/* ─── 오른쪽 반: 로그인 칸 ─── */
.auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(32px, 6vh, 72px) clamp(20px, 5vw, 64px);
  box-sizing: border-box;
}

.auth-panel {
  width: 100%;
  max-width: 400px;
}

.auth-head {
  margin-bottom: 12px;
}
.auth-title {
  margin: 0;
  font-size: clamp(1.9rem, 2.6vw, 2.4rem);
  font-weight: 850;
  letter-spacing: -0.04em;
  line-height: 1.15;
}
.auth-sub {
  margin: 8px 0 0;
  color: var(--text-2);
  line-height: 1.6;
  word-break: keep-all;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 입력칸: 이름표는 위, 도움말은 아래 */
.auth-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.auth-field label {
  color: var(--text-2);
  font-size: 0.88rem;
  font-weight: 700;
}
.auth .auth-field input {
  height: 50px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.auth .auth-field input:hover {
  border-color: var(--text-2);
}
.auth .auth-field input:focus {
  outline: none;
  border-color: var(--team);
  box-shadow: 0 0 0 4px rgba(var(--team-rgb), 0.16);
}
html[data-theme="dark"] .auth .auth-field input:focus {
  border-color: color-mix(in srgb, var(--team) 50%, #ffffff);
}
.auth-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

/* 약관 동의 */
.auth-checks {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}
.auth-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--text-2);
  font-size: 0.9rem;
  line-height: 1.45;
  cursor: pointer;
}
.auth .auth-check input {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--team);
}

/* 동의 줄 끝의 '보기' (약관을 새 탭으로) */
.auth .auth-view {
  flex: none;
  margin: -13px -8px -13px auto;   /* 누르는 칸은 44 이상, 보이는 자리는 그대로 (안쪽 여백만큼 바깥을 당겨요) */
  padding: 13px 8px;
  color: var(--muted);
  font-size: 0.82rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.auth .auth-view:hover {
  color: var(--text);
}

/* 로그인 칸 맨 아래: 이용약관 · 개인정보처리방침 */
.auth-legal {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin: 28px 0 0;
  font-size: 0.8rem;
}
.auth .auth-legal a {
  margin: -15px -6px;   /* 누르는 칸은 44 이상, 보이는 자리는 그대로 */
  padding: 15px 6px;
  color: var(--muted);
  text-decoration: none;
}
.auth .auth-legal a:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* 로그인 · 가입하기 버튼 (모양은 테마의 .btn) */
.auth-submit {
  width: 100%;
  height: 52px;
  margin-top: 6px;
  font-size: 1.02rem;
}

/* "또는" 가로선 */
.auth-or {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 0.82rem;
}
.auth-or::before,
.auth-or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* 소셜 로그인 버튼 (2026-11-19): 로고만 있는 정사각형을 한 줄로 가운데 (에어비앤비 참고, 사용자 결정)
   바탕은 회사 규칙 그대로 — 카카오는 노란 바탕이 규칙이라 모두 회사 공식 바탕으로 맞춰요. 테마 · 다크 모드와 상관없이 같아요.
   마우스 올림 · 누름 반응은 아래 "버튼 반응 (사이트 전체)" (모양 · 크기는 그대로, 막만 덮어요) */
.social-login {
  display: flex;
  justify-content: center;
  gap: 12px;
}
.auth .social-button {
  display: grid;
  place-items: center;
  flex: none;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 12px;   /* 로그인 페이지의 입력칸 · 로그인 버튼과 같은 모서리 */
  cursor: pointer;
  box-sizing: border-box;
}
.auth .social-button img {
  display: block;
  width: 24px;
  height: 24px;
}
/* 애플 · 페이스북 로고는 그림 안에서 모양이 작게 그려져 있어요 (칸의 72 ~ 76%, 카카오 · 구글은 90%+)
   → 조금 크게 그려서 다른 회사 로고와 눈으로 보는 크기를 맞춰요 (2026-11-27 사용자 요청) */
.auth .social-button--apple img,
.auth .social-button--facebook img {
  width: 30px;
  height: 30px;
}
.auth .social-button:disabled {
  cursor: default;
}
.auth .social-button--google { border-color: #747775; background: #ffffff; }
.auth .social-button--kakao { background: #fee500; }
.auth .social-button--naver { background: #03c75a; }
.auth .social-button--facebook { background: #1877f2; }
.auth .social-button--apple { background: #000000; }
html[data-theme="dark"] .auth .social-button--apple { border-color: rgba(255, 255, 255, 0.4); }   /* 검은 바탕 위에서도 칸이 보이게 */

/* 회원가입 ↔ 로그인 바꾸기 */
.auth-switch {
  margin: 6px 0 0;
  color: var(--text-2);
  font-size: 0.92rem;
  text-align: center;
}
.auth .link-button {
  margin: -13px -4px;          /* 누르는 칸은 44 이상('회원가입' · '가입 취소' 등), 보이는 자리는 그대로 */
  padding: 13px 4px;
  border: 0;
  background: none;
  color: var(--team);
  font: inherit;
  font-weight: 750;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: pointer;
}
html[data-theme="dark"] .auth .link-button {
  color: color-mix(in srgb, var(--team) 45%, #ffffff);
}

/* 안내 · 오류 메시지 */
.auth-message {
  margin: 0 0 20px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(var(--team-rgb), 0.08);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.5;
}
.auth-message.error {
  background: #fdecec;
  color: #b42318;
}
html[data-theme="dark"] .auth-message.error {
  background: rgba(180, 35, 24, 0.2);
  color: #ffb4ab;
}

/* 좁은 화면: 왼쪽 반은 숨기고 로그인 칸만 */
@media (max-width: 860px) {
  .auth {
    grid-template-columns: 1fr;
  }
  .auth-side {
    display: none;
  }
  .auth .auth-brand--mobile {
    display: inline-flex;
    margin-bottom: 32px;
  }
  .auth-main {
    align-items: flex-start;
  }
}

/* ─── 화면을 꽉 채우는 페이지 공통 (뼈대용 임시 스타일) ─── */
.full-body {
  margin: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;    /* 위: 메뉴 / 아래: 내용 */
}

/* ─── 다음 경기 페이지 ─── */
/* 홈의 칸들처럼 테두리 없이 옅은 회색 바탕의 둥근 카드예요. 색은 테마 변수(--surface 등)를 써서 다크 모드도 따라가요.
   칸 높이는 내용에 맞춰 늘어나고, 길어지면 페이지 전체가 스크롤돼요 */
/* 겉모습 */
.next-match-page {
  --page-bottom: 16px;       /* 아래쪽을 작게: 노트북 화면에서도 스크롤 없이 한 화면에 (폭 · 옆 여백은 "페이지 틀") */
  display: flex;
  flex-direction: column;
  gap: var(--panel-gap);
}

.match-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));   /* 3칸: 경기장 칸이 2칸, 오른쪽 줄(기사 · 기록 · 전술분석)이 1칸 */
  gap: var(--panel-gap);
  align-items: stretch;
}

/* 회색 판: 모든 팀 페이지가 같이 써요. 안쪽 여백 · 모서리는 맨 위 :root의 숫자 (페이지마다 바꾸지 않아요) */
.nm-box {
  box-sizing: border-box;
  min-width: 0;
  min-height: 420px;
  padding: var(--panel-pad);
  border-radius: var(--radius-panel);
  background: var(--surface-3);   /* 흰 칸과 구분이 잘 되게 조금 더 회색 (이전: --surface-2) */
  color: var(--text);
}

/* 떠 있는 칸(경기 목록 · 선수 바꾸기 창)이 열릴 때 살짝 떠오르기. 페이지 칸들은 등장 움직임 없이 바로 보여요 */
@keyframes nm-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* 판 제목: 모든 페이지 같은 크기 · 같은 아래 간격 (다음 경기 오른쪽 줄처럼 작은 칸만 아래에서 작게) */
.nm-box h2 {
  margin: 0 0 16px;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.nm-box h3 {
  margin: 0 0 10px;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.nm-box p {
  margin: 0 0 14px;
  color: var(--text-2);
  font-size: 1.05rem;
  line-height: 1.75;
}

.nm-box a {
  color: var(--text);
  text-decoration-color: var(--line);
  text-underline-offset: 3px;
}
.nm-box a:hover {
  text-decoration-color: currentColor;
}

/* 경기장 칸 오른쪽 줄: 위 정사각형(주요 기사) · 가운데 직사각형(재밌는 기록) · 아래 작은 정사각형 둘(양 팀 전술분석).
   페이지를 스크롤하지 않아도 한 화면에 다 보이게, 칸 안이 넘치면 그 칸 안에서만 스크롤돼요. */
.nm-side {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-column: 3;
  grid-template-rows: minmax(0, 1fr) 120px 110px;   /* 주요 기사(남는 높이) · 재밌는 기록(120px) · 전술분석 둘(110px) */
  gap: var(--panel-gap);
  min-width: 0;
  min-height: 0;
  contain: size;             /* 이 줄의 내용 높이가 줄 전체 높이를 늘리지 않게: 높이는 경기장 칸에 맞춰져요 → 페이지가 스크롤되지 않아요 */
}
.nm-side > .nm-box {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.nm-side .nm-articles {
  grid-column: 1 / -1;       /* 남는 높이를 가져요 */
}
.nm-side .nm-records {
  grid-column: 1 / -1;       /* 직사각형 */
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;          /* 스크롤 없이 위쪽 ‹ › 로 하나씩 넘겨요 */
}
/* 위 줄: ‹ 는 왼쪽 끝, › 는 오른쪽 끝, 가운데에 몇 번째인지 */
.nm-side .records-pager {
  justify-content: space-between;
}
.nm-side .nm-records #records {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;       /* 기록 한 줄 · 두 줄 모두 남는 높이의 가운데에 */
}
.nm-side .nm-tactics {
  cursor: pointer;           /* 누르면 전술 설명 팝업 */
}
.nm-side .nm-box h2 {
  margin: 0 0 8px;
  font-size: 1.15rem;
}
.nm-side .nm-tactics h2 {
  margin-bottom: 6px;
  font-size: 0.95rem;
}
.nm-side .nm-box h3 {
  margin: 0 0 6px;
  font-size: 0.92rem;
}
.nm-side .nm-box p {
  margin: 0 0 8px;
  font-size: 0.92rem;
  line-height: 1.6;
}
.nm-side .nm-tactics p {
  margin-bottom: 6px;
  font-size: 0.8rem;
  line-height: 1.5;
}
.nm-side #records li {
  padding: 0 4px;
  word-break: keep-all;      /* 단어 중간에서 줄이 끊기지 않게 */
  border-top: none;
  color: var(--text);
  font-size: 0.98rem;
  font-weight: 550;
  line-height: 1.5;
}
.nm-side #records li[hidden] {
  display: none;
}

/* 목록(재밌는 기록 · 이적 소식 · 출처): 점 대신 얇은 줄로 나눠요 */
#records,
#transfer-news,
.art-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
#records li,
#transfer-news li {
  padding: 12px 0;
  border-top: 1px solid var(--line);
  color: var(--text-2);
  line-height: 1.6;
}
#records li:first-child,
#transfer-news li:first-child {
  padding-top: 0;
  border-top: none;
}

/* ── 주요 기사 · 경기 후 인터뷰 칸 ──
   맨 위 제목 줄 + 목록(4개가 남는 높이를 똑같이 나눠 가져요) → 누르면 칸 안에서 내용 → 크게 보기 버튼으로 팝업 */
.nm-side > .nm-articles {
  display: flex;
  flex-direction: column;
  overflow: hidden;          /* 이 칸은 스크롤 대신 페이지를 넘겨요 */
}
.art-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  margin-bottom: 12px;
}
/* 제목(글을 열면 그 자리에 [목록으로])은 왼쪽 끝, 페이지 넘기기 · 크게 보기 · 승부예측은 오른쪽 */
.art-head .art-title,
.art-head .art-back {
  margin-right: auto;
}
.nm-side .art-head .art-title {
  margin: 0 auto 0 0;        /* 판 제목의 아래 간격 대신 줄 간격(.art-head)을 써요 */
  white-space: nowrap;
}
.art-title[hidden] {
  display: none;
}
/* 승부예측 가기: 불투명한 동그라미 아이콘 (옆의 크게 보기와 같은 모양 · 크기) */
.art-predict {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
}
.art-predict .btn-icon {
  width: 16px;
  height: 16px;
}
.art-back {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
  height: 30px;
  padding: 0 12px 0 6px;
  border: none;
  border-radius: var(--radius-ctl);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s;
}
.art-back .btn-icon {
  width: 16px;
  height: 16px;
}
.art-back[hidden],
.art-expand[hidden] {
  display: none;
}
.art-expand {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
}
.art-expand .btn-icon {
  width: 15px;
  height: 15px;
}
.art-back:focus-visible,
.art-item:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--team) 45%, transparent);
  outline-offset: 2px;
}

/* 목록 */
.art-list-view,
.art-reader {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.art-list-view[hidden],
.art-reader[hidden] {
  display: none;
}
.art-list {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-rows: repeat(4, minmax(0, 1fr));   /* 기사가 4개보다 적어도 한 칸 크기는 같아요 */
  grid-template-columns: minmax(0, 1fr);           /* 긴 제목이 칸 폭을 밀어내지 않게 (넘치면 …) */
  gap: var(--card-gap);      /* 다른 페이지 목록(승부예측 경기 줄 등)과 같은 간격 */
}
.art-item {
  display: flex;
  align-items: center;       /* 제목은 세로 가운데, 언론사 · 일시는 오른쪽 끝 */
  gap: 12px;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding: 0 16px;           /* 승부예측 경기 줄과 같은 옆 여백 */
  border: none;
  border-radius: var(--radius-card);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;             /* 마우스를 올려도 흰색 그대로 */
}
.art-item-title {
  display: -webkit-box;      /* 제목은 두 줄까지: 넘치면 … */
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  word-break: keep-all;      /* 단어 중간에서 줄이 끊기지 않게 */
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.35;
  flex: 1;
  min-width: 0;
  letter-spacing: -0.01em;
}
.art-item-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;     /* 언론사 · 일시 두 줄, 오른쪽 끝에 맞춰요 */
  gap: 2px;
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.3;
  white-space: nowrap;
  text-align: right;
}
.art-meta {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.75rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.nm-side p.art-meta,
.article-dialog p.art-meta {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.4;
}

/* 페이지 넘기기 [‹ 1 / 3 ›]: 칸에서는 제목 줄 오른쪽, 팝업에서는 아래 가운데 */
.art-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 0 0 auto;
}
.art-pager-bottom {
  gap: 12px;
  padding-top: 10px;
}
.art-pager[hidden] {
  display: none;
}
.art-pager .picker-arrow:disabled {
  opacity: 0.35;
  cursor: default;
}
.art-page-count {
  min-width: 3.4em;
  color: var(--text-2);
  font-size: 0.8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

/* 내용: 칸 높이만큼 채우면 옆 단으로 넘어가요 → 한 단이 한 페이지 (js의 makeTextPages가 넘겨요) */
.nm-side .art-reader-title {
  margin: 0 0 4px;
  font-size: 1rem;
  line-height: 1.4;
}
.art-pages {
  flex: 1;
  min-height: 0;
  column-count: 1;
  column-gap: 32px;          /* js의 TEXT_PAGE_GAP과 같아야 해요 */
  column-fill: auto;
  overflow: hidden;
  orphans: 2;                /* 페이지 끝 · 처음에 한 줄만 덜렁 남지 않게 */
  widows: 2;
}
.nm-side .art-pages p,
.article-dialog .art-pages p {
  margin: 0 0 10px;
  color: var(--text-2);
  font-size: 0.88rem;
  line-height: 1.65;
}
.art-pages p.art-sources {
  color: var(--muted);
  font-size: 0.78rem;
}

/* ── 전술분석 칸 뚜껑: 칸 내용 대신 그 팀 로고 (누르면 전술 설명 팝업: js의 renderTacticLids) ── */
.nm-side > .nm-tactics {
  position: relative;        /* 뚜껑의 기준 */
  overflow: hidden;          /* 가려진 글이 스크롤되지 않게 */
}
.nm-lid {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  padding: 0;
  border: none;
  border-radius: var(--radius-panel);
  background: var(--surface-3);   /* 칸 바탕과 같은 회색 */
  color: var(--text);
  cursor: pointer;
  transition: background-color 0.2s;
}
.nm-lid:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--team) 45%, transparent);
  outline-offset: -3px;
}
.nm-lid .team-badge {
  width: 56px;
  font-size: 0.95rem;
}

/* ── 전술 설명 팝업: 왼쪽 경기장(페이지의 경기장을 옮겨 와요) + 오른쪽 전술 단계 ── */
.match-dialog.tactics-dialog {   /* 기본 팝업(.match-dialog) 폭보다 크게 */
  width: min(1440px, 95vw);
  height: min(820px, 90vh);
  max-width: none;
  max-height: none;
  padding: 20px;
}
.tactics-dialog[open] {
  display: flex;
  gap: 20px;
}
.tactics-stage-slot {
  flex: 1;
  min-width: 0;
  display: grid;
  place-items: center;
  container-type: size;      /* 경기장 폭 = 이 칸에 16:9로 꽉 차게 */
  --stage-w: min(100cqw, 100cqh * 16 / 9);
}
.tactics-stage-slot .lineup-halves {
  border-radius: var(--radius-card);       /* 위에 붙은 줄이 없으니 네 모서리 모두 둥글게 */
  box-shadow: none;
}
.tactics-stage-slot .lineup-fullscreen,
.tactics-stage-slot .team-tactic {
  display: none;             /* 팝업 안에서는 전체화면 · 라인 높이 버튼 없이 (그림을 가리지 않게) */
}
/* 전술 설명에서 경기장 일부를 확대할 때: 경기장 밖으로 나간 부분은 잘라요 */
.tactics-stage-slot .lineup-stage {
  overflow: hidden;
  border-radius: var(--radius-card);
}
.tactics-stage-slot .lineup-halves {
  transition: scale 0.9s var(--ease), transform-origin 0.9s var(--ease);
}
html[data-motion="reduce"] .tactics-stage-slot .lineup-halves {
  transition: none;
}
/* 확대한 만큼 선수 원 · 공 · 화살표는 다시 줄여요 (조금만 크게 보이게) */
.demo-zoomed .player-spot,
.demo-zoomed .pitch-ball {
  scale: calc(1.25 / var(--zoom, 1));
}
.demo-zoomed .demo-overlay .demo-arrow,
.demo-zoomed .demo-zone rect {
  stroke-width: calc(1px / var(--zoom, 1));
}
.demo-zoomed .demo-zone text {
  font-size: calc(3px / var(--zoom, 1) * 1.25);
}
/* 확대 중에는 만질 수 없어요 (끌기 계산이 원래 크기 기준이라) */
.lineup-halves.demo-zoomed,
.lineup-halves.demo-zoomed * {
  pointer-events: none;
}
/* 설명이 자동으로 넘어가는 동안은 경기장을 못 만져요 */
.lineup-halves.demo-lock,
.lineup-halves.demo-lock * {
  pointer-events: none;
}
/* 단계가 바뀔 때 선수 · 공이 천천히 미끄러져요 (시간은 js가 --glide로) */
.demo-glide .player-spot.editable {
  transition: translate var(--glide, 0.9s) var(--ease), opacity 0.4s;
}
.demo-glide .pitch-ball {
  transition: left var(--glide, 0.9s) var(--ease), top var(--glide, 0.9s) var(--ease);
}
.pitch-ball.demo-pass {      /* 패스: 공만 조금 빠르게 */
  transition: left 0.7s cubic-bezier(0.3, 0.6, 0.3, 1), top 0.7s cubic-bezier(0.3, 0.6, 0.3, 1);
}
html[data-motion="reduce"] .demo-glide .player-spot.editable,
html[data-motion="reduce"] .demo-glide .pitch-ball,
html[data-motion="reduce"] .pitch-ball.demo-pass {
  transition: none;
}

/* 이 단계의 핵심 선수만 밝게: 나머지 선수는 흐리게, 핵심 선수는 노란 테두리 */
.demo-focus-on .player-spot {
  opacity: 0.4;
  transition: opacity 0.4s, translate var(--glide, 0.9s) var(--ease);
}
.demo-focus-on #lineup-left .player-spot,
.demo-focus-on #lineup-right .player-spot {
  z-index: 1;
}
.demo-focus-on .player-spot:not(.demo-focus) .player-name {
  opacity: 0;                /* 핵심 선수 이름만 보여요 (복잡한 장면에서 글자가 엉키지 않게) */
}
.demo-focus-on .lineup-half:not(:has(.demo-focus)) .player-spot {
  opacity: 0.3;              /* 상대 팀은 더 흐리게 */
}
.demo-focus-on .player-spot.demo-focus {
  z-index: 2;
  opacity: 1;
  box-shadow: 0 0 0 3px #ffe066, 0 10px 16px -6px rgba(0, 0, 0, 0.6);
}

/* 경기장 위 그림판: 화살표 · 노리는 공간 (경기장 선 위, 선수 아래) */
.demo-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.demo-arrow {
  fill: none;
  stroke-width: 0.9;
  stroke-linecap: round;
}
.demo-arrow--pass {          /* 패스: 흰 실선이 그려지듯 */
  stroke: #ffffff;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: demo-draw 0.7s var(--ease) forwards;
  filter: drop-shadow(0 0.4px 0.6px rgba(0, 0, 0, 0.5));
}
.demo-arrow--run {           /* 침투: 노란 점선 */
  stroke: #ffe066;
  stroke-dasharray: 2.2 1.6;
  animation: demo-fade 0.5s var(--ease) both;
}
.demo-arrow--press {         /* 압박: 빨간 굵은 선 */
  stroke: #ff6b6b;
  stroke-width: 1.2;
  animation: demo-fade 0.5s var(--ease) both;
}
@keyframes demo-draw {
  to { stroke-dashoffset: 0; }
}
@keyframes demo-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.demo-zone rect {
  fill: rgba(255, 224, 102, 0.16);
  stroke: rgba(255, 224, 102, 0.85);
  stroke-width: 0.45;
  stroke-dasharray: 1.6 1.2;
}
.demo-zone text {
  fill: #ffffff;
  font-size: 3px;
  font-weight: 800;
  paint-order: stroke;
  stroke: rgba(0, 0, 0, 0.45);
  stroke-width: 0.6px;
}
.demo-zone {
  animation: demo-fade 0.6s var(--ease) both;
}
html[data-motion="reduce"] .demo-arrow,
html[data-motion="reduce"] .demo-zone {
  animation: none;
  stroke-dashoffset: 0;
}

.tactics-panel {
  flex: 0 0 340px;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.tactics-panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.tactics-teams {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--surface-2);
}
.tactics-teams button {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 5px 8px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease);
}
.tactics-teams button[aria-pressed="true"] {
  background: var(--spot);   /* 설명 중인 팀 = 그 팀 색 */
  color: var(--spot-ink);
}
.tactics-teams .team-badge {
  width: 22px;
  font-size: 0.45rem;
}
.tactics-demo-title {
  margin: 0 0 6px;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.tactics-summary {
  margin: 0 0 16px;
  color: var(--text-2);
  font-size: 0.9rem;
  line-height: 1.6;
}
.tactics-steps {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tactics-step {
  display: grid;
  grid-template-columns: 26px 1fr;
  column-gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s;
}
.tactics-step.active {
  background: var(--surface-2);
}
.tactics-step-num {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 0.8rem;
  font-weight: 800;
  transition: background-color 0.25s, color 0.25s;
}
.tactics-step.active .tactics-step-num,
.tactics-step.seen .tactics-step-num {
  background: var(--spot);
  color: var(--spot-ink);
}
.tactics-step strong {
  align-self: center;
  font-size: 0.95rem;
}
/* 단계 설명: 줄마다 [등번호 칩 이름] + 할 일. 지금 단계만 펼쳐요 */
.tactics-step-lines {
  grid-column: 2;
  display: none;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  flex-direction: column;
  gap: 7px;
}
.tactics-step.active .tactics-step-lines {
  display: flex;
}
.tactics-step-lines li {
  color: var(--text-2);
  font-size: 0.86rem;
  line-height: 1.55;
  word-break: keep-all;
}
.tactics-who {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-right: 6px;
  color: var(--text);
  font-weight: 700;
  white-space: nowrap;
}
.tactics-chip {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 3px;
  box-sizing: border-box;
  border-radius: 999px;
  background: var(--spot);
  color: var(--spot-ink);
  font-size: 0.7rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* 그림 읽는 법: 패스 · 침투 · 압박 · 노리는 공간 */
.tactics-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  color: var(--text-2);
  font-size: 0.78rem;
}
.tactics-legend li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tactics-legend i {
  display: inline-block;
  width: 22px;
  height: 0;
  border-top: 3px solid #9aa0a6;
  border-radius: 2px;
}
.tactics-legend .lg-run i {
  border-top: 3px dashed #e0b400;
}
.tactics-legend .lg-press i {
  border-top-color: #e5484d;
}
.tactics-legend .lg-zone i {
  width: 16px;
  height: 12px;
  border: 1.5px dashed #e0b400;
  border-radius: 3px;
  background: rgba(255, 224, 102, 0.3);
}
.tactics-done {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--spot) 12%, var(--surface));
  color: var(--text);
  font-size: 0.86rem;
  line-height: 1.5;
}
.tactics-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
}
.tactics-controls .panel-icon-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
.tactics-play {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 120px;
  justify-content: center;
  height: 38px;
  padding: 0 18px;
  border: none;
  border-radius: var(--radius-ctl);
  background: var(--spot);
  color: var(--spot-ink);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}
.tactics-play .btn-icon {
  width: 16px;
  height: 16px;
}
.tactics-dialog button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--team) 45%, transparent);
  outline-offset: 2px;
}

/* 크게 보기 팝업 */
.article-dialog {
  width: min(760px, 90vw);
  height: min(640px, 86vh);
  padding: 28px 32px 22px;
}
.article-dialog[open] {
  display: flex;
  flex-direction: column;
}
.article-dialog .dialog-header {
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 6px;
}
.article-dialog .dialog-header h2 {
  font-size: 1.35rem;
  line-height: 1.35;
}
.article-dialog .panel-icon-btn {
  flex: 0 0 auto;
}
.article-dialog .art-pages p {
  margin-bottom: 14px;
  font-size: 1.02rem;
  line-height: 1.8;
}
.article-dialog .art-pages p.art-sources {
  font-size: 0.85rem;
}

/* 베스트 11 칸: 위 줄의 왼쪽 2칸 */
.nm-lineups {
  grid-column: 1 / 3;
  /* 경기 고르는 칸과 경기장의 폭(같은 값을 둘 다 써요): 칸 폭에 맞추되, 낮은 화면에서도 페이지가 스크롤되지 않게 화면 높이로도 제한
     (276px = 메뉴 · 페이지 여백 · 칸 여백 · 경기 고르는 칸) */
  --stage-w: min(100%, calc((100vh - 276px) * 16 / 9));
  display: flex;
  flex-direction: column;
  gap: 0;                    /* 경기 선택칸 아래 간격은 .match-info가, 이어 붙은 줄과 경기장 사이는 간격 없음 */
}

/* 경기 고르는 칸: "A팀 vs B팀" 한 줄 (버튼이지만 카드 안의 흰 알약처럼 보이게) */
.match-info {
  position: relative;
  display: flex;
  justify-content: center;   /* 팀 이름 한 줄 (날짜 · 상태 · 라인업은 경기장 위에 이어 붙은 줄로 옮겼어요) */
  align-items: center;
  flex: 0 0 auto;            /* 작게: 로고 VS 로고만큼만 (왼쪽에 놓여요) */
  box-sizing: border-box;
  border: none;
  border-radius: var(--radius-card);   /* 경기장 칸과 같은 모서리 */
  padding: 8px 34px 8px 18px;   /* 오른쪽은 ▾ 자리 */
  background: var(--surface);
  box-shadow: 0 0 0 rgba(17, 18, 20, 0);
  font: inherit;             /* 버튼 기본 글꼴 대신 페이지 글꼴 쓰기 */
  font-size: 0.95rem;        /* VS 글자 크기 */
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
  color: inherit;
  cursor: pointer;
}
.match-info::after {         /* 눌러서 바꿀 수 있다는 작은 표시 */
  content: '▾';
  position: absolute;
  right: 14px;
  top: 0;                    /* 위아래 가운데: translate 대신 위 · 아래를 칸 끝에 붙이고 가운데 정렬 (칸이 떠오를 때 같이 선명하게) */
  bottom: 0;
  display: flex;
  align-items: center;
  font-size: 0.8em;
  font-weight: 400;
  color: var(--muted);
}
.match-info:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--team) 45%, transparent);
  outline-offset: 3px;
}

/* 맨 위 줄: 경기장과 같은 폭. 왼쪽 경기 선택칸(작게) + 오른쪽 남는 자리는 흰색 빈칸 */
.match-top {
  display: flex;
  align-items: stretch;
  gap: 12px;
  width: var(--stage-w);
  margin: 0 auto 12px;
}
/* 로고 VS 로고를 누르면 그 아래로 펼쳐지는 경기 목록: 맨 위 ← N라운드 →, 그 아래 [로고 VS 로고] 경기들이 세로로 (6~7개 보이고 나머지는 스크롤) */
.match-top {
  position: relative;
}
/* 경기 고르는 칸 + 펼쳐지는 목록 묶음: 목록이 칸과 같은 폭이 되도록 이 묶음을 기준으로 해요 */
.match-select {
  position: relative;
  display: flex;
  flex: 0 0 auto;
}
.match-picker {
  position: absolute;
  z-index: 40;
  top: calc(100% + 8px);
  left: 0;
  right: 0;                  /* 위의 로고 VS 로고 칸과 같은 폭 */
  box-sizing: border-box;
  padding: 10px;
  border-radius: var(--radius-panel);   /* 떠 있는 칸 (팝업) */
  background: var(--surface);
  box-shadow: 0 18px 40px -16px rgba(17, 18, 20, 0.4), 0 0 0 1px var(--line);
  animation: nm-in 0.25s var(--ease);
}
html[data-motion="reduce"] .match-picker {
  animation: none;
}
.match-picker[hidden] {
  display: none;
}
.picker-rounds {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 8px;
}
.picker-title {
  flex: 1;
  text-align: center;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.picker-arrow {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  transition: background-color 0.2s;
}
.picker-arrow .btn-icon {
  width: 16px;
  height: 16px;
}
.picker-current {
  display: block;
  width: 100%;               /* 화살표 줄 아래 한 줄 */
  margin: 0 0 8px;
  padding: 4px 0;
  border: none;
  border-radius: var(--radius-ctl);
  background: var(--surface-2);
  color: var(--text-2);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}
.picker-current[hidden] {
  display: none;
}
.picker-grid {
  display: flex;
  flex-direction: column;    /* 로고 VS 로고가 세로로 쭉 */
  gap: 6px;
  max-height: calc(6.5 * 49px);   /* 6개 + 일곱째 절반이 보여요. 나머지는 스크롤 (절반 걸친 칸이 스크롤된다는 힌트) */
  padding-right: 2px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.picker-item {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  padding: 8px 4px;
  border: none;
  border-radius: var(--radius-card);
  background: var(--surface-2);
  color: var(--text-2);
  font: inherit;
  font-size: 0.65rem;
  font-weight: 800;
  cursor: pointer;
  transition: background-color 0.2s;
}
.picker-item:disabled {
  background: none;
  box-shadow: inset 0 0 0 1px var(--line);
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}
.picker-item .team-badge {
  width: 27px;
  font-size: 0.5rem;
  letter-spacing: 0;
}
.picker-arrow:focus-visible,
.picker-current:focus-visible,
.picker-item:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--team) 45%, transparent);
  outline-offset: 2px;
}

/* 맨 위 오른쪽 칸: 경기 일시 · 라인업 종류 · 경기 시작까지 카운트다운 · 공유 · 모드 선택 */
.match-panel {
  position: relative;        /* 공유 메뉴의 기준 */
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  box-sizing: border-box;
  padding: 0 12px;
  border-radius: var(--radius-card);   /* 경기장 칸과 같은 모서리 */
  background: var(--surface);
  container-type: inline-size;   /* 칸이 좁으면 덜 중요한 것부터 숨겨요 (아래 @container) */
  font-size: 0.92rem;
}
/* 맨 오른쪽 칸: [‹ 지난 경기로] · [이번 경기로] — 옆 칸들과 같은 흰 칸 (글자 + 가는 쪽 화살표) */
.match-jump {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  box-sizing: border-box;
  padding: 0 14px 0 8px;     /* 화살표 쪽은 조금 좁게 (기사 칸의 [목록으로]와 같은 모양) */
  border: none;
  border-radius: var(--radius-card);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s;
}
.match-jump.forward {
  padding: 0 8px 0 14px;
}
.match-jump .btn-icon {
  width: 16px;
  height: 16px;
}
.match-jump[hidden] {
  display: none;
}
.match-jump:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--team) 45%, transparent);
  outline-offset: 3px;
}
/* 경기 고르는 칸 · 오른쪽 칸 · 이어 붙은 줄 + 경기장: 마우스를 올려도 떠오르지 않아요 (제자리에 그대로) */
.match-info,
.match-panel,
.field-unit {
  position: relative;
}
.lineup-halves {
  /* 초록을 경기장 위로 4px 더 깔아 둬요 (흰 줄 밑에 숨어서 안 보여요) */
  box-shadow: 0 -4px 0 #3c9650;
}
.match-strip {
  z-index: 1;                /* 흰 줄이 경기장보다 위에 그려져요 (경계는 늘 흰 줄 끝) */
}

/* 날짜 · 카운트다운은 자리(폭)를 미리 정해 둬요: 숫자가 바뀌어도 칸이 흔들리거나 옆 칸이 밀리지 않게.
   숫자는 같은 폭(tabular-nums)에 두 자리로 고정해서 글자 폭도 안 변해요. */
.match-panel .match-info-date {
  flex: 0 0 auto;
  min-width: 9.8em;          /* 최소 자리만 정해 두고 (24시간 표시의 가장 긴 날짜 '12월 31일 (수) 23:30'), 글자가 더 길면(오전/오후 표시 등) 그만큼 늘어나요. 날짜는 절대 …로 줄이거나 숨기지 않아요 */
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  white-space: nowrap;
}
.match-panel .match-chip {
  flex: 0 1 auto;            /* 오전/오후 표시로 날짜가 길어지면 이 칸이 조금 양보해요 */
  min-width: 0;
  overflow: hidden;
  box-sizing: border-box;
  width: 9.6em;              /* 가장 긴 "-23시간 59분 59초" · 점 + "경기 종료"가 들어가는 폭 */
  padding: 4px 8px;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  text-align: center;
  white-space: nowrap;
}
/* 경기 중 · 경기 종료: 글자 옆에 점. 경기 중 = 깜빡이는 빨간 점, 경기 종료 = 회색 점 */
.match-panel #bar-clock {
  margin-left: auto;         /* 날짜와는 떨어지고 라인업/전술판 쪽으로 바짝 붙어요 */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.match-panel #bar-clock[data-state="live"]::before,
.match-panel #bar-clock[data-state="finished"]::before {
  content: '';
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.match-panel #bar-clock[data-state="live"]::before {
  background: #e5383b;
  animation: live-blink 1.1s ease-in-out infinite;
}
.match-panel #bar-clock[data-state="finished"]::before {
  background: #9a9da5;
}
@keyframes live-blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.2; }
}
html[data-motion="reduce"] .match-panel #bar-clock[data-state="live"]::before {
  animation: none;           /* 움직임 줄이기: 깜빡이지 않고 빨간 점만 */
}

/* 아주 좁은 칸에서만 덜 중요한 것부터 숨겨요 */
/* 칸이 좁아지면 날짜는 지키고, 덜 중요한 카운트다운부터 숨겨요 */
@container (max-width: 420px) {   /* 맨 위 줄에 [이번 경기로 · 지난 경기로] 칸이 있어도 데스크톱에서는 보여요 */
  .match-panel #bar-clock { display: none; }
}
.panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.panel-icon-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  transition: background-color 0.2s;
}
.panel-icon-btn:focus-visible,
.mode-toggle button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--team) 45%, transparent);
  outline-offset: 2px;
}
.panel-icon-btn .btn-icon {
  width: 17px;
  height: 17px;
}

/* 모드 선택: [라인업 | 전술판] */
.mode-toggle {
  position: relative;
  isolation: isolate;        /* 팀 색 알약(::before)이 글자 뒤 · 바탕 앞에 오게 */
  display: flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--surface-2);
}
/* 고른 칸 뒤에서 미끄러지는 팀 색 알약 (위치 · 폭은 js의 updateModeIndicator가 --ind-x · --ind-w로 알려줘요) */
.mode-toggle::before {
  content: '';
  position: absolute;
  z-index: -1;
  top: 3px;
  bottom: 3px;
  left: 0;
  width: var(--ind-w, 0px);
  transform: translateX(var(--ind-x, 3px));
  border-radius: 999px;
  background: var(--team);
}
.mode-toggle[data-ready]::before {
  transition:
    transform 0.45s cubic-bezier(0.34, 1.45, 0.5, 1),   /* 살짝 튕기며 미끄러져요 */
    width 0.45s cubic-bezier(0.34, 1.45, 0.5, 1);
}
html[data-motion="reduce"] .mode-toggle[data-ready]::before {
  transition: none;
}
.mode-toggle[hidden] {
  display: none;
}
.mode-toggle button {
  padding: 5px 12px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}
.mode-toggle.locked {
  opacity: 0.5;              /* 끝난 경기: 바꿀 수 없어요 */
}
.mode-toggle button:disabled {
  cursor: not-allowed;
}
.mode-toggle button[aria-pressed="true"] {
  color: var(--team-ink);    /* 고른 모드: 팀 색 알약 위의 글자색 */
}


.match-info-teams {
  display: flex;
  align-items: center;
  gap: 14px;
}
.match-info .team-badge {
  width: 34px;
  font-size: 0.66rem;
  letter-spacing: 0.02em;
}
.match-info-team {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* 포메이션 (4-3-3) */

/* 경기장 위에 이어 붙은 줄: 양옆 [로고 · 팀 이름 · 홈/원정 그림] (눌러도 아무 일 없어요)
   경기 선택칸과 같은 흰색이고 경기장에 틈 없이 붙어 있어요. (경기장은 건드리지 않아요) */
.match-strip {
  position: relative;
  display: flex;
  justify-content: space-between;   /* 양옆에 두 팀 (가운데는 비어 있어요) */
  align-items: center;
  gap: 16px;
  width: var(--stage-w);
  margin: 0 auto;
  box-sizing: border-box;
  height: 52px;              /* 높이 고정 (4의 배수): 화면 배율 125% · 150% · 175%에서도 실제 픽셀이 딱 떨어져서, 떠오를 때 흰 줄 · 초록 경계가 1칸씩 흔들리지 않아요 */
  padding: 0 18px;
  border: none;
  border-radius: var(--radius-card) var(--radius-card) 0 0;   /* 위 모서리만 둥글게. 아래는 직각이라 직각인 경기장 위 모서리에 딱 붙어요 */
  background: var(--surface);     /* 경기 선택칸과 같은 색 */
  color: inherit;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 700;
}
/* 양옆 팀: [로고] 이름 [그림] (오른쪽은 반대 순서로 바깥쪽에 로고) */
.strip-team {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  justify-self: start;
}
.strip-team.right {
  justify-self: end;
}
.strip-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
/* 팀 이름을 누르면 포메이션 고르기 (끝난 경기는 못 눌러요) */
.strip-team.pickable {
  margin: -4px -10px;        /* 누르는 영역만 넓히고 글자 위치는 그대로 */
  padding: 4px 10px;
  border-radius: var(--radius-ctl);
  cursor: pointer;
  transition: background-color 0.2s;
}
.strip-team.pickable[aria-expanded="true"] {
  background: var(--hover-bg);   /* 포메이션 칸이 열려 있는 동안 (마우스 올림 반응은 "버튼 반응 (사이트 전체)") */
}
.strip-team.pickable:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--team) 45%, transparent);
  outline-offset: 2px;
}
.match-strip.picker-open {
  z-index: 40;               /* 고르기 창이 경기장 · 선수 위에 */
}
.formation-picker {
  position: absolute;
  top: calc(100% + 8px);
  z-index: 40;
  width: 340px;
  box-sizing: border-box;
  padding: 12px;
  border-radius: var(--radius-panel);
  background: var(--surface);
  box-shadow: 0 20px 40px -16px rgba(17, 18, 20, 0.4);
}
.formation-picker.left { left: 12px; }
.formation-picker.right { right: 12px; }
.formation-title {
  margin: 0 0 8px;
  color: var(--text-2);
  font-size: 0.8rem;
  font-weight: 700;
}
.formation-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.formation-grid button {
  padding: 7px 0;
  border: none;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;       /* 4-1-2-1-2도 한 줄로 */
  cursor: pointer;
  transition: background-color 0.2s;
}
.formation-grid button[aria-pressed="true"] {
  background: var(--spot);   /* 지금 포메이션 = 그 팀 색 */
  color: var(--spot-ink);
}
.formation-grid button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--team) 45%, transparent);
  outline-offset: 2px;
}
.match-strip .team-badge {
  width: 32px;
  font-size: 0.62rem;
  letter-spacing: 0.02em;
}
.match-strip .venue-icon {
  width: 24px;
  height: 24px;
}
.match-chip {
  background: rgba(255, 255, 255, 0.2);   /* 잔디 위 반투명 흰 알약 */
  color: #ffffff;
}
.match-chip {
  padding: 4px 14px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 0.95rem;
  font-weight: 700;
}
.match-info-vs {
  font-size: 0.8em;
  font-weight: 600;
  color: var(--muted);
}

/* 홈(경기장) · 원정(비행기) 그림 */
.venue-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  fill: currentColor;
  color: var(--muted);
}

/* 축구장: 잔디 + 하얀 선 + 양쪽 골대. 가운데 선 왼쪽 = 왼쪽 팀 진영, 오른쪽 = 오른쪽 팀 진영 */
.lineup-halves {
  position: relative;        /* 공 · 선수 · 선의 기준 */
  flex: none;
  width: var(--stage-w);     /* 경기 고르는 칸과 같은 폭 (.nm-lineups의 --stage-w) */
  margin: 0 auto;
  aspect-ratio: 16 / 9;      /* 가로세로비 고정: 일반 화면 · 전체화면 모두 같아요 */
  --spot-size: calc(36px * var(--ps, 1));   /* 선수 팀 색 원 지름 (한 줄 간격 계산에도 써요) */
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);   /* 내용이 길어도 두 진영이 같은 폭을 지키게 */
  border-radius: 0 0 var(--radius-card) var(--radius-card);   /* 위쪽은 직각 (위에 이어 붙은 줄과 딱 맞게) */
  --lw: calc(4px * var(--ps, 1));   /* 경기장 선 굵기 (전체화면에서는 더 굵어져요) */
  --field-zoom: 1.22;               /* 경기장 그림 확대 배율: 골대 · 터치라인이 화면 밖으로 밀려날 만큼 */
  background: #3c9650;               /* 잔디: 한 가지 초록으로 통일 */
  color: #ffffff;
  overflow: hidden;
}

/* 경기장 선 (22px 바깥은 골대 자리) */
.field {
  position: absolute;
  /* 가운데를 기준으로 확대: 그림 판을 경기장보다 넓게(1.22배) 잡아서 바깥쪽 골대 · 터치라인이 보이지 않아요.
     scale(이미지처럼 키우기)을 쓰면 경기장이 움직일 때 선과 초록 바탕이 따로 움직여 끊겨 보여서, 판 크기로 키워요. */
  inset: calc((1 - var(--field-zoom, 1)) / 2 * 100%);
  --lw: calc(4px * var(--ps, 1) * var(--field-zoom, 1));   /* 키운 만큼 선도 굵게 (예전 모양과 같게) */
  container-type: size;      /* 가운데 원 크기를 판 높이 기준(cqh)으로 정하려고 */
  pointer-events: none;
}
.field > span {
  position: absolute;
  box-sizing: border-box;
  --line: #ffffff;
}
.f-line {
  inset: 22px;
  border: var(--lw) solid var(--line);
}
.f-mid {
  left: 50%;
  top: 22px;
  bottom: 22px;
  width: var(--lw);
  margin-left: calc(var(--lw) / -2);
  background: var(--line);
}
.f-circle {
  left: calc(50% - 13cqh);   /* 가운데 (지름 = 판 높이의 26%) */
  top: 37%;
  width: 26cqh;
  height: 26%;               /* 경기장이 커지면 같이 커져요 */
  border: var(--lw) solid var(--line);
  border-radius: 50%;
}
.f-box,
.f-six {
  border: var(--lw) solid var(--line);
}
.f-box { top: 22%; width: 20%; height: 56%; }   /* 위아래 가운데: top = (100% - 높이) / 2 */   /* 확대해도 골키퍼가 박스 안에 서도록 넓게 */
.f-six { top: 30%; width: 14%; height: 40%; }   /* 골 에어리어: 이전보다 훨씬 크게 */
.f-box.l, .f-six.l { left: 22px; border-left: none; }
.f-box.r, .f-six.r { right: 22px; border-right: none; }
/* 페널티 아크: 페널티 박스 바깥쪽으로 튀어나온 반원 (박스 끝선에서 시작해요) */
.f-arc {
  top: 35%;                  /* 위아래 가운데 */
  height: 30%;
  aspect-ratio: 1 / 2;       /* 폭 = 높이의 절반 → 딱 반원 */
  border: var(--lw) solid var(--line);
}
.f-arc.l {
  left: calc(22px + 20% - 1px);   /* 페널티 박스(폭 20%)의 오른쪽 끝선 */
  border-left: none;
  border-radius: 0 999px 999px 0;
}
.f-arc.r {
  right: calc(22px + 20% - 1px);
  border-right: none;
  border-radius: 999px 0 0 999px;
}
.f-goal {
  top: 40%;                  /* 위아래 가운데 */
  width: 16px;
  height: 20%;
  border: var(--lw) solid #ffffff;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.4) 0 1px, transparent 1px 6px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.4) 0 1px, transparent 1px 6px);
}
.f-goal.l { left: 6px; border-right: none; border-radius: 4px 0 0 4px; }
.f-goal.r { right: 6px; border-left: none; border-radius: 0 4px 4px 0; }

.lineup-half {
  display: flex;
  flex-direction: column;
  pointer-events: none;      /* 한쪽 진영 칸이 다른 쪽 선수를 가리지 않게 (선수만 잡히게 해요) */
  min-width: 0;
  padding: calc(46px * var(--ts, 1)) 18px;   /* 위아래 같은 여백 → 선수들이 경기장 가운데에 와요. 여백이 작아서 선수 사이가 넓어져요 */
}
#lineup-left { padding-left: 34px; }     /* 골키퍼가 골 에어리어 안에 오게 */
#lineup-right { padding-right: 34px; }
/* 가장 앞 줄(공격수)과 중앙선 사이 여백. 양 팀 같아요
   (46px → 30px: 공격수를 하프라인 쪽으로 붙여서 가운데 줄들 사이를 넓혀요 → 긴 이름이 덜 겹쳐요) */
#lineup-left { padding-right: calc(30px * var(--ps, 1)); }
#lineup-right { padding-left: calc(30px * var(--ps, 1)); }

/* 한 팀의 진영: 줄(골키퍼 → 수비 → 미드 → 공격)을 가로로 늘어놓아요 */
.pitch {
  flex: 1;
  display: flex;
  flex-direction: row;               /* 왼쪽 팀: 골키퍼가 왼쪽 끝 → 오른쪽으로 공격 */
  justify-content: flex-start;       /* 골키퍼(골대 쪽)부터 */
}

/* 수비 ~ 공격 줄: 골키퍼와의 간격은 고정(양 팀 똑같이), 가장 앞 줄은 진영 끝(중앙선 쪽 여백이 양 팀 똑같아서 중앙선과의 간격도 같아요).
   그 사이 줄들은 고르게 퍼져요. 줄 수가 달라도(4-3-3 · 4-2-3-1) 골키퍼 - 수비 · 중앙선 - 공격 간격은 같아요. */
.pitch-lines {
  flex: 1;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  margin-left: 9%;                   /* 골키퍼 - 수비 간격 (진영 폭에 대한 비율, 17% → 9%: 수비를 골키퍼 쪽으로) */
}

#lineup-right .pitch {
  flex-direction: row-reverse;       /* 오른쪽 팀: 골키퍼가 오른쪽 끝 → 왼쪽으로 공격 */
}
#lineup-right .pitch-lines {
  flex-direction: row-reverse;
  margin-left: 0;
  margin-right: 9%;
}

/* 한 줄(예: 수비 4명)은 세로로 세워요 */
.pitch-row {
  display: flex;
  flex-direction: column;
  justify-content: center;           /* 줄은 선수 수와 상관없이 가운데에 */
  /* 같은 줄의 선수 사이 간격 (팀마다 따로, js가 --line-max는 팀 진영에 · --row-n은 줄마다 넣어요):
     가장 사람이 많은 줄이 딱 맞는 기준 간격, 그보다 한 명 적을 때마다 기준 간격의 30%씩 더 넓어요.
     예) 5-3-2: 5명 줄 = 기준, 3명 줄 = 기준 × 1.6, 2명 줄 = 기준 × 1.9 */
  gap: calc((100% - var(--line-max, 4) * var(--spot-size)) / (var(--line-max, 4) - 1)
            * (1 + 0.3 * (var(--line-max, 4) - var(--row-n, 4))));
}

#lineup-right .pitch-row {
  flex-direction: column-reverse;    /* 마주보는 팀은 위아래도 반대로 */
}

/* 선수: 작은 흰 원(등번호) + 그 바깥에 한 겹 팀 상징색 원. 이름은 원 아래에 떠 있어요.
   (--spot · --spot-ink는 js가 팀마다 넣어요) */
.player-spot {
  position: relative;        /* 끌 때 다른 선수 위로 올라오게 */
  box-sizing: border-box;
  display: grid;
  place-items: center;
  width: calc(36px * var(--ps, 1));      /* 팀 색 원: 안쪽 등번호 원(28px) 바깥으로 4px만 */
  height: calc(36px * var(--ps, 1));
  border-radius: 50%;
  background: var(--spot, var(--surface));   /* 바깥 한 겹 = 팀 상징색 */
  box-shadow: 0 8px 12px -6px rgba(0, 0, 0, 0.55);
  pointer-events: auto;      /* 진영 칸들은 클릭을 통과시키고, 선수만 잡히게 */
}

/* 안쪽 작은 원: 등번호 */
.player-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: calc(28px * var(--ps, 1));
  height: calc(28px * var(--ps, 1));
  border-radius: 50%;
  background: #ffffff;
  color: #1a1b1e;
  font-size: calc(0.8rem * var(--ps, 1));
  font-weight: 800;
  line-height: 1;
}

/* 원 아래에 떠 있는 이름 (자리를 차지하지 않아요) */
.player-name {
  position: absolute;
  top: 100%;
  left: -60px;               /* 선수 원 양쪽으로 60px씩 넓힌 칸 안에서 글자를 가운데 정렬 (반 픽셀 어긋남 없이) */
  right: -60px;
  margin-top: 4px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #ffffff;
  font-size: calc(0.78rem * var(--ps, 1));
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65);
  pointer-events: none;
}

/* 예상 라인업: 끌거나 눌러서 바꿀 수 있는 선수 */
.player-spot.editable {
  cursor: grab;
  touch-action: none;        /* 터치 기기에서 끌 때 화면이 같이 스크롤되지 않게 */
  user-select: none;
  outline: none;
  transition: scale 0.2s var(--ease), box-shadow 0.2s;
}
.player-spot.editable:focus-visible {
  box-shadow: 0 0 0 3px #ffffff, 0 0 0 6px color-mix(in srgb, var(--team) 70%, transparent);
}
.player-spot.selected {
  scale: 1.15;
  box-shadow: 0 0 0 3px #ffffff, 0 12px 20px -8px rgba(0, 0, 0, 0.6);
}
.player-spot.dragging {
  z-index: 5;
  scale: 1.18;
  cursor: grabbing;
  box-shadow: 0 0 0 3px #ffffff, 0 18px 28px -10px rgba(0, 0, 0, 0.6);
  transition: none;
}

/* 선수를 눌렀을 때 뜨는 "바꿀 선수" 목록 */
.swap-popup {
  position: absolute;
  z-index: 6;
  box-sizing: border-box;
  width: 250px;
  padding: 14px;
  border-radius: var(--radius-panel);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 48px -16px rgba(17, 18, 20, 0.5);
  animation: nm-in 0.25s var(--ease);
}
.swap-title {
  margin: 0 0 10px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}
.swap-empty {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}
.swap-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
}
.swap-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 6px 8px;
  border: none;
  border-radius: var(--radius-ctl);
  background: var(--surface-2);
  color: inherit;
  font: inherit;
  font-size: 0.85rem;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s;
}
.swap-item:focus-visible {
  outline: 2px solid var(--team);
}
.swap-num {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--spot);
  color: var(--spot-ink);
  font-size: 0.78rem;
  font-weight: 700;
}

/* 공: 끌어서 옮겨요 */
.pitch-ball {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 50%;
  width: calc(34px * var(--ps, 1));
  height: calc(34px * var(--ps, 1));
  margin: calc(-17px * var(--ps, 1)) 0 0 calc(-17px * var(--ps, 1));   /* 공의 가운데가 left · top 위치에 오게 (translate 대신) */
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffffff, #d4d6da 72%);
  box-shadow:
    inset 0 0 0 2px #1a1b1e,
    0 8px 14px -6px rgba(17, 18, 20, 0.55);
  cursor: grab;
  touch-action: none;
  transition: scale 0.25s var(--ease), box-shadow 0.2s;
}
.pitch-ball:not([hidden]) {
  animation: ball-in 0.4s var(--ease);   /* 선수를 움직이면 가운데에 톡 나타나요 */
}
@keyframes ball-in {
  from { opacity: 0; scale: 0.3; }
  to   { opacity: 1; scale: 1; }
}
html[data-motion="reduce"] .pitch-ball {
  animation: none;
}
.pitch-ball[hidden] {
  display: none;
}
.pitch-ball.dragging {
  cursor: grabbing;
  scale: 1.18;
}
/* 라인 높이: 공격 · 중간 · 수비 알약 버튼 세 개 (그 팀만 바뀌어요) */
.team-tactic {
  position: absolute;
  z-index: 6;
  top: calc(10px * var(--ts, 1));   /* 경기장 맨 위 */
  left: 28px;
  display: flex;
  gap: calc(6px * var(--ts, 1));
}
.team-tactic.right {
  left: auto;
  right: 28px;
}
.team-tactic[hidden] {
  display: none;
}
.team-tactic button {
  padding: calc(4px * var(--ts, 1)) calc(14px * var(--ts, 1));
  border-radius: 999px;                                  /* 알약 */
  background: rgba(255, 255, 255, 0.07);                 /* 유리: 아주 연한 흰 막 + 살짝만 흐림 → 뒤의 선 · 선수가 비쳐 보여요 */
  -webkit-backdrop-filter: blur(2px) saturate(1.3);
  backdrop-filter: blur(2px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), inset 0 -1px 0 rgba(255, 255, 255, 0.15), 0 8px 20px -10px rgba(0, 0, 0, 0.3);
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  font: inherit;
  font-size: calc(0.9rem * var(--ts, 1));   /* 팀 이름 · 포메이션과 같은 크기 */
  font-weight: 700;
  line-height: 1.3;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}
/* 유리 알약: 올리면 살짝 밝게, 누르면 아주 밝게 (모양 · 크기는 그대로) */
.team-tactic button:hover {
  background: rgba(255, 255, 255, 0.2);
}
.team-tactic button:active {
  background: rgba(255, 255, 255, 0.4);
}
.team-tactic button[aria-pressed="true"] {
  background: color-mix(in srgb, var(--spot, #ffffff) 78%, transparent);   /* 누른 알약: 그 팀 상징색 */
  color: var(--spot-ink, #ffffff);
  text-shadow: none;
}
.team-tactic button:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

/* 유리가 나타날 때: 살짝 내려오며 흐릿한 데서 또렷해져요 */
@keyframes glass-in {
  from { opacity: 0; transform: translateY(-8px) scale(0.94); filter: blur(6px); }
  to   { opacity: 1; transform: none; filter: none; }
}
.team-tactic:not([hidden]),
.lineup-refresh:not([hidden]) {
  animation: glass-in 0.45s var(--ease);
}
html[data-motion="reduce"] .team-tactic,
html[data-motion="reduce"] .lineup-refresh {
  animation: none;
}

/* 라인 높이를 바꿀 때 선수들이 미끄러지듯 움직여요 */
.tactic-glide .player-spot.editable {
  transition: translate 0.55s var(--ease), scale 0.2s var(--ease), box-shadow 0.2s;
}
html[data-motion="reduce"] .tactic-glide .player-spot.editable {
  transition: none;
}

/* 전체화면: 무대가 화면을 꽉 채우고(잔디색), 경기장은 그 가운데에서 16:9를 지키며 최대한 커져요.
   16:9가 아닌 화면에서는 남는 위아래 · 좌우를 같은 잔디색으로 채워요. */
.lineup-stage:fullscreen {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #3c9650;
}
.lineup-stage:fullscreen .lineup-halves {
  width: min(100vw, calc(100vh * 16 / 9));
  border-radius: 0;
}

/* 경기장 모서리 아이콘 버튼 (새로고침 · 전체화면): 글자 없이 아이콘만, 반투명 */
.lineup-refresh,
.lineup-fullscreen {
  position: absolute;
  z-index: 7;
  bottom: calc(30px * var(--ts, 1));
  display: grid;
  place-items: center;
  width: calc(30px * var(--ts, 1));
  height: calc(30px * var(--ts, 1));
  padding: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);                 /* 유리: 아주 연한 흰 막 + 살짝만 흐림 → 뒤의 선 · 선수가 비쳐 보여요 */
  -webkit-backdrop-filter: blur(2px) saturate(1.3);
  backdrop-filter: blur(2px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), inset 0 -1px 0 rgba(255, 255, 255, 0.15), 0 8px 20px -10px rgba(0, 0, 0, 0.3);
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  opacity: 0;                /* 평소엔 숨어 있어요: 마우스가 경기장 위에서 움직일 때만 나타나요 (.controls-awake) */
  pointer-events: none;
  transition: background-color 0.2s, opacity 0.2s;
}
.lineup-halves.controls-awake .lineup-refresh,
.lineup-halves.controls-awake .lineup-fullscreen,
.lineup-refresh:focus-visible,
.lineup-fullscreen:focus-visible {   /* 키보드로 고른 버튼은 항상 보여요 */
  opacity: 1;
  pointer-events: auto;
}
html[data-motion="reduce"] .lineup-refresh,
html[data-motion="reduce"] .lineup-fullscreen {
  transition: none;
}
.lineup-halves.controls-instant .lineup-refresh,
.lineup-halves.controls-instant .lineup-fullscreen {
  transition: none;          /* 마우스가 경기장을 나가면 서서히가 아니라 바로 사라져요 */
}
.lineup-refresh { left: calc(30px * var(--ts, 1)); }      /* 경기장 왼쪽 아래: 뭔가 옮기면 나타나요 */
.lineup-fullscreen { right: calc(30px * var(--ts, 1)); }  /* 경기장 오른쪽 아래 */
.lineup-refresh[hidden],
.lineup-fullscreen[hidden] {
  display: none;
}
.lineup-refresh:hover,
.lineup-fullscreen:hover {
  background: rgba(255, 255, 255, 0.3);
}
.lineup-refresh:active,
.lineup-fullscreen:active {
  background: rgba(255, 255, 255, 0.45);   /* 누르면 아주 밝게 (크기는 그대로) */
}
.lineup-refresh:focus-visible,
.lineup-fullscreen:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 2px;
}
.btn-icon {
  width: calc(18px * var(--ts, 1));
  height: calc(18px * var(--ts, 1));
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.btn-icon .icon-fill {       /* 꽉 채운 모양 (공 가운데 · 축구화 · 과녁 가운데 점) */
  fill: currentColor;
  stroke: none;
}

/* 선택 영역: 끌어서 만든 네모. 안의 선수들을 한꺼번에 옮겨요 */
.sel-area {
  position: absolute;
  box-sizing: border-box;
  border: 1.5px dashed rgba(255, 255, 255, 0.9);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.14);
  cursor: move;
}


/* ─── 경기 선택 창 ─── */
.match-dialog {
  width: min(560px, 90vw);
  box-sizing: border-box;
  border: none;
  border-radius: var(--radius-panel);
  padding: 24px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 30px 70px -20px rgba(17, 18, 20, 0.45);
}

/* 창 뒤쪽을 어둡게 */
.match-dialog::backdrop {
  background: rgba(0, 0, 0, 0.4);
}

.dialog-header {
  display: flex;
  justify-content: space-between;   /* 제목은 왼쪽, ✕는 오른쪽 위 */
  align-items: center;
}

.dialog-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.dialog-close {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: none;
  color: var(--text-2);
  font-size: 1.1em;
  cursor: pointer;
  transition: background-color 0.2s;
}

.match-list {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: flex;
  flex-direction: column;
  gap: var(--card-gap);
}

.match-list button {
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: var(--radius-card);
  background: var(--surface-2);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s;
}


/* 지금 보고 있는 경기: 팀 색 테두리 */
.match-list button.current {
  box-shadow: inset 0 0 0 2px var(--team);
  font-weight: 700;
}

/* ─── 게시판 공통: 다음 경기 페이지처럼 카드 모양 ───
   - 카드(.bd-box) = 테두리 없는 옅은 회색 둥근 칸 (다음 경기의 .nm-box와 같은 모양).
   - 버튼(.bd-btn) = 팀 색 알약 / .quiet를 붙이면 조용한 흰 알약.
   - 색은 테마 변수(--surface 등)를 써서 다크 모드도 따라가요.
   - .board-area 안에서만 쓰는 이유: 다크 모드의 a · input 기본 색(아래쪽 다크 테마 묶음)보다 우선하려고요.
   */
.board-page,
.post-page,
.write-page,
.user-page {
  display: flex;             /* 폭 · 여백은 "페이지 틀" (메뉴 폭과 같아요) */
  flex-direction: column;
  gap: var(--panel-gap);
}

.bd-box {
  box-sizing: border-box;
  min-width: 0;
  padding: var(--panel-pad);
  border-radius: var(--radius-panel);
  background: var(--surface-3);
  color: var(--text);
}
.bd-box h1,
.bd-box h2 {
  margin: 0 0 16px;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.3;
}
.bd-box h1 { font-size: 1.6rem; }   /* 글 제목 */
.bd-box h2 { font-size: 1.25rem; }  /* 판 제목 (다른 페이지의 판 제목과 같은 크기) */

/* 버튼: 팀 색 둥근 네모 */
.board-area .bd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border: none;
  border-radius: var(--radius-ctl);
  background: var(--team);
  color: var(--team-ink);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}
/* 조용한 버튼: 흰 버튼 (회색 카드 위에서 잘 보여요) */
.board-area .bd-btn.quiet {
  background: var(--surface);
  color: var(--text-2);
}

/* 입력칸 공통: 회색 카드 위의 흰 칸 */
.board-area input[type="text"],
.board-area .bd-box textarea,   /* .bd-box를 넣어 다크 모드 기본 입력칸 색보다 우선해요 */
.board-area .bd-box select {
  box-sizing: border-box;
  width: 100%;
  padding: 11px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-ctl);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.5;
}
.board-area textarea {
  resize: vertical;
}
.board-area input::placeholder,
.board-area textarea::placeholder {
  color: var(--muted);
}
/* 입력칸을 눌러도 칸 테두리 · 주변은 그대로예요 (깜빡이는 커서로 알 수 있어요) */
.board-area input:focus,
.board-area textarea:focus,
.board-area select:focus {
  outline: none;
}
.board-area input[type="checkbox"],
.board-area input[type="radio"] {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--team);   /* 체크 · 동그라미도 팀 색 */
}

/* 키보드로 옮겨 다닐 때 보이는 테두리 */
.board-area .bd-btn:focus-visible,
.board-area .flair-filter button:focus-visible,
.board-area .pagination button:focus-visible,
.board-area .comment-actions button:focus-visible,
.board-area .reaction-btn:focus-visible,
.board-area .post-more-btn:focus-visible,
.board-area .post-more-menu button:focus-visible,
.board-area .post-row:focus-visible,
.board-area .back-link:focus-visible,
.board-area a.author-link:focus-visible,
.user-edit-btn:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--team) 45%, transparent);
  outline-offset: 2px;
}

/* 게시판 버튼의 마우스 올림 · 누름 반응은 사이트 전체가 같이 써요 → 아래쪽 "버튼 반응 (사이트 전체)" */

.error-message {
  color: red;
}

/* ─── 게시판 목록 ─── */
/* 회색 카드 없이 흰 바탕. 말머리 탭이 폴더 탭처럼 목록 위에 붙어 있어요 */
.board-page {
  gap: 0;                    /* 탭 줄과 목록이 딱 붙게 */
}
.board-page,
.user-page {                 /* 유저 페이지의 글 목록도 게시판 목록과 같은 색 */
  --board-bg: var(--page-bg);   /* 페이지(목록) 바탕색 */
  --board-chip: color-mix(in srgb, var(--text) 6%, var(--board-bg));   /* 흰 바탕 위 버튼 · 칸의 옅은 회색 (다크 모드에서도 보여요) */
  --board-sheet: color-mix(in srgb, var(--text) 5%, var(--board-bg));  /* 고른 탭 + 목록 판 색 (폴더 하나처럼 이어져요) */
  --board-tab: color-mix(in srgb, var(--text) 11%, var(--board-bg));    /* 고르지 않은 탭 + 글 줄 색 (더 짙은 회색) */
  --board-notice: color-mix(in srgb, var(--team) 13%, var(--board-bg));   /* 공지 줄 + 고른 탭 색 (흰 바탕에 팀 색을 옅게: 밝으면서 팀 색이 느껴지게) */
}
/* 한 줄: 왼쪽 말머리 탭 / 오른쪽 검색 · 정렬 · 글쓰기. 아래에 얇은 선 */
.board-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;     /* 탭은 선에 붙고, 오른쪽 도구도 아래쪽에 맞춰요 */
  gap: 16px;
  position: relative;
  height: 46px;              /* 높이를 딱 떨어지는 숫자로: 아래 구분선들이 픽셀에 딱 맞아 모두 같은 굵기로 보여요 */
}
.board-actions {
  display: flex;
  flex: 1;                   /* 탭 옆 남는 폭을 다 써요 → 검색창이 가로로 늘어나요 */
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding-bottom: 5px;       /* 선에서 살짝 띄워요 */
}
.board-area .board-search {
  flex: 1;                   /* 탭 옆 남는 폭을 다 써요 (모양은 사이트 공통 검색칸 .site-search) */
  width: auto;
}
.board-area .board-head .bd-btn.quiet {
  background: var(--board-chip);
}

/* 정렬: 버튼 하나 (최신순 ↔ 인기순). 오른쪽 작은 화살표가 "누르면 바뀌어요"를 알려줘요 */
.board-area .sort-toggle::after {
  content: '⇅';
  color: var(--muted);
  font-size: 0.85em;
}

/* 말머리 탭: 윤곽선 없는 둥근 사다리꼴(밑변이 더 길어요). 고른 탭은 목록과 같은 색, 나머지는 더 짙은 회색 */
.flair-filter {
  display: flex;
  align-items: flex-end;
  flex-shrink: 0;
}
.board-area .flair-filter button:first-child {
  margin-left: 0;            /* '전체' 탭 밑변이 목록 판 왼쪽 끝에서 딱 끝나게 */
}
.board-area .flair-filter button {
  position: relative;
  isolation: isolate;        /* 사다리꼴 바탕(::before)이 글자 뒤에 오게 */
  margin: 0 -1px;            /* 옆 탭과 밑변 끝이 거의 맞닿게 */
  padding: 9px 18px;
  border: none;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.2s;
}
/* 사다리꼴 모양: 둥근 사각형을 뒤로 눕혀서 위가 좁아 보이게 해요 */
.board-area .flair-filter button::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  border-radius: 4px 4px 0 0;   /* 모서리를 살짝만 둥글게 (날카로운 느낌) */
  background: var(--board-tab);
  transform: perspective(60px) rotateX(14deg);
  transform-origin: bottom;
  transition: background-color 0.2s;
}
.board-area .flair-filter button.active {
  z-index: 1;                /* 고른 탭은 옆 탭 위로 */
  padding-top: 12px;         /* 고른 탭은 조금 더 높게 */
  color: var(--text);
}
.board-area .flair-filter button.active::before {
  bottom: -1px;              /* 아래 목록 판과 1px 겹쳐서 틈 없이 이어지게 */
  background: var(--board-notice);  /* 맨 위 공지 줄과 같은 색 */
}

/* 글 목록 판: 회색 칸은 첫 글 위에서 시작해 마지막 글에서 끝나요. 페이지 번호는 그 아래 흰 바탕 위 */
.board-list {
  position: relative;
}
/* 왼쪽 위 둥근 모서리 뒤의 작은 칸: '전체' 탭 색 (고르면 공지 색, 아니면 짙은 회색) → 탭과 판이 이어져 보여요 */
.board-list::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: var(--radius-panel);   /* 목록 판 모서리 크기와 같게 */
  height: var(--radius-panel);
  background: var(--board-tab);
}
.board-list.all-tab-active::before {
  background: var(--board-notice);
}
.post-list:not(:empty),
.board-empty {
  position: relative;
  z-index: 1;                /* 모서리 뒤 작은 칸 위로 */
  border-radius: var(--radius-panel);   /* 다른 페이지의 회색 판과 같은 모서리 */
  background: var(--board-sheet);
}
.board-empty {
  margin: 0;
  padding: 56px 20px;
  color: var(--muted);
  text-align: center;
}
.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
/* 글 사이 구분선: 양 끝을 비워서 짧게 */
.post-list li + li {
  position: relative;
}
.post-list li + li::before {
  content: '';
  position: absolute;
  z-index: 1;
  top: 0;
  left: 16px;
  right: 16px;
  border-top: 1px solid var(--line-strong);   /* 배경 대신 테두리: 화면 배율이 달라도 모든 구분선이 같은 굵기 */
  pointer-events: none;
}
/* 공지끼리 구분선: 팀 상징색 (굵기 · 길이는 다른 구분선과 같아요) */
.post-list li.pinned + li.pinned::before {
  border-top-color: color-mix(in srgb, var(--team) 35%, transparent);   /* 팀 색을 연하게 */
}
/* 공지와 일반 글 사이에는 구분선이 없어요 */
.post-list li.pinned + li:not(.pinned)::before {
  display: none;
}

/* 한 줄: [말머리] 제목 ------ 조회 · 좋아요 · 댓글 (글쓴이는 글 안 제목줄에) */
.board-area .post-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  box-sizing: border-box;
  min-height: 51px;          /* 줄 높이를 딱 떨어지는 숫자로 (구분선이 흐려져 굵어 보이지 않게) */
  padding: 14px 16px;
  border-radius: 0;          /* 직각 (첫 글 위 · 마지막 글 아래 모서리만 아래에서 둥글게) */
  background: var(--board-sheet);   /* 글 줄은 고른 탭과 같은 회색 */
  color: var(--text);
  text-decoration: none;
  transition: background-color 0.2s;
}
/* 목록 판 모서리에 맞춰요: 첫 글은 위 둘, 마지막 글은 아래 둘 */
.board-area .post-list li:first-child .post-row {
  border-top-left-radius: var(--radius-panel);
  border-top-right-radius: var(--radius-panel);
}
.board-area .post-list li:last-child .post-row {
  border-bottom-left-radius: var(--radius-panel);
  border-bottom-right-radius: var(--radius-panel);
}
.post-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.post-title {
  overflow: hidden;
  text-overflow: ellipsis;   /* 제목이 너무 길면 … 으로 */
  white-space: nowrap;
  font-weight: 600;
}
.post-stats {
  display: flex;
  gap: 14px;
  flex-shrink: 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;   /* 숫자 폭을 같게: 줄마다 안 흔들려요 */
}

/* 고정글(공지 · 평점): 팀 색이 아주 옅게 깔려요 */
.board-area .post-list li.pinned .post-row {
  background: var(--board-notice);
}

/* 페이지 번호: 동그란 버튼 (다음 경기의 동그란 버튼과 같은 크기) */
.pagination {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}
.pagination:empty {
  display: none;
}
.board-area .pagination button {
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border: none;
  border-radius: 999px;
  background: var(--board-bg);   /* 흰 바탕 위 (회색 목록 판 아래) */
  color: var(--text-2);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}
.board-area .pagination button.active {
  background: var(--team);
  color: var(--team-ink);
}

/* 말머리 알약 (목록 · 글 보기 같이 써요) */
.flair {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}
.post-row .flair {
  justify-content: center;
  background: var(--board-bg);   /* 회색 글 줄 위라 흰색 */
  min-width: 2.6em;          /* 목록에서는 폭을 맞춰서 제목이 한 줄로 가지런히 */
}
.post-list li.pinned .flair {
  background: var(--team);
  color: var(--team-ink);
}

/* ─── 글 보기 ─── */
/* 맨 위 한 줄: 왼쪽 목록으로 / 오른쪽 끝 ... 버튼 */
.post-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
/* 목록으로: 카드 위 작은 버튼 */
.board-area .back-link {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: var(--radius-ctl);
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  transition: color 0.2s;
}

/* ... 버튼 → 누르면 아래에 작은 메뉴 (내 글: 삭제 / 남의 글: 신고) */
.post-more {
  position: relative;        /* 메뉴가 버튼 바로 아래에 뜨는 기준 */
}
.board-area .post-more-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.post-more-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}
.post-more-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 10;               /* 아래 글 카드 위로 */
  min-width: 96px;
  padding: 6px;
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
}
.board-area .post-more-menu button {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border: none;
  border-radius: var(--radius-ctl);
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

/* 제목줄: 왼쪽 [말머리] 제목 / 오른쪽 글쓴이 (프로필 · 닉네임 · 배지) */
.post-headline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 16px;
}
.bd-box .post-headline h1 {
  margin: 0;
  min-width: 0;
}
.post-author {
  display: flex;
  flex-shrink: 0;
  max-width: 40%;
  font-size: 0.9rem;
}
.post-author .avatar {
  width: 34px;
  height: 34px;
}
.post-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.post-heading .flair {
  font-size: 0.8rem;
}
.post-meta {
  margin: -6px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}
.post-content {
  min-height: 60px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line-strong);
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.8;
  white-space: pre-wrap;     /* 글쓴이가 넣은 줄바꿈을 그대로 */
  overflow-wrap: anywhere;   /* 아주 긴 주소도 칸 밖으로 안 넘쳐요 */
}

/* 좋아요 · 수 · 싫어요 (신고 · 삭제는 맨 위 ... 버튼) */
.post-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
}
/* 좋아요(하트) · 싫어요(엄지 아래): 동그라미 안에 그림만. 누른 상태면 팀 색 + 그림이 꽉 차요 */
.board-area .reaction-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}
.reaction-btn svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.board-area .reaction-btn[aria-pressed="true"] {
  background: var(--team);
  color: var(--team-ink);
}
.reaction-btn[aria-pressed="true"] svg {
  fill: currentColor;
}
.like-count + .reaction-btn {
  margin-left: 4px;          /* 좋아요 수와 싫어요 버튼 사이를 조금 더 */
}
.like-count {
  color: var(--text-2);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.action-message {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

/* 댓글 카드 */
/* 제목 "댓글 N" (왼쪽) ---- 정렬 버튼 (오른쪽) */
.comments-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
}
.comments-head h2 {
  margin: 0;
}
.comment-form,
.reply-form {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
}
/* 밑줄 한 줄 입력칸 + 오른쪽 글자 수 (칸 · 바탕 없이 아래 선만) */
.comment-field {
  position: relative;
  flex: 1;
  min-width: 0;
}
.board-area .comment-field input {
  display: block;
  padding: 8px 76px 8px 2px;   /* 오른쪽은 글자 수 자리 */
  border: none;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  background: transparent;
}
.comment-count {
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  pointer-events: none;      /* 글자 수 위를 눌러도 입력칸이 눌려요 */
}
.reply-form {
  margin: 8px 0 4px 20px;
}
.comment-list,
.reply-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.comment {
  padding: 14px 0;
}
.comment-list > .comment + .comment {
  border-top: 1px solid var(--line);
}
/* 답글: 안쪽으로 들여쓰고 왼쪽에 얇은 줄 */
.reply-list {
  margin: 4px 0 0 20px;
  padding-left: 16px;
  border-left: 2px solid var(--line-strong);
}
.reply-list:empty {
  display: none;
}
.reply-list .comment {
  padding: 10px 0;
}
.comment-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}
.comment-meta .author-link {
  gap: 6px;
}
.comment-text {
  margin: 4px 0 6px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.comment-actions {
  display: flex;
  gap: 4px;
  margin-left: -8px;         /* 글자 줄에 맞춰 보이게 */
}
.board-area .comment-actions button {
  padding: 4px 8px;
  border: none;
  border-radius: var(--radius-ctl);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}
/* 신고 창 */
.report-reasons {
  list-style: none;
  padding: 0;
  margin: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.report-reasons label,
.block-option {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
/* 신고 창 안의 "이 사용자 차단하기" 선택칸 */
.block-option {
  margin: 0 0 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line-strong);   /* 신고 이유와 구분하는 선 */
}

/* ─── 글쓰기: 큰 카드 하나 (.bd-box) ─── */
.write-page form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
/* 말머리(좁게) + 제목(넓게) 한 줄 */
.write-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 12px;
}
.board-area .write-row input,
.board-area .write-row select {
  height: 46px;              /* 말머리 · 제목 칸 높이를 똑같이 */
}
.write-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
/* 내용 칸: 크기 조절 손잡이 없이, 옆 스크롤바도 숨겨요 (글이 길면 마우스 휠로는 내려가요) */
.board-area .write-field textarea {
  resize: none;
  scrollbar-width: none;
}
.board-area .write-field textarea::-webkit-scrollbar {
  display: none;
}
/* 글자 수: 내용 칸 아래 오른쪽 "12 / 300" */
.write-count {
  margin: -2px 4px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.write-page .error-message {
  margin: 0 0 16px;
  padding: 12px 16px;
  border-radius: var(--radius-card);
  background: color-mix(in srgb, #e03131 10%, var(--surface));
  color: #c92a2a;
  font-size: 0.9rem;
}
.write-buttons {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  padding-top: 18px;
  border-top: 1px solid var(--line-strong);
}

/* ─── 투표 · 선수 평점 ─── */
.poll-toggle {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 8px;
  color: var(--text-2);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}
.poll-fields {
  margin-top: -6px;
  padding: 16px;
  border-radius: var(--radius-card);
  background: var(--surface-2);
}
.poll-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));   /* 항목 입력칸 두 줄로 */
  gap: 8px;
}
.poll-hint {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.85rem;
}

/* 글 보기 안의 투표 · 평점: 카드 안의 흰 칸 */
.poll-section,
.ratings-section {
  margin: 24px 0 0;
  padding: 20px;
  border-radius: var(--radius-card);
  background: var(--surface);
}
.ratings-section h2 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}
#ratings-guide {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.85rem;
}
.poll-options,
.ratings-list {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.poll-options label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.poll-options li {
  font-size: 0.95rem;
}
.poll-bar {
  height: 8px;
  margin-top: 6px;
  background: var(--surface-3);
  border-radius: 999px;
  overflow: hidden;
}
.poll-bar-fill {
  height: 100%;
  background: color-mix(in srgb, var(--team) 45%, var(--surface-3));
  border-radius: 999px;
  transition: width 0.6s var(--ease);
}
.poll-options li.my-choice {
  font-weight: 700;
}
.poll-options li.my-choice .poll-bar-fill {
  background: var(--team);   /* 내가 고른 항목만 진한 팀 색 */
}
.poll-total {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}
.rating-row {
  display: flex;
  justify-content: space-between;   /* 이름은 왼쪽, 점수는 오른쪽 */
  align-items: center;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}
.board-area .rating-row select {
  width: auto;
  min-width: 72px;
  padding: 6px 10px;
  border-radius: var(--radius-ctl);
  background: var(--surface-2);
}

/* ─── 프로필 그림 (js/avatar.js) ───
   동그라미 안에 회색 기본 모습 + 장신구. 크기: 기본 28px / .avatar-sm 댓글 / .avatar-md 꾸미기 칸 / .avatar-lg 유저 페이지 / .avatar-xl 꾸미기 미리보기
   바탕은 흰색 (회색 카드 위). 흰 팝업 안에서는 회색 */
.avatar {
  display: inline-block;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface);
  vertical-align: middle;
}
.avatar svg {
  display: block;
  width: 100%;
  height: 100%;
}
.avatar-sm { width: 24px; height: 24px; }
.avatar-md { width: 44px; height: 44px; }
.avatar-lg { width: 112px; height: 112px; }
.avatar-xl { width: 168px; height: 168px; }

/* 글쓴이: (프로필) 닉네임 [배지] — 회원이면 누르면 그 사람 페이지
   (.board-area를 붙여 다크 모드의 링크 기본 색(파랑)보다 우선해요) */
.board-area .author-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--text-2);
  font-weight: 700;
  text-decoration: none;
}
.author-name {
  overflow: hidden;
  text-overflow: ellipsis;   /* 닉네임 + 배지가 길면 … 으로 */
  white-space: nowrap;
}
a.author-link:hover .author-name {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ─── 유저 페이지 (user.html) ───
   프로필 칸(회색 카드): 왼쪽 프로필 그림 + 연필 | 세로줄 | 오른쪽 닉네임 [배지] · 방문자 · 작성글
   아래 글 목록은 게시판 목록과 같은 모양 (.post-list) */
.user-card {
  display: flex;
  align-items: center;
  gap: 28px;
}
.user-avatar-wrap {
  position: relative;        /* 연필 버튼이 그림 오른쪽 아래에 붙는 기준 */
  flex-shrink: 0;
}
.user-avatar-wrap .avatar {
  display: block;
}
/* 연필: 팀 색 동그라미 (회색 카드 색 테두리로 그림과 살짝 떨어져 보여요) */
.board-area .user-edit-btn {
  position: absolute;
  right: -2px;
  bottom: -2px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 3px solid var(--surface-3);
  border-radius: 50%;
  background: var(--team);
  color: var(--team-ink);
  cursor: pointer;
  transition: background-color 0.2s;
}
.user-edit-btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.user-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  align-self: stretch;
  min-width: 0;
  padding-left: 28px;
  border-left: 1px solid var(--line-strong);
}
.bd-box .user-name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  font-size: 1.6rem;
  overflow-wrap: anywhere;
}
/* 배지: 흰 알약 (태그) */
.user-badge {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0;
}
/* 방문자 · 작성글: 흰 알약 두 개 */
.user-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}
.user-stats div {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.85rem;
}
.user-stats dt {
  color: var(--muted);
  font-weight: 600;
}
.user-stats dd {
  margin: 0;
  color: var(--text);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* ─── 프로필 꾸미기 창 ───
   왼쪽 큰 미리보기 / 오른쪽 칸마다 [이름] + 장신구 한 줄(밀어서 가운데 네모에 두면 선택) + 아래 이름 칸
   이름 칸은 늘 한 줄 자리를 차지해서, 잠긴 장신구 안내가 나와도 창 크기가 그대로예요 */
.match-dialog.avatar-dialog {
  width: min(640px, 92vw);
  --avatar-chip: color-mix(in srgb, var(--text) 7%, transparent);   /* 팝업 바탕 위 옅은 칸 (라이트 · 다크 모두 보여요) */
  --tile: 52px;              /* 장신구 칸 크기 */
}
.avatar-hint {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}
.avatar-editor {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-top: 18px;
}
.avatar-dialog .avatar {
  background: var(--avatar-chip);
}
.avatar-rows {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}
.avatar-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  grid-template-areas: "label strip" ". name";
  align-items: center;
  column-gap: 10px;
}
.avatar-row-label {
  grid-area: label;
  color: var(--text-2);
  font-size: 0.9rem;
  font-weight: 700;
}
/* 장신구 줄: 옆으로 밀리고, 칸이 가운데에 딱 붙어요. 양 끝은 흐리게 */
.avatar-strip-wrap {
  grid-area: strip;
  position: relative;
  min-width: 0;
}
.avatar-strip {
  position: relative;        /* 칸 위치(offsetLeft)를 줄 기준으로 */
  display: flex;
  gap: 8px;
  padding: 6px calc(50% - var(--tile) / 2);   /* 첫 칸 · 마지막 칸도 가운데에 올 수 있게 */
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  border-radius: var(--radius-card);
  background: var(--avatar-chip);
  cursor: grab;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent);
  touch-action: pan-x;
}
.avatar-strip::-webkit-scrollbar {
  display: none;
}
.avatar-strip.dragging {
  scroll-snap-type: none;    /* 마우스로 끄는 동안은 자유롭게 */
  cursor: grabbing;
}
.avatar-strip:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--team) 45%, transparent);
  outline-offset: 2px;
}
.board-area .avatar-tile {
  position: relative;
  display: grid;
  flex: 0 0 var(--tile);
  place-items: center;
  width: var(--tile);
  height: var(--tile);
  padding: 0;
  border: none;
  border-radius: 12px;
  background: none;
  cursor: inherit;
  scroll-snap-align: center;
}
.avatar-tile .avatar {
  pointer-events: none;      /* 끌 때 그림이 따로 잡히지 않게 */
}
.avatar-dialog .avatar-tile .avatar {
  background: var(--surface);
}
/* 없음 칸: 빗금 친 동그라미 */
.avatar-none svg {
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.6;
  stroke-linecap: round;
}
/* 잠긴 장신구: 흐리게 + 오른쪽 아래 자물쇠 */
.avatar-tile.locked .avatar {
  opacity: 0.45;
}
.avatar-tile.locked::after {
  content: '🔒';
  position: absolute;
  right: 0;
  bottom: 0;
  font-size: 12px;
  line-height: 1;
}
/* 가운데 네모: 줄 위에 겹친 팀 색 테두리 (여기 온 장신구가 골라져요) */
.avatar-strip-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  width: calc(var(--tile) + 6px);
  height: calc(var(--tile) + 6px);
  border-radius: 14px;
  box-shadow: inset 0 0 0 2.5px var(--team);
  transform: translate(-50%, -50%);
  pointer-events: none;
}
/* 이름 칸: 늘 한 줄 (잠긴 장신구면 필요한 배지) */
.avatar-row-name {
  grid-area: name;
  height: 1.5em;
  margin: 2px 0 0;
  overflow: hidden;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.avatar-row-name.empty,
.avatar-row-name.locked {
  color: var(--muted);
}
.avatar-dialog .error-message {
  margin: 12px 0 0;
}
.avatar-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}
.board-area .bd-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* 게시판 머리 줄: 탭 + 도구가 한 줄에 안 들어가는 폭(태블릿 등)에서는 도구 줄이 탭 위로 올라가요 */
@media (max-width: 1000px) {
  .board-head {
    flex-wrap: wrap;
    gap: 12px;
    height: auto;
  }
  .board-actions {
    order: -1;
    width: 100%;
    padding-bottom: 0;
  }
  .board-search {
    flex: 1;
  }
  .flair-filter {
    flex-wrap: wrap;         /* 탭이 넘치면 다음 줄로 */
  }
}

/* 태블릿 세로 등 좁은 화면 (페이지 · 카드 여백은 맨 위 :root의 숫자가 화면 폭에 맞춰 줄어요) */
@media (max-width: 760px) {
  .board-area .post-row {
    flex-wrap: wrap;
    gap: 6px;
  }
  .post-stats {
    width: 100%;
  }
  .write-row,
  .poll-inputs {
    grid-template-columns: 1fr;
  }
}

/* 움직임 줄이기 */
html[data-motion="reduce"] .board-area .bd-btn,
html[data-motion="reduce"] .poll-bar-fill {
  transition: none;
}

/* 게시판 정지 중 안내 (목록 위) · 댓글을 못 올렸을 때 이유 */
.board-ban-notice {
  margin: 0 0 14px;
  padding: 12px 16px;
  border-radius: var(--radius-card);
  background: color-mix(in srgb, #e03131 10%, var(--board-bg, var(--bg)));
  color: var(--text);
  font-size: 0.88rem;
  line-height: 1.5;
}
.comment-error {
  margin: -8px 0 16px;
  font-size: 0.85rem;
}

/* hidden 이 붙은 칸은 위에서 display를 줘도 꼭 숨겨요 (맨 아래에 둬야 이겨요) */
.board-area [hidden],
.board-area[hidden] {
  display: none;
}

/* ─── 사이트 전체 안내 (common.js의 applySiteNotices) ─── */
/* 위쪽 메뉴 바로 아래 알림 띠 (관리자 페이지 → 설정에서 켜요) */
.site-banner {
  padding: 10px 20px;
  background: var(--team, #3D195B);
  color: var(--team-ink, #fff);
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
}
/* 관리자 구경 모드: 화면 오른쪽 아래 "관리자 사이트로" 버튼 (common.js의 showStaffReturnButton) */
.staff-return {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1500;
  padding: 11px 18px;
  border-radius: 999px;
  background: #3D195B;       /* PL 보라 = 관리자 페이지 색 */
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}
.staff-return:hover {
  background: #522a78;
}

/* 사이트 정지 · 점검 중: 화면 전체를 덮어요 */
.site-gate-open,
.site-gate-open body {
  overflow: hidden;
}
.site-gate {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(6px);
}
.site-gate-box {
  width: 100%;
  max-width: 440px;
  box-sizing: border-box;
  padding: 32px 28px;
  border-radius: var(--radius-box);
  background: var(--surface);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
  text-align: center;
}
.site-gate-box h1 {
  margin: 0 0 12px;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.site-gate-box p {
  margin: 0;
  color: var(--text-2);
  line-height: 1.7;
  white-space: pre-line;
}
.site-gate-button {
  margin-top: 20px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-ctl);
  background: var(--team, #3D195B);
  color: var(--team-ink, #fff);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

/* ─── 배지 팝업 (뼈대용 임시 스타일) ─── */
.badge-dialog p {
  font-size: 1.1em;
  margin: 12px 0 4px;
}

/* ─── 주요 뉴스 (폭 · 여백은 "페이지 틀") ─── */

/* 위쪽 줄: 왼쪽 걸러 보기, 오른쪽 끝 검색 */
.news-toolbar {
  flex-wrap: wrap;           /* 화면이 좁으면 검색칸이 다음 줄로 */
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: var(--panel-gap);
}

/* 걸러 보기: 고르는 칩 3개 (다른 페이지의 고르는 칩처럼 알약 모양). 고르지 않은 칩은 옅은 회색, 고른 칩은 팀 색으로 채워요
   마우스 올림 · 누름 반응은 아래 "버튼 반응 (사이트 전체)" */
.news-filter {
  display: flex;
  gap: 8px;
}

.news-filter button {
  padding: 9px 19px;         /* 예전 윤곽선(1px) 자리까지 여백으로: 크기는 그대로 */
  border: none;              /* 윤곽선이 없어야 마우스를 올렸을 때 막이 칩 전체를 덮어요 */
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
  font: inherit;
  font-size: 0.95em;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

.news-filter button.active {
  background: var(--team);
  color: var(--team-ink);
}

/* ═════════════════════════════════════════════
   검색칸 (사이트 공통: 뉴스 · 게시판 · FAQ) — 입력칸 + 돋보기 버튼이 한 덩어리
   누르면(글을 칠 때) 테두리가 검은색으로 진해져요. ✕(지우기)는 검은 얇은 선, 돋보기 쪽에 붙어 있어요.
   ═════════════════════════════════════════════ */
.site-search {
  display: flex;
  width: min(320px, 100%);
  box-sizing: border-box;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-ctl);
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.2s;
}
.site-search:focus-within {
  border-color: var(--text);   /* 검은 윤곽선 (다크 모드에서는 밝은 선) */
}

.site-search input,
html[data-theme="dark"] .site-search input {   /* 다크 모드 기본 입력칸 색보다 우선 */
  flex: 1;
  min-width: 0;
  padding: 8px 0 8px 14px;   /* 오른쪽은 비워서 ✕가 돋보기 쪽에 붙어요 */
  border: none;
  outline: none;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 0.95em;
}
/* ✕(지우기): 브라우저 기본 그림 대신 검은 얇은 ✕ (글자가 있을 때만 보여요) */
.site-search input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  margin: 0 0 0 8px;
  background: var(--text);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M2.5 2.5l9 9M11.5 2.5l-9 9' stroke='black' stroke-width='1.3' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M2.5 2.5l9 9M11.5 2.5l-9 9' stroke='black' stroke-width='1.3' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
  cursor: pointer;
}

.site-search-button {
  flex: 0 0 auto;
  width: 38px;
  padding: 0;
  border: none;
  background: none;
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.2s;
}

.site-search-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
}

/* 뉴스: 위쪽 줄 오른쪽 끝 */
.news-search {
  margin-left: auto;         /* 오른쪽 끝으로 밀기 */
}

/* 기사가 없을 때 · 검색 결과가 없을 때 안내: 크게, 가운데 */
/* 페이지 번호: 상자 없이 숫자만. 지금 페이지는 팀 색 + 굵게 */
.news-page .pagination {
  gap: 4px;
  margin-top: 28px;
}

.news-page .pagination button {
  min-width: 32px;
  height: 32px;
  padding: 0 6px;
  border: none;
  border-radius: var(--radius-ctl);
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.95em;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: color 0.2s;
}


.news-page .pagination button.active {
  color: var(--team);
  font-weight: 800;
}

.news-page .pagination-gap {
  min-width: 24px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.news-empty {
  margin: 64px 0;
  color: var(--muted);
  font-size: 1.4em;
  font-weight: 600;
  text-align: center;
}

.news-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);   /* 한 줄에 3개 */
  gap: var(--panel-gap);
}

/* 화면이 좁으면(패드 세로 등) 한 줄에 2개 */
@media (max-width: 820px) {
  .news-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 카드 한 칸: 화살표와 점을 카드 위에 겹쳐 놓으려고 기준점(relative)이 돼요 */
.news-card-wrap {
  position: relative;
}

/* 주요 기사(내 팀 다음 경기 관련): 왼쪽 위 모서리에 비스듬한 띠
   흰 띠 + 진한 글자: 어떤 팀 색 카드(검정 · 노랑 · 빨강…) 위에서도 잘 보여요. 카드 모서리(12px) 밖으로는 잘라요 */
.news-ribbon {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  width: 104px;
  height: 104px;
  overflow: hidden;
  border-top-left-radius: 12px;
  pointer-events: none;      /* 띠를 눌러도 카드가 눌려요 */
}
.news-ribbon span {
  position: absolute;
  top: 24px;
  left: -34px;
  width: 140px;
  padding: 6px 0;
  background: #ffffff;
  color: #111214;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-align: center;
  transform: rotate(-45deg);
  box-shadow: 0 2px 8px rgba(17, 18, 20, 0.28);
}

/* 카드: 인스타그램처럼 세로가 조금 긴 모양 */
.news-card {
  aspect-ratio: 4 / 5;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 24px 40px 36px;   /* 양옆은 화살표 자리, 아래는 점 자리 */
  border-radius: 12px;
  box-sizing: border-box;
  overflow: hidden;
  cursor: pointer;
  touch-action: pan-y;       /* 가로로 미는 건 넘기기, 세로 스크롤은 그대로 */
}

/* 첫 장(제목)은 글자를 아래쪽에 */
.news-card[data-slide="cover"] {
  justify-content: flex-end;
}

/* PL 공통 기사: 흰색 카드 (배경에 묻히지 않게 테두리) */
.news-card-pl {
  background: #ffffff;
  color: #111111;
  border: 2px solid #dddddd;
}

.news-card .slide-title {
  margin: 0;
  font-size: 1.2em;
}

.news-card .slide-subtitle {
  margin: 0;
  font-size: 0.85em;
  opacity: 0.85;
}

.news-card .slide-text {
  margin: 0;
  font-size: 0.95em;
  line-height: 1.6;
}

/* 반투명 화살표: 평소엔 안 보이고 마우스를 올리면 나타나요 */
.news-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  color: #ffffff;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
}

.news-arrow-prev {
  left: 6px;
}

.news-arrow-next {
  right: 6px;
}

/* 키보드(Tab)로 골랐을 때만 :focus-visible 이에요.
   (마우스로 누르고 팝업을 닫으면 카드가 선택된 채로 남아서 :focus-within을 쓰면 화살표가 계속 떠 있어요) */
.news-card-wrap:hover .news-arrow,
.news-card-wrap:has(:focus-visible) .news-arrow {
  opacity: 1;
}

/* 마우스가 없는 기기(패드)에서는 화살표 대신 손가락으로 밀어서 넘겨요 */
@media (hover: none) {
  .news-arrow {
    display: none;
  }
}

/* 뉴스 카드의 화살표: 배경 없이 크고 굵은 < > , 70% 투명한 검은색 (클럽소개 슬라이드쇼는 위의 동그란 모양 그대로) */
.news-card-wrap .news-arrow {
  width: 40px;
  height: 56px;
  padding: 0;
  border-radius: 0;
  background: none;
  color: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}

.news-card-wrap .news-arrow-prev {
  left: 2px;
}

.news-card-wrap .news-arrow-next {
  right: 2px;
}

/* 마우스를 올리면 화살표가 진해져요 (자리는 그대로) */
.news-card-wrap .news-arrow:hover {
  color: rgba(0, 0, 0, 0.55);
}

.news-card-wrap .news-arrow svg {
  width: 40px;
  height: 40px;
}

.viewer-arrow svg {
  width: 30px;
  height: 30px;
}

.news-card-wrap .news-arrow svg,
.viewer-arrow svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.15s var(--ease);
}

/* 첫 장(제목)에 마우스를 올리면 오른쪽 화살표가 양옆으로 왔다갔다: "넘겨 볼 수 있어요" 표시
   (화살표 위에 직접 올리면 멈추고 진해져요) */
.news-card-wrap:hover .news-card[data-slide="cover"] ~ .news-arrow-next:not(:hover) svg {
  animation: news-arrow-nudge 0.6s ease-in-out infinite;
}

@keyframes news-arrow-nudge {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(6px); }
}

@media (hover: none) {
  .news-card-wrap .news-arrow {
    display: none;
  }
}

/* 움직임 줄이기 설정: 화살표 · 버튼이 움직이지 않게 */
html[data-motion="reduce"] .news-card-wrap .news-arrow svg,
html[data-motion="reduce"] .viewer-arrow svg,
html[data-motion="reduce"] .news-filter button {
  transform: none !important;
  transition: none;
  animation: none !important;
}

/* 몇 번째 장인지 점으로 표시: ● ○ ○ */
.news-dots {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 4px;
  font-size: 0.6em;
  pointer-events: none;      /* 점 위를 눌러도 카드가 눌리게 */
  opacity: 0;                /* 평소엔 숨기고, 마우스를 올리면 화살표와 같이 나타나요 */
  transition: opacity 0.15s;
}

/* 뉴스 카드의 장 번호: 오른쪽 위, 반투명 검정(30%) 바탕에 흰 글씨 "2 / 5"
   마우스를 올렸을 때 · 넘겨 본 카드일 때 보여요 */
.news-count {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.3);
  color: #ffffff;
  font-size: 0.8em;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  pointer-events: none;      /* 번호 위를 눌러도 카드가 눌리게 */
  opacity: 0;
  transition: opacity 0.15s;
}

.news-card-wrap:hover .news-count,
.news-card-wrap:has(:focus-visible) .news-count,
.news-card-wrap.is-flipped .news-count {
  opacity: 1;
}

/* 마우스가 없는 기기(패드)는 "올리기"가 없어서 번호를 항상 보여줘요 (밀어서 넘길 수 있다는 표시) */
@media (hover: none) {
  .news-count {
    opacity: 1;
  }
}

/* ─── 장 내용 (목록 카드 · 보기 창 공통) ─── */
.slide-heading {
  margin: 0 0 8px;
}

.slide-sources {
  margin: 0;
  padding-left: 18px;
}

.slide-sources a {
  color: inherit;
}

.slide-time {
  margin: 12px 0 0;
  font-size: 0.85em;
  opacity: 0.8;
}

/* ─── 카드뉴스 보기 창 ─── */
.news-viewer {
  width: min(460px, 92vw);
  padding: 0;
  border: none;
  border-radius: var(--radius-panel);
  overflow: hidden;
}

.news-viewer::backdrop {
  background: rgba(0, 0, 0, 0.6);
}

.viewer-close {
  position: absolute;
  top: 8px;
  right: 12px;
  color: inherit;
}

/* ✕에 마우스를 올리면: 하얀 동그라미 대신 반투명 동그라미 (카드 색이 비쳐 보여요) */

/* 흰 카드(PL 공통 기사)에서는 흰 반투명이 안 보이니 검은 반투명으로 */

.viewer-stage {
  aspect-ratio: 4 / 5;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px 28px;
  box-sizing: border-box;
  touch-action: pan-y;
  user-select: none;         /* 끌 때 글자가 선택되지 않게 */
  cursor: grab;
}

.viewer-stage.news-card-pl {
  border: none;
}

.viewer-stage .slide-title {
  margin: 0 0 12px;
  font-size: 1.6em;
}

.viewer-stage .slide-subtitle,
.viewer-stage .slide-text {
  margin: 0;
  line-height: 1.6;
}

.viewer-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: #ffffff;
  color: #111111;
}

/* 보기 창 아래 화살표: 박스 없이 < > 만 */
.viewer-arrow {
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: var(--radius-ctl);
  background: none;
  color: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.viewer-arrow:disabled {
  opacity: 0.2;              /* 첫 장 · 마지막 장에서는 흐리게 */
  cursor: default;
}

/* ─── 경기 결과 (다음 경기 페이지의 결과 화면) ─── */
/* 진영 뒤에 반투명하게 크게 쓴 점수 */
.lineup-half {
  position: relative;
}
.big-score {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 20em;
  font-weight: bold;
  line-height: 1;
  color: #ffffff;
  opacity: 0.2;
  pointer-events: none;      /* 점수가 선수 이름을 가리거나 클릭을 막지 않게 */
  user-select: none;
}
.lineup-half > *:not(.big-score):not(h3) {
  position: relative;        /* 선수 이름이 점수보다 앞에 보이게 */
}

/* 선수 이름 아래: 골(공) · 어시스트(축구화) 아이콘 + 시간 (js의 addPlayerStats)
   같은 아이콘이 2개 이상이면 겹쳐요 → 아이콘마다 흰 동그라미 바탕(등번호 원과 같은 흰색) */
.player-stats {
  position: absolute;
  top: 100%;
  left: -60px;               /* 이름과 같은 방식으로 가운데 정렬 */
  right: -60px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: calc(6px * var(--ps, 1));
  margin-top: calc(21px * var(--ps, 1));   /* 이름 글자 아래 */
  white-space: nowrap;
  pointer-events: auto;      /* 마우스를 올리면 골 · 어시스트 수와 시간 */
}
.stat-group {
  display: flex;
  align-items: center;
  gap: calc(3px * var(--ps, 1));
}
.stat-icons {
  display: flex;
}
.stat-icon {
  display: grid;
  place-items: center;
  width: calc(15px * var(--ps, 1));
  height: calc(15px * var(--ps, 1));
  border-radius: 50%;
  background: #ffffff;
  color: #1a1b1e;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}
.stat-icon + .stat-icon {
  margin-left: calc(-7px * var(--ps, 1));   /* 반쯤 겹쳐요 */
}
.stat-icon .btn-icon {
  width: calc(12px * var(--ps, 1));
  height: calc(12px * var(--ps, 1));
  stroke-width: 1.8;
}
.stat-times {
  color: #ffffff;
  font-size: calc(0.68rem * var(--ps, 1));
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65);
}

/* 원 왼쪽 위: 카드 (경고 노랑 · 퇴장 빨강), 살짝 기울인 작은 네모 */
.player-card {
  position: absolute;
  z-index: 1;
  top: calc(-4px * var(--ps, 1));
  left: calc(-3px * var(--ps, 1));
  width: calc(9px * var(--ps, 1));
  height: calc(12px * var(--ps, 1));
  border-radius: 2px;
  box-shadow: 0 0 0 1.5px #ffffff, 0 1px 3px rgba(0, 0, 0, 0.4);
  rotate: -12deg;
  pointer-events: auto;
}
.player-card.yellow { background: #f5c518; }
.player-card.red { background: #e5383b; }

/* 원 오른쪽 위: 교체 아이콘 (누르면 들어온 선수, 다시 누르면 나간 선수) */
.sub-toggle {
  position: absolute;
  z-index: 2;
  top: calc(-6px * var(--ps, 1));
  left: calc(100% - 10px * var(--ps, 1));
  display: flex;
  align-items: center;
  gap: calc(2px * var(--ps, 1));
  height: calc(17px * var(--ps, 1));
  min-width: calc(17px * var(--ps, 1));
  box-sizing: border-box;
  padding: 0 calc(2px * var(--ps, 1));
  border: none;
  border-radius: 999px;
  background: #ffffff;
  color: #1a1b1e;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  font: inherit;
  cursor: pointer;
  pointer-events: auto;
}
.sub-toggle .btn-icon {
  width: calc(12px * var(--ps, 1));
  height: calc(12px * var(--ps, 1));
  stroke-width: 2.2;
}
.sub-toggle[aria-pressed="true"] {   /* 들어온 선수 쪽: 팀 색 바탕 + 시간 */
  padding-right: calc(5px * var(--ps, 1));
  background: var(--spot);
  color: var(--spot-ink);
}
.sub-time {
  font-size: calc(0.66rem * var(--ps, 1));
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.sub-toggle:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

/* 들어온 선수: 나간 선수 원 위에 딱 겹친 층 (같은 모양). 교체 아이콘을 누르면 보여요 */
.sub-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: none;
  place-items: center;
  border-radius: 50%;
  background: var(--spot);
  box-shadow: 0 8px 12px -6px rgba(0, 0, 0, 0.55);
}
.player-spot.subbed > .sub-layer {
  display: grid;
}
/* 나간 선수는 들어온 선수 밑으로: 이름 · 기록 · 카드 · 교체 아이콘은 숨겨요 (들어온 선수의 것이 그 자리에) */
.player-spot.subbed > :is(.player-name, .player-stats, .player-card, .sub-toggle) {
  visibility: hidden;
}

/* 경기 선택 창: 고를 수 없는 경기는 점선 칸 + 흐리게 */
.match-list button:disabled {
  background: none;
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--muted);
  cursor: not-allowed;
}

/* 경기 선택 창 제목 줄: ◀ 7라운드 경기 ▶ [이번 라운드] ✕ */
.dialog-rounds {
  flex: 1;
  margin-bottom: 0;
  margin-right: 8px;
}
.match-list {
  touch-action: pan-y;   /* 터치 기기: 옆으로 밀면 라운드 넘기기 */
}

/* ─── 다음 경기: 준비 안 된 경기 안내 ─── */
.match-notice {
  margin: 0;
  padding: 14px 20px;
  border-radius: 16px;
  background: var(--surface-2);
  color: var(--text-2);
}

/* ─── 리그 테이블 ─── */
/* 다음 경기 페이지처럼 옅은 회색 둥근 칸(.nm-box). 색은 테마 변수(--surface 등)라 다크 모드도 따라가요.
   폭 · 바깥 여백은 "페이지 틀", 칸 안쪽 여백 · 칸 사이는 맨 위 :root의 숫자 */
/* 겉모습 */
.table-page {
  /* 순위 구역 색: 표의 막대 · 아래 안내 · 흐름 그래프가 같이 써요 */
  --zone-ucl: #2f6fdb;
  --zone-uel: #e8890c;
  --zone-uecl: #2f9e44;
  --zone-relegation: #d6336c;

  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;   /* 왼쪽 순위표 넓게, 오른쪽 줄은 고정 폭 */
  gap: var(--panel-gap);
  align-items: start;
}

/* 좁은 화면(작은 태블릿)에서는 위아래로 */
@media (max-width: 960px) {
  .table-page {
    grid-template-columns: minmax(0, 1fr);
  }
}

.table-page .nm-box {
  min-height: 0;
}

.table-page .fixture-box {
  position: relative;   /* 안내를 누른 경기 칸 위에 덮을 때 기준 */
}

/* 오른쪽 줄: 경기 목록 아래에 현재 흐름 칸 */
.table-side {
  display: flex;
  flex-direction: column;
  gap: var(--panel-gap);
  min-width: 0;
}

/* 오른쪽 제목 줄: ◀ 제목 ▶ [이번 라운드] */
.fixture-header {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 16px;
}

.fixture-header h2 {
  margin: 0;
}

.round-arrow {
  width: 30px;
  height: 30px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: none;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.2s;
}
.round-arrow svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.round-arrow:hover {
  color: var(--text);   /* 바탕 반응은 아래 "버튼 반응 (사이트 전체)" */
}

.round-current {
  margin-left: auto;   /* 오른쪽 끝으로 */
  padding: 5px 12px;
  border: none;
  border-radius: var(--radius-ctl);
  background: var(--team);
  color: var(--team-ink);
  font: inherit;
  font-size: 0.8em;
  font-weight: 700;
  cursor: pointer;
}

/* 표가 화면보다 넓으면 표만 옆으로 스크롤 */
/* 표 전체를 감싸는 흰 둥근 판 (표가 화면보다 넓으면 판 안에서만 옆으로 스크롤) */
.table-scroll {
  overflow-x: auto;
  padding: 10px 0 4px;    /* 양옆 여백 없음: 구역 막대가 판 맨 왼쪽에 붙어요 */
  border-radius: var(--radius-card);
  background: var(--surface);
}

.league-table th:first-child,
.league-table td:first-child {
  padding-left: 22px;
}
.league-table th:last-child,
.league-table td:last-child {
  padding-right: 18px;
}

.league-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92em;
  font-variant-numeric: tabular-nums;   /* 숫자 폭을 똑같이 → 세로 줄이 반듯하게 */
}

.league-table th,
.league-table td {
  padding: 7px 8px;
  text-align: center;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}

.league-table th {
  padding-top: 0;
  font-size: 0.82em;
  font-weight: 600;
  color: var(--muted);
}

.league-table tbody td:first-child {
  position: relative;
  width: 28px;
  color: var(--text-2);
}

.league-table .col-team {
  text-align: left;
  font-weight: 600;
}

/* 순위 구역: 순위 숫자 왼쪽(줄 맨 왼쪽)에 색 막대 */
.league-table tbody tr:last-child td {
  border-bottom: none;
}

/* 같은 구역 줄끼리 막대가 위아래로 이어져요 (줄 사이 선까지 덮게 아래로 1px 더). 구역의 첫 줄 · 끝 줄만 끝이 둥글게 */
.league-table tbody tr[class*="zone-"] td:first-child::before {
  content: '';
  position: absolute;
  left: 0;               /* 흰 판 맨 왼쪽 */
  top: 0;
  bottom: -1px;
  width: 5px;
  background: var(--zone);
}
.league-table tbody tr.zone-start td:first-child::before {
  top: 8px;
  border-top-right-radius: 3px;
}
.league-table tbody tr.zone-end td:first-child::before {
  bottom: 8px;
  border-bottom-right-radius: 3px;
}
.league-table tr.zone-ucl        { --zone: var(--zone-ucl); }
.league-table tr.zone-uel        { --zone: var(--zone-uel); }
.league-table tr.zone-uecl       { --zone: var(--zone-uecl); }
.league-table tr.zone-relegation { --zone: var(--zone-relegation); }

.league-table .col-points {
  font-weight: 800;
}

/* 줄 위에 덧칠하는 옅은 그림자색 (글자색을 아주 조금 섞어서 → 밝은 화면에선 진하게, 다크 모드에선 밝게)
   배경 그림으로 덧칠해서 내 팀 줄(팀 색 바탕) 위에서도 똑같이 진해져요 */
.league-table {
  --row-hover: color-mix(in srgb, var(--text) 5%, transparent);
  --row-selected: color-mix(in srgb, var(--text) 9%, transparent);
}

.league-table tbody tr {
  cursor: pointer;
}

.league-table tbody tr:hover {
  background-image: linear-gradient(var(--row-hover), var(--row-hover));
}

/* 내 팀 줄: 팀 색을 아주 옅게 (색은 JavaScript가 --team-tint로 넣어줘요). 글씨는 다른 줄과 같은 굵기 */
.league-table tr.my-team {
  background-color: var(--team-tint);
}

/* 누른 팀 줄: 윤곽선 없이 조금 더 진하게 */
.league-table tbody tr.selected {
  background-image: linear-gradient(var(--row-selected), var(--row-selected));
}

.league-table tbody tr:focus-visible {
  outline: 2px solid var(--team);
  outline-offset: -2px;
}

/* 최근 5경기: 색 있는 정사각형 안에 하얀 글자, 오른쪽 끝이 최근 */
.form-list {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
}

.form-box {
  width: 22px;
  height: 22px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border-radius: 6px;
  color: white;
  font-size: 0.78em;
  font-weight: 700;
}
.form-W { background: #2f9e44; }
.form-D { background: #868e96; }
.form-L { background: #e03131; }

/* 표 아래 색 막대 안내 (작은 글씨) */
.zone-legend {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: 0.8em;
  color: var(--text-2);
}

.zone-legend li {
  display: flex;
  align-items: center;
  gap: 6px;
}

.zone-mark {
  width: 4px;
  height: 12px;
  border-radius: 2px;
}
.zone-mark.zone-ucl        { background: var(--zone-ucl); }
.zone-mark.zone-uel        { background: var(--zone-uel); }
.zone-mark.zone-uecl       { background: var(--zone-uecl); }
.zone-mark.zone-relegation { background: var(--zone-relegation); }

/* 오른쪽 경기 목록: 흰 칸 하나에 위는 날짜(작게), 아래는 팀 이름 */
.fixture-list {
  touch-action: pan-y;   /* 터치 기기: 위아래 스크롤은 그대로, 옆으로 밀기는 라운드 넘기기 */
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--card-gap);
}

.fixture-item {
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  border: 1px solid transparent;   /* 끝난 경기(점선)와 크기를 맞추는 자리 */
  border-radius: var(--radius-card);
  background-color: var(--surface);
  background-clip: padding-box;    /* 흰 바탕은 테두리 안쪽만: 마우스를 올렸을 때 막이 칸 전체를 덮어요 (가장자리 줄 없이) */
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s;
}

.fixture-when {
  font-size: 0.78em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.fixture-teams {
  font-size: 0.92em;
  font-weight: 600;
}

/* 마우스 올림 · 누름 반응은 아래 "버튼 반응 (사이트 전체)" */

/* 끝난 경기 중 누를 수 없는 칸: 바탕 없이 흐리게 */
.fixture-item.finished {
  background-color: transparent;
  border-color: var(--line-strong);
  border-style: dashed;
  cursor: default;
}
.fixture-item.finished .fixture-teams {
  color: var(--text-2);
}
/* 결과를 볼 수 있는 끝난 경기: 실선 + 누를 수 있게 */
.fixture-item.finished.has-result {
  border-style: solid;
  cursor: pointer;
}

/* 내 팀 경기 (라운드별 목록에서만): 왼쪽에 팀 색 직선 막대.
   흰 바탕과 같은 자리(테두리 안쪽)부터 칠해서 칸 위아래 끝까지 꽉 차고, 둥근 모서리에서는 모서리 모양대로 잘려요 */
.fixture-item.my-match {
  background-image: linear-gradient(90deg, var(--team) 0 5px, transparent 5px);
  background-origin: padding-box;
}

/* 아직 준비 안 된 경기: 회색 칸 (누르면 안내만 나와요) */
.fixture-item.not-ready {
  background-color: color-mix(in srgb, var(--text) 6%, transparent);
}
.fixture-item.not-ready .fixture-teams {
  color: var(--text-2);
}
.fixture-item.my-match .fixture-teams {
  font-weight: 800;
}

/* 준비 안 된 경기를 눌렀을 때 안내: 누른 칸 자리에 같은 크기로 덮어요 (위치 · 크기는 JavaScript가 넣어요).
   빨간색, 나타날 때 좌우로 흔들려요. 마우스는 통과해서 같은 칸을 또 누를 수 있어요 */
.fixture-box .fixture-notice {
  position: absolute;
  z-index: 1;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0 14px;
  pointer-events: none;
  border-radius: var(--radius-card);
  background: color-mix(in srgb, #e03131 12%, var(--surface));
  color: #c92a2a;
  font-size: 0.88em;
  font-weight: 600;
}
html[data-theme="dark"] .fixture-box .fixture-notice {
  color: #ff8787;   /* 어두운 바탕에서도 잘 읽히는 빨강 */
}
.fixture-notice.shake {
  animation: notice-shake 0.4s ease;
}

@keyframes notice-shake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-6px); }
  40%      { transform: translateX(6px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(4px); }
}

html[data-motion="reduce"] .fixture-notice.shake {
  animation: none;
}

/* ─── 현재 흐름 (팀을 골랐을 때만) ─── */
.flow-summary {
  margin-bottom: 18px;
}

.flow-summary p {
  margin: 0;
  line-height: 1.5;
}

/* 연속 기록: 크게. 앞에 결과 색 점 */
.flow-summary .flow-streak {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.flow-streak::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #868e96;
}
.flow-streak.streak-W::before,
.flow-streak.streak-lastW::before,
.flow-streak.streak-unbeaten::before { background: #2f9e44; }
.flow-streak.streak-L::before,
.flow-streak.streak-lastL::before,
.flow-streak.streak-winless::before  { background: #e03131; }

.flow-summary .flow-record {
  margin-top: 4px;
  font-size: 0.9rem;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

/* 라운드별 순위 그래프: 흰 칸 안에 */
.flow-chart {
  padding: 14px 14px 8px;
  border-radius: 12px;
  background: var(--surface);
}

.flow-chart .flow-chart-caption {
  margin: 0 0 8px;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-2);
}
.flow-chart-caption strong {
  display: block;
  color: var(--text);
  font-size: 1.05rem;
}

.flow-chart svg {
  display: block;
  width: 100%;
  max-width: 420px;   /* 좁은 화면(한 줄 배치)에서 그래프 글씨가 너무 커지지 않게 */
  height: auto;
  overflow: visible;
}

.chart-zone                 { opacity: 0.09; }
.chart-zone.zone-ucl        { fill: var(--zone-ucl); }
.chart-zone.zone-uel        { fill: var(--zone-uel); }
.chart-zone.zone-uecl       { fill: var(--zone-uecl); }
.chart-zone.zone-relegation { fill: var(--zone-relegation); }

.chart-grid {
  stroke: var(--line);
  stroke-width: 1;
}

.chart-axis {
  fill: var(--muted);
  font-size: 10px;
}

.chart-line {
  fill: none;
  stroke: var(--team);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.chart-dot {
  fill: var(--team);
  stroke: var(--surface);   /* 선과 겹치는 곳을 바탕색 테두리로 띄우기 */
  stroke-width: 2;
}

/* 점에 마우스를 올리기 쉽게 넓은 투명 칸 */
.chart-hit {
  fill: transparent;
}

.chart-label {
  fill: var(--text);
  font-size: 11px;
  font-weight: 800;
}

.flow-box .flow-subtitle {
  margin: 22px 0 10px;
  font-size: 0.95rem;
  font-weight: 800;
}

/* 팀 상황 분석: 앞에 작은 팀 색 점 */
.flow-notes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.flow-notes li {
  position: relative;
  padding-left: 14px;
  font-size: 0.88em;
  line-height: 1.55;
  color: var(--text-2);
}
.flow-notes li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--team);
}

/* ─── 클럽소개 (뼈대용 임시 스타일) ─── */
/* 페이지 전체가 화면 한 장에 맞춰져요 (바깥 스크롤 없음, 글은 칸 안에서만 스크롤) */
.club-page {
  --page-bottom: 16px;       /* 한 화면에 딱 맞추는 페이지라 아래 여백은 작게 (폭 · 옆 여백은 "페이지 틀") */
  flex: 1;                   /* 메뉴를 뺀 나머지 높이를 모두 차지 */
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.club-picker {
  margin-bottom: 12px;
}

.club-picker select {
  font: inherit;
  padding: 4px 8px;
}

/* 왼쪽 로고(좁게) + 오른쪽 글(넓게) */
.club-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 2fr 3fr;
  grid-template-rows: minmax(0, 1fr);
  gap: var(--panel-gap);
}

.club-visual {
  display: flex;
  flex-direction: column;
  min-height: 0;
  box-sizing: border-box;
}

.club-logo,
.club-slideshow {
  flex: 1;                   /* 왼쪽 칸 높이를 꽉 채워요 */
  min-height: 0;
  border-radius: var(--radius-card);
}

.club-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 2em;
  font-weight: bold;
  text-align: center;
  padding: 16px;
  box-sizing: border-box;
}

.club-slideshow {
  position: relative;
  overflow: hidden;
  touch-action: pan-y;   /* 터치 기기: 위아래 스크롤은 그대로, 옆으로 밀기는 사진 넘기기 */
}

.slide-stage {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.3em;
  text-align: center;
}

/* 슬라이드쇼: 화살표는 마우스를 올렸을 때, 점은 항상 */
.club-slideshow:hover .news-arrow,
.club-slideshow:focus-within .news-arrow {
  opacity: 1;
}
.club-slideshow .news-dots {
  opacity: 1;
}

.club-note {
  margin: 8px 0 0;
  font-size: 0.8em;
  color: #666;
}

.club-texts {
  display: flex;
  flex-direction: column;
  gap: var(--panel-gap);
  min-height: 0;
}

/* 닫힌 칸: 두 칸이 오른쪽 높이를 반씩 나눠 꽉 채워요 (아래에 빈 여백이 안 생기게) */
.club-section {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  min-height: 0;             /* .nm-box의 최소 높이(420px)를 풀어야 화면 안에 맞아요 */
  position: relative;        /* 아래 그라데이션의 기준 */
  overflow: hidden;
}

/* 닫혀 있을 때: 맨 밑은 칸과 같은 회색, 위로 갈수록 투명해져서 칸의 가운데쯤에서 사라져요 (글이 칸 색으로 스며들듯 흐려져요) */
.club-section::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 55%;
  background: linear-gradient(to top,
    var(--surface-3) 0,
    var(--surface-3) 84px,   /* 화살표 줄까지는 칸 색 그대로 → 글이 잘리는 선이 안 보여요 */
    color-mix(in srgb, var(--surface-3) 0%, transparent) 100%);
  pointer-events: none;      /* 그라데이션 위로도 글을 누를 수 있게 */
}
.club-section.open::after,
.club-section.compact::after {
  display: none;
}

/* 열린 칸: 남은 높이를 모두 차지 / 다른 칸이 열려 있으면 이름 줄만 */
.club-section.open {
  flex: 1 1 0;
}
.club-section.compact {
  flex: 0 0 auto;
}

.club-section h2 {
  margin: 0 0 8px;
  font-size: 1.1em;
}

/* 요약 제목: 상자 이름 옆에 한 줄로 (길면 … 으로 줄여요) */
.club-section h2 {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.club-title {
  font-weight: normal;
  color: var(--text-2);      /* 다크 모드에서도 잘 보이게 테마 색을 써요 */
}

/* 다른 상자가 열려 있을 때: 이름 + 제목 한 줄, 화살표는 그 오른쪽에 */
.club-section.compact {
  flex-direction: row;
  align-items: center;
  gap: 16px;
}
.club-section.compact .club-content {
  display: none;
}
.club-section.compact h2 {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}

.club-section h3 {
  margin: 14px 0 6px;
  font-size: 1em;
}

.club-section p {
  margin: 0 0 8px;
  line-height: 1.6;
}

/* 닫혀 있을 때: 칸 높이만큼 보이고 넘치는 글은 잘려요 (아래는 그라데이션이 덮어요) */
.club-content {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* 열렸을 때: 글은 칸 안에서만 스크롤 (스크롤바는 숨겨요 — 마우스 휠 · 터치로 움직여요)
   위(이름 줄) · 아래(화살표 줄)는 칸과 같은 색의 반투명 유리라서, 그 밑으로 지나가는 글이 살짝 흐리게 비쳐요. */
.club-section.open {
  --club-head: calc(var(--panel-pad) + 42px);   /* 위 유리 높이 (칸 위 여백 + 이름 줄) */
  --club-foot: 64px;         /* 아래 유리 높이 (화살표 줄) */
}
.club-section.open .club-content {
  position: absolute;
  inset: 0;                  /* 칸 전체를 채우고, 위 · 아래 유리 밑으로 글이 지나가요 */
  padding: var(--club-head) var(--panel-pad) var(--club-foot);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;     /* 스크롤바 숨기기 (파이어폭스 · 크롬) */
}
.club-section.open .club-content::-webkit-scrollbar {
  display: none;             /* 스크롤바 숨기기 (예전 크롬 · 사파리) */
}
.club-section.open h2,
.club-section.open .club-more {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 2;
  margin: 0;
  box-sizing: border-box;
  background: color-mix(in srgb, var(--surface-3) 72%, transparent);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.club-section.open h2 {
  top: 0;
  height: var(--club-head);
  padding: var(--panel-pad) var(--panel-pad) 0;
}
.club-section.open .club-more {
  bottom: 0;
  height: var(--club-foot);
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 0;
}

.club-facts {
  font-size: 0.9em;
  color: #555;
}

.club-list {
  margin: 0 0 8px;
  padding-left: 20px;
  line-height: 1.6;
}

.club-updated,
.club-sources {
  font-size: 0.8em;
  color: #666;
}

/* 더보기 · 접기: 칸 맨 밑 가운데의 큰 검은 화살표 (닫힘 = 아래, 열림 = 위) */
.club-more {
  position: relative;
  z-index: 1;                /* 그라데이션보다 위에 */
  flex: none;
  align-self: center;
  margin: 8px 0 -8px;        /* 칸 아래 여백 쪽으로 조금 내려가요 */
  padding: 8px 14px;
  border: none;
  border-radius: var(--radius-ctl);
  background: none;
  color: var(--text);
  line-height: 0;
  cursor: pointer;
}
.club-more svg {
  display: block;
  width: 52px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 4.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.35s var(--ease);
}
.club-more[aria-expanded="true"] svg {
  transform: rotate(180deg);   /* 열리면 화살표가 위로 (마우스 올림 · 누름 반응은 "버튼 반응 (사이트 전체)") */
}
.club-more:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}
/* 이름 줄만 보일 때는 오른쪽에 붙어요 */
.club-section.compact .club-more {
  margin: 0;
  padding: 6px 8px;
}
.club-section.compact .club-more svg {
  width: 36px;
  height: 18px;
}
html[data-motion="reduce"] .club-more svg {
  transition: none;
}

/* 좁은 화면(세로 패드)에서는 위아래로 놓고, 페이지가 스크롤돼요. 열린 글은 칸 안에서 스크롤 */
@media (max-width: 900px) {
  .full-body:has(.club-page) {
    height: auto;
  }
  .club-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }
  .club-logo,
  .club-slideshow {
    flex: none;
    aspect-ratio: 16 / 9;
  }
  .club-section,
  .club-section.open {
    flex: none;
  }
  .club-section .club-content {
    flex: none;
    height: 16em;            /* 닫혀 있을 때 미리보기 높이 */
  }
  .club-section.open {
    height: 70vh;            /* 열린 칸 높이 (글은 칸 안에서 스크롤) */
  }
  .club-section.open .club-content {
    height: auto;
  }
}

/* ─── 승부예측 ───
   다음 경기 · 리그테이블처럼 옅은 회색 둥근 칸(.nm-box). 스크롤 없이 한 화면에 들어오게:
   - 왼쪽 위: 예측 칸 (안에 흰 상자) / 왼쪽 아래: 팀 팬 중 상위 % | 팀별 랭킹 순위 (나란히)
   - 오른쪽: 이번 라운드 경기 목록
   목록이 길면 그 칸 안에서만 스크롤돼요(.predict-scroll). 색은 테마 변수라 다크 모드도 따라가요.
   다른 페이지도 쓰는 이름(.predict-save, .tab-group 등)이 있어서 모두 .prediction-page 안으로 묶었어요. */
/* 겉모습 */
.prediction-page {
  --pick: #dcdde1;   /* 고른 경기 · 고른 탭: 칸 회색보다 한 단계 진한 회색 */
  --page-bottom: 24px;       /* 한 화면에 딱 맞추는 페이지라 아래 여백은 작게 (폭 · 옆 여백은 "페이지 틀") */

  flex: 1;                   /* 메뉴를 뺀 나머지 높이를 모두 차지 (body.full-body) */
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;   /* 왼쪽 넓게, 오른쪽 경기 목록은 고정 폭 */
  gap: var(--panel-gap);
}
html[data-theme="dark"] .prediction-page {
  --pick: #34363c;
}

.prediction-page .nm-box {
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.prediction-page .nm-box p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* 칸 안에서만 스크롤. 스크롤바는 가늘게 */
.predict-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

/* 왼쪽 줄: 위 예측 칸은 내용만큼, 아래 랭킹 두 칸이 남은 높이를 채워요 */
.predict-main {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: var(--panel-gap);
}

.predict-bottom {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--panel-gap);
}

/* ── 예측 칸 ──
   라운드 정보 줄 없이 흰 상자가 판 맨 위부터 (판 안쪽 여백은 다른 판과 같아요) */
.prediction-page .predict-box {
  position: relative;
}

/* 흰 상자: 로고 · 점수 줄은 위쪽 여백을 넉넉히 둬서 상자 가운데쯤에 (아래에 딱 붙이지 않아요) */
.predict-form {
  position: relative;        /* 저장 버튼 · ⓘ를 모서리에 얹는 기준 */
  padding: 92px 24px 20px;
  border-radius: var(--radius-card);
  background: var(--surface);
}
html[data-theme="dark"] .predict-form {
  background: var(--surface-2);
}

/* 오른쪽 위 ⓘ: 마우스를 올리면(키보드로 고르면 · 휴대폰은 누르면) 아래로 설명이 떠요 */
.predict-info {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
}
.predict-info-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: help;
}
.predict-info-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}
.predict-info-btn:focus-visible {
  outline: 2px solid var(--team);
  outline-offset: 1px;
}
.predict-tip {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: max-content;
  max-width: 300px;
  padding: 10px 14px;
  border-radius: var(--radius-ctl);
  background: #1a1b1e;
  color: #ffffff;
  box-shadow: var(--shadow-lift);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
  pointer-events: none;
}
html[data-theme="dark"] .predict-tip {
  background: #2a2c31;
}
.prediction-page .predict-tip p {
  font-size: 0.82rem;
  line-height: 1.55;
  color: inherit;            /* 칸 안 글(.nm-box p)의 흐린 색 대신 흰 글자 */
}
.predict-info:hover .predict-tip,
.predict-info:focus-within .predict-tip,
.predict-info.is-open .predict-tip {
  opacity: 1;
  visibility: visible;
  transform: none;
}
html[data-motion="reduce"] .predict-tip {
  transition: none;
}

/* 두 팀: 로고 아래 점수 밑줄, 가운데 : */
.predict-teams {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 40px;
}

.predict-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 48px;                 /* 로고와 점수 밑줄 사이를 넉넉하게 */
}

.predict-logo {
  width: 200px;
  height: 200px;
  border-radius: var(--radius-panel);
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 800;
  padding: 12px;
  box-sizing: border-box;
}

/* 점수 칸 = 밑줄 _ */
.prediction-page .predict-score {
  width: 72px;
  height: 56px;
  padding: 0;
  border: none;
  border-bottom: 3px solid var(--text);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 2.2rem;
  font-weight: 800;
  text-align: center;
  font-variant-numeric: tabular-nums;
  outline: none;
  -moz-appearance: textfield;   /* 숫자 칸의 위아래 화살표 숨기기 (파이어폭스) */
  appearance: textfield;
  transition: border-color 0.2s;
}
.prediction-page .predict-score::-webkit-outer-spin-button,
.prediction-page .predict-score::-webkit-inner-spin-button {
  -webkit-appearance: none;     /* 숫자 칸의 위아래 화살표 숨기기 (크롬 · 엣지) */
  margin: 0;
}
.prediction-page .predict-score:focus {
  border-bottom-color: var(--team);
}
.prediction-page .predict-score:disabled {
  border-bottom-color: var(--line-strong);
  color: var(--muted);
}

.predict-colon {
  font-size: 2rem;
  font-weight: 800;
  padding-bottom: 6px;
  color: var(--muted);
}

/* 안내: 늘 한 줄 자리를 잡아 둬요 */
.prediction-page .predict-form .predict-message {
  min-height: 1.5em;
  margin-top: 16px;
  color: var(--text-2);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 다른 팬들의 예측 막대: 저장 전에도 자리는 그대로 (안 보이게만) → 칸 높이가 바뀌지 않아요 */
.predict-stats {
  width: min(100%, 420px);
  margin: 8px auto 0;
}
.predict-stats.is-empty {
  visibility: hidden;
}
.prediction-page .predict-stats .stats-caption {
  margin: 0 0 6px;
  font-size: 0.78rem;
  line-height: 1.3;
  color: var(--muted);
  text-align: center;
}
.stats-bar {
  display: flex;
  gap: 3px;                  /* 두 팀 색이 비슷해도 칸이 구분되게 */
  height: 26px;
  border-radius: 999px;
  overflow: hidden;
}
.stats-part {
  min-width: 34px;           /* 작은 %도 글자가 들어가게 */
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.stats-part.draw {
  background: var(--line-strong);
  color: var(--text-2);
}

/* 저장 버튼: 흰 상자 오른쪽 아래에 얹어요 (줄을 따로 차지하지 않게) */
.predict-actions {
  position: absolute;
  right: 20px;
  bottom: 18px;
}

.prediction-page .predict-save {
  padding: 9px 26px;
  border: none;
  border-radius: var(--radius-ctl);
  background: var(--team);
  color: var(--team-ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s;
}
.prediction-page .predict-save:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
/* 킥오프가 지난 경기: 버튼은 안 보이지만 자리는 그대로 */
.prediction-page .predict-save.is-locked {
  visibility: hidden;
}

/* ── 오른쪽: 라운드 경기 목록 ── */
/* 제목 줄: "7라운드"  ‹ ☰ › */
.round-head {
  position: relative;        /* 라운드 고르기 칸의 기준 */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;       /* 다른 판의 제목 아래 간격과 같아요 */
}
.prediction-page .round-head h2 {
  margin: 0;
}

.round-nav {
  display: flex;
  gap: 4px;
}
.round-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background-color 0.2s;
}
html[data-theme="dark"] .round-btn {
  background: var(--surface-2);
}
.round-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.round-btn[aria-expanded="true"] {
  background: var(--pick);
}
.round-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ☰를 누르면 제목 줄 아래에 1~38라운드 칸이 떠요 */
.round-picker {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 10;
  width: 100%;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  padding: 14px;
  border-radius: var(--radius-panel);
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(17, 18, 20, 0.14), 0 0 0 1px var(--line);
}
.round-picker[hidden] {
  display: none;
}
.round-picker button {
  height: 34px;
  padding: 0;
  border: none;
  border-radius: var(--radius-ctl);
  background: var(--surface-2);
  color: var(--text-2);
  font: inherit;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background-color 0.2s;
}
/* 이번 라운드: 팀 색 글씨 / 보고 있는 라운드: 진한 회색 */
.round-picker button.this-round {
  color: var(--team);
  font-weight: 800;
}
.round-picker button.active {
  background: var(--pick);
  color: var(--text);
  font-weight: 800;
}

/* 경기 칸들: 칸 높이를 10경기가 나눠 채워요 (흰 칸, 고르면 테두리 없이 진한 회색) */
.prediction-page .predict-list {
  margin: 0;
}
.prediction-page .predict-list li {
  flex: 1 1 0;
  min-height: 52px;
  display: flex;
}

.prediction-page .predict-list button {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 8px 16px;
  background: var(--surface);
  font-size: 0.92rem;
}
.prediction-page .predict-list .pick-teams {
  font-weight: 700;
  color: var(--text);
}
.prediction-page .predict-list .pick-detail {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 400;
}
/* 지난 경기: 적중 여부 색 (내 지난 예측과 같은 색) */
.prediction-page .pick-exact { color: #2f9e44; font-weight: 700; }
.prediction-page .pick-outcome { color: #1a56db; font-weight: 700; }
.prediction-page .pick-miss,
.prediction-page .pick-none { color: var(--muted); }
html[data-theme="dark"] .prediction-page .predict-list button {
  background: var(--surface-2);
}
/* 경기 줄 오른쪽 끝 아이콘 (다음 경기 페이지로): 마우스를 올린 줄에만 반투명 동그라미로 나타나요.
   마우스가 없는 기기(휴대폰 · 태블릿)는 늘 보여요. 아이콘 자리만큼 글자가 안 덮이게 줄 오른쪽 여백을 둬요. */
.prediction-page .predict-list li {
  position: relative;
}
.prediction-page .predict-list li:has(.pick-go) button {
  padding-right: 56px;
}
.pick-go {
  position: absolute;
  top: 50%;
  right: 12px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(17, 18, 20, 0.08);   /* 반투명: 뒤의 줄 색이 비쳐요 */
  color: var(--text);
  opacity: 0;
  translate: 0 -50%;
  transition: opacity 0.2s, background-color 0.2s;
}
html[data-theme="dark"] .pick-go {
  background: rgba(255, 255, 255, 0.12);
}
.pick-go svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.prediction-page .predict-list li:hover .pick-go,
.pick-go:focus-visible {
  opacity: 1;
}
.pick-go:hover {
  background: rgba(17, 18, 20, 0.16);
}
html[data-theme="dark"] .pick-go:hover {
  background: rgba(255, 255, 255, 0.22);
}
.pick-go:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--team) 45%, transparent);
  outline-offset: 2px;
}
@media (hover: none) {
  .pick-go {
    opacity: 1;
  }
}
/* 아이콘 위에 마우스가 있어도 줄은 회색 그대로 */
.prediction-page .predict-list li:hover > button:not(:disabled) {
  box-shadow: inset 0 0 0 999px var(--lift-hover);
}
.prediction-page .predict-list li > button:not(:disabled):active {
  box-shadow: inset 0 0 0 999px var(--lift-press);
}
.prediction-page .predict-list button.current,
html[data-theme="dark"] .prediction-page .predict-list button.current {
  box-shadow: none;
  background: var(--pick);
  font-weight: 700;
}

/* ── 왼쪽 아래 두 칸 (팀 팬 중 상위 % | 팀별 랭킹 순위) ──
   - 요약: 칸 전체가 버튼, 큰 숫자는 칸 한가운데. 마우스를 올려도 모양은 그대로예요.
   - 순위표: 칸 맨 위부터 내용이 보이고, ‹ 뒤로 · 탭은 그 위에 떠 있어요. */
.prediction-page .predict-ranking {
  position: relative;
  padding: 0;                /* 여백은 안쪽 버튼 · 목록이 가져요 → 칸 끝까지 누를 수 있어요 */
  overflow: hidden;
}

.box-view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* 순위표 윗줄: ‹ 뒤로 [탭] — 목록 위에 떠 있어요 */
.view-head {
  position: absolute;
  top: 12px;
  left: var(--panel-pad);
  right: var(--panel-pad);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;      /* 빈 곳은 아래 목록을 그대로 스크롤 · 클릭 */
}
.view-head > * {
  pointer-events: auto;
}
.prediction-page .table-view .predict-scroll {
  padding: 12px var(--panel-pad) var(--panel-pad);   /* 맨 위(예전 제목 자리)부터 바로 보여요 */
}
.view-back {
  flex: none;
  width: 30px;
  height: 30px;
  padding: 0 0 2px;
  border: none;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.4;              /* 60% 투명 */
  transition: opacity 0.2s;
}
html[data-theme="dark"] .view-back {
  background: var(--surface-2);
}
.view-back:hover,
.view-back:focus-visible {
  opacity: 1;                /* 마우스를 올리거나 키보드로 고르면 또렷하게 */
}
/* 팀별 순위표 탭은 오른쪽 끝에 */
.view-head .tab-group {
  margin-left: auto;
}

/* 요약 버튼: 칸 전체, 내용은 한가운데 */
.ranking-open {
  flex: 1;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  padding: 20px 12px;
  border: none;
  border-radius: 0;
  background: none;
  color: var(--text);
  font: inherit;
  text-align: center;
  cursor: pointer;
}
/* 키보드로 고를 때만 테두리 */
.ranking-open:focus-visible {
  outline: 2px solid var(--team);
  outline-offset: -4px;
  border-radius: var(--radius-panel);
}
.half-big {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}
/* 큰 숫자 위 연한 글씨 ("아스날 팬 중" / "팀별 랭킹") */
.half-label {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.4;
}
.half-more {
  margin-top: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-2);
}

/* ── 랭킹 표 ── */
.prediction-page .tab-group {
  display: flex;
  gap: 4px;
}
/* 탭도 경기 목록과 같은 규칙: 흰 알약, 고르면 진한 회색 */
.prediction-page .tab-group button {
  padding: 4px 12px;
  border: none;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background-color 0.2s;
}
html[data-theme="dark"] .prediction-page .tab-group button {
  background: var(--surface-2);
}
.prediction-page .tab-group button.active,
html[data-theme="dark"] .prediction-page .tab-group button.active {
  background: var(--pick);
  color: var(--text);
  font-weight: 700;
}


.prediction-page .ranking-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.prediction-page .ranking-list li {
  display: flex;
  gap: 10px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}
.prediction-page .ranking-list .rank {
  width: 1.6em;
  text-align: right;
  color: var(--muted);
}
.prediction-page .ranking-list .rank-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 내 줄: 흰 줄로 눈에 띄게 */
.prediction-page .ranking-list li.me,
html[data-theme="dark"] .prediction-page .ranking-list li.me {
  border-bottom-color: transparent;
  border-radius: var(--radius-ctl);
  background: var(--surface);
  font-weight: 700;
}
.prediction-page .ranking-list li.me .rank {
  color: var(--text);
}
.prediction-page .ranking-list li.ranking-gap {
  justify-content: center;
  color: var(--muted);
}

/* 키가 낮은 노트북 화면: 로고를 줄여서 아래 랭킹 · 내 지난 예측 칸에 자리를 더 줘요 */
@media (max-height: 820px) {
  .predict-logo {
    width: 150px;
    height: 150px;
    font-size: 1.15rem;
  }
  .predict-team {
    gap: 30px;
  }
  .predict-form {
    padding-top: 72px;
  }
  .prediction-page .predict-list {
    gap: 6px;
  }
  .prediction-page .predict-list li {
    min-height: 46px;
  }
  .prediction-page .predict-list button {
    padding: 4px 16px;
  }
}

/* 좁은 화면(세로 태블릿): 위아래로 쌓고, 한 화면 고정을 풀어 페이지 전체가 스크롤돼요 (경기 목록은 맨 아래) */
@media (max-width: 960px) {
  .full-body:has(.prediction-page) {
    height: auto;
  }
  .prediction-page {
    --page-bottom: 32px;      /* 페이지가 스크롤되니 아래 여백을 보통대로 */
    flex: none;
    grid-template-columns: minmax(0, 1fr);
  }
  .predict-bottom {
    flex: none;
    height: 400px;           /* 랭킹 · 내 지난 예측은 여기서도 칸 안에서만 스크롤 */
  }
}

/* ─── 선수 (뼈대용 임시 스타일, 폭 · 여백은 "페이지 틀") ─── */
.players-page .nm-box {
  min-height: 0;          /* 표 길이만큼만 */
}

/* 위쪽: 팀 로고 + 큰 팀 이름 (누르면 아래로 팀 목록) */
.players-team {
  position: relative;   /* 팀 목록을 버튼 바로 아래에 띄우는 기준 */
  margin-bottom: 10px;
}
.team-switch {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  padding: 6px 0;   /* 바탕 없이 (마우스를 올려도 누르는 영역이 보이지 않게) */
  border: none;
  border-radius: 12px;
  background: none;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.team-switch:focus-visible {   /* 키보드로 왔을 때만 테두리 */
  outline: 2px solid var(--team);
  outline-offset: 2px;
}
.team-switch .team-badge {
  width: 56px;
  font-size: 0.95rem;
}
.team-switch-name {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.team-switch-arrow {
  font-size: 1.4rem;
  color: var(--muted);
  transition: transform 0.25s var(--ease);
}
.team-switch[aria-expanded="true"] .team-switch-arrow {
  transform: rotate(180deg);
}

/* 펼쳐지는 팀 목록: 두 줄로 20팀이 한눈에 */
.team-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
  width: 440px;
  margin: 0;
  padding: 8px;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--surface);
  box-shadow: var(--shadow-lift);
  transform-origin: top left;
  animation: team-menu-in 0.22s var(--ease);
}
.team-menu[hidden] {
  display: none;
}
@keyframes team-menu-in {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}
.team-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 10px;
  border: none;
  border-radius: var(--radius-ctl);
  background: none;
  color: var(--text-2);
  font: inherit;
  font-size: 0.92rem;
  text-align: left;
  cursor: pointer;
}
.team-menu button:hover {
  color: var(--text);        /* 바탕 반응은 "버튼 반응 (사이트 전체)" */
}
.team-menu button:focus-visible {
  background: var(--hover-bg);
  color: var(--text);
  outline: none;
}
.team-menu button.current {
  color: var(--text);
  font-weight: 700;
  background: color-mix(in srgb, var(--team) 10%, transparent);
}
.team-menu .team-badge {
  flex: none;
  width: 28px;
  font-size: 0.55rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);   /* 작은 배지는 바깥 링 없이 */
}
html[data-motion="reduce"] .team-menu {
  animation: none;
}
html[data-motion="reduce"] .team-switch-arrow {
  transition: none;
}

/* 열 제목 = 정렬 버튼 */
.sort-button {
  border: none;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  padding: 0;
}

/* 시장가치: 위 유로, 아래 작게 원화 */
.players-table .col-value {
  text-align: right;
}
.value-krw {
  display: block;
  font-size: 0.8em;
  color: #777;
}

.status-mark {
  cursor: help;
}

.compare-toggle {
  font: inherit;
  font-size: 0.8em;
  padding: 2px 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-ctl);
  background: none;
  color: var(--text-2);
  cursor: pointer;
  white-space: nowrap;
}

/* 정보 목록 (설정 · 관리자 페이지) */
.info-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 16px;
  margin: 8px 0 0;
}
.info-list dt {
  color: #666;
}
.info-list dd {
  margin: 0;
}

/* 비교 창: 왼쪽 선수 | 오른쪽 목록 또는 선수 */
.compare-dialog {
  width: min(860px, 94vw);
}
.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 10px;
}
.compare-side + .compare-side {
  border-left: 1px dashed #999;
  padding-left: 16px;
}
.compare-name {
  margin: 0;
  font-size: 1em;
}
/* 팀 고르기 줄 · 이름 줄은 높이를 고정해서 왼쪽 · 오른쪽 기록 줄이 맞게 */
.compare-pick {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  margin-bottom: 8px;
}
.compare-pick select {
  font: inherit;
  padding: 3px 6px;
}
.compare-head {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  margin-bottom: 8px;
}
.compare-head .round-current {
  margin-left: 0;
}
.compare-list-title {
  margin: 0 0 6px;
  font-size: 0.85em;
  color: #666;
}
.compare-list {
  max-height: 50vh;
  overflow-y: auto;
  margin-top: 0;
}
.compare-list button {
  font-size: 0.9em;
}
/* 기록 줄: 왼쪽 · 오른쪽 높이를 맞춰서 같은 항목끼리 마주 보게 */
.compare-stats {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0 12px;
  margin: 0;
}
.compare-stats dt,
.compare-stats dd {
  margin: 0;
  padding: 4px 6px;
  line-height: 1.4;
  border-bottom: 1px solid #eee;
  white-space: nowrap;
}
.compare-stats dt {
  color: #666;
}
.compare-stats dd.better {
  font-weight: bold;
  background: #e6f4ea;
}

/* ─── 선수 전용 페이지 (player.html, 폭 · 여백은 "페이지 틀") ───
   맨 위: 뒤로 가기 → 사진 자리 동그라미 + 이름(아래 가는 줄) + 팀 · 포지션 · 등번호
   아래 회색 판 하나: 왼쪽 좁은 줄(기본 정보 · 최근 평점 · 뛰었던 팀 · 우승 수상) / 오른쪽 넓은 줄(이번 시즌 · 시즌별 기록)
   강조색은 팀 색 하나만. 좁은 화면에서 한 줄로 쌓이는 건 맨 아래 "작은 화면" 부분에 */
.profile-back {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 32px;
  margin-bottom: 16px;
  padding: 0 14px 0 8px;
  border-radius: var(--radius-ctl);
  background: var(--surface);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
}
html[data-theme="dark"] .profile-back {   /* 다크 모드 링크 색(파랑) 대신 · 바탕과 구분되게 한 단계 밝게 */
  background: var(--surface-3);
  color: var(--text);
}
.profile-back svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.profile-back:focus-visible {
  outline: 2px solid var(--team);
  outline-offset: 2px;
}

.profile-hero {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: var(--panel-gap);
}
/* 프로필 사진 자리: 선수 팀 색 동그라미 + 등번호 (사진 허가 뒤에 진짜 사진으로) */
.profile-photo {
  flex: none;
  display: grid;
  place-items: center;
  width: 112px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--team);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), var(--shadow-soft);
  color: var(--team-ink);
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.profile-id {
  flex: 1;
  min-width: 0;
}
/* 이름 + 영어 이름, 아래 가는 줄이 오른쪽 끝까지 */
.profile-name-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--line-strong);
}
.profile-name {
  margin: 0;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.profile-name-en {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 600;
}
.profile-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 0;
  margin: 12px 0 0;
  color: var(--text-2);
  font-size: 0.95rem;
}
.profile-meta > span + span::before {   /* 사이사이 가운데 점 */
  content: "·";
  margin: 0 10px;
  color: var(--muted);
}
.profile-club {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 700;
}
.profile-club .team-badge {
  flex: none;
  width: 24px;
  font-size: 0.5rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);   /* 작은 배지는 바깥 링 없이 */
}

/* 회색 판: 왼쪽 1 : 오른쪽 2, 줄마다 흰 칸이 위에서부터 쌓여요 (칸 높이가 달라도 빈틈 없이) */
.profile-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  align-items: start;
  gap: var(--card-gap);
  min-height: 0;
}
.profile-col {
  display: flex;
  flex-direction: column;
  gap: var(--card-gap);
  min-width: 0;
}
.profile-card {
  min-width: 0;
  padding: 20px;
  border-radius: var(--radius-card);
  background: var(--surface);
}
.profile-board .profile-card h2 {
  margin: 0 0 14px;
  font-size: 1.05rem;
}
.profile-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin-bottom: 14px;
}
.profile-board .profile-card-head h2 {
  margin: 0;
}
.profile-card-note {
  color: var(--muted);
  font-size: 0.8rem;
}
/* 자료 없음 · 준비 중 */
.profile-board .profile-pending {
  margin: 0;
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-ctl);
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
  text-align: center;
}
.profile-career + .profile-pending,
.profile-table-scroll + .profile-pending {
  margin-top: 12px;
}

/* 기본 정보 */
.profile-info {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px 20px;
  margin: 0;
  font-size: 0.92rem;
}
.profile-info dt {
  color: var(--muted);
}
.profile-info dd {
  margin: 0;
  font-weight: 600;
}
.profile-info dd.is-out {   /* 부상 · 출장정지 */
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: #dc2626;
}
html[data-theme="dark"] .profile-info dd.is-out {
  color: #ff6369;
}
.profile-info-sub {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
}

/* 이번 시즌: 큰 숫자 4개 */
.profile-key-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--card-gap);
}
.profile-key {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
  padding: 14px 16px;
  border-radius: var(--radius-ctl);
  background: var(--surface-2);
}
html[data-theme="dark"] .profile-key {
  background: var(--surface-3);   /* 다크 모드는 --surface-2가 흰 칸과 같아서 */
}
.profile-key-label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}
.profile-key-value {
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.profile-key-rank {
  color: var(--text-2);
  font-size: 0.78rem;
  white-space: nowrap;
}
/* 리그 3위 안: 순위 글자에 팀 색 바탕 */
.profile-key.is-top .profile-key-rank {
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--team);
  color: var(--team-ink);
  font-weight: 700;
}

/* 기록 표 (이번 시즌 나머지 · 시즌별) */
.profile-table-scroll {
  overflow-x: auto;
}
.profile-key-stats + .profile-table-scroll {
  margin-top: 16px;
}
.profile-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}
.profile-table th,
.profile-table td {
  padding: 9px 8px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}
.profile-table th:first-child,
.profile-table td:first-child,
.profile-table .col-club {
  text-align: left;
}
.profile-table thead th {
  padding-top: 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}
.profile-table tbody th {
  color: var(--text-2);
  font-weight: 600;
}
.profile-table tbody tr:last-child > * {
  border-bottom: none;
}
.profile-table td.is-top {
  color: var(--text);
  font-weight: 800;
}
/* 리그 순위 열: 제목 "리그 순위 (모든 포지션) ▾" 전체가 누르는 곳, 아래 "상위 n%"는 가운데 */
.profile-table .profile-league-head,
.profile-table td.col-league {
  text-align: center;
}
.profile-rank-mode {
  position: relative;          /* 투명한 고르기 칸(select)이 글자 전체를 덮는 기준 */
  display: inline-flex;
  cursor: pointer;
}
.profile-rank-text {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 2px 6px;
}
.profile-rank-pick {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: var(--text-2);
  font-weight: 700;
}
.profile-rank-pick svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* 실제로 눌리는 칸: 보이지 않게 글자 위를 덮어요 (테두리 · 바탕 · 윤곽선 없이) */
.profile-rank-mode select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: none;
  outline: none;
  opacity: 0;
  font: inherit;
  cursor: pointer;
  appearance: none;
}
.profile-rank-mode select option {   /* 펼친 목록 (다크 모드에서도 읽히게) */
  background: var(--surface);
  color: var(--text);
}
/* 마우스를 올리면 글자만 진하게 */
.profile-rank-mode:hover .profile-rank-text,
.profile-rank-mode:hover .profile-rank-pick {
  color: var(--text);
}
.profile-key-rank[title],
.profile-table td[title] {
  cursor: help;   /* 마우스를 올리면 90분당 값 · 몇 명 중 몇 위 */
}
.profile-table tr.is-current > * {   /* 시즌별 기록의 이번 시즌 줄 */
  background: color-mix(in srgb, var(--team) 9%, transparent);
  color: var(--text);
  font-weight: 700;
}

/* 최근 5경기 평점: 막대 (가장 높은 경기만 팀 색) */
.profile-bars {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 22px 0 0;   /* 위: 가장 높은 막대 위 숫자 자리 */
  list-style: none;
}
.profile-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  height: 180px;
}
.profile-bar-fill {
  position: relative;
  width: 100%;
  max-width: 40px;
  height: calc(var(--h) * 120px);
  border-radius: 6px 6px 2px 2px;
  background: var(--surface-3);
}
html[data-theme="dark"] .profile-bar-fill {
  background: var(--hover-bg);
}
.profile-bar.is-best .profile-bar-fill {
  background: var(--team);
}
.profile-bar-value {
  position: absolute;
  bottom: 100%;
  left: 50%;
  margin-bottom: 4px;
  transform: translateX(-50%);
  font-size: 0.8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.profile-bar-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  color: var(--muted);
  font-size: 0.72rem;
}
.profile-bar-foot .team-badge {
  width: 22px;
  font-size: 0.45rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

/* 뛰었던 팀: 최근 것이 위로 */
.profile-career {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.profile-career li {
  display: flex;
  align-items: center;
  gap: 12px;
}
.profile-career .team-badge {
  flex: none;
  width: 34px;
  font-size: 0.6rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}
.profile-badge-plain {   /* 팀 목록에 없는 팀(국가대표 등) */
  --badge: var(--surface-3);
  --badge-ink: var(--text-2);
}
.profile-career-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.profile-career-text strong {
  font-size: 0.95rem;
}
.profile-career-text span {
  color: var(--muted);
  font-size: 0.82rem;
}

/* 우승 · 수상 */
.profile-board .profile-honors-card h3 {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}
.profile-honors {
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}
.profile-honors:last-child {
  margin-bottom: 0;
}
.profile-honors li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.profile-honors li:last-child {
  border-bottom: none;
}
.profile-honor-name {
  font-size: 0.92rem;
  font-weight: 600;
}
.profile-honor-count {
  font-size: 0.92rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.profile-honor-seasons {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.8rem;
}

/* 선수를 못 찾았을 때 */
.profile-missing {
  min-height: 0;
  text-align: center;
}
.profile-missing p {
  margin: 0;
}

/* ─── 자료실 (폭 · 여백은 "페이지 틀") ───
   회색 판(.nm-box) 하나 안에 기록 카드(흰 칸)가 격자로. 카드마다 상위 5개 + 전체 보기(창).
   탭은 승부예측 · 선수 맞히기와 같은 흰 알약, "우리 팀만"은 경기노트와 같은 스위치.
   좁은 화면에서 카드 열 수는 맨 아래 "작은 화면" 부분에 */
/* 겉모습 */
.stats-page {
  --pick: #dcdde1;   /* 고른 탭: 흰 칸보다 한 단계 진한 회색 */
}
html[data-theme="dark"] .stats-page {
  --pick: #34363c;
}
.stats-page .nm-box {
  min-height: 0;     /* 카드 길이만큼만 */
}

/* 제목 줄: 왼쪽 자료실 + ⓘ(반영 시각 · 꺾쇠 설명) · 오른쪽 스위치와 탭 */
.stats-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-bottom: 16px;
}
.stats-title {
  position: relative;   /* ⓘ 말풍선이 제목 왼쪽 끝에 맞춰 열려요 (휴대폰에서 화면 밖으로 안 나가게) */
  display: flex;
  align-items: center;
  gap: 4px;
  margin-right: auto;   /* 스위치 · 탭을 오른쪽 끝으로 */
  min-width: 0;
}
.stats-title h2 {
  margin: 0;
  font-size: 1.75rem;   /* 다른 칸 제목(1.25rem)보다 크게: 페이지 제목 */
  letter-spacing: -0.02em;
}
.stats-page .stats-head-info {
  position: static;
  margin: 2px 0 0;
}
.stats-head-info .stats-info-btn {
  width: 34px;
  height: 34px;
}
.stats-head-info .stats-info-btn svg {
  width: 20px;
  height: 20px;
}
.stats-page .stats-head-info .stats-tip {
  top: calc(100% + 6px);
  left: 0;
  right: auto;
  max-width: min(300px, calc(100vw - 64px));
  padding: 10px 14px;
}
.stats-page .stats-switch {
  margin: 0;
}

.stats-page .tab-group {
  display: flex;
  gap: 4px;
}
.stats-page .tab-group button {
  padding: 4px 12px;
  border: none;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}
html[data-theme="dark"] .stats-page .tab-group button {
  background: var(--surface-2);
}
.stats-page .tab-group button.active {
  background: var(--pick);
  color: var(--text);
  font-weight: 700;
}
.stats-page .tab-group button:focus-visible {
  outline: 2px solid var(--team);
  outline-offset: 2px;
}

/* 기록 카드 격자: 16개 = 4열 × 4줄 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--card-gap);
}
.stats-page .stats-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 48px 0;
  text-align: center;
  color: var(--muted);
}

.stats-card {
  --card-bg: var(--surface);   /* 아래 그라데이션도 이 색으로 */
  position: relative;          /* 전체 보기 버튼이 카드 아래쪽을 덮어요 */
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 16px;
  border-radius: var(--radius-card);
  background: var(--card-bg);
}
html[data-theme="dark"] .stats-card {
  --card-bg: var(--surface-2);
}
/* 제목 줄: 왼쪽 제목 · 오른쪽 끝 ⓘ (선수별 기록 중 조건이 있는 카드만) */
.stats-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.stats-card-head h3 {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 1rem;
}

/* ⓘ: 마우스를 올리면(휴대폰은 누르면) 아래에 조건 말풍선 (승부예측 ⓘ와 같은 모양) */
.stats-info {
  position: relative;
  flex: none;
  margin: -6px -6px -6px 0;   /* 제목 줄 높이는 그대로 · 카드 오른쪽 여백 쪽으로 조금 */
}
.stats-info-btn {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: help;
}
.stats-info-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}
.stats-info-btn:focus-visible {
  outline: 2px solid var(--team);
  outline-offset: 1px;
}
.stats-page .stats-tip {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 3;   /* 옆 · 아래 카드보다 위에 */
  width: max-content;
  max-width: 240px;
  margin: 0;
  padding: 8px 12px;
  border-radius: var(--radius-ctl);
  background: #1a1b1e;
  color: #ffffff;
  font-size: 0.8rem;
  line-height: 1.5;
  box-shadow: var(--shadow-lift);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
  pointer-events: none;
}
html[data-theme="dark"] .stats-page .stats-tip {
  background: #2a2c31;
}
.stats-info:hover .stats-tip,
.stats-info:focus-within .stats-tip,
.stats-info.is-open .stats-tip {
  opacity: 1;
  visibility: visible;
  transform: none;
}
html[data-motion="reduce"] .stats-page .stats-tip {
  transition: none;
}
/* 자료실 ⓘ 안: 반영 시각(굵게) · 꺾쇠 설명 네 줄 · 공동 순위 규칙(흐리게) */
.stats-page .stats-tip p {
  margin: 0;
  font-size: inherit;
  line-height: inherit;
  color: inherit;   /* 칸 안 글(.nm-box p)의 흐린 색 대신 흰 글자 */
}
.stats-page .stats-tip .stats-tip-strong {
  margin-bottom: 8px;
  font-weight: 700;
}
.stats-legend {
  display: grid;
  gap: 2px;
  margin: 4px 0;
  padding: 0;
  list-style: none;
}
.stats-legend li {
  display: flex;
  align-items: center;
  gap: 8px;
}
.stats-page .stats-tip .stats-tip-sub {
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.6);
}
.stats-page .stats-card-empty {
  margin: 8px 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

/* 상위 4개: 순위 · 꺾쇠 · 배지 · 이름(선수는 아래에 팀) · (작은 설명) · 값
   줄 높이를 모두 같게(44px) → 같은 줄의 카드끼리 높이 · 그라데이션 자리가 맞아요 */
.stats-top {
  margin: 0 -8px 36px;   /* 양옆: 우리 팀 줄 바탕이 카드 안쪽 여백까지 닿게 · 아래: 화살표 자리 (4줄이 안 될 때) */
  padding: 0;
  list-style: none;
  font-variant-numeric: tabular-nums;
}
.stats-top li {
  position: relative;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 4px 8px;
  border-radius: var(--radius-ctl);
}
/* 4줄이면: 4위 줄 아래쪽에 화살표가 겹쳐서 카드가 짧아지고, 4위 줄은 그라데이션에 거의 가려져요
   (그라데이션은 전체 보기 버튼의 바탕 → 아래 "전체 보기") */
.stats-top.faded {
  margin-bottom: -6px;
}
.stats-top li.my-team {
  background: rgba(var(--team-rgb), 0.12);
}
.stats-rank {
  flex: none;
  width: 18px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
}
/* 순위 변화 꺾쇠: 초록 위 · 빨강 아래, 여러 칸이면 두 개 겹쳐요 (안 바뀌었으면 빈 칸) */
.stats-move {
  flex: none;
  display: inline-block;
  width: 10px;
  height: 12px;
}
.stats-top .stats-move {
  margin: 0 -4px;   /* 순위 · 배지와 붙여서 */
}
.stats-move svg {
  display: block;
  width: 10px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.stats-move.down svg {
  transform: rotate(180deg);
}
.stats-move.up {
  color: #16a34a;
}
.stats-move.down {
  color: #dc2626;
}
html[data-theme="dark"] .stats-move.up,
.stats-tip .stats-move.up {   /* 어두운 바탕(다크 모드 · ⓘ 말풍선)에서는 밝게 */
  color: #3dd68c;
}
html[data-theme="dark"] .stats-move.down,
.stats-tip .stats-move.down {
  color: #ff6369;
}
.stats-top .team-badge,
.stats-club .team-badge {
  flex: none;
  width: 24px;
  font-size: 0.5rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);   /* 작은 배지는 바깥 링 없이 */
}
.stats-name {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}
.stats-name-main {
  overflow: hidden;
  font-size: 0.92rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stats-name-sub {
  overflow: hidden;
  font-size: 0.74rem;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stats-extra {
  flex: none;
  margin-right: 6px;
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--muted);
}
.stats-value {
  flex: none;
  font-size: 0.95rem;
  font-weight: 700;
}
/* 1위 줄: 값만 크게 (카드마다 가장 먼저 눈에 들어오게) */
.stats-top li.leader .stats-value {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* 전체 보기: 카드 아래쪽(4위 줄 + 화살표 둘레)을 다 덮는 버튼. 바탕이 그라데이션이고 화살표가 그 위에 있어요.
   누르는 칸은 안 보여요: 마우스를 올리거나 눌러도 막을 덮지 않고 화살표 색만 진해져요
   (그래서 "버튼 반응 (사이트 전체)" 목록에 넣지 않았어요) */
.stats-more {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;               /* 위 줄들보다 위에 */
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 60px;             /* 4위 줄 위쪽 조금 위부터 카드 끝까지 */
  padding: 0 0 8px;
  border: none;
  border-radius: 0 0 var(--radius-card) var(--radius-card);
  background: none;
  color: var(--text-2);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;   /* 휴대폰에서 눌러도 칸이 번쩍 보이지 않게 */
}
/* 4줄일 때: 위에서 아래로 갈수록 카드 색이 서서히 진해져서(처음엔 빠르게, 끝으로 갈수록 천천히)
   카드 맨 아래에서 카드 색이 돼요 → 흐리다가 갑자기 흰 칸이 나오지 않아요 */
.stats-top.faded + .stats-more {
  background: linear-gradient(to bottom,
    transparent 0%,
    color-mix(in srgb, var(--card-bg) 30%, transparent) 10%,
    color-mix(in srgb, var(--card-bg) 52%, transparent) 20%,
    color-mix(in srgb, var(--card-bg) 70%, transparent) 32%,
    color-mix(in srgb, var(--card-bg) 82%, transparent) 45%,
    color-mix(in srgb, var(--card-bg) 91%, transparent) 60%,
    color-mix(in srgb, var(--card-bg) 97%, transparent) 78%,
    var(--card-bg) 100%);
}
.stats-more-icon {
  display: block;
  padding: 0 12px;
  border-radius: var(--radius-ctl);
  line-height: 0;
  transition: color 0.15s;
}
.stats-more:hover .stats-more-icon {
  color: var(--text);
}
html[data-motion="reduce"] .stats-more-icon {
  transition: none;
}
.stats-more svg {
  display: block;
  width: 32px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 4.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.stats-more:focus-visible {
  outline: none;
}
.stats-more:focus-visible .stats-more-icon {
  outline: 2px solid var(--team);
  outline-offset: 2px;
}

/* 전체 순위 창: 창 안에서 표만 스크롤, 제목 줄은 위에 붙어 있어요 */
.stats-dialog {
  --team-tint: rgba(var(--team-rgb), 0.12);   /* 우리 팀 줄 (.league-table tr.my-team) */
  width: min(640px, 92vw);
  max-height: min(80vh, 760px);
}
.stats-dialog[open] {
  display: flex;
  flex-direction: column;
}
.stats-dialog .stats-dialog-note {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}
.stats-table-scroll {
  flex: 1;
  min-height: 0;
  margin-top: 16px;
  overflow: auto;
  padding: 0;
  border-radius: 0;
  background: none;
}
.stats-table th {
  position: sticky;   /* 길게 내려도 열 제목이 위에 */
  top: 0;
  z-index: 1;
  padding-top: 4px;
  background: var(--surface);
}
.stats-table th:first-child,
.stats-table td:first-child {
  padding-left: 8px;
}
.stats-table th:last-child,
.stats-table td:last-child {
  padding-right: 8px;
  text-align: right;
}
/* 우리 팀 줄: 줄(tr) 대신 칸마다 칠해요 (줄에 칠하면 크롬에서 배지 옆에 흰 세로줄이 생겨요) */
.stats-table tr.my-team {
  background-color: transparent;
}
.stats-table tr.my-team td {
  background-color: var(--team-tint);
}
.stats-table tbody tr {
  cursor: default;   /* 눌러서 열리는 줄이 아니에요 */
}
.stats-table tbody tr:hover {
  background-image: none;
}
/* 선수별 기록: 선수 줄을 누르면 선수 전용 페이지로 (카드 줄은 "버튼 반응 (사이트 전체)" 막) */
.stats-table tbody tr.is-link {
  cursor: pointer;
}
.stats-table tbody tr.is-link:hover {
  background-image: linear-gradient(var(--row-hover), var(--row-hover));
}
.stats-top li.is-link {
  cursor: pointer;
}
.stats-top li.is-link:focus-visible,
.stats-table tbody tr.is-link:focus-visible {
  outline: 2px solid var(--team);
  outline-offset: -2px;
}
.stats-table td.col-team {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stats-club {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.stats-table .stats-col-club {
  text-align: left;
}
.stats-table td.stats-col-club {
  color: var(--text-2);
}
.stats-table .stats-extra {
  margin-right: 8px;
}
/* 순위 칸: 숫자 + 꺾쇠 */
.stats-rank-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ─── 자료실 그래프 탭 (js/pages/stats-graphs.js) ───
   넓은 그래프(순위 변동 · 모자이크 · 골 도움 지도)는 한 줄 전체, 공격 vs 수비 · 골 지분은 반씩.
   선 · 눈금은 가는 회색(1px), 강조만 팀 색. 색은 아래 --g-… 변수 (다크 모드는 따로 고른 색).
   승 · 무 · 패와 골 지분 색은 색약 검사를 거친 색 (승 · 무 · 패는 칸에 글자도 같이) */
.stats-page {
  --g-grid: #ececef;      /* 눈금선 */
  --g-line: #d4d4d8;      /* 강조하지 않은 선 */
  --g-dot: #a1a1aa;       /* 강조하지 않은 점 */
  --g-win: #15803d;
  --g-draw: #d4d4d8;
  --g-loss: #f87171;
  --g-none: #f1f1f3;      /* 아직 안 한 경기 */
  --g-win-ink: #ffffff;
  --g-draw-ink: #3f3f46;
  --g-loss-ink: #450a0a;
  --g-s1: #2a78d6;        /* 골 지분 조각 1 ~ 5 + 그 밖 */
  --g-s2: #eb6834;
  --g-s3: #1baf7a;
  --g-s4: #eda100;
  --g-s5: #e87ba4;
  --g-other: #c3c2b7;
}
html[data-theme="dark"] .stats-page {
  --g-grid: #2c2d31;
  --g-line: #45464c;
  --g-dot: #6b6c73;
  --g-win: #147a3b;
  --g-draw: #4b4d55;
  --g-loss: #eb6a6a;
  --g-none: #2a2b30;
  --g-draw-ink: #e4e4e7;
  --g-loss-ink: #3b0808;
  --g-s1: #3987e5;
  --g-s2: #d95926;
  --g-s3: #199e70;
  --g-s4: #c98500;
  --g-s5: #d55181;
  --g-other: #5a5a57;
}
.stats-grid.is-graphs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.stats-graph {
  --card-bg: var(--surface);
  min-width: 0;
  padding: 18px 20px 20px;
  border-radius: var(--radius-card);
  background: var(--card-bg);
}
html[data-theme="dark"] .stats-graph {
  --card-bg: var(--surface-2);
}
.stats-graph.wide {
  grid-column: 1 / -1;
}
/* 제목 줄: 왼쪽 제목 · 오른쪽 선택지 (순위 변동의 [전체] [기간]) */
.stats-graph-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.stats-graph h3 {
  margin: 0;
  font-size: 1.05rem;
}
.stats-graph-tools:empty {
  display: none;
}
/* 두 개 중 하나 고르기 (자료실 탭과 같은 알약 모양, 작게) */
.g-seg {
  display: flex;
  gap: 2px;
  padding: 2px;
  border-radius: 999px;
  background: var(--g-none);
}
.g-seg button {
  padding: 3px 12px;
  border: none;
  border-radius: 999px;
  background: none;
  color: var(--text-2);
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
}
.g-seg button[aria-pressed="true"] {
  background: var(--card-bg);
  color: var(--text);
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}
.g-seg button:focus-visible {
  outline: 2px solid var(--team);
  outline-offset: 1px;
}
.stats-page .stats-graph-desc {
  margin: 2px 0 14px;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--muted);
}
.stats-page .stats-graph-empty {
  margin: 0;
  padding: 32px 0;
  text-align: center;
  color: var(--muted);
}
.stats-graph-body {
  position: relative;
  min-width: 0;
}

/* 그림 공통: 눈금 · 축 이름 · 평균선 */
.g-svg {
  display: block;
  overflow: visible;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
}
.g-grid {
  stroke: var(--g-grid);
  stroke-width: 1;
}
.g-tick {
  font-size: 11px;
  fill: var(--muted);
}
.g-axis-name {
  font-size: 11.5px;
  font-weight: 600;
  fill: var(--text-2);
}
.g-cross {
  stroke: var(--g-line);
  stroke-width: 1;
}

/* 순위 변동: 왼쪽 눈금 · 가운데 선(기간이면 가로 스크롤) · 오른쪽 팀 이름 */
.g-rank {
  display: flex;
}
.g-rank > svg {
  flex: none;
}
.g-rank-view {
  position: relative;   /* 끝 원 막(.g-rank-dots)이 스크롤 칸 위에 겹쳐요 */
  flex: 1;
  min-width: 0;
}
.g-rank-scroll {
  overflow: hidden;
}
.g-rank-dots {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}
.g-rank-strip {
  fill: var(--card-bg);   /* 끝 원 오른쪽으로 삐져나온 선 가리기 */
}
.g-end-dot.dim {
  opacity: 0.6;
}
/* 가로축 라운드 알약: 누를 수 있는 칩처럼 보이게. 올린 라운드는 진한 알약 */
.g-round rect {
  fill: var(--g-none);
}
.g-round-text {
  font-size: 11px;
  font-weight: 600;
  fill: var(--text-2);
}
.g-round.active rect {
  fill: var(--text);
}
.g-round.active .g-round-text {
  fill: var(--card-bg);
}
.g-round-dot {
  fill: var(--muted);
  opacity: 0.6;
}
/* 가로축에서 라운드를 고르면 원 · 팀 이름이 부드럽게 옮겨가요 (스크롤할 때는 바로) */
.g-rank.g-anim .g-end-dot,
.g-rank.g-anim .g-rank-label {
  transition: transform 0.25s var(--ease);
}
html[data-motion="reduce"] .g-rank.g-anim .g-end-dot,
html[data-motion="reduce"] .g-rank.g-anim .g-rank-label {
  transition: none;
}
/* 기간: 아래 가로 스크롤 막대 (화면 설정과 상관없이 늘 보이게 모양을 직접 정해요) */
.g-rank-scroll.is-range {
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-color: auto;   /* 사이트 전체 막대 색(html)을 풀어야 크롬이 아래 모양을 써요 */
}
.g-rank-scroll.is-range::-webkit-scrollbar {
  height: 8px;
}
.g-rank-scroll.is-range::-webkit-scrollbar-track {
  border-radius: 999px;
  background: var(--g-none);
}
.g-rank-scroll.is-range::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: var(--g-line);
}
.g-rank-scroll.is-range::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}
@supports not selector(::-webkit-scrollbar) {
  .g-rank-scroll.is-range {
    scrollbar-color: var(--g-line) var(--g-none);   /* 파이어폭스 */
  }
}
.g-rank-plot,
.g-rank-side {
  cursor: pointer;
}
.g-svg .g-rank-line {
  fill: none;
  stroke: var(--g-line);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
  transition: opacity 0.15s;
}
.g-svg .g-rank-line.dim {
  opacity: 0.45;
}
.g-svg .g-rank-line.hover {
  stroke-width: 2.5;             /* 마우스를 올린 팀: 팀 색만 (고른 팀은 그대로) */
}
.g-svg .g-rank-line.on {
  stroke-width: 3.5;
}
/* 기간: 20팀 모두 팀 색이라 고르지 않은 선은 살짝 흐리게, 고른 팀은 빛나는 효과 */
.g-rank-plot.is-range .g-rank-line.dim {
  opacity: 0.6;
}
.g-rank-plot.is-range .g-rank-line.on {
  filter: drop-shadow(0 0 3px var(--glow)) drop-shadow(0 0 6px var(--glow));
}
.g-rank-label {
  font-size: 12px;
  fill: var(--muted);
}
.g-rank-label.hover {
  fill: var(--text-2);
  font-weight: 600;
}
.g-rank-label.on {
  font-weight: 700;
  fill: var(--text);
}
.g-end-dot {
  stroke: var(--card-bg);   /* 카드 색 고리: 선과 겹쳐도 또렷하게 */
  stroke-width: 2;
}

/* 공격 vs 수비: 배지는 svg 위에 겹친 span */
.g-scatter {
  position: relative;
}
.g-avg {
  stroke: var(--muted);
  stroke-width: 1;
  opacity: 0.6;
}
.g-avg-name {
  font-size: 10.5px;
  fill: var(--muted);
}
.g-zone {
  font-size: 12px;
  font-weight: 700;
  fill: var(--muted);
  opacity: 0.8;
}
.g-badge {
  position: absolute;
  display: grid;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--card-bg);   /* 겹쳐도 배지마다 또렷하게 */
  cursor: default;
}
.g-badge .team-badge {
  width: 24px;
  font-size: 0.5rem;
}
.g-badge.mine {
  z-index: 1;
  box-shadow: 0 0 0 2px var(--card-bg), 0 0 0 4px var(--team);
}
.g-badge.mine .team-badge {
  width: 30px;
  font-size: 0.6rem;
}
.g-badge:hover,
.g-badge:focus-visible {
  z-index: 2;
  outline: none;
  box-shadow: 0 0 0 2px var(--card-bg), 0 0 0 4px var(--text);
}

/* 골 지분: 왼쪽 도넛 · 오른쪽 목록 */
.g-select {
  margin-bottom: 14px;
  padding: 6px 10px;
  border: 1px solid var(--g-line);
  border-radius: var(--radius-ctl);
  background: var(--card-bg);
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
}
.g-share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
}
.g-donut {
  flex: none;
}
.g-slice {
  stroke: var(--card-bg);   /* 조각 사이 2px 틈 */
  stroke-width: 2;
  transition: opacity 0.15s;
}
.g-slice.dim {
  opacity: 0.3;
}
.g-donut-total {
  font-size: 30px;
  font-weight: 800;
  fill: var(--text);
  font-variant-numeric: normal;
}
.g-donut-unit {
  font-size: 12px;
  fill: var(--muted);
}
.g-legend {
  flex: 1;
  min-width: 180px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.g-legend li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-radius: var(--radius-ctl);
  font-size: 0.86rem;
}
.g-legend li:focus-visible {
  outline: 2px solid var(--team);
}
.g-swatch {
  flex: none;
  width: 12px;
  height: 12px;
  border-radius: 3px;
}
.g-legend-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.g-legend-value {
  flex: none;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

/* 시즌 결과 모자이크: 이름 칸 · 라운드 칸들 · 성적. 칸이 너무 작아지면 옆으로 스크롤 */
.g-legend.g-legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-bottom: 10px;
}
.g-legend-row li {
  padding: 0;
  font-size: 0.8rem;
  color: var(--text-2);
}
.g-mosaic-scroll {
  overflow-x: auto;
  padding-bottom: 4px;
}
.g-mosaic {
  display: grid;
  grid-template-columns: 112px repeat(var(--rounds), minmax(18px, 1fr)) max-content;
  gap: 2px;
  align-items: center;
  min-width: max-content;
}
.g-mosaic-round {
  font-size: 10px;
  color: var(--muted);
  text-align: center;
}
.g-mosaic-team {
  display: flex;
  gap: 6px;
  min-width: 0;
  padding-right: 6px;
  font-size: 0.8rem;
  white-space: nowrap;
}
.g-mosaic-rank {
  flex: none;
  width: 16px;
  color: var(--muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.g-mosaic-name {
  overflow: hidden;
  text-overflow: ellipsis;
}
.g-mosaic-team.mine,
.g-mosaic-record.mine {
  font-weight: 700;
}
.g-mosaic-team.mine .g-mosaic-name {
  box-shadow: inset 0 -2px 0 var(--team);   /* 우리 팀 이름 밑줄 */
}
.g-mosaic-record {
  padding-left: 8px;
  font-size: 0.76rem;
  color: var(--text-2);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.g-cell {
  display: grid;
  place-items: center;
  height: 18px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}
.g-cell-win {
  background: var(--g-win);
  color: var(--g-win-ink);
}
.g-cell-draw {
  background: var(--g-draw);
  color: var(--g-draw-ink);
}
.g-cell-loss {
  background: var(--g-loss);
  color: var(--g-loss-ink);
}
.g-cell-none {
  background: var(--g-none);
}
.g-cell[data-run]:hover {
  box-shadow: 0 0 0 2px var(--text);
}

/* 골 · 도움 지도 */
.g-iso {
  stroke: var(--g-line);
  stroke-width: 1;
  opacity: 0.6;
}
.g-iso-name {
  font-size: 10px;
  fill: var(--muted);
}
.g-dot {
  fill: var(--g-dot);
  fill-opacity: 0.75;
  stroke: var(--card-bg);   /* 겹쳐도 점마다 또렷하게 */
  stroke-width: 1.5;
}
.g-dot.mine {
  fill-opacity: 1;
}
.g-dot-name {
  font-size: 11.5px;
  font-weight: 600;
  fill: var(--text-2);
}
.g-dot-name.mine {
  fill: var(--text);
  font-weight: 800;
}
.g-ring {
  fill: none;
  stroke: var(--text);
  stroke-width: 1.5;
}

/* 그래프 설명 칸 (마우스를 올리면): 값은 굵게, 이름은 아래에 작게 */
.chart-tip {
  position: fixed;
  z-index: 1000;
  max-width: 260px;
  padding: 8px 12px;
  border-radius: var(--radius-ctl);
  background: #1a1b1e;
  color: #ffffff;
  font-size: 0.78rem;
  line-height: 1.5;
  box-shadow: var(--shadow-lift);
  pointer-events: none;
}
html[data-theme="dark"] .chart-tip {
  background: #2a2c31;
}
.chart-tip p {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
}
.chart-tip .chart-tip-strong {
  font-size: 0.9rem;
  font-weight: 700;
  color: #ffffff;
}
html[data-motion="reduce"] .g-svg .g-rank-line,
html[data-motion="reduce"] .g-slice {
  transition: none;
}

/* ─── 경기노트 ───
   다음 경기 · 리그테이블처럼 옅은 회색 둥근 칸(.nm-box). 그 안의 입력칸 · 저장된 노트는 흰 칸이고 윤곽선이 없어요.
   - 왼쪽: 제목, 경기 고르기(누르면 ‹ N라운드 › 칸이 떠요), 경기 정보, 노트 입력칸들, 맨 아래 [삭제] [저장]
   - 오른쪽: 저장된 글들. 경기노트 칸과 높이가 같고, 글이 많아지면 그 칸 안에서만 스크롤돼요.
   .note-field · .note-actions · .note-switch는 다른 페이지(설정 · FAQ · 게임)도 써서,
   경기노트 모양은 모두 .notes-page 안으로 묶었어요. 색은 테마 변수라 다크 모드도 따라가요. */
/* 겉모습 */
.notes-page {
  --pick: #dcdde1;   /* 고른 노트 · 고른 경기: 흰 칸보다 한 단계 진한 회색 */

  display: grid;             /* 폭 · 여백은 "페이지 틀" */
  grid-template-columns: minmax(0, 1fr) 360px;   /* 왼쪽 노트 넓게, 오른쪽 저장된 글들은 고정 폭 */
  gap: var(--panel-gap);
  align-items: stretch;      /* 두 칸 높이를 같게 */
}
html[data-theme="dark"] .notes-page {
  --pick: #34363c;
}

.notes-page .nm-box {
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.notes-page .nm-box h2 {
  margin: 0;                 /* 제목 줄(아래)이 간격을 정해요 */
}

/* 제목 줄: 경기노트 · 오른쪽 끝에 [+ 새 노트] (.round-current가 오른쪽으로 밀어요) */
.note-editor-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

/* ── 한줄평 아래: 안내 · [삭제] [저장] ── */
.notes-page .note-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.notes-page .note-message {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 버튼: 꽉 찬 둥근 네모 (저장 = 팀 색, 삭제 = 옅은 빨강) */
.note-save,
.note-delete {
  padding: 10px 24px;
  border: none;
  border-radius: var(--radius-ctl);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.2s, background-color 0.2s;
}
.note-save {
  background: var(--team);
  color: var(--team-ink);
}
.note-delete {
  background: #fde8e8;
  color: #d6336c;
}
html[data-theme="dark"] .note-delete {
  background: rgba(214, 51, 108, 0.18);
  color: #f783ac;
}

/* ── 경기 고르기 ── */
.note-match-pick {
  position: relative;        /* 라운드 칸이 뜨는 기준 */
  display: flex;
  margin-bottom: 8px;
}
.note-match-btn {
  flex: none;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 10px 18px;
  border: none;
  border-radius: var(--radius-ctl);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s;
}
.note-match-btn[aria-expanded="true"] {
  background: var(--pick);
}
.note-match-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.2s;
}
.note-match-btn[aria-expanded="true"] svg {
  transform: rotate(180deg);
}
.notes-page .note-match-info {
  margin: 0 0 20px 6px;      /* 경기 고르기 칸 바로 아래 */
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 떠 있는 칸: ‹ N라운드 › + 그 라운드 경기들 */
.note-match-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 10;
  width: 380px;
  max-width: 100%;
  box-sizing: border-box;
  padding: 12px;
  border-radius: var(--radius-panel);
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(17, 18, 20, 0.14), 0 0 0 1px var(--line);
}
.note-match-panel[hidden] {
  display: none;
}
.note-round-nav {
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  align-items: center;
  margin-bottom: 8px;
}
.note-round-nav strong {
  text-align: center;
  font-size: 1rem;
  font-weight: 800;
}
.note-round-nav .round-btn {
  background: var(--surface-2);
}
html[data-theme="dark"] .note-round-nav .round-btn {
  background: var(--surface-3);
}

.note-match-options {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.note-match-options button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: none;
  border-radius: var(--radius-ctl);
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s;
}
.note-match-options button.current,
html[data-theme="dark"] .note-match-options button.current {
  background: var(--pick);
  font-weight: 700;
}
/* 아직 안 끝난 경기: 흐리게, 못 눌러요 */
.note-match-options button:disabled {
  color: var(--muted);
  cursor: not-allowed;
}
.pick-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pick-state {
  flex: none;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 0.75rem;
}

/* ── 노트 입력칸들 ── */
.note-form {
  display: flex;
  flex-direction: column;
  gap: var(--card-gap);
}
.note-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--card-gap);
}
.notes-page .note-field {
  gap: 6px;
  min-width: 0;
}
.notes-page .note-field > span:first-child {
  font-weight: 700;
  font-size: 0.9rem;
}

/* 흰 칸, 윤곽선 없음 (눌러서 쓸 때도), 크기 조절 손잡이 없음 */
.notes-page .note-field textarea,
.notes-page .note-field input,
.notes-page .note-field select {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border: none;
  border-radius: var(--radius-ctl);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 400;          /* 위 제목 글씨의 굵기를 물려받지 않게 */
  line-height: 1.6;
  outline: none;
  resize: none;
}
.notes-page .note-field textarea:focus,
.notes-page .note-field input:focus,
.notes-page .note-field select:focus {
  outline: none;
}
.notes-page .note-field textarea::placeholder,
.notes-page .note-field input::placeholder {
  color: var(--muted);
  opacity: 0.8;
}
.notes-page .note-field select {
  cursor: pointer;
}

/* 글자 수: 칸 안 오른쪽 아래 */
.note-input {
  position: relative;
  display: block;
}
.notes-page .note-input textarea {
  padding-bottom: 30px;      /* 글자 수 자리 */
}
.notes-page .note-input.one-line input {
  padding-right: 84px;       /* 한 줄 칸: 글자 수는 오른쪽 가운데 */
}
.note-count {
  position: absolute;
  right: 14px;
  bottom: 8px;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.note-input.one-line .note-count {
  bottom: 50%;
  transform: translateY(50%);
}

/* 별도 흰 칸 안에 (옆 MOM 칸과 같은 높이) */
.notes-page .note-stars {
  display: flex;
  gap: 2px;
  min-height: 48px;
  box-sizing: border-box;
  padding: 0 10px;
  align-items: center;
  justify-content: space-between;   /* 별 10개를 칸 너비에 고르게 펼쳐요 (왼쪽에 몰리지 않게) */
  border-radius: var(--radius-ctl);
  background: var(--surface);
  container-type: inline-size;   /* 별 크기를 이 칸 너비에 맞춰요 */
}
.note-stars .star {
  border: none;
  background: none;
  font-size: 1.4em;
}
/* 좁은 화면에서도 별 10개가 칸 안에 들어가게 (칸 너비의 8%까지만) */
.notes-page .note-stars .star {
  font-size: min(1.4rem, 8cqi);
  line-height: 1;
  color: var(--line-strong);
  cursor: pointer;
  padding: 0 1px;
}
.note-stars .star.on {
  color: #f59f00;
}

/* ── 오른쪽: 저장된 글들 ── */
/* contain: size → 이 칸은 자기 내용으로 높이를 늘리지 않고, 왼쪽 경기노트 칸 높이에 맞춰요 (넘치면 목록만 스크롤) */
.note-saved {
  contain: size;
}
.note-saved-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
/* "내 팀만" 글자 + 스위치: 제목 줄 오른쪽 끝 */
.notes-page .note-saved-head .note-switch {
  margin: 0 0 0 auto;
}
.notes-page .note-list {
  flex: 1;
  min-height: 0;
  list-style: none;
  margin: 0 -6px 0 0;        /* 스크롤바가 칸에 붙지 않게 */
  padding: 0 6px 0 0;
  display: flex;
  flex-direction: column;
  gap: var(--card-gap);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.notes-page .note-list li {
  flex: none;
}

/* 노트 칸: 흰 칸, 윤곽선 없음 (고른 노트는 진한 회색) */
.notes-page .note-list button {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 16px;
  border: none;
  border-radius: var(--radius-card);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s;
}
.notes-page .note-list button.current,
html[data-theme="dark"] .notes-page .note-list button.current {
  background: var(--pick);
}
/* 내 팀 경기 노트: 칸 전체가 팀 색 (고르면 조금 어둡게) */
.notes-page .note-list button.my-team-note,
html[data-theme="dark"] .notes-page .note-list button.my-team-note {
  background: var(--team);
  color: var(--team-ink);
  transition: filter 0.2s;
}
.notes-page .note-list button.my-team-note.current {
  filter: brightness(0.82);
}
.notes-page .note-list button.my-team-note .note-meta {
  color: inherit;
  opacity: 0.85;
}
.note-meta {
  font-size: 0.82rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note-empty {
  color: var(--muted);
  font-size: 0.9rem;
}

/* 좁은 화면(작은 태블릿)에서는 위아래로: 저장된 글들은 높이를 따로 정해요 */
@media (max-width: 960px) {
  .notes-page {
    grid-template-columns: minmax(0, 1fr);
  }
  .note-saved {
    contain: none;
    max-height: 520px;
  }
}

/* "내 팀만" 켜고 끄는 스위치 (게임 페이지도 써요) */
.note-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  font-size: 0.9em;
  cursor: pointer;
  user-select: none;
}
.note-switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.switch-track {
  position: relative;
  width: 36px;
  height: 20px;
  border-radius: 10px;
  background: #bbb;
  transition: background 0.15s;
}
.switch-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  transition: left 0.15s;
}
.note-switch input:checked ~ .switch-track {
  background: #2f9e44;
}
.note-switch input:checked ~ .switch-track::after {
  left: 18px;
}
.note-switch input:focus-visible ~ .switch-track {
  outline: 2px solid black;
  outline-offset: 2px;
}

/* 다른 페이지(설정 · FAQ · 게임)도 쓰는 입력칸 · 버튼 줄 (뼈대용 임시 스타일) */
.note-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.note-field > span {
  font-weight: bold;
  font-size: 0.9em;
}
.note-field textarea,
.note-field input,
.note-field select {
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-ctl);
  background: var(--surface);
  color: var(--text);
  resize: vertical;
}
.note-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ─── FAQ ───
   다른 페이지처럼 옅은 회색 둥근 칸(.nm-box). 그 안에 흰 칸(.faq-panel) 하나가 제목까지 내용 전체를 담아요.
   - 위 칸: 제목(크게), 분류 탭(알약 모양) · 검색창(오른쪽에 돋보기), 질문 목록
   - 아래 칸(문의 안내): 이메일 주소 · 설명. 내용만큼만 높이를 차지해요 (밑에 빈 여백 없음)
   색은 테마 변수라 다크 모드도 따라가요. */
/* 겉모습 */
.faq-page {
  --pick: #dcdde1;   /* 고른 분류 탭: 흰 칸보다 한 단계 진한 회색 */

  display: flex;             /* 폭 · 여백은 "페이지 틀" */
  flex-direction: column;
  gap: var(--panel-gap);
}
html[data-theme="dark"] .faq-page {
  --pick: #34363c;
}

.faq-page .nm-box {
  min-height: 0;   /* 기본 최소 높이(420px)를 풀어서 내용만큼만 */
}

/* 흰 칸: 회색 칸 안을 꽉 채워요 */
.faq-panel {
  padding: 20px;
  border-radius: var(--radius-card);
  background: var(--surface);
}
.faq-page .nm-box h2 {
  margin: 0;
}
.faq-page .faq-panel > h2 {   /* 문의 안내 제목 */
  margin-bottom: 10px;
}

/* 분류 탭 · 검색 한 줄 */
.faq-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

/* 분류 탭: 양옆이 반원인 알약 모양. 옅은 회색, 고르면 진한 회색 + 굵게 */
.faq-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.faq-tabs button {
  padding: 6px 14px;
  border: none;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background-color 0.2s;
}
html[data-theme="dark"] .faq-tabs button {
  background: var(--surface-3);
}
.faq-tabs button.active,
html[data-theme="dark"] .faq-tabs button.active {
  background: var(--pick);
  color: var(--text);
  font-weight: 700;
}

/* 검색창: 오른쪽 끝 (모양은 사이트 공통 검색칸 .site-search) */
.faq-search {
  margin-left: auto;
}

/* 질문 목록 */
.faq-list {
  margin: 0;
  padding-left: 28px;
}
.faq-list li {
  border-bottom: 1px solid var(--line);
}
.faq-list li:last-child {
  border-bottom: none;
}
.faq-list summary {
  padding: 12px 8px;
  border-radius: var(--radius-ctl);
  cursor: pointer;
  font-weight: 700;
}
.faq-answer {
  padding: 2px 8px 14px;
  color: var(--text-2);
  line-height: 1.6;
}
.faq-page .faq-answer p {
  margin: 0 0 4px;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* 문의 안내: 설명 · 이메일 주소(팀 색 글자, 누르면 메일 쓰기) · 짧은 덧붙임 */
.faq-contact p {
  margin: 0 0 10px;
  color: var(--text-2);
  font-size: 0.95rem;
  line-height: 1.6;
}
.faq-page .faq-email {
  display: inline-block;
  margin: 0 0 10px;
  color: var(--team);
  font-size: 1.15rem;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 4px;
  transition: text-decoration-color 0.2s;
}
.faq-page .faq-email:hover {
  text-decoration-color: currentColor;
}
.faq-page .faq-contact .faq-contact-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

/* ─── 설정 ───
   다른 페이지처럼 옅은 회색 둥근 칸(.nm-box) 두 개.
   - 왼쪽: 설정 종류 버튼들. 회색 칸 여백을 좁게 하고, 버튼은 흰 알약 (고른 것은 진한 회색)
   - 오른쪽: 고른 설정. 분야(테마 · 언어 · 비밀번호 …)마다 흰 칸(.settings-group) 하나씩
   .settings-group · .choice-row · .settings-note는 게임 페이지도 써서,
   설정 모양은 모두 .settings-page 안으로 묶었어요(아래 "설정 페이지 모양"). 색은 테마 변수라 다크 모드도 따라가요. */
/* 겉모습 */
.settings-page {
  --pick: #dcdde1;   /* 고른 메뉴 · 고른 선택지: 흰 칸보다 한 단계 진한 회색 */

  display: grid;             /* 폭 · 여백은 "페이지 틀" (관리자 페이지는 아래 .admin-page에서 따로) */
  grid-template-columns: 220px minmax(0, 1fr);
  gap: var(--panel-gap);
  align-items: start;
}
html[data-theme="dark"] .settings-page {
  --pick: #34363c;
}

/* 왼쪽 메뉴: 흰 버튼들 (고른 것은 진한 회색)
   스크롤해도 따라와요: 위쪽 메뉴(68px) 바로 아래에 붙어 있어요 */
.settings-page .settings-nav {
  position: sticky;
  top: calc(68px + var(--page-top));
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: var(--card-gap);
}
.settings-nav button {
  padding: 12px 16px;
  border: none;
  border-radius: var(--radius-card);
  background: var(--surface);
  color: var(--text-2);
  font: inherit;
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s;
}
.settings-nav button.active,
html[data-theme="dark"] .settings-nav button.active {
  background: var(--pick);
  color: var(--text);
  font-weight: 700;
}

/* 오른쪽 내용 칸 */
.settings-page .settings-body {
  min-height: 0;
}

/* 좁은 화면: 위아래로 놓고, 메뉴는 따라오지 않아요 (내용을 가리지 않게) */
@media (max-width: 760px) {
  .settings-page {
    grid-template-columns: minmax(0, 1fr);
  }
  .settings-page .settings-nav {
    position: static;
  }
}
.settings-section h2 {
  margin-top: 0;
}
.settings-section h3 {
  margin: 20px 0 8px;
  font-size: 1em;
}

.settings-group {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-card);
  margin: 0 0 12px;
  padding: 8px 12px 10px;
}
.settings-group legend {
  font-weight: bold;
  padding: 0 4px;
}

.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
}
.choice-column {
  flex-direction: column;
}
.choice {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.choice input:disabled + span {
  opacity: 0.45;
}

.settings-note {
  margin: 6px 0 0;
  font-size: 0.85em;
  opacity: 0.75;
}
.settings-preview {
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(127, 127, 127, 0.12);
  font-size: 0.9em;
}

.block-list {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
}
.block-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 4px;
  border-bottom: 1px solid rgba(127, 127, 127, 0.25);
}

.settings-form {
  max-width: 420px;
}
.settings-message {
  min-height: 1.2em;
  margin: 0;
  font-size: 0.9em;
}
.settings-message.error {
  color: #e03131;
}

.settings-toast {
  min-height: 1.2em;
  margin: 12px 0 0;
  font-size: 0.85em;
  color: #2f9e44;
}

/* ── 설정 페이지 모양 (분야마다 흰 칸) ── */
.settings-page .settings-group {
  min-width: 0;
  margin: 0 0 var(--card-gap);
  padding: 20px;
  border: none;
  border-radius: var(--radius-card);
  background: var(--surface);
}
.settings-page .settings-group:last-child {
  margin-bottom: 0;
}
/* 분야 이름: 흰 칸 안쪽 맨 위 (legend는 원래 테두리 위에 걸쳐서 float로 안으로 넣어요) */
.settings-page .settings-group legend,
.settings-page .settings-group h3 {
  float: left;
  width: 100%;
  margin: 0 0 12px;
  padding: 0;
  font-size: 1rem;
  font-weight: 700;
}
.settings-page .settings-group > legend + *,
.settings-page .settings-group > h3 + * {
  clear: both;
}

/* 선택지: 알약 모양 (고른 것은 진한 회색). 동그라미 버튼은 화면에서만 숨겨요 */
.settings-page .choice-row {
  gap: 8px;
}
.settings-page .choice-column {
  align-items: flex-start;
}
.settings-page .choice {
  position: relative;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 0.92rem;
  transition: background-color 0.2s;
}
html[data-theme="dark"] .settings-page .choice {
  background: var(--surface-3);
}
.settings-page .choice:has(input:checked),
html[data-theme="dark"] .settings-page .choice:has(input:checked) {
  background: var(--pick);
  color: var(--text);
  font-weight: 700;
}
.settings-page .choice:has(input:disabled) {
  opacity: 0.45;
  cursor: not-allowed;
}
.settings-page .choice input:disabled + span {
  opacity: 1;   /* 흐리게는 칸 전체(위)에서 해요 */
}
.settings-page .choice:has(input:focus-visible) {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}
.settings-page .choice input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}

.settings-page .settings-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.6;
}
.settings-page .settings-group > .settings-note:first-child {
  margin: 0 0 12px;
}

/* 언어 · 단위 미리 보기: 흰 칸들과 구분되게 점선 */
.settings-page .settings-preview {
  margin: 12px 0 0;
  padding: 12px 16px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-ctl);
  background: none;
  color: var(--text-2);
  font-size: 0.9rem;
}

/* 비밀번호 · 탈퇴: 입력칸은 흰 칸 오른쪽 끝까지, 버튼은 오른쪽 끝에 */
.settings-page .settings-form {
  max-width: none;
}
.settings-page #logout {
  display: block;
  margin-left: auto;
}

.settings-page .settings-message {
  margin: 0;
  font-size: 0.9rem;
}

/* 내 정보 */
.settings-page .info-list {
  gap: 8px 20px;
  margin: 0;
  font-size: 0.95rem;
}
.settings-page .info-list dt {
  color: var(--muted);
}

/* 차단 목록 */
.settings-page .block-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.settings-page .block-list li:last-child {
  border-bottom: none;
}
.settings-page .block-list .compare-toggle {
  padding: 6px 14px;
  border: none;
  border-radius: var(--radius-ctl);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 700;
  transition: background-color 0.2s;
}
html[data-theme="dark"] .settings-page .block-list .compare-toggle {
  background: var(--surface-3);
}

/* 비밀번호 · 탈퇴 입력칸: 흰 칸 안이라 옅은 회색 칸, 윤곽선 없음 */
.settings-page .note-field > span {
  font-size: 0.9rem;
}
.settings-page .note-field input {
  padding: 12px 14px;
  border: none;
  border-radius: var(--radius-ctl);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
}
html[data-theme="dark"] .settings-page .note-field input {
  background: var(--surface-3);
}
.settings-page .note-field input:focus-visible {
  box-shadow: 0 0 0 2px var(--line-strong);
}

/* 로그아웃: 조용한 회색 버튼 */
.settings-plain {
  padding: 10px 24px;
  border: none;
  border-radius: var(--radius-ctl);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s;
}
html[data-theme="dark"] .settings-plain {
  background: var(--surface-3);
}
.settings-plain:disabled {   /* 응원 팀 바꾸기: 7일 제한 중 */
  opacity: 0.45;
  cursor: not-allowed;
}

/* ─── 다크 테마 (뼈대용 간단한 색 바꾸기) ───
   설정 > 화면 > 테마에서 다크를 고르면 <html data-theme="dark">가 돼요.
   CSS 디자인 단계에서 색을 변수로 정리하면서 다시 다듬을 거예요. */
html[data-theme="dark"] {
  color-scheme: dark;        /* 입력칸 · 스크롤바 같은 브라우저 기본 부품도 어둡게 */
}
html[data-theme="dark"] body {
  background: #16181c;
  color: #e6e6e6;
}
html[data-theme="dark"] a {
  color: #8ab4f8;
}
html[data-theme="dark"] .nm-box {
  border-color: #8a8a8a;
}
html[data-theme="dark"] dialog {
  background: #1f2227;
  color: #e6e6e6;
}
html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select,
html[data-theme="dark"] button {
  color: inherit;
}
html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
  background: #24272d;
  border-color: #666;
}
html[data-theme="dark"] .predict-save,
html[data-theme="dark"] .match-list button.current,
html[data-theme="dark"] .note-list button.current {
  border-color: #e6e6e6;
}
html[data-theme="dark"] .match-notice,
html[data-theme="dark"] .fixture-notice,
html[data-theme="dark"] .ranking-list li.me {
  background: #4a3f1f;
}
html[data-theme="dark"] .compare-stats dd.better,
html[data-theme="dark"] .compare-table td.better {
  background: #1f3a28;
}

/* ─── 게임 (뼈대용 임시 스타일) ─── */
/* 게임 목록: 제목 · 한 줄 소개 아래에 회색 판 하나, 그 안에 게임마다 흰 칸 (폭 · 여백은 "페이지 틀") */
.games-page > h2 {
  margin: 0 0 4px;
  font-size: 1.25rem;        /* 다른 판의 제목과 같은 크기 */
  font-weight: 800;
  letter-spacing: -0.02em;
}
.games-page > .settings-note {
  margin: 0 0 16px;
  color: var(--muted);
  opacity: 1;
}
.game-list {
  list-style: none;
  padding: var(--panel-pad);
  margin: 0 0 12px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--card-gap);
  border-radius: var(--radius-panel);
  background: var(--surface-3);
}
@media (max-width: 800px) {
  .game-list {
    grid-template-columns: 1fr;
  }
}
.game-card {
  display: block;
  height: 100%;
  box-sizing: border-box;
  padding: 20px;
  border-radius: var(--radius-card);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
}
html[data-theme="dark"] .game-card {
  background: var(--surface-2);
}
.game-card.disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.game-card h3 {
  margin: 0 0 6px;
}
.game-card p {
  margin: 6px 0 0;
  line-height: 1.5;
}
.game-tags {
  display: flex;
  gap: 4px;
}
.game-tag {
  font-size: 0.75em;
  padding: 1px 8px;
  border: 1px solid currentColor;
  border-radius: 10px;
}

/* 게임 페이지의 버튼 · 탭: 다른 페이지와 같은 모양
   (이름은 승부예측 페이지와 같지만, 승부예측 쪽 모양은 .prediction-page 안에만 있어요) */
:is(.ball-page, .fb-page) .predict-save {
  display: inline-flex;
  align-items: center;
  padding: 9px 22px;
  border: none;
  border-radius: var(--radius-ctl);
  background: var(--team);
  color: var(--team-ink);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
:is(.ball-page, .fb-page) .predict-save:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.guess-page .tab-group {
  display: flex;
  gap: 4px;
}
.guess-page .tab-group button {
  padding: 4px 12px;
  border: none;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}
html[data-theme="dark"] .guess-page .tab-group button {
  background: var(--surface-2);
}
.guess-page .tab-group button.active {
  background: var(--pick);
  color: var(--text);
  font-weight: 700;
}

/* 로고 공 승부 (폭 · 여백은 "페이지 틀") */
.ball-page {
  display: grid;
  grid-template-columns: 1fr 600px;
  gap: var(--panel-gap);
  align-items: start;
}
@media (max-width: 1000px) {
  .ball-page {
    grid-template-columns: 1fr;
  }
}
.ball-setup h2 {
  margin-top: 0;
}
.ball-teams {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 12px;
}
.ball-teams .note-field {
  flex: 1;
}
.ball-vs {
  padding-bottom: 8px;
  font-weight: bold;
}
.ball-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.ball-score {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.2em;
}
.ball-score strong {
  font-size: 1.4em;
}
.ball-minute {
  font-size: 0.8em;
  padding: 2px 8px;
  border: 1px solid currentColor;
  border-radius: 10px;
}
#ball-canvas {
  width: 100%;
  max-width: 560px;
  height: auto;
}
.ball-end {
  width: 100%;
  text-align: center;
}
.ball-result {
  font-size: 1.1em;
  font-weight: bold;
}
.ball-end .note-actions {
  justify-content: center;
  align-items: center;
}
a.predict-save {
  display: inline-block;
  color: inherit;
  text-decoration: none;
}

/* 오늘의 선수 맞히기 (폭 · 여백은 "페이지 틀") */
.guess-page {
  --pick: #dcdde1;   /* 고른 탭: 흰 칸보다 한 단계 진한 회색 (승부예측 · 설정과 같아요) */
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: var(--panel-gap);
  align-items: start;
}
html[data-theme="dark"] .guess-page {
  --pick: #34363c;
}
@media (max-width: 900px) {
  .guess-page {
    grid-template-columns: 1fr;
  }
}
.guess-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.guess-head h2 {
  margin: 0;
}
.guess-side {
  display: flex;
  flex-direction: column;
  gap: var(--panel-gap);
}
.guess-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}
.guess-input-row .round-current {
  margin-left: 0;
}
.guess-search {
  position: relative;   /* 자동완성 목록을 입력칸 바로 아래에 띄우려고 */
  flex: 1;
}
.guess-search input {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-ctl);
  background: var(--surface);
  color: var(--text);
}
.guess-suggest {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  top: calc(100% + 2px);
  max-height: 260px;
  overflow-y: auto;
  list-style: none;
  margin: 0;
  padding: 4px 0;
  border: 1px solid #999;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.guess-suggest li {
  padding: 6px 10px;
  cursor: pointer;
}
.guess-suggest li:hover,
.guess-suggest li.active {
  background: var(--hover-bg);
}
.guess-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 4px;
  margin-top: 8px;
}
.guess-table th {
  font-size: 0.85em;
  font-weight: bold;
  text-align: center;
}
.guess-table td {
  padding: 8px 6px;
  border-radius: 6px;
  text-align: center;
  white-space: nowrap;
}
.guess-name {
  font-weight: bold;
  text-align: left !important;
}
.guess-cell.hit {
  background: #2f9e44;
  color: #ffffff;
}
.guess-cell.near {
  background: #f2c94c;
  color: #111111;
}
.guess-cell.miss {
  background: rgba(127, 127, 127, 0.25);
}
.guess-end {
  margin-top: 12px;
  text-align: center;
}
.guess-how {
  margin: 0;
  padding-left: 18px;
  line-height: 1.6;
  font-size: 0.9em;
}
.guess-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  text-align: center;
}
.guess-stats div {
  display: flex;
  flex-direction: column;
}
.guess-stats strong {
  font-size: 1.4em;
}
.guess-stats span {
  font-size: 0.75em;
  opacity: 0.75;
}
.guess-dist {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}
.guess-dist li {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 3px 0;
  font-size: 0.85em;
}
.guess-dist li > span:first-child {
  width: 12px;
  text-align: right;
}
.guess-bar {
  box-sizing: border-box;
  padding: 1px 6px;
  text-align: right;
  background: rgba(127, 127, 127, 0.35);
  border-radius: 4px;
}
html[data-theme="dark"] .guess-suggest {
  background: #24272d;
}

/* 미니 축구 (폭 · 여백은 "페이지 틀") */
.fb-page {
  display: flex;
  flex-direction: column;
  gap: var(--panel-gap);
}
.fb-setup h2 {
  margin-top: 0;
}
.fb-setup-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px;
}
.fb-setup-row .ball-teams {
  flex: 1;
  min-width: 320px;
  margin-bottom: 0;
}
.fb-level {
  margin: 0;
}
.fb-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  scroll-margin-top: 84px;   /* 킥오프 때 경기장으로 내려가도 위쪽 메뉴에 가리지 않게 */
}
/* 3D 경기장: 가로세로 16:10, 골 표시 · 안내 글은 그 위에 겹쳐요 */
.fb-view {
  position: relative;
  width: 100%;
}
#fb-canvas {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  background: #9fd3f2;
  touch-action: none;
}
.fb-flash {
  position: absolute;
  left: 0;
  right: 0;
  top: 12%;
  margin: 0;
  text-align: center;
  font-size: 3em;
  font-weight: bold;
  color: #ffffff;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.45), 0 0 18px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}
.fb-notice {
  position: absolute;
  left: 50%;
  bottom: 6%;
  transform: translateX(-50%);
  margin: 0;
  padding: 4px 14px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.55);
  color: #ffffff;
  font-weight: bold;
  pointer-events: none;
}
/* 화면 밖 동료 표시: 화면 끝의 동그라미(등번호) + 선수 쪽을 가리키는 뾰족한 끝 + 하는 일 */
.fb-edge {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.fb-edge-mark {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
}
.fb-edge-mark[hidden] {
  display: none;
}
.fb-edge-num {
  position: absolute;
  left: -15px;
  top: -15px;
  width: 30px;
  height: 30px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  background: var(--kit, #ffffff);
  color: var(--kit-text, #111111);
  font-size: 0.8em;
  font-weight: bold;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}
.fb-edge-tip {
  position: absolute;
  left: 0;
  top: -7px;
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 10px solid rgba(255, 255, 255, 0.9);
  transform-origin: 0 7px;
}
.fb-edge-mark.is-me .fb-edge-num {
  border-color: #ffe066;
  box-shadow: 0 0 0 2px #ffe066, 0 1px 4px rgba(0, 0, 0, 0.45);
}
.fb-edge-mark.is-me .fb-edge-tip {
  border-left-color: #ffe066;
}
.fb-edge-tag {
  position: absolute;
  left: 0;
  top: 17px;
  transform: translateX(-50%);
  padding: 1px 6px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.65);
  color: #ffffff;
  font-size: 0.7em;
  font-weight: bold;
  white-space: nowrap;
}
.fb-edge-mark.tag-up .fb-edge-tag {
  top: auto;
  bottom: 17px;
}
.fb-edge-tag[hidden] {
  display: none;
}
.fb-edge-tag.tag-ask { background: #f08c00; }
.fb-edge-tag.tag-run { background: #2f9e44; }
.fb-edge-tag.tag-overlap { background: #0c8599; }
.fb-edge-tag.tag-press { background: #e03131; }
.fb-edge-tag.tag-cover { background: #1971c2; }
.fb-edge-tag.tag-receive { background: #6741d9; }
.fb-card {
  position: absolute;
  right: 14px;
  top: 64px;
  margin: 0;
  padding: 6px 12px 6px 34px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.65);
  color: #ffffff;
  font-weight: bold;
  pointer-events: none;
}
/* 카드 그림: 왼쪽에 노란 · 빨간 네모 */
.fb-card::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 50%;
  width: 14px;
  height: 19px;
  margin-top: -9.5px;
  border-radius: 2px;
  background: #ffd43b;
}
.fb-card.is-red::before {
  background: #e03131;
}
.fb-celebrate {
  position: absolute;
  left: 50%;
  bottom: 14%;
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  max-width: calc(100% - 32px);
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.6);
  color: #ffffff;
}
.fb-celebrate[hidden] {
  display: none;
}
.fb-celebrate p {
  width: 100%;
  margin: 0 0 4px;
  text-align: center;
  font-weight: bold;
}
.fb-celebrate button {
  color: inherit;
  border-color: rgba(255, 255, 255, 0.7);
}
.fb-view-note {
  position: absolute;
  inset: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  text-align: center;
  color: #1d1d1d;
}
.fb-touch {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  user-select: none;
  -webkit-user-select: none;
}
.fb-touch[hidden] {
  display: none;
}
.fb-stick {
  position: relative;
  width: 130px;
  height: 130px;
  flex-shrink: 0;
  border: 2px solid currentColor;
  border-radius: 50%;
  touch-action: none;
}
.fb-stick-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 52px;
  height: 52px;
  margin: -26px 0 0 -26px;
  border-radius: 50%;
  background: rgba(127, 127, 127, 0.45);
  pointer-events: none;
}
.fb-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.fb-touch-button {
  min-width: 72px;
  min-height: 52px;
  padding: 4px 6px;
  font: inherit;
  font-size: 0.85em;
  border: 2px solid currentColor;
  border-radius: 12px;
  background: none;
  touch-action: none;
}
.fb-touch-button:active {
  background: rgba(127, 127, 127, 0.3);
}
.fb-touch-shoot {
  font-weight: bold;
}
.fb-keys {
  width: 100%;
}
.fb-keys summary {
  cursor: pointer;
  font-weight: bold;
}
.fb-keys-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (max-width: 800px) {
  .fb-keys-grid {
    grid-template-columns: 1fr;
  }
}
.fb-keys h3 {
  margin: 10px 0 6px;
  font-size: 0.95em;
}
.fb-keys dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 10px;
  margin: 0;
  font-size: 0.9em;
}
.fb-keys dd {
  margin: 0;
}
.fb-keys kbd {
  display: inline-block;
  padding: 0 6px;
  border: 1px solid currentColor;
  border-bottom-width: 2px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.9em;
}

/* 미니 축구 전체화면: 경기장이 화면을 채우고, 점수판 · 태블릿 버튼은 위에 겹쳐요
   (같은 규칙을 표준 · 사파리용으로 두 번 써요. 한 줄에 같이 쓰면 사파리가 아닌 브라우저가 전체를 무시해요) */
.fb-stage:fullscreen {
  position: relative;
  display: block;
  width: 100vw;
  height: 100vh;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #000000;
}
.fb-stage:fullscreen .fb-view {
  position: absolute;
  inset: 0;
}
.fb-stage:fullscreen #fb-canvas {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  border-radius: 0;
}
.fb-stage:fullscreen .ball-score {
  position: absolute;
  z-index: 2;
  top: 12px;
  left: 14px;   /* 중계 화면처럼 왼쪽 위 */
  padding: 4px 14px;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.55);
  color: #ffffff;
}
.fb-stage:fullscreen .fb-touch {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: 12px;
  box-sizing: border-box;
  padding: 0 16px;
  color: #ffffff;
}
.fb-stage:fullscreen .ball-score button {
  color: inherit;
  border-color: rgba(255, 255, 255, 0.6);
}
.fb-stage:fullscreen .fb-keys {
  display: none;
}
/* 경기가 끝나도 전체화면 그대로: 결과 · 다시 하기 · 승부예측을 경기장 가운데에 띄워요 */
.fb-stage:fullscreen .ball-end {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: auto;
  min-width: 280px;
  max-width: calc(100% - 32px);
  box-sizing: border-box;
  padding: 16px 24px;
  border: 3px solid #000000;
  border-radius: 12px;
  background: #ffffff;
  color: #1d1d1d;
}
.fb-stage:-webkit-full-screen {
  position: relative;
  display: block;
  width: 100vw;
  height: 100vh;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #000000;
}
.fb-stage:-webkit-full-screen .fb-view {
  position: absolute;
  inset: 0;
}
.fb-stage:-webkit-full-screen #fb-canvas {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  border-radius: 0;
}
.fb-stage:-webkit-full-screen .ball-score {
  position: absolute;
  z-index: 2;
  top: 12px;
  left: 14px;   /* 중계 화면처럼 왼쪽 위 */
  padding: 4px 14px;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.55);
  color: #ffffff;
}
.fb-stage:-webkit-full-screen .fb-touch {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: 12px;
  box-sizing: border-box;
  padding: 0 16px;
  color: #ffffff;
}
.fb-stage:-webkit-full-screen .ball-score button {
  color: inherit;
  border-color: rgba(255, 255, 255, 0.6);
}
.fb-stage:-webkit-full-screen .fb-keys {
  display: none;
}
/* 경기가 끝나도 전체화면 그대로: 결과 · 다시 하기 · 승부예측을 경기장 가운데에 띄워요 */
.fb-stage:-webkit-full-screen .ball-end {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: auto;
  min-width: 280px;
  max-width: calc(100% - 32px);
  box-sizing: border-box;
  padding: 16px 24px;
  border: 3px solid #000000;
  border-radius: 12px;
  background: #ffffff;
  color: #1d1d1d;
}

/* ⚠️ 개발용 테스트 시계 막대 (DEV_MODE · 흐르는 시계일 때만, js의 renderDevClock) */
.dev-clock {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px 6px 14px;
  border-radius: 999px;
  background: #111214;
  color: #ffffff;
  font-size: 0.8rem;
  box-shadow: 0 6px 20px rgba(17, 18, 20, 0.3);
}
.dev-clock-time {
  margin-right: 4px;
  font-variant-numeric: tabular-nums;   /* 초가 바뀌어도 폭이 그대로 */
}
.dev-clock button {
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  background: transparent;
  color: #ffffff;
  font: inherit;
  cursor: pointer;
}
.dev-clock button[aria-pressed="true"] {
  background: #ffffff;
  color: #111214;
}

/* ═════════════════════════════════════════════
   관리자 페이지 (admin.html)
   설정 페이지 모양(왼쪽 메뉴 + 오른쪽 흰 칸들)을 그대로 쓰고, 표 · 버튼 · 입력칸만 더해요.
   테마는 항상 깔끔(skin.js의 FIXED_SKIN_PAGES), 색은 PL 보라.
   ═════════════════════════════════════════════ */
.admin-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 40px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.admin-brand {
  margin-right: auto;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 800;
  text-decoration: none;
}
.admin-who {
  color: var(--muted);
  font-size: 0.85rem;
}
.admin-link {
  padding: 6px 12px;
  border: none;
  border-radius: 999px;
  background: none;
  color: var(--text-2);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.admin-link:hover {
  background: var(--hover-bg);
}

/* 들어오기 전 안내 · 2단계 인증 */
.admin-gate {
  max-width: 440px;
  margin: 60px auto;
  padding: 32px 28px;
  box-sizing: border-box;
  border-radius: var(--radius-box);
  background: var(--surface-3);
  text-align: center;
}
.admin-gate[hidden],
.admin-toast[hidden] {
  display: none;
}
.admin-gate h1 {
  margin: 0 0 10px;
  font-size: 1.3rem;
  font-weight: 800;
}
.admin-gate-text {
  margin: 0;
  color: var(--text-2);
}
.admin-qr {
  display: block;
  width: 200px;
  height: 200px;
  margin: 12px auto;
  padding: 8px;
  border-radius: 12px;
  background: #ffffff;   /* QR 코드는 다크 모드에서도 흰 바탕이어야 읽혀요 */
}
.admin-mfa-form {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}
.admin-mfa-form input {
  width: 150px;
  padding: 10px 12px;
  border: none;
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 1.2rem;
  letter-spacing: 0.25em;
  text-align: center;
}
.admin-message {
  min-height: 1.2em;
  margin: 10px 0 0;
  color: #e03131;
  font-size: 0.85rem;
}

/* 본문: 위쪽 메뉴가 없어서 "페이지 틀"을 안 써요 → 폭 · 여백을 여기서 정해요 */
.admin-page {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  box-sizing: border-box;
  padding: 40px 40px 48px;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 28px;
}
@media (max-width: 760px) {
  .admin-page {
    grid-template-columns: minmax(0, 1fr);
    padding: 24px 20px 32px;
  }
}
@media (max-width: 640px) {
  .admin-page {
    padding: 14px 12px 28px;
  }
}
.admin-page .settings-nav {
  top: 24px;   /* 관리자 페이지는 위쪽 메뉴가 따라오지 않아요 */
}
.admin-note {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.6;
}
.admin-muted {
  color: var(--muted);
  font-size: 0.82rem;
}
.admin-empty {
  margin: 8px 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* 첫 화면 숫자 칸 */
.admin-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin: 0 0 12px;
}
.admin-tile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  border-radius: 18px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 0.85rem;
}
.admin-tile-n {
  color: var(--text);
  font-size: 1.6rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* 신고함 탭 (처리 전 / 처리함) */
.admin-tabs {
  display: flex;
  gap: 6px;
  margin: 0 0 14px;
}
.admin-tabs button {
  padding: 7px 14px;
  border: none;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}
.admin-tabs button.active {
  background: var(--team);
  color: var(--team-ink);
}

/* 글 · 댓글 · 공지 한 개 */
.admin-item {
  padding: 12px 0;
  border-top: 1px solid var(--line-strong);
}
.admin-item:first-of-type,
.settings-group > h3 + .admin-item {
  border-top: none;
}
.admin-item-title {
  margin: 0 0 4px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.admin-content {
  max-height: 8.5em;
  overflow: auto;
  margin: 6px 0;
  font-size: 0.9rem;
  line-height: 1.6;
  white-space: pre-wrap;     /* 회원이 쓴 줄바꿈 그대로 */
  overflow-wrap: anywhere;
}
.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.admin-page .bd-btn {
  padding: 7px 14px;
  font-size: 0.82rem;
}
.admin-page .bd-btn.quiet {
  background: var(--surface-2);
}
html[data-theme="dark"] .admin-page .bd-btn.quiet {
  background: var(--surface-3);
}
.admin-page .bd-btn.danger {
  color: #e03131;
}

/* 입력 양식 */
.admin-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.admin-grid-form {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px 16px;
}
.admin-grid-form .admin-actions {
  grid-column: 1 / -1;
}
.admin-inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
  margin: 0 0 12px;
}
.admin-inline-form > input[type="text"],
.admin-inline-form > .admin-field {
  flex: 1;
  min-width: 160px;
}
.admin-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--text-2);
  font-size: 0.82rem;
  font-weight: 600;
}
.admin-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  cursor: pointer;
}
.admin-page input[type="text"],
.admin-page input[type="number"],
.admin-page input[type="datetime-local"],
.admin-page select,
.admin-page textarea {
  box-sizing: border-box;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--surface-2);   /* 흰 칸 위라 옅은 회색 */
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
}
html[data-theme="dark"] .admin-page input[type="text"],
html[data-theme="dark"] .admin-page input[type="number"],
html[data-theme="dark"] .admin-page input[type="datetime-local"],
html[data-theme="dark"] .admin-page select,
html[data-theme="dark"] .admin-page textarea {
  background: var(--surface-3);
}
.admin-page textarea {
  resize: vertical;
}
.admin-page input.admin-days {
  width: 100px;
}
.admin-inline-form > select {
  width: auto;
}
/* 한국어 · 영어 두 칸 나란히 (관리자가 쓰는 글은 두 언어 모두 받아요) */
.admin-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
}

/* 목록 (회원 · 팀별 팬 수 · 제재 기록 · 활동 기록) */
.admin-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.admin-list li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
  padding: 10px 6px;
  border-top: 1px solid var(--line-strong);
}
.admin-list li:first-child {
  border-top: none;
}
.admin-list.compact li {
  padding: 7px 4px;
}
.admin-member-row {
  border-radius: 10px;
  cursor: pointer;
}
.admin-member-row:hover {
  background: var(--surface-2);
}
.admin-log li {
  flex-direction: column;
}
.admin-detail {
  color: var(--muted);
  font-size: 0.75rem;
  overflow-wrap: anywhere;
}
.admin-info dd {
  overflow-wrap: anywhere;
}

/* 금칙어 알약 (누르면 지워요) */
.admin-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.admin-chip {
  padding: 6px 12px;
  border: none;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

/* 화면 아래 알림 */
.admin-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 50;
  transform: translateX(-50%);
  margin: 0;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}
.admin-toast.error {
  background: #e03131;
  color: #ffffff;
}

/* ═════════════════════════════════════════════
   버튼 반응 (사이트 전체 같은 규칙 — 게시판에서 정한 방식)
   - 마우스를 올리면 살짝 밝게, 누르면 아주 밝게. 눌러도 모양 · 크기 · 자리는 그대로예요 (작아지거나 뜨지 않아요).
   - 방법: 버튼 위에 막(안쪽 그림자)을 덮어요. 둥근 모서리 · 글자는 그대로예요.
     팀 색 · 회색 · 어두운 버튼 = 흰 막 / 흰 버튼 · 흰 바탕 위의 바탕 없는 버튼 = 회색 막 (라이트 모드). 다크 모드는 모두 흰 막.
   - 고르는 칩 · 탭 · 켜기/끄기(말머리 탭, 좋아요/싫어요 …)는 고른 상태가 따로 보여서, 누를 때는 막이 없고 올렸을 때만.
   - 새 버튼을 만들면 아래 목록에 이름을 넣어요 (흰 버튼이면 "회색 막" 목록에도).
   ⚠️ 맨 아래 "작은 화면"보다 앞, 페이지 규칙들보다 뒤에 둬야 해요 (같은 힘의 규칙이면 뒤에 있는 게 이겨요).
   ═════════════════════════════════════════════ */
:root {
  --lift-hover: rgba(255, 255, 255, 0.22);
  --lift-press: rgba(255, 255, 255, 0.5);
}
html[data-theme="dark"] {
  --lift-hover: rgba(255, 255, 255, 0.1);
  --lift-press: rgba(255, 255, 255, 0.24);
}

/* 회색 막 (라이트 모드): 흰 버튼 · 흰 바탕 위의 바탕 없는 버튼 */
html:not([data-theme="dark"]) .board-area .bd-btn.quiet,
html:not([data-theme="dark"]) .board-area .pagination button,
html:not([data-theme="dark"]) .board-area .reaction-btn,
html:not([data-theme="dark"]) .board-area .post-more-btn,
html:not([data-theme="dark"]) .board-area .post-more-menu button,
html:not([data-theme="dark"]) .site-search-button,
html:not([data-theme="dark"]) .dialog-close,
html:not([data-theme="dark"]) .menu-toggle,
html:not([data-theme="dark"]) .notice-item,
html:not([data-theme="dark"]) .share-target,
html:not([data-theme="dark"]) .match-info,
html:not([data-theme="dark"]) .match-jump,
html:not([data-theme="dark"]) .sub-toggle[aria-pressed="false"],
html:not([data-theme="dark"]) .strip-team.pickable,
html:not([data-theme="dark"]) .art-item,
html:not([data-theme="dark"]) .tactics-step,
html:not([data-theme="dark"]) .news-page .pagination button,
html:not([data-theme="dark"]) .viewer-arrow,
html:not([data-theme="dark"]) button.fixture-item:not(.finished),
html:not([data-theme="dark"]) .round-btn,
html:not([data-theme="dark"]) .view-back,
html:not([data-theme="dark"]) .prediction-page .tab-group button,
html:not([data-theme="dark"]) .prediction-page .predict-list button,
html:not([data-theme="dark"]) .team-menu button,
html:not([data-theme="dark"]) .compare-toggle,
html:not([data-theme="dark"]) .note-match-btn,
html:not([data-theme="dark"]) .note-match-options button,
html:not([data-theme="dark"]) .notes-page .note-list button,
html:not([data-theme="dark"]) .faq-list summary,
html:not([data-theme="dark"]) .settings-nav button,
html:not([data-theme="dark"]) a.game-card,
html:not([data-theme="dark"]) .guess-page .tab-group button,
html:not([data-theme="dark"]) .stats-page .tab-group button,
html:not([data-theme="dark"]) .stats-info-btn,
html:not([data-theme="dark"]) .stats-top li.is-link,
html:not([data-theme="dark"]) .profile-back,
html:not([data-theme="dark"]) .auth .social-button--google,
html:not([data-theme="dark"]) .avatar-tile {
  --lift-hover: rgba(0, 0, 0, 0.05);
  --lift-press: rgba(0, 0, 0, 0.13);
}
/* (:has()를 쓰는 이름은 따로: 이걸 모르는 옛 브라우저에서도 위 목록은 그대로 먹게) */
html:not([data-theme="dark"]) .news-viewer:has(.news-card-pl) .viewer-close {   /* PL 공통 기사는 흰 카드 */
  --lift-hover: rgba(0, 0, 0, 0.05);
  --lift-press: rgba(0, 0, 0, 0.13);
}
/* 단, 회색 칸 위 버튼(게시판 목록 위 정렬) · 팀 색이나 진한 회색으로 고른 상태는 다시 흰 막 */
html:not([data-theme="dark"]) .board-area .board-head .bd-btn.quiet,
html:not([data-theme="dark"]) .board-area .reaction-btn[aria-pressed="true"],
html:not([data-theme="dark"]) .board-area .pagination button.active,
html:not([data-theme="dark"]) .tactics-step.active,
html:not([data-theme="dark"]) .round-btn[aria-expanded="true"],
html:not([data-theme="dark"]) .note-round-nav .round-btn,
html:not([data-theme="dark"]) .prediction-page .tab-group button.active,
html:not([data-theme="dark"]) .prediction-page .predict-list button.current,
html:not([data-theme="dark"]) .settings-page .block-list .compare-toggle,
html:not([data-theme="dark"]) .note-match-btn[aria-expanded="true"],
html:not([data-theme="dark"]) .notes-page .note-list button.current,
html:not([data-theme="dark"]) .notes-page .note-list button.my-team-note,
html:not([data-theme="dark"]) .settings-nav button.active,
html:not([data-theme="dark"]) .guess-page .tab-group button.active,
html:not([data-theme="dark"]) .stats-page .tab-group button.active {
  --lift-hover: rgba(255, 255, 255, 0.22);
  --lift-press: rgba(255, 255, 255, 0.5);
}

/* 마우스를 올렸을 때: 모든 버튼 */
.board-area .bd-btn:hover,
.board-area .pagination button:hover,
.board-area .comment-actions button:hover,
.board-area .reaction-btn:hover,
.board-area .post-more-btn:hover,
.board-area .post-more-menu button:hover,
.board-area .back-link:hover,
.board-area .flair-filter button:hover::before,   /* 말머리 탭은 사다리꼴 모양(::before)에 덮어요 */
.site-search-button:hover,
.dialog-close:hover,
.menu-toggle:hover,
.menu-drawer a:hover,
.menu-circle:hover,
.notice-item:hover,
.share-target:hover,
.share-copy:hover,
.match-info:hover,
.match-jump:hover,
.sub-toggle:hover,
.picker-arrow:not(:disabled):hover,
.picker-current:hover,
.picker-item:not(:disabled):hover,
.panel-icon-btn:not(:disabled):hover,
.mode-toggle button:not(:disabled):hover,
.strip-team.pickable:hover,
.art-back:hover,
.art-item:hover,
.tactics-step:hover,
.formation-grid button:hover,
.tactics-play:hover,
.nm-lid:hover,
.match-list button:not(:disabled):hover,
.news-filter button:hover,
.news-page .pagination button:hover,
.club-slideshow .news-arrow:hover,
.viewer-close:hover,
.viewer-arrow:not(:disabled):hover,
.round-arrow:hover,
.round-current:hover,
button.fixture-item:hover,
.club-more:hover,
.prediction-page .predict-save:not(:disabled):hover,
.predict-info-btn:hover,
.stats-info-btn:hover,
.round-btn:not(:disabled):hover,
.round-picker button:hover,
.view-back:hover,
.prediction-page .tab-group button:hover,
.team-menu button:hover,
.compare-toggle:hover,
.note-match-btn:hover,
.note-match-options button:not(:disabled):hover,
.note-save:hover,
.note-delete:hover,
.notes-page .note-list button:hover,
.faq-tabs button:hover,
.faq-list summary:hover,
.settings-nav button:hover,
.settings-plain:not(:disabled):hover,
a.game-card:hover,
:is(.ball-page, .fb-page) .predict-save:not(:disabled):hover,
.guess-page .tab-group button:hover,
.stats-page .tab-group button:hover,
.stats-top li.is-link:hover,
.profile-back:hover,
.user-edit-btn:hover,
.auth .social-button:not(:disabled):hover,
.avatar-tile:hover {
  box-shadow: inset 0 0 0 999px var(--lift-hover);
}
.settings-page .choice:not(:has(input:disabled)):hover {   /* :has()를 쓰는 이름은 따로 */
  box-shadow: inset 0 0 0 999px var(--lift-hover);
}

/* 눌렀을 때: 고르는 칩 · 탭 · 켜기/끄기는 빼요 (고른 상태가 따로 보여서) */
.board-area .bd-btn:active,
.board-area .pagination button:active,
.board-area .comment-actions button:active,
.board-area .post-more-btn:active,
.board-area .post-more-menu button:active,
.board-area .back-link:active,
.site-search-button:active,
.dialog-close:active,
.menu-toggle:active,
.menu-drawer a:active,
.menu-circle:active,
.notice-item:active,
.share-target:active,
.share-copy:active,
.match-info:active,
.match-jump:active,
.sub-toggle:active,
.picker-arrow:not(:disabled):active,
.picker-current:active,
.picker-item:not(:disabled):active,
.panel-icon-btn:not(:disabled):active,
.strip-team.pickable:active,
.art-back:active,
.art-item:active,
.tactics-step:active,
.tactics-play:active,
.nm-lid:active,
.match-list button:not(:disabled):active,
.news-page .pagination button:active,
.club-slideshow .news-arrow:active,
.viewer-close:active,
.viewer-arrow:not(:disabled):active,
.round-arrow:active,
.round-current:active,
button.fixture-item:active,
.club-more:active,
.prediction-page .predict-save:not(:disabled):active,
.predict-info-btn:active,
.stats-info-btn:active,
.round-btn:not(:disabled):active,
.round-picker button:active,
.view-back:active,
.team-menu button:active,
.compare-toggle:active,
.note-match-btn:active,
.note-match-options button:not(:disabled):active,
.note-save:active,
.note-delete:active,
.notes-page .note-list button:active,
.faq-list summary:active,
.settings-nav button:active,
.settings-plain:not(:disabled):active,
a.game-card:active,
:is(.ball-page, .fb-page) .predict-save:not(:disabled):active,
.stats-top li.is-link:active,
.profile-back:active,
.auth .social-button:not(:disabled):active,
.user-edit-btn:active {
  box-shadow: inset 0 0 0 999px var(--lift-press);
}

/* 경기 고르기 창의 "지금 보고 있는 경기"는 팀 색 테두리(안쪽 그림자)를 그대로 두고 그 위에 막을 덮어요 */
.match-list:not(.predict-list) button.current:hover {
  box-shadow: inset 0 0 0 2px var(--team), inset 0 0 0 999px var(--lift-hover);
}
.match-list:not(.predict-list) button.current:active {
  box-shadow: inset 0 0 0 2px var(--team), inset 0 0 0 999px var(--lift-press);
}

/* ═════════════════════════════════════════════
   작은 화면 (반응형) — 태블릿 · 휴대폰
   기준 폭: 1200(홈 · 다음 경기가 한 줄로) · 900(위쪽 메뉴 → ☰) · 640(휴대폰) · 420(작은 휴대폰)
   페이지마다 원래 자리에 있는 태블릿 규칙(960 · 860 · 760 등)은 그대로 두고, 여기서는 나머지를 채워요.
   ⚠️ 테마(skins)는 크기를 바꾸지 않아요. 크기 · 배치는 모두 여기서.
   ═════════════════════════════════════════════ */

/* ── 페이지 틀 숫자: 화면이 좁아지면 여백을 줄여요 (메뉴 · 내용이 같은 숫자를 써서 양 끝이 계속 맞아요) ── */
@media (max-width: 900px) {
  :root {
    --page-gutter: 24px;
  }
}
@media (max-width: 640px) {
  :root {
    --page-gutter: 16px;
    --page-top: 16px;
    --page-bottom: 32px;
    --panel-gap: 14px;
    --panel-pad: 16px;
  }
}

/* ── 위쪽 메뉴: ☰ 버튼과 펼쳐지는 메뉴판 (넓은 화면에서는 숨어요) ── */
.menu-toggle,
.menu-drawer {
  display: none;
}

@media (max-width: 900px) {
  .top-menu {
    gap: 14px;               /* 옆 여백은 위 "페이지 틀 숫자"를 따라가요 */
  }
  .top-menu .menu-links,
  .menu-divider {
    display: none;           /* 가운데 메뉴는 메뉴판 안으로 (동그라미 버튼들은 메뉴 줄에 그대로) */
  }
  .menu-toggle {
    display: inline-grid;
    place-content: center;
    gap: 4px;
    flex: none;
    width: 42px;
    height: 42px;
    margin-right: -11px;     /* 세 줄(20px)의 오른쪽 끝이 내용 오른쪽 끝과 딱 맞게 (버튼 42px - 줄 20px의 반) */
    padding: 0;
    border: none;
    border-radius: var(--radius-ctl);
    background: transparent;
    color: var(--text);
    cursor: pointer;
    transition: background-color 0.2s;
  }
  .menu-open .menu-toggle {
    background: var(--surface-2);
  }
  .menu-toggle:focus-visible {
    outline: 2px solid var(--team);
    outline-offset: 2px;
  }
  .menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: transform 0.3s var(--ease), opacity 0.2s;
  }
  /* 열리면 세 줄 → ✕ */
  .menu-open .menu-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .menu-open .menu-toggle span:nth-child(2) { opacity: 0; }
  .menu-open .menu-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

  /* 메뉴판: 메뉴 바로 아래로 펼쳐져요 */
  .menu-drawer {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: 12px var(--page-gutter) 18px;   /* 메뉴판 안 칸들도 내용 양 끝에 맞춰요 */
    background: var(--bg);
    border-radius: 0 0 var(--radius-panel) var(--radius-panel);
    box-shadow: 0 24px 40px -20px rgba(17, 18, 20, 0.35);
    visibility: hidden;
    opacity: 0;
    translate: 0 -8px;
    transition: opacity 0.25s var(--ease), translate 0.25s var(--ease), visibility 0s 0.25s;
  }
  .menu-open .menu-drawer {
    visibility: visible;
    opacity: 1;
    translate: 0 0;
    transition: opacity 0.25s var(--ease), translate 0.25s var(--ease);
  }
  .menu-drawer-main {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  .menu-drawer a {
    display: flex;
    align-items: center;
    min-height: 48px;          /* 손가락으로 누르기 편한 높이 */
    padding: 0 16px;
    box-sizing: border-box;
    border-radius: var(--radius-card);
    background: var(--surface-2);
    color: var(--text);
    font-size: 0.98rem;
    font-weight: 700;
    text-decoration: none;
    transition: background-color 0.2s;
  }
  .menu-drawer a.active {
    background: var(--team);
    color: var(--team-ink);
  }
}
html[data-motion="reduce"] .menu-drawer,
html[data-motion="reduce"] .menu-toggle span {
  transition: none;
}

@media (max-width: 640px) {
  .top-menu {
    height: 56px;
  }
  .top-menu .menu-logo-mark {
    height: 26px;
  }
  .menu-small {
    gap: 6px;
  }
  .menu-circle {
    width: 32px;
    height: 32px;
  }
  .menu-circle svg {
    width: 18px;
    height: 18px;
  }
  .menu-drawer-main {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 420px) {
  .top-menu {
    gap: 10px;
  }
  .menu-small {
    gap: 4px;                  /* 작은 휴대폰(320px)에서도 동그라미 5개 + ☰가 한 줄에 */
  }
  .menu-circle {
    width: 30px;
    height: 30px;
  }
}

/* ── 다음 경기: 1200px 아래는 경기장 칸이 한 줄 전체, 기사 · 기록 · 전술은 그 아래 ── */
@media (max-width: 1200px) {
  .next-match-page {
    --page-bottom: 32px;      /* 한 줄씩이 되면 페이지가 스크롤돼요 → 아래 여백을 보통대로 */
  }
  .match-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .nm-lineups {
    grid-column: 1;
    --stage-w: 100%;          /* 페이지가 스크롤되니 화면 높이에 맞춰 줄일 필요 없어요 */
  }
  .nm-side {
    grid-column: 1;
    contain: none;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: 360px 132px 150px;   /* 주요 기사 · 재밌는 기록 · 전술분석 둘 */
  }
}
@media (max-width: 640px) {
  .nm-lineups {
    --stage-w: 640px;          /* 경기장은 640px로 두고 옆으로 밀어서 봐요 (선수 원이 너무 작아지지 않게) */
  }
  .match-top {
    width: 100%;
    flex-wrap: wrap;
  }
  .match-select,
  .match-panel {
    flex: 1 1 100%;
  }
  .match-jump {
    flex: 1 1 100%;
    justify-content: center;
    min-height: 44px;
  }
  .match-panel {
    min-height: 48px;
  }
  .field-unit {
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    border-radius: 16px;
  }
  .nm-side {
    grid-template-rows: 340px 140px 140px;
  }
  .art-item {
    padding: 0 14px;
  }
  .art-item-title {
    font-size: 0.95rem;
  }
}

/* 전술 설명 팝업: 좁으면 경기장 위 · 설명 아래 */
@media (max-width: 900px) {
  .match-dialog.tactics-dialog {
    width: 100vw;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
    padding: 12px;
  }
  .tactics-dialog[open] {
    flex-direction: column;
    gap: 12px;
  }
  .tactics-stage-slot {
    flex: none;
    width: 100%;
    height: auto;
    container-type: inline-size;
    --stage-w: 100cqw;
  }
  .tactics-panel {
    flex: 1;
    min-height: 0;
  }
  .tactics-panel-head {
    order: -1;
    margin-bottom: 10px;
  }
  .tactics-summary {
    margin-bottom: 10px;
  }
}

/* ── 승부예측 (페이지 · 칸 여백은 위 "페이지 틀 숫자"가 줄여요) ── */
@media (max-width: 640px) {
  .predict-form {
    padding: 18px 14px 16px;
  }
  .predict-teams {
    gap: 14px;
  }
  .predict-team {
    gap: 22px;
    min-width: 0;
  }
  .predict-logo {
    width: min(34vw, 140px);
    height: min(34vw, 140px);
    font-size: 1rem;
  }
  .prediction-page .predict-score {
    width: 56px;
    height: 48px;
  }
  .predict-bottom {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }
}

/* ── 주요 뉴스: 휴대폰은 한 줄에 카드 하나 (카드는 덜 길쭉하게) ── */
@media (max-width: 560px) {
  .news-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .news-card {
    aspect-ratio: 4 / 3;
  }
}

/* ── 게시판: 말머리 탭은 줄바꿈 대신 옆으로 밀기 ── */
@media (max-width: 640px) {
  .board-area .flair-filter {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    max-width: 100%;
  }
  .board-area .flair-filter::-webkit-scrollbar {
    display: none;
  }
  .board-area .flair-filter button {
    padding: 9px 14px;
  }
  .board-head {
    flex-direction: column;
    align-items: stretch;
  }
  .board-actions {
    flex-wrap: wrap;
  }
  .board-area .board-search {
    flex: 1 1 100%;
    max-width: none;
  }
  .board-actions .sort-toggle {
    margin-left: auto;
  }
}

/* ── 글 보기 · 유저 페이지 · 꾸미기 창: 휴대폰 ── */
@media (max-width: 640px) {
  .post-headline {
    flex-direction: column;  /* 글쓴이는 제목 아래 줄로 */
    align-items: flex-start;
    gap: 12px;
  }
  .post-author {
    max-width: 100%;
  }
  .user-card {
    gap: 18px;
  }
  .user-card .avatar-lg {
    width: 84px;
    height: 84px;
  }
  .user-edit-btn {
    width: 32px;
    height: 32px;
  }
  .user-info {
    gap: 10px;
    padding-left: 18px;
  }
  .bd-box .user-name {
    font-size: 1.3rem;
  }
  .avatar-editor {
    flex-direction: column;  /* 미리보기 위, 장신구 칸 아래 */
    gap: 16px;
    margin-top: 12px;
  }
  .avatar-preview .avatar-xl {
    width: 120px;
    height: 120px;
  }
  .avatar-rows {
    width: 100%;
  }
}

/* ── FAQ: 휴대폰 (페이지 · 칸 여백은 위 "페이지 틀 숫자"가 줄여요) ── */
@media (max-width: 640px) {
  .faq-panel {
    padding: 16px;
  }
  .faq-search {
    margin-left: 0;
    flex: 1 1 100%;
  }
  .faq-list {
    padding-left: 22px;
  }
}

/* ── 게임: 팀 고르기 줄 · 머리 부분이 좁으면 아래로 ── */
@media (max-width: 640px) {
  .ball-teams {
    flex-wrap: wrap;
  }
  .ball-teams .note-field {
    flex: 1 1 100%;
  }
  .ball-teams .note-field select {
    width: 100%;
  }
  .ball-vs {
    padding-bottom: 0;
  }
  .fb-setup-row .ball-teams {
    min-width: 0;
  }
  .guess-head {
    flex-wrap: wrap;
  }
  .guess-input-row {
    flex-wrap: wrap;
  }
  .ball-score {
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 12px;
    font-size: 1rem;
  }
  .ball-score > span:not(.ball-minute) {
    white-space: nowrap;
  }
}

/* ── 팀 선택: 태블릿 세로는 칸 사이를 좁게, 휴대폰은 3칸 × 7줄 (아래로 스크롤) ── */
@media (max-width: 900px) {
  .start-page {
    padding: 20px;
  }
  #team-grid {
    gap: 10px;
  }
}
@media (max-width: 640px) {
  body:has(.start-page) {
    overflow: auto;   /* 휴대폰은 7줄이라 화면보다 길어요 → 아래로 스크롤 (2026-11-17: 맨 아래 줄이 잘려 안 보이던 것) */
  }
  .start-page {
    height: auto;
    min-height: 100dvh;
    padding: 16px 12px calc(24px + env(safe-area-inset-bottom));
  }
  #team-grid {
    flex: none;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(7, 92px);
  }
  .team-box {
    font-size: 15px;
  }
  .team-box.selected {
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    text-align: center;
  }
  .team-box.selected .team-name {
    flex: none;
    font-size: 19px;
  }
  .team-box.selected .team-info {
    flex: none;
    gap: 6px;
    font-size: 12.5px;
  }
}

/* ── 자료실: 기록 카드 4열 → 2열(1200 이하) → 1열(휴대폰) ── */
@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 900px) {
  .stats-grid.is-graphs {
    grid-template-columns: minmax(0, 1fr);   /* 그래프는 900 이하에서 한 줄에 하나 */
  }
}
@media (max-width: 640px) {
  .stats-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .stats-graph {
    padding: 16px;
  }
  .g-mosaic {
    grid-template-columns: 84px repeat(var(--rounds), minmax(18px, 1fr)) max-content;
  }
  .stats-head .tab-group {
    width: 100%;   /* 탭은 아래 줄에 꽉 차게 */
  }
  .stats-head .tab-group button {
    flex: 1;
    padding: 6px 12px;
  }
}

/* ── 선수 전용 페이지: 960 아래는 한 줄로 쌓아요 (기본 정보 → 이번 시즌 → 최근 평점 → 시즌별 → 뛰었던 팀 → 우승 수상) ── */
@media (max-width: 960px) {
  .profile-board {
    grid-template-columns: minmax(0, 1fr);
  }
  .profile-col {
    display: contents;   /* 두 줄을 풀어서 칸 순서를 아래 order로 섞어요 */
  }
  .profile-info-card    { order: 1; }
  .profile-season-card  { order: 2; }
  .profile-recent-card  { order: 3; }
  .profile-seasons-card { order: 4; }
  .profile-career-card  { order: 5; }
  .profile-honors-card  { order: 6; }
}
@media (max-width: 640px) {
  .profile-hero {
    gap: 16px;
  }
  .profile-photo {
    width: 80px;
    font-size: 1.9rem;
  }
  .profile-name {
    font-size: 1.5rem;
  }
  .profile-name-en {
    font-size: 0.9rem;
  }
  .profile-meta {
    font-size: 0.88rem;
  }
  .profile-meta > span + span::before {
    margin: 0 7px;
  }
  .profile-card {
    padding: 16px;
  }
  .profile-key-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));   /* 큰 숫자 2 × 2 */
  }
  .profile-key-value {
    font-size: 1.6rem;
  }
  .profile-table {
    font-size: 0.84rem;
  }
  .profile-table th,
  .profile-table td {
    padding-inline: 5px;
  }
  .profile-rank-text {   /* "리그 순위" 아래 줄에 (모든 포지션) ▾ → 표가 화면 폭에 들어와요 */
    flex-direction: column;
  }
}

/* ── 개발용 테스트 시계 막대: 휴대폰에서는 작게 ── */
@media (max-width: 640px) {
  .dev-clock {
    left: 8px;
    bottom: 8px;
    font-size: 0.7rem;
  }
}

/* ── 관리자: 한국어 · 영어 두 칸은 휴대폰에서 위아래로 ── */
@media (max-width: 640px) {
  .admin-pair {
    grid-template-columns: 1fr;
  }
}

/* ═══ 폰 · 패드: 누른 뒤 윤곽선 없음 (2026-11-14 사용자 결정, 사이트 전체) ═══
   손가락 · 마우스로 누른 버튼 · 링크 · 고르는 칸에는 포커스 테두리(윤곽선)를 그리지 않아요.
   키보드 Tab으로 다니면 common.js가 <html data-input="keyboard">로 바꿔서 그대로 보여요 (키보드 쓰는 사람이 어디 있는지 알 수 있게).
   글을 쓰는 입력칸의 테두리는 그대로 (어디에 쓰고 있는지 보여야 해서). 다른 규칙보다 앞서야 해서 !important */
@media (max-width: 1023px) {
  html {
    -webkit-tap-highlight-color: transparent;   /* 누를 때 칸이 번쩍 보이지 않게 */
  }
  html:not([data-input="keyboard"]) :is(button, a, select, summary, label, [role="button"], [role="tab"], [tabindex]):is(:focus, :focus-visible),
  html:not([data-input="keyboard"]) :is(.choice, .club-section, .home-box, .profile-rank-mode) {   /* 안쪽 버튼이 골라지면 바깥 칸에 테두리를 그리던 곳 */
    outline: none !important;
  }
  html:not([data-input="keyboard"]) .player-spot.editable:focus-visible:not(.selected) {   /* 경기장 선수 점: 테두리 대신 그림자 고리 */
    box-shadow: none;
  }
}
