/* app.css — 디자인 토큰과 전 화면 스타일 (프리미엄 미니멀 · 라이트 테마 단일) */

/* ============================================================ 폰트 */
@font-face {
  font-family: 'Pretendard Variable';
  src: url('../assets/fonts/PretendardVariable.woff2') format('woff2-variations');
  font-weight: 45 920;
  font-style: normal;
  font-display: swap;
}

/* ============================================================ 토큰 */
:root {
  --bg: #FAF9F7;
  --surface: #FFFFFF;
  --ink: #2B2724;
  --ink-soft: #8A8480;
  --line: #ECE8E3;
  --accent: #B08D57;
  --accent-soft: #F3EDE3;
  --danger: #C25E5E;
  --radius: 16px;
  --radius-lg: 24px;
  /* 그림자 3단. 예전에는 rest/hover 두 단뿐이라 모든 카드가 같은 높이에 떠 있었다 —
     위계가 없으니 눈이 머물 곳도 없었다. raise 는 히어로·시작 바처럼 층이 다른 것에만. */
  --shadow-sm: 0 1px 2px rgba(43, 39, 36, .04);
  --shadow: 0 1px 2px rgba(43, 39, 36, .04), 0 2px 8px rgba(43, 39, 36, .05);
  --shadow-lift: 0 2px 6px rgba(43, 39, 36, .06), 0 14px 34px rgba(43, 39, 36, .13);
  --shadow-raise: 0 4px 10px rgba(43, 39, 36, .07), 0 24px 60px rgba(43, 39, 36, .16);
  --shadow-gold: 0 10px 30px rgba(176, 141, 87, .22);

  --font: 'Pretendard Variable', -apple-system, BlinkMacSystemFont, 'Malgun Gothic', sans-serif;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --topbar-h: 64px;
}

