/* ═════════════════════════════════════════════
   사이트 맨 앞 = 팀 고르기 (index.html) — 배치 · 크기 · 처음 한 번 움직임 (2026-11-26)
   색은 css/skins/clean/index.css

   스크롤 없이 한 화면: 메뉴(반투명) 아래로 밤 경기장 칸이 비쳐요 → 칸 안에 로고 · 21칸 · 소셜/약관 줄
   경기장 칸의 위 여백(화면 위 끝 ~ 칸) = 아래 여백(칸 ~ 화면 아래 끝) = 옆 여백 (--lp-edge, 작게 → 칸 윗부분이 메뉴 뒤로)
   팀 칸은 정사각형 + 아래 팀 이름. 크기는 남은 자리(.lp-grid-wrap)에 맞춰 저절로 정해요 (container query 단위 cqw · cqh)
   경기장 선: "1m가 화면에서 몇 px인지" --m 하나에서 나와요 (원 반지름 9.15m). 칸 안팎의 선이 이어져요
   ═════════════════════════════════════════════ */
.landing-body {
  --lp-edge: clamp(8px, 1.2vw, 18px);                    /* 칸 바깥 여백 (화면 위 끝 · 아래 끝 · 양옆 모두 같아요) */
  --lp-r: clamp(12px, 1.1vw, 18px);                      /* 칸 모서리 */
  --lp-head: 68px;                                       /* 따라오는 메뉴 높이 */
  --lp-stage-h: calc(100vh - 2 * var(--lp-edge));
  --lp-ring: calc(var(--lp-stage-h) * 0.94);             /* 가운데 원 지름: 칸 높이 가득 */
  --m: calc(var(--lp-ring) / 18.3);                      /* 1m */
  --cols: 7;                                             /* 팀 칸 한 줄 개수 · 줄 수 (21칸) */
  --rows: 3;
  --gx: clamp(8px, 1vw, 16px);                           /* 팀 칸 가로 · 세로 간격 */
  --gy: clamp(8px, 1.4vh, 16px);
  --name-fs: 14px;                                       /* 팀 이름 글자 · 자리 (두 줄) */
  --name-h: calc(var(--name-fs) * 2.5 + 6px);
  margin: 0;
  font-family: var(--font);
}
@supports (height: 100svh) {
  .landing-body {
    --lp-stage-h: calc(100svh - 2 * var(--lp-edge));
  }
}

/* 한 화면: 스크롤하지 않아요 (스크롤바도 없음) */
html:has(> body.landing-body) {
  overflow: hidden;
  scrollbar-width: none;
}
html:has(> body.landing-body)::-webkit-scrollbar {
  display: none;
}

/* 화면 읽기 프로그램만 읽는 글자 */
.lp-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* 손님인지 확인되면(js/pages/index.js가 html에 .lp-ready) 보여요 */
html:not(.lp-ready) .lp-page {
  visibility: hidden;
}
.lp-page {
  position: relative;
  height: 100vh;
  overflow: hidden;
}
@supports (height: 100svh) {
  .lp-page {
    height: 100svh;
  }
}