/* ============================================================ 리셋 */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
body.is-locked { overflow: hidden; }
h1, h2, h3, p, figure { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { cursor: default; }
img { display: block; max-width: 100%; }
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.icon { flex: none; }

/* ============================================================ 앱 셸 / 전환 */
.app { min-height: 100dvh; }

.splash {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center;
  background: var(--bg);
  transition: opacity .4s var(--ease), visibility .4s;
}
.splash.is-hidden { opacity: 0; visibility: hidden; }

.view { animation: none; }
.view--enter { opacity: 0; transform: translateY(8px); }
.view { transition: opacity .12s var(--ease), transform .12s var(--ease); }
.view--exit { opacity: 0; transform: translateY(-4px); }

.screen {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

/* ============================================================ 타이포 공통 */
.wordmark {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .35em;
  color: var(--accent);
  text-indent: .35em;
}
.wordmark--hero { font-size: 14px; margin-bottom: 18px; }

.tabular { font-variant-numeric: tabular-nums; }

/* ============================================================ 상단 바 */
.topbar {
  height: var(--topbar-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 0 clamp(16px, 3vw, 32px);
  flex: none;
}
.topbar__left { grid-column: 1; display: flex; align-items: center; gap: 10px; justify-self: start; }
.topbar__center { grid-column: 2; justify-self: center; }
.topbar__right { grid-column: 3; display: flex; align-items: center; gap: 8px; justify-self: end; }
.topbar__title { font-size: 16px; font-weight: 600; letter-spacing: -.02em; }

.icon-btn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 12px;
  color: var(--ink);
  transition: background-color .18s var(--ease), color .18s var(--ease), transform .18s var(--ease);
}
.icon-btn:hover { background: var(--accent-soft); color: var(--accent); }
.icon-btn:active { transform: scale(.96); }
.icon-btn.is-danger:hover { background: rgba(194, 94, 94, .1); color: var(--danger); }
.icon-btn:disabled { opacity: .35; }
.icon-btn:disabled:hover { background: none; color: var(--ink); }

/* ============================================================ 버튼 */
.btn {
  height: 46px;
  padding: 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 12px;
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: -.01em;
  white-space: nowrap;
  transition: background-color .18s var(--ease), border-color .18s var(--ease),
              color .18s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease);
}
.btn--sm { height: 36px; padding: 0 14px; font-size: 13.5px; border-radius: 10px; }
.btn--lg { height: 52px; padding: 0 44px; font-size: 15.5px; }
.btn--block { width: 100%; }

.btn--primary { background: var(--accent); color: #fff; box-shadow: var(--shadow); }
.btn--primary:hover:not(:disabled) { background: #9C7B49; transform: translateY(-1px); }
.btn--primary:active:not(:disabled) { transform: translateY(0); }

.btn--ghost { border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.btn--ghost:hover:not(:disabled) { border-color: #DCD5CB; background: #FCFBFA; transform: translateY(-1px); }

.btn--danger { border: 1px solid rgba(194, 94, 94, .3); color: var(--danger); background: var(--surface); }
.btn--danger:hover:not(:disabled) { background: rgba(194, 94, 94, .07); transform: translateY(-1px); }

.btn:disabled { opacity: .38; transform: none; box-shadow: none; }

.link-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--ink-soft);
  transition: color .18s var(--ease);
}
.link-btn:hover { color: var(--accent); }

/* ============================================================ 공통 조각 */
.block { margin-top: clamp(32px, 5vw, 52px); }
.block__head {
  display: flex; align-items: baseline; gap: 12px;
  margin-bottom: 16px;
}
.block__head--center { justify-content: center; margin-top: 56px; }
/* 히어로 40px 다음이 곧장 15px 이라 그 사이가 비어 있었다. 섹션 제목을 한 단 올려
   "제목 → 섹션 제목 → 본문" 세 단계가 실제로 구분되게 한다. */
.block__title { font-size: 16.5px; font-weight: 600; letter-spacing: -.015em; }
.block__hint { font-size: 12.5px; color: var(--ink-soft); }

.thumb {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  background: var(--accent-soft);
}
.thumb--ratio { aspect-ratio: 3 / 4; }
.thumb__img { width: 100%; height: 100%; object-fit: cover; }
.thumb--empty { background: repeating-linear-gradient(45deg, #F5F2ED, #F5F2ED 6px, #FAF9F7 6px, #FAF9F7 12px); }

.check-badge {
  position: absolute;
  top: 10px; right: 10px;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 6px rgba(43, 39, 36, .18);
}

.empty {
  grid-column: 1 / -1;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 56px 20px;
  text-align: center;
}
.empty__mark {
  width: 56px; height: 56px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 10px;
}
.empty__title { font-size: 15px; font-weight: 600; }
.empty__msg { font-size: 13px; color: var(--ink-soft); max-width: 340px; }
.empty .btn { margin-top: 14px; }

.banner {
  display: flex; align-items: flex-start; gap: 12px;
  width: min(760px, calc(100% - 32px));
  margin: 0 auto 8px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.banner__icon { color: var(--accent); display: grid; place-items: center; padding-top: 1px; }
/* 인앱 브라우저 경고 — 시드 실패 안내보다 한 단계 세게. 여기서 흘리면 사진을 잃는다. */
.banner--warn {
  border-left-color: var(--danger);
  background: #FFFBFA;
}
.banner--warn .banner__icon { color: var(--danger); }
.banner--warn .banner__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.banner__body { flex: 1; }
.banner__title { font-size: 13.5px; font-weight: 600; }
.banner__msg { font-size: 12.5px; color: var(--ink-soft); line-height: 1.55; }
/* 실제 오류 문구. 원장이 전화로 읽어 줄 수 있어야 원인을 찾는다 */
.banner__detail {
  margin-top: 4px;
  font-size: 11.5px; color: var(--ink-soft); opacity: .75;
  word-break: break-all;
}
.banner__actions { margin-top: 10px; }

/* ============================================================ 홈 */
/* 단일 배경색 위에 모든 것이 평평하게 놓여 있던 게 밋밋함의 바닥이었다.
   외부 요청 0 제약이 있어 이미지는 못 쓰므로 CSS 그라데이션 한 겹만 아주 옅게 깐다. */
.screen--home { position: relative; isolation: isolate; }
.screen--home::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  /* 140vw 로 두면 모바일에서 뷰포트보다 1.4배 넓은 요소가 되어 좌우로 밀린다
     (360px 화면에서 504px → 좌우 72px 씩 삐져나감). body 의 overflow-x:hidden 은
     뷰포트로 전파돼 시각적으로만 잘릴 뿐, 실제 스크롤 폭은 남는다.
     데스크톱은 1200px 쪽이 이기므로 이 변경으로 달라지지 않는다. */
  width: min(1200px, 100%);
  height: min(620px, 70vh);
  transform: translateX(-50%);
  /* 두 겹 모두 radial 이어야 한다 — linear 를 섞으면 요소의 사각형 경계가 그대로 드러난다 */
  background:
    radial-gradient(ellipse 62% 62% at 50% 2%, rgba(176, 141, 87, .13), rgba(176, 141, 87, 0) 70%),
    radial-gradient(ellipse 88% 72% at 50% -6%, rgba(255, 255, 255, .95), rgba(255, 255, 255, 0) 72%);
  pointer-events: none;
  z-index: -1;
}

.home-body {
  flex: 1;
  width: min(920px, 100%);
  margin: 0 auto;
  padding: clamp(8px, 2vw, 24px) clamp(16px, 3vw, 32px) 48px;
}
.hero { text-align: center; padding: clamp(16px, 4vw, 40px) 0 0; }
.hero__title {
  font-size: clamp(28px, 4.4vw, 40px);
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.25;
}
.hero__desc {
  margin-top: 10px;
  font-size: 14.5px;
  color: var(--ink-soft);
}

/* 히어로 무대 — 실제 대결 카드의 축소판. 시작을 누르기 전에 무엇을 하는지 그림으로 말한다. */
.hero-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 2.4vw, 26px);
  margin-top: clamp(20px, 3.4vw, 34px);
}
.hero-stage__card {
  position: relative;
  width: clamp(104px, 15vw, 148px);
  aspect-ratio: 3 / 4;
  border-radius: 18px;
  overflow: hidden;
  background: var(--accent-soft);
  box-shadow: var(--shadow-lift);
  transition: transform .3s var(--ease);
}
.hero-stage__card--left { transform: rotate(-2.4deg); }
.hero-stage__card--right { transform: rotate(2.4deg); }
.hero-stage__card.is-empty {
  background: repeating-linear-gradient(45deg, #F5F2ED, #F5F2ED 6px, #FAF9F7 6px, #FAF9F7 12px);
  box-shadow: var(--shadow);
}
.hero-stage__img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 1;
  transition: opacity .34s var(--ease);
}
.hero-stage__img.is-entering { opacity: 0; }
.hero-stage__img.is-leaving { opacity: 0; }
.hero-stage__vs {
  font-size: clamp(12px, 1.4vw, 14px);
  font-weight: 600;
  letter-spacing: .16em;
  color: var(--accent);
  text-indent: .16em;
}

/* 최근 결과 — 지난 기록을 좌측 레일에서 본문 안으로 옮긴 자리 */
.recent { margin-top: clamp(28px, 4.4vw, 44px); }
.recent[hidden] { display: none; }
.recent__head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin-bottom: 14px;
}
.recent__strip {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.recent__strip::-webkit-scrollbar { display: none; }
.recent__item {
  flex: none;
  width: 104px;
  display: flex; flex-direction: column;
  text-align: left;
  transition: transform .2s var(--ease);
}
.recent__item:hover { transform: translateY(-3px); }
.recent__thumb {
  width: 100%;
  border-radius: 14px;
  box-shadow: var(--shadow);
  transition: box-shadow .2s var(--ease);
}
.recent__item:hover .recent__thumb { box-shadow: var(--shadow-lift); }
.recent__name {
  margin-top: 9px;
  font-size: 13px; font-weight: 500; letter-spacing: -.01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.recent__sub {
  font-size: 11.5px; color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.group-card {
  position: relative;
  text-align: left;
  padding: 14px 14px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease),
              border-color .2s var(--ease), background-color .2s var(--ease);
}
.group-card:hover:not(:disabled) { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.group-card:active:not(:disabled) { transform: scale(.988); transition-duration: .09s; }
/* 선택 상태에 border 를 굵히면 padding 으로 상쇄해도 서브픽셀에서 흔들린다.
   바깥 링(box-shadow)으로 그리면 레이아웃 시프트가 0이다. */
.group-card.is-selected {
  border-color: transparent;
  background: var(--accent-soft);
  box-shadow: 0 0 0 2px var(--accent), var(--shadow-gold);
  transform: scale(1.012);
}
.group-card.is-selected:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.012);
  box-shadow: 0 0 0 2px var(--accent), var(--shadow-gold);
}
.group-card.is-disabled { opacity: .5; box-shadow: none; }

/* 균등 4분할은 어느 세트든 똑같이 생겨 보인다. 대표 1장을 세워 표정을 만든다. */
.group-card__previews { display: grid; grid-template-columns: 1.5fr 1fr; gap: 6px; }
.group-card__lead { aspect-ratio: 3 / 4; }
/* height:0 + min-height:100% — 이게 없으면 측면 셀 3장이 각자 사진 원본 비율로 늘어나
   행 높이를 결정해 버려서, 대표 사진 아래에 빈 공간이 생기고 카드가 두 배로 길어진다.
   height:0 으로 행 높이 계산에서 빠진 뒤 확정된 행 높이(=대표 사진 높이)를 되받는다. */
.group-card__side {
  display: grid; grid-template-rows: repeat(3, 1fr); gap: 6px;
  height: 0; min-height: 100%;
}
/* 세로 사진을 가로로 자르는 자리라 정중앙을 잡으면 얼굴이 잘린다.
   증례 사진도 인물 정면이 대부분이므로 위쪽으로 치우쳐 자른다. */
.group-card__cell { min-height: 0; }
.group-card__cell .thumb__img { object-position: 50% 30%; }
/* hover 중 대표 사진 순환 (JS 가 이미지를 겹쳐 넣고 이 전환으로 크로스페이드) */
.group-card__lead .thumb__img {
  position: absolute; inset: 0;
  transition: opacity .34s var(--ease);
}
.group-card__lead .thumb__img.is-entering { opacity: 0; }
.group-card__foot {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  margin-top: 12px;
}
.group-card__name { font-size: 14.5px; font-weight: 500; letter-spacing: -.01em; }
.group-card__count {
  font-size: 12.5px; color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.segment {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.segment__item {
  min-width: 78px;
  height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  transition: background-color .2s var(--ease), color .2s var(--ease);
}
.segment__item:hover:not(:disabled) { color: var(--ink); }
.segment__item.is-active { background: var(--accent); color: #fff; }
.segment__item:disabled { opacity: .3; }

/* 홈에서는 시작 바가 대신하지만 새 월드컵 만들기(create.js)는 아직 이 둘을 쓴다 */
.pool-note {
  margin-top: 14px;
  font-size: 13px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.home-actions { margin-top: clamp(32px, 5vw, 48px); text-align: center; }

/* 고정 시작 바 — 주 액션이 긴 스크롤 아래 숨어 있던 문제.
   sticky 라서 문서 끝에서는 제자리 흐름으로 돌아가 본문을 가리지 않는다. */
.startbar {
  position: sticky;
  bottom: 0;
  z-index: 20;
  border-top: 1px solid var(--line);
  background: rgba(250, 249, 247, .84);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
}
.startbar__inner {
  width: min(920px, 100%);
  margin: 0 auto;
  padding: 12px clamp(16px, 3vw, 32px);
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.startbar__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.startbar__title {
  font-size: 15px; font-weight: 600; letter-spacing: -.01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.startbar__sub {
  font-size: 12.5px; color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.foot-note {
  padding: 0 24px 32px;
  text-align: center;
  font-size: 11.5px;
  color: var(--ink-soft);
  letter-spacing: .01em;
}

/* ============================================================ 대결 */
.screen--play { overflow: hidden; }

.progress {
  height: 3px;
  background: var(--line);
  flex: none;
}
.progress__fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width .45s var(--ease);
}
.round-label {
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: .04em;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.arena {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 3vw, 40px);
  /* 위 여백은 사진을 깎아 먹는다 — 필요한 만큼만 */
  padding: clamp(10px, 1.6vh, 18px) clamp(16px, 3vw, 40px) 0;
  min-height: 0;
  transition: opacity .18s var(--ease);
}
.arena--enter { opacity: 0; }

.pick-card {
  position: relative;
  /* 카드 높이 = 사진 높이 (이름표가 absolute 오버레이라 카드 밖 높이를 안 먹는다).
     그래서 여기서 빼는 170 은 카드 위아래 크롬만이다:
       톱바 64 + 진행바 3 + 진출자 띠 34 + 아레나 패딩 14 + 힌트 46 ≈ 161, 여유 9.
     상한 440 은 근거 없는 숫자였고 1440×900 에서 이게 먼저 걸려 사진이 작았다 → 560. */
  width: min(560px, 44vw, calc((100dvh - 170px) * 0.75));
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .28s var(--ease), box-shadow .28s var(--ease), opacity .38s var(--ease);
}
.pick-card:hover:not(:disabled) { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.pick-card__frame { aspect-ratio: 3 / 4; overflow: hidden; background: var(--accent-soft); }
.pick-card__img { width: 100%; height: 100%; object-fit: cover; }
/* 이름표를 사진 위로 올린다.
   흰 띠로 두면 카드 높이의 15% 안팎을 사진이 아닌 것이 먹는다 — 그만큼 사진이 작아진다.
   비교 대상이 사진인 화면이라 그 자리는 사진에 주는 게 맞다. 스크림으로 가독성 확보. */
.pick-card__foot {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 30px 16px 14px;
  text-align: center;
  color: #fff;
  background: linear-gradient(180deg,
    rgba(24, 21, 19, 0) 0%, rgba(24, 21, 19, .55) 48%, rgba(24, 21, 19, .78) 100%);
  pointer-events: none;
}
.pick-card__name {
  font-size: 15px; font-weight: 500; letter-spacing: -.01em;
  max-width: 100%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .4);
}
.pick-card__group {
  font-size: 11.5px; color: rgba(255, 255, 255, .82);
  text-shadow: 0 1px 3px rgba(0, 0, 0, .4);
}
.pick-card__key {
  position: absolute;
  top: 14px; left: 14px;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, .82);
  color: var(--ink-soft);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity .2s var(--ease);
}
.pick-card--right .pick-card__key { left: auto; right: 14px; }
.arena:hover .pick-card__key { opacity: 1; }

/* 승자와 패자의 방향을 나눈다. 둘 다 제자리에서 커지고/사라지면
   "내가 고른 게 이겼다"가 아니라 "한 장이 없어졌다"로 읽힌다.
   승자는 상대 자리 쪽으로 밀고 들어가고, 패자는 바깥으로 물러난다. */
.pick-card.is-winner {
  box-shadow: 0 0 0 2px var(--accent), 0 18px 44px rgba(176, 141, 87, .28);
  z-index: 2;
}
.pick-card--left.is-winner { transform: scale(1.04) translateX(5%); }
.pick-card--right.is-winner { transform: scale(1.04) translateX(-5%); }
.pick-card.is-loser { opacity: 0; }
.pick-card--left.is-loser { transform: scale(.94) translateX(-9%); }
.pick-card--right.is-loser { transform: scale(.94) translateX(9%); }
.arena.is-resolving .vs { opacity: 0; }

/* 누른 즉시 반응. 해소 애니메이션(450ms)이 끝날 때까지 아무 반응이 없으면 먹통처럼 느껴진다. */
.pick-card:active:not(:disabled) {
  transform: scale(.985);
  transition-duration: .09s;
}

.vs {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  flex: none;
  transition: opacity .3s var(--ease);
}
.vs__rule {
  display: block;
  width: 1px; height: clamp(24px, 6vh, 56px);
  background: linear-gradient(180deg, rgba(176, 141, 87, 0), rgba(176, 141, 87, .55));
}
.vs__rule:last-child {
  background: linear-gradient(180deg, rgba(176, 141, 87, .55), rgba(176, 141, 87, 0));
}
.vs__text {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .22em;
  color: var(--accent);
  text-indent: .22em;
}

/* 첫 판이 끝나면 안 보이는 줄인데 화면 높이에 비례해 커지고 있었다(900px 에서 66px).
   그만큼 카드가 작아진다 — 고정값으로 묶는다. */
.arena__hint {
  flex: none;
  padding: 12px 16px 16px;
  text-align: center;
  font-size: 12px;
  color: var(--ink-soft);
  transition: opacity .3s var(--ease);
}
/* 첫 판이 끝나면 사라진다. visibility 가 아니라 opacity 만 — 높이가 유지돼야
   힌트가 없어질 때 카드가 아래로 튀지 않는다. */
.arena__hint.is-gone { opacity: 0; }

/* 라운드 전환 오버레이 (D1). 화면 전체를 덮되 입력은 통과시킨다. */
.round-gate {
  position: fixed; inset: 0;
  z-index: 40;
  display: grid; place-items: center;
  background: rgba(250, 249, 247, .92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .22s var(--ease), visibility .22s;
}
.round-gate.is-on { opacity: 1; visibility: visible; }
.round-gate__label {
  font-size: clamp(34px, 7vw, 60px);
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--ink);
  transform: scale(.9);
  opacity: 0;
  transition: transform .3s var(--ease), opacity .3s var(--ease);
}
.round-gate.is-on .round-gate__label { transform: scale(1); opacity: 1; }

/* ============================================================ 결과 */
.result-body {
  flex: 1;
  width: min(880px, 100%);
  margin: 0 auto;
  padding: 0 clamp(16px, 3vw, 32px) 64px;
}
.winner { position: relative; text-align: center; padding: clamp(8px, 2vw, 24px) 0 0; }
.sparkle {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}
.winner__head {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  margin-bottom: 22px;
}
.winner__rule { display: block; width: clamp(40px, 12vw, 96px); height: 1px; background: var(--accent); opacity: .5; }
.winner__eyebrow {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .42em;
  text-indent: .42em;
  color: var(--accent);
}
.winner__frame {
  position: relative;
  width: min(300px, 62vw);
  margin: 0 auto;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--accent-soft);
  box-shadow: 0 18px 48px rgba(43, 39, 36, .16);
}
.winner__img { width: 100%; height: 100%; object-fit: cover; }
.winner__badge {
  position: absolute;
  top: 12px; right: 12px;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .9);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  backdrop-filter: blur(6px);
}
.winner__name {
  margin-top: 22px;
  font-size: clamp(22px, 3.4vw, 30px);
  font-weight: 600;
  letter-spacing: -.02em;
}
.winner__group { margin-top: 4px; font-size: 13px; color: var(--ink-soft); }

/* 우승 리빌 (E1). 사진 → 이름 순으로 세워 올린 뒤 파티클이 이어받는다.
   지연은 평상시 상태에 걸어 둔다 — 클래스를 걷어낼 때(=등장할 때) 순서가 생긴다. */
.winner__head, .winner__frame, .winner__name, .winner__group {
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.winner__frame { transition-delay: .06s; }
.winner__name { transition-delay: .16s; }
.winner__group { transition-delay: .2s; }
.winner.is-revealing .winner__head { opacity: 0; transform: translateY(8px); }
.winner.is-revealing .winner__frame { opacity: 0; transform: scale(.93); }
.winner.is-revealing .winner__name,
.winner.is-revealing .winner__group { opacity: 0; transform: translateY(12px); }

.result-actions {
  display: flex; justify-content: center; gap: 10px; flex-wrap: wrap;
  margin-top: 32px;
}

.rank-list { display: grid; gap: 10px; }
.rank-group {
  display: grid;
  grid-template-columns: 104px 1fr;
  align-items: start;
  gap: 20px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
/* 순위 위계 (E2). 위 두 단만 크기를 달리하면 "1위 → 2위 → 나머지"가 눈으로 읽힌다.
   아래로 갈수록 같은 크기여도 되는 이유는, 3위부터는 어차피 동순위 묶음이기 때문. */
.rank-group--first {
  border-color: rgba(176, 141, 87, .38);
  background: var(--accent-soft);
  box-shadow: var(--shadow-gold);
}
.rank-group--first .rank-item { width: 104px; }
.rank-group--first .rank-group__rank { font-size: 16px; }
.rank-group--second { border-color: rgba(176, 141, 87, .2); }
.rank-group--second .rank-item { width: 88px; }
.rank-group--second .rank-group__rank { font-size: 15px; }
.rank-group__head {
  display: flex; flex-direction: column; gap: 1px;
  padding-top: 4px;
}
.rank-group__rank { font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.rank-group__round { font-size: 11.5px; color: var(--ink-soft); }
.rank-group__items { display: flex; flex-wrap: wrap; gap: 12px; }
.rank-item { width: 74px; }
.rank-item .thumb { border-radius: 10px; }
.rank-item__meta { display: flex; flex-direction: column; margin-top: 7px; }
.rank-item__name {
  font-size: 12.5px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* 이름과 같은 취급. 안 그러면 "자연스러운 디자 / 인" 처럼 두 줄로 끊겨
   순위 카드마다 높이가 들쭉날쭉해진다. */
.rank-item__group {
  font-size: 11px; color: var(--ink-soft);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ============================================================ 관리 */
.manage-body, .stats-body {
  flex: 1;
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: 4px clamp(16px, 3vw, 32px) 32px;
}

.tabs {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.tab {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-soft);
  transition: background-color .18s var(--ease), color .18s var(--ease), box-shadow .18s var(--ease);
}
.tab:hover { background: var(--accent-soft); color: var(--ink); }
.tab.is-active { background: var(--accent-soft); color: var(--accent); }
.tab.is-drop { box-shadow: inset 0 0 0 2px var(--accent); background: var(--accent-soft); }
.tab__count {
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  opacity: .7;
}
.tab--add { color: var(--ink-soft); }

.group-bar { padding: 16px 0 4px; }
.group-bar__row { display: flex; align-items: center; gap: 10px; }
.group-bar__icon { color: var(--accent); display: grid; place-items: center; }
.group-bar__count { font-size: 12.5px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.group-bar__spacer { flex: 1; }
.group-bar__note { font-size: 12.5px; color: var(--ink-soft); }

.inline-input {
  field-sizing: content;
  min-width: 9ch;
  max-width: 260px;
  height: 34px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.01em;
  transition: border-color .18s var(--ease), background-color .18s var(--ease);
}
.inline-input:hover { border-color: var(--line); }
.inline-input:focus { border-color: var(--accent); background: var(--surface); }

.selection-bar { display: none; }
.selection-bar.is-open { display: block; padding: 12px 0 0; }
.selection-bar__row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.selection-bar__count { font-size: 13px; font-weight: 500; padding-left: 4px; }

.dropzone { position: relative; margin-top: 18px; border-radius: var(--radius); }
.dropzone__hint {
  position: absolute; inset: 0;
  display: none;
  flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  border: 1.5px dashed var(--accent);
  border-radius: var(--radius);
  background: rgba(250, 249, 247, .92);
  color: var(--accent);
  font-size: 13.5px;
  z-index: 5;
}
.dropzone.is-dragover .dropzone__hint { display: flex; }
.dropzone__mark { display: grid; place-items: center; }
.dropzone.is-busy { opacity: .6; pointer-events: none; }

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 14px;
  min-height: 220px;
}
.photo-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 8px 8px 6px;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.photo-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.photo-card.is-selectable { cursor: pointer; }
.photo-card.is-selected { border: 2px solid var(--accent); background: var(--accent-soft); padding: 7px 7px 5px; }
.photo-card.is-dragging { opacity: .4; }
.photo-card__foot { padding: 8px 4px 2px; display: flex; flex-direction: column; }
.photo-card__name {
  font-size: 12.5px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.photo-card__group { font-size: 11px; color: var(--ink-soft); }
.photo-card__actions {
  position: absolute;
  top: 12px; right: 12px;
  display: flex; gap: 2px;
  padding: 2px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(4px);
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity .18s var(--ease), transform .18s var(--ease);
}
.photo-card:hover .photo-card__actions,
.photo-card:focus-within .photo-card__actions { opacity: 1; transform: translateY(0); }
.photo-card.is-selectable .photo-card__actions { display: none; }
.photo-card__actions .icon-btn { width: 28px; height: 28px; border-radius: 8px; }

.manage-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: 18px clamp(16px, 3vw, 32px) 30px;
}
.manage-foot__note { font-size: 11.5px; color: var(--ink-soft); }

.group-picker { display: grid; gap: 6px; margin-top: 6px; }
.group-picker__item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  text-align: left;
  transition: border-color .18s var(--ease), background-color .18s var(--ease);
}
.group-picker__item:hover { border-color: var(--accent); background: var(--accent-soft); }
.group-picker__icon { color: var(--accent); display: grid; place-items: center; }
.group-picker__name { flex: 1; font-size: 14px; font-weight: 500; }
.group-picker__count { font-size: 12px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }

/* ============================================================ 통계 */
.stat-summary { padding: 8px 0 20px; }
.stat-summary__row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 18px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.metric { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.metric__value {
  font-size: 22px; font-weight: 600; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.metric__label { font-size: 11.5px; color: var(--ink-soft); }

.filter-bar { padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.filter-bar__row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  height: 32px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-soft);
  background: var(--surface);
  transition: border-color .18s var(--ease), color .18s var(--ease), background-color .18s var(--ease);
}
.chip:hover { color: var(--ink); border-color: #DCD5CB; }
.chip.is-active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.sort-wrap {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 10px 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
}
.select { border: 0; background: none; font-size: 13px; color: var(--ink); cursor: pointer; }

.toggle {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--ink-soft); cursor: pointer;
}
.toggle input { accent-color: var(--accent); width: 15px; height: 15px; }

.stat-list { display: grid; gap: 8px; padding-top: 18px; }
.stat-card {
  display: grid;
  grid-template-columns: 28px 44px minmax(0, 240px) minmax(80px, 1fr) auto 58px;
  align-items: center;
  gap: 14px;
  padding: 10px 16px 10px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.stat-card:hover { border-color: #DCD5CB; box-shadow: var(--shadow); }
.stat-card__rank {
  text-align: center;
  font-size: 12.5px; color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.stat-card .thumb { border-radius: 8px; }
.stat-card__meta { display: flex; flex-direction: column; min-width: 0; }
.stat-card__name {
  font-size: 13.5px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.stat-card__group { font-size: 11.5px; color: var(--ink-soft); }
.stat-card__bar { height: 4px; border-radius: 999px; background: var(--line); overflow: hidden; }
.stat-card__fill { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.stat-card__rate { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.stat-card__pct { font-size: 14.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat-card__low { font-size: 10.5px; color: var(--ink-soft); opacity: .75; }
.stat-card__detail { font-size: 11px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.stat-card__crown {
  display: flex; flex-direction: column; align-items: center;
  padding-left: 12px;
  border-left: 1px solid var(--line);
}
.stat-card__crown-value { font-size: 14.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat-card__crown-label { font-size: 10.5px; color: var(--ink-soft); }

/* ============================================================ 모달 / 토스트 */
.dim {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  padding: 20px;
  background: rgba(43, 39, 36, .4);
  opacity: 0;
  transition: opacity .18s var(--ease);
}
.dim.is-open { opacity: 1; }
.modal {
  width: min(420px, 100%);
  max-height: 84dvh;
  overflow-y: auto;
  padding: 26px 26px 20px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lift);
  transform: scale(.96);
  transition: transform .18s var(--ease);
}
.dim.is-open .modal { transform: scale(1); }
.modal__title { font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.modal__message { margin-top: 8px; font-size: 13.5px; color: var(--ink-soft); line-height: 1.6; }
.modal__field { margin-top: 16px; }
.field-label { display: block; font-size: 12px; color: var(--ink-soft); margin-bottom: 6px; }
.input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  font-size: 14.5px;
  transition: border-color .18s var(--ease), background-color .18s var(--ease);
}
.input:focus { border-color: var(--accent); background: var(--surface); }
.modal__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }

/* 우측 슬라이드오버 — 길어질 수 있는 보조 목록용. dim 은 모달과 공유한다. */
.dim--sheet { display: block; padding: 0; }
.sheet {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(380px, 100%);
  display: flex; flex-direction: column;
  background: var(--surface);
  box-shadow: var(--shadow-raise);
  transform: translateX(16px);
  opacity: .4;
  transition: transform .26s var(--ease), opacity .26s var(--ease);
}
.dim--sheet.is-open .sheet { transform: translateX(0); opacity: 1; }
.sheet__head {
  flex: none;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  height: var(--topbar-h);
  padding: 0 12px 0 22px;
  border-bottom: 1px solid var(--line);
}
.sheet__title { font-size: 16px; font-weight: 600; letter-spacing: -.02em; }
.sheet__body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 18px calc(24px + env(safe-area-inset-bottom));
}

.toast {
  position: fixed;
  left: 50%; bottom: 28px;
  z-index: 70;
  transform: translate(-50%, 12px);
  padding: 11px 20px;
  border-radius: 999px;
  background: rgba(43, 39, 36, .93);
  color: #F7F5F2;
  font-size: 13px;
  letter-spacing: -.01em;
  box-shadow: var(--shadow-lift);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.toast.is-open { opacity: 1; transform: translate(-50%, 0); }

/* ============================================================ 반응형 */
@media (max-width: 900px) {
  .stat-card {
    grid-template-columns: 26px 40px minmax(0, 1fr) auto 52px;
    gap: 10px;
    padding: 10px 12px 10px 8px;
  }
  .stat-card__bar { display: none; }
}

@media (max-width: 760px) {
  :root { --topbar-h: 58px; }

  .arena {
    flex-direction: column;
    gap: 10px;
    padding: 10px 16px 0;
  }
  .pick-card {
    /* 카드 밖 높이: 톱바 58 + 진행바 3 + 진출자 띠 34 + 아레나 패딩 10 +
       카드 사이 gap 10×2 + VS 행 21 + 힌트 40 ≈ 186, 여유 10 → 196.
       이름표가 오버레이로 바뀌어 카드 높이 = 사진 높이가 됐다(예전엔 흰 띠 50px 이
       두 장이면 100px 을 먹었다). 상한도 74 → 86vw. */
    width: min(86vw, calc((100dvh - 196px) * 0.375));
  }
  /* 카드가 작아 스크림이 사진을 많이 덮는다 — 데스크톱과 같은 비율이 되게 조인다 */
  .pick-card__foot { padding: 18px 12px 9px; }
  .pick-card__name { font-size: 14px; }
  .pick-card__group { font-size: 11px; }
  .pick-card__key { display: none; }
  .arena__hint { padding: 10px 16px 14px; font-size: 11.5px; }
  .arena__hint-kbd { display: none; }

  /* 세로 적층이라 VS 구분선과 승패 방향도 세로축으로 돈다 */
  .vs { flex-direction: row; gap: 10px; }
  .vs__rule {
    width: clamp(24px, 12vw, 60px); height: 1px;
    background: linear-gradient(90deg, rgba(176, 141, 87, 0), rgba(176, 141, 87, .55));
  }
  .vs__rule:last-child {
    background: linear-gradient(90deg, rgba(176, 141, 87, .55), rgba(176, 141, 87, 0));
  }
  .pick-card--left.is-winner { transform: scale(1.04) translateY(5%); }
  .pick-card--right.is-winner { transform: scale(1.04) translateY(-5%); }
  .pick-card--left.is-loser { transform: scale(.94) translateY(-9%); }
  .pick-card--right.is-loser { transform: scale(.94) translateY(9%); }

  .rank-group--first .rank-item { width: 88px; }
  .rank-group--second .rank-item { width: 78px; }

  .group-grid { grid-template-columns: 1fr; }
  .segment { display: flex; width: 100%; }
  .segment__item { flex: 1; min-width: 0; }
  .home-actions .btn { width: 100%; }

  /* 좁은 화면에서는 요약 두 줄과 큰 버튼이 나란히 서면 둘 다 찌그러진다 — 위아래로 쌓는다. */
  .startbar__inner { flex-direction: column; align-items: stretch; gap: 10px; padding-top: 10px; }
  .startbar__text { align-items: center; text-align: center; }
  .startbar .btn { width: 100%; }
  .startbar__title, .startbar__sub { max-width: 100%; }

  .hero-stage__card { width: min(34vw, 128px); }
  .recent__item { width: 88px; }

  .topbar { padding: 0 14px; }
  .topbar__title { font-size: 15px; }

  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 10px; }
  .rank-group { grid-template-columns: 1fr; gap: 12px; padding: 14px; }
  .rank-group__head { flex-direction: row; align-items: baseline; gap: 8px; padding-top: 0; }
  .rank-group__items { gap: 10px; }
  .rank-item { width: 72px; }
  .manage-foot { flex-direction: column; align-items: flex-start; gap: 8px; }
  .result-actions .btn { flex: 1; }
}

@media (max-width: 420px) {
  .stat-card { grid-template-columns: 22px 36px minmax(0, 1fr) auto; }
  .stat-card__crown { display: none; }
  .btn--lg { padding: 0 28px; }
}

/* ============================================================ 모션 저감 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
  /* 승패 표시는 링/투명도만 남기고 이동·확대는 뺀다. 3단계에서 좌우 방향을 나누며
     선택자 명시도가 올라갔으므로 여기서도 같은 명시도로 눌러야 한다. */
  .pick-card.is-winner,
  .pick-card--left.is-winner, .pick-card--right.is-winner,
  .pick-card--left.is-loser, .pick-card--right.is-loser { transform: none; }
  .round-gate { display: none; }
}

.sample-note {
  margin: -4px 0 14px;
  font-size: 12.5px;
  color: var(--ink-soft);
}
.sample-note .link-btn { display: inline; vertical-align: baseline; }

/* 새 월드컵 만들기 진입점 */
.mode-card {
  display: flex; align-items: center; gap: 16px;
  width: 100%;
  margin-top: clamp(24px, 4vw, 36px);
  padding: 18px 20px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.mode-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); border-color: var(--accent); }
.mode-card__body { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.mode-card__name { font-size: 15.5px; font-weight: 600; letter-spacing: -.01em; }
.mode-card__desc { font-size: 12.5px; color: var(--ink-soft); }
.mode-card__go { color: var(--accent); display: grid; place-items: center; }

/* 만들기 화면 — 아직 저장 전인 사진들 */
.dropzone--create {
  margin-top: 14px;
  padding: 16px;
  border: 1px dashed var(--line);
  min-height: 220px;
}
.dropzone--create.is-dragover { border-color: var(--accent); background: var(--accent-soft); }
.photo-grid--staged {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
}
.staged { position: relative; }
.staged .icon-btn {
  position: absolute; top: 6px; right: 6px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 1px 4px rgba(43, 39, 36, .2);
}
.home-actions .btn + .btn { margin-left: 10px; }

/* ---------------------------------------------------------------- 스위치
   네이티브 체크박스는 브라우저 기본 렌더라 다른 컨트롤과 톤이 안 맞는다.
   role="switch" 버튼으로 직접 그린다. */
.switch {
  display: inline-flex; align-items: center; gap: 9px;
  margin-left: auto;            /* block__head 안에서 우측으로 밀어낸다 */
  align-self: center;           /* block__head 는 baseline 정렬이라 따로 잡아 준다 */
  padding: 4px 2px;
  border-radius: 999px;
  cursor: pointer;
}
.switch__track {
  position: relative;
  width: 34px; height: 20px;
  flex: none;
  border-radius: 999px;
  background: #E4DDD3;
  transition: background-color .22s var(--ease);
}
.switch__knob {
  position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(43, 39, 36, .22);
  transition: transform .22s var(--ease);
}
.switch__label {
  font-size: 12.5px;
  color: var(--ink-soft);
  transition: color .22s var(--ease);
  white-space: nowrap;
}
.switch:hover .switch__track { background: #D8CFC2; }
.switch[aria-checked="true"] .switch__track { background: var(--accent); }
.switch[aria-checked="true"]:hover .switch__track { background: #9E7C48; }
.switch[aria-checked="true"] .switch__knob { transform: translateX(14px); }
.switch[aria-checked="true"] .switch__label { color: var(--ink); }
.switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ==================================================== 지난 회차 기록 (시트 안 전체 목록) */

/* 예전에는 홈 좌측 레일이었다. 컨테이너 없이 여백에 떠 있어 "남은 자리"로 읽혔고,
   레일+본문을 한 덩어리로 가운데 정렬한 탓에 본문이 화면 중심에서 밀려 보였으며,
   1180px 미만에서는 페이지 최하단으로 내려가 같은 기능이 두 위치에 존재했다.
   최근 4개는 본문 안 .recent 스트립으로, 전체 목록은 이 시트로 나눴다. */
.history__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.history__count { font-size: 12.5px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.history__list { display: grid; gap: 6px; }
.history__empty { font-size: 12.5px; color: var(--ink-soft); }
.history__item {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 8px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  transition: border-color .18s var(--ease), background-color .18s var(--ease);
}
.history__item:hover { border-color: var(--accent); background: var(--accent-soft); }
.history__thumb { width: 38px; flex: none; border-radius: 8px; }
.history__meta { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.history__name {
  font-size: 13px; font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.history__sub { font-size: 11.5px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.history__item .icon-btn { opacity: 0; flex: none; }
.history__item:hover .icon-btn, .history__item:focus-within .icon-btn { opacity: 1; }

/* 진행 중 진출자 띠 — 대결 카드보다 커지면 안 된다. 높이를 고정해 레이아웃이 튀지 않게 한다. */
.advanced {
  display: flex; align-items: center; gap: 6px;
  min-height: 34px;
  padding: 6px clamp(16px, 3vw, 40px) 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.advanced::-webkit-scrollbar { display: none; }
.advanced.is-empty { visibility: hidden; }
.advanced__label {
  flex: none;
  font-size: 11.5px; color: var(--ink-soft);
  margin-right: 2px;
}
.advanced__thumb {
  flex: none;
  width: 22px; height: 28px;
  border-radius: 4px; overflow: hidden;
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--line) inset;
}
.advanced__thumb img { width: 100%; height: 100%; object-fit: cover; }
/* 방금 올라간 한 장만 튀어나온다 (D5) */
.advanced__thumb.is-new { animation: advanced-pop .42s var(--ease); }
@keyframes advanced-pop {
  0%   { transform: scale(.4) translateY(6px); opacity: 0; }
  60%  { transform: scale(1.12) translateY(0); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