/* ─── 메뉴: 왼쪽 로고 | 오른쪽 언어 (반투명이라 뒤의 경기장 칸이 살짝 비쳐요) ─── */
.landing-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--lp-head);
  padding: 0 calc(var(--lp-edge) + clamp(10px, 1.6vw, 28px));   /* 로고 · 언어는 칸 안쪽 여백에 맞춰요 */
  box-sizing: border-box;
}
.lp-home {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.lp-mark {
  display: block;
  width: 96px;
  height: auto;
  overflow: visible;
  fill: none;
  stroke-width: 7;                 /* 작게 볼 땐 선이 너무 가늘어서 조금 굵게 */
}
.lp-lang-wrap {
  position: relative;
  margin-right: -8px;              /* 글자 오른쪽 끝이 칸 오른쪽 끝과 맞게 (누르는 칸 여백만큼) */
}
.lp-lang {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 8px 0 12px;
  border: 0;
  border-radius: 999px;
  background: none;
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
.lp-lang svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}
.lp-lang .lp-lang-caret {
  width: 16px;
  height: 16px;
  stroke-width: 2.2;
  transition: transform 0.2s var(--ease);
}
.lp-lang[aria-expanded="true"] .lp-lang-caret {
  transform: rotate(180deg);
}
.lp-lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 168px;
  margin: 0;
  padding: 6px;
  list-style: none;
  border-radius: 12px;
  transform-origin: top right;
  animation: lp-menu-in 0.16s cubic-bezier(0.23, 1, 0.32, 1);
}
@keyframes lp-menu-in {
  from { opacity: 0; transform: scale(0.97); }
}
.lp-lang-menu button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: none;
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.lp-lang-menu [aria-checked="true"]::after {   /* 지금 언어: 오른쪽 체크 */
  content: "";
  width: 16px;
  height: 16px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%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 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ─── 밤 경기장 칸: 화면 위 · 아래 끝, 양옆 여백이 같아요 (칸 윗부분은 메뉴 뒤로) ─── */
.lp-main {
  height: 100%;
}
.lp-hero {
  position: relative;
  isolation: isolate;
  height: 100%;
  padding: var(--lp-edge);
  box-sizing: border-box;
}
.lp-stage-wrap {
  position: relative;
  isolation: isolate;
  height: 100%;
}
.lp-stage {
  position: relative;
  isolation: isolate;
  height: 100%;
  /* 위: 메뉴 바로 아래부터 로고 / 아래: 소셜 · 약관 줄이 칸 아래 끝 가까이 */
  padding: calc(var(--lp-head) - var(--lp-edge) + clamp(0px, 0.8vh, 8px)) clamp(10px, 1.6vw, 28px) 0;
  box-sizing: border-box;
  overflow: hidden;
  border-radius: var(--lp-r);
}
/* 경기장 선: 칸의 한가운데가 (0, 0) */
.lp-field {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: -1;
  width: 0;
  height: 0;
}
.lp-circle {
  position: absolute;
  left: 0;
  top: 0;
  width: calc(var(--m) * 20);
  height: calc(var(--m) * 20);
  translate: -50% -50%;
  overflow: visible;
  fill: none;
  stroke-width: 0.11;
  rotate: -90deg;                  /* 위쪽 가운데부터 그려지게 */
}
.lp-half::before {
  content: "";
  position: absolute;
  top: calc(var(--m) * -0.055);
  left: -60vw;
  width: 120vw;
  height: calc(var(--m) * 0.11);
}

/* 칸 안: 로고 · 한 줄 → 21칸(남은 높이 전부) → 소셜 · 약관 줄 */
.lp-pick {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(8px, 2vh, 24px);
  height: 100%;
}
.lp-brand-row {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(4px, 1vh, 12px);
  margin: 0;
}
.lp-logo {
  display: block;
  width: clamp(120px, 14vw, 220px);
  height: auto;
  overflow: visible;
  fill: none;
  stroke-width: 5.5;
}
.lp-tagline {
  font-size: clamp(13px, 0.5vw + 9px, 17px);
  font-weight: 500;
  text-align: center;
  word-break: keep-all;
}
.lp-grid-wrap {
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  container-type: size;            /* 안의 팀 칸이 이 칸의 폭 · 높이(cqw · cqh)로 크기를 정해요 */
  display: grid;
  place-items: center;
}
.lp-teams {
  /* 정사각형 한 변: 폭으로 정한 값과 높이로 정한 값 중 작은 쪽 → 21칸이 늘 이 칸 안에 다 들어가요 */
  --col-max: calc((100cqw - (var(--cols) - 1) * var(--gx)) / var(--cols));
  --sq: min(var(--col-max), calc((100cqh - (var(--rows) - 1) * var(--gy)) / var(--rows) - var(--name-h)));
  --col: min(var(--col-max), calc(var(--sq) + 30px));   /* 칸 한 줄 폭: 정사각형 + 이름이 넘치지 않을 여유 */
  display: flex;
  flex-wrap: wrap;
  justify-content: center;         /* 마지막 줄이 모자라면 가운데로 */
  gap: var(--gy) var(--gx);
  width: calc(var(--cols) * var(--col) + (var(--cols) - 1) * var(--gx));
  margin: 0;
  padding: 0;
  list-style: none;
}
.lp-teams li {
  display: flex;
  width: var(--col);
}
.lp-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.lp-team-square {
  display: grid;
  place-items: center;
  width: var(--sq);
  height: var(--sq);
  box-sizing: border-box;
  border-radius: max(10px, calc(var(--sq) * 0.14));
  transition: transform 0.16s var(--ease), background-color 0.2s, box-shadow 0.2s;
}
.lp-team:active .lp-team-square {
  transform: scale(0.96);
}
.lp-team .team-badge {
  width: calc(var(--sq) * 0.5);
  height: calc(var(--sq) * 0.5);
  font-size: max(9px, calc(var(--sq) * 0.13));
}
.lp-team-name {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  width: 100%;
  height: calc(var(--name-fs) * 2.5);
  font-family: var(--font-ui);
  font-size: var(--name-fs);
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  word-break: keep-all;
  overflow-wrap: break-word;
  hyphens: auto;                   /* 영어 긴 이름(Wolverhampton 등)은 하이픈으로 나눠요 */
}
.lp-team-name small {
  display: block;
  font-size: 0.82em;
  font-weight: 600;
}

/* ─── 소셜 · 약관 줄 (칸 안 맨 아래) ─── */
.landing-footer {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0 20px;
  width: 100%;
  font-size: 13px;
}
.lp-social {
  display: flex;
  gap: 2px;
  margin: 0 0 0 -10px;
  padding: 0;
  list-style: none;
}
.lp-social-link {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  transition: background-color 0.2s, color 0.2s, transform 0.16s var(--ease);
}
a.lp-social-link:active {
  transform: scale(0.95);
}
.lp-social-icon {
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}
.lp-foot-links {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 0;
}
.landing-footer a:not(.lp-social-link) {
  display: inline-flex;
  align-items: center;
  min-height: 44px;                /* 누르는 칸 44 */
  text-underline-offset: 4px;
}

/* ─── 처음 열 때 한 번: 원 · 하프라인이 그려지고 → 로고 → 팀 칸이 차례로 (모두 1.5초 안, 그 뒤로는 멈춰요) ─── */
@keyframes lp-draw {
  from { stroke-dasharray: 1; stroke-dashoffset: 1; }
  to   { stroke-dasharray: 1; stroke-dashoffset: 0; }
}
@keyframes lp-run {
  from { transform: scaleX(0); }
}
@keyframes lp-rise {
  from { opacity: 0; transform: translateY(10px); }
}
html.lp-ready .lp-stage .lp-circle circle {
  animation: lp-draw 1s cubic-bezier(0.65, 0, 0.2, 1) backwards;
}
html.lp-ready .lp-stage .lp-half::before {
  animation: lp-run 0.9s cubic-bezier(0.23, 1, 0.32, 1) 0.1s backwards;
}
html.lp-ready .lp-brand-row {
  animation: lp-rise 0.5s cubic-bezier(0.23, 1, 0.32, 1) 0.15s backwards;
}
html.lp-ready .lp-teams li {
  animation: lp-rise 0.45s cubic-bezier(0.23, 1, 0.32, 1) backwards;
  animation-delay: calc(0.3s + var(--i, 0) * 0.025s);
}

/* ─── 크기별 칸 배치 (21칸): PC · 패드 · 휴대폰 가로는 가로 7 × 세로 3 (사용자 결정), 휴대폰 세로만 한 줄 4칸 ─── */
/* 패드 (641 ~ 1023) */
@media (max-width: 1023px) {
  .landing-body {
    --lp-head: 64px;
    --name-fs: 13px;
  }
}
/* 세로로 긴 화면: 원 크기를 폭에 맞춰요 */
@media (max-aspect-ratio: 1 / 1) {
  .landing-body {
    --lp-ring: min((100vw - 2 * var(--lp-edge)) * 0.92, var(--lp-stage-h) * 0.94);
  }
}
/* 휴대폰 (640 이하): 4칸 × 6줄 */
@media (max-width: 640px) {
  .landing-body {
    --lp-head: 60px;
    --cols: 4;
    --rows: 6;
    --gx: 8px;
    --gy: 8px;
    --name-fs: 12px;
    --lp-ring: 122vw;
  }
  .lp-mark {
    width: 80px;
  }
  .landing-footer {
    justify-content: center;
  }
  .lp-social {
    margin: 0;
  }
}
/* 키가 작은 휴대폰 (높이 720 이하, 아이폰 SE 등): 5칸 × 5줄 · 한 줄 소개는 숨겨요 */
@media (max-width: 640px) and (max-height: 720px) {
  .landing-body {
    --cols: 5;
    --rows: 5;
    --name-fs: 11px;
  }
  .lp-tagline {
    display: none;
  }
  .lp-logo {
    width: 96px;
  }
}
/* 아주 좁은 휴대폰 (폭 360 이하): 4칸 × 6줄 (이름이 들어가게) */
@media (max-width: 360px) {
  .landing-body {
    --cols: 4;
    --rows: 6;
    --name-fs: 10.5px;
  }
}
/* 아주 낮은 창 (휴대폰 가로 등, 높이 500 이하): 7 × 3 그대로 · 한 줄 소개는 숨겨요 */
@media (max-height: 500px) {
  .landing-body {
    --name-fs: 11px;
  }
  .lp-tagline {
    display: none;
  }
  .lp-logo {
    width: 96px;
  }
  .landing-footer {
    justify-content: center;
  }
}
