/* ============================================================
   공통 컴포넌트 (design.md 5장 — 고른 시안)
   ①C VS 카드 · ②C 평행사변형 버튼 · ③C 2단 자막 제목 · ④A 사선 순위 행 · ⑤C 사진 타일
   ============================================================ */

/* ---------- 글씨 ---------- */
.num { font-family: var(--font-num); font-weight: 800; font-style: italic; font-variant-numeric: tabular-nums; line-height: 1; }
.label { font-family: var(--font-num); font-weight: 700; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; }
.display { font-family: var(--font-display); font-weight: 400; line-height: 1; letter-spacing: -0.01em; }

/* ---------- 평행사변형 / 띠 ---------- */
.para { clip-path: polygon(var(--slant) 0, 100% 0, calc(100% - var(--slant)) 100%, 0 100%); }
.strip { clip-path: polygon(0 0, 100% 0, calc(100% - var(--slant)) 100%, 0 100%); }
.strip-l { clip-path: polygon(var(--slant) 0, 100% 0, 100% 100%, 0 100%); }

/* ③C 2단 자막 제목 */
.title2 { display: flex; flex-direction: column; align-items: flex-start; margin-bottom: var(--gap); }
.title2 .t-sub {
  background: var(--team-deep); color: #fff; padding: 5px 16px 5px 12px;
  clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
}
.title2 .t-main {
  margin-left: 14px; margin-top: -2px;
  background: var(--ink); color: #fff; padding: 8px 30px 10px 18px;
  clip-path: polygon(0 0, 100% 0, calc(100% - 16px) 100%, 0 100%);
  font-family: var(--font-display); font-size: clamp(22px, 3.4vmin, 32px); line-height: 1.1;
}
.title2.is-ink .t-sub { background: var(--ink); }
.title-row { display: flex; align-items: flex-start; gap: 16px; }
.title-row .grow { flex: 1; min-width: 0; }
.title-note { color: var(--ink-3); font-size: 14px; font-weight: 500; align-self: center; }

/* 작은 소제목 (섹션용) */
.subtitle { display: flex; flex-direction: column; align-items: flex-start; margin: 4px 0 10px; }
.subtitle .t-sub { background: var(--team-deep); color: #fff; font-size: 11px; padding: 4px 14px 4px 10px; clip-path: polygon(0 0, 100% 0, calc(100% - 8px) 100%, 0 100%); }
.subtitle .t-main { margin-left: 12px; margin-top: -2px; background: var(--ink); color: #fff; padding: 6px 24px 8px 14px; clip-path: polygon(0 0, 100% 0, calc(100% - 12px) 100%, 0 100%); font-family: var(--font-display); font-size: 20px; }

/* ---------- 뒤로가기 ---------- */
.back {
  width: 52px; height: 52px; flex: none; border-radius: 12px;
  background: var(--ink); color: #fff; font-size: 24px; font-weight: 700;
  display: grid; place-items: center; transition: transform 0.15s;
}
.back:active { transform: scale(0.94); }

/* ---------- ②C 버튼 ---------- */
.btn {
  height: 56px; padding: 0 28px; font-weight: 800; font-size: 18px;
  display: inline-grid; place-items: center; transition: transform 0.15s, filter 0.15s;
  clip-path: polygon(16px 0, 100% 0, calc(100% - 16px) 100%, 0 100%);
}
.btn:active { transform: scale(0.97); }
.btn-team { background: var(--team); color: var(--team-on); }
.btn-team:active { background: var(--team-deep); }
.btn-ink { background: var(--ink); color: var(--hot); }
.btn-ghost { background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 3px var(--ink); }
.btn:disabled, .btn.is-off { background: var(--panel-2); color: var(--ink-3); cursor: default; transform: none; }
/* 입력 흐름(로그인 등)에서는 각지게 쓰지 않음 */
.btn-square { clip-path: none; border-radius: var(--r-md); }

/* 칩 — 평행사변형 */
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 18px;
  font-size: 13px; font-weight: 700; border-radius: 0;
  background: var(--panel); color: var(--ink);
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
}
.chip.is-on { background: var(--ink); color: #fff; }
.chip.team { background: var(--team); color: var(--team-on); }
.chip.hot { background: var(--hot); color: var(--ink); }

/* ---------- ①C VS 카드 (대각선 분할) ---------- */
.vs-card {
  position: relative; overflow: hidden; border-radius: var(--r-lg);
  background: var(--home-a, var(--panel-2));
  display: block; width: 100%; text-align: left;
  --seam: 55%;
}
.vs-card .vs-away {
  position: absolute; inset: 0; background: var(--away, var(--panel));
  clip-path: polygon(calc(var(--seam) + 24px) 0, 100% 0, 100% 100%, calc(var(--seam) - 24px) 100%);
}
.vs-card .vs-seam {
  position: absolute; inset: 0; background: var(--ink);
  clip-path: polygon(calc(var(--seam) + 17px) 0, calc(var(--seam) + 31px) 0, calc(var(--seam) - 17px) 100%, calc(var(--seam) - 31px) 100%);
}
/* 카드 전체가 선택 버튼 — 왼쪽/오른쪽 절반을 그대로 누름 */
.vs-hit { position: absolute; inset: 0 0 38px 0; z-index: 3; background: transparent; }
.vs-hit.left { clip-path: polygon(0 0, calc(var(--seam) + 24px) 0, calc(var(--seam) - 24px) 100%, 0 100%); }
.vs-hit.right { clip-path: polygon(calc(var(--seam) + 24px) 0, 100% 0, 100% 100%, calc(var(--seam) - 24px) 100%); }
.vs-hit:hover { background: rgba(255, 255, 255, 0.12); }
.vs-hit:active { background: rgba(255, 255, 255, 0.22); }
/* 고른 쪽: 노란 윤곽 + 깃발, 안 고른 쪽은 어둡게 */
.vs-hit.is-picked { background: rgba(255, 225, 77, 0.16); box-shadow: inset 0 0 0 5px var(--hot); }
.vs-card.is-picked .vs-hit:not(.is-picked) { background: rgba(11, 13, 18, 0.32); }
.pick-flag {
  position: absolute; left: 25%; top: 14px; transform: translateX(-50%);
  background: var(--hot); color: var(--ink); font-size: 13px; font-weight: 800;
  padding: 6px 20px; white-space: nowrap;
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
  animation: flag-in 0.3s var(--ease-out);
}
.vs-hit.right .pick-flag { left: 75%; }
@keyframes flag-in { from { opacity: 0; transform: translate(-50%, -8px); } }
/* 누른 순간 반응 */
.vs-hit.is-tapped { animation: tap-flash 0.4s var(--ease-out); }
@keyframes tap-flash {
  0% { background: rgba(255, 255, 255, 0.55); }
  100% { background: rgba(255, 255, 255, 0); }
}
.vs-foot-r { display: flex; align-items: center; gap: 12px; }
.vs-cancel { background: var(--paper); color: var(--ink); height: 24px; padding: 0 14px; font-size: 12px; }
.vs-cancel:active { transform: scale(0.95); }

.vs-card .vs-body { position: relative; display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 8px; padding: 18px 24px; }
.vs-card .vs-side { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.vs-card .vs-side.right { text-align: right; align-items: flex-end; }
.vs-card .vs-name { font-family: var(--font-display); font-size: clamp(20px, 3vmin, 34px); }
.vs-card .vs-odd { font-size: clamp(34px, 7vmin, 76px); }
.vs-card .vs-badge { background: var(--hot); color: var(--ink); padding: 6px 22px; font-size: clamp(18px, 3vmin, 32px); align-self: center; }
.vs-card .vs-bar { position: relative; margin: 0 24px; height: 10px; border-radius: 5px; background: rgba(255, 255, 255, 0.45); overflow: hidden; }
.vs-card .vs-bar i { position: absolute; inset: 0 auto 0 0; background: #fff; border-radius: 5px; }
.vs-card .vs-foot { position: relative; margin-top: 12px; background: var(--ink); color: #fff; display: flex; justify-content: space-between; gap: 12px; padding: 9px 24px; font-size: 13px; font-weight: 700; }
.vs-card .vs-foot .close { color: var(--hot); }
.vs-card.is-locked { --seam: 55%; }
.vs-card.is-locked .vs-name, .vs-card.is-locked .vs-odd { color: var(--ink-2); }
.vs-card.is-locked .vs-seam { background: var(--ink-3); }
.vs-card.is-locked .vs-foot { background: var(--ink-2); }
.vs-card.is-locked .vs-badge { background: var(--panel); color: var(--ink-3); }
.vs-card.is-picked { outline: 4px solid var(--hot); outline-offset: -4px; }

/* ---------- ④A 순위 행 ---------- */
.rank-list { display: flex; flex-direction: column; }
.rank-row {
  display: grid; grid-template-columns: 62px 1fr auto; align-items: center; gap: 12px;
  height: 48px; padding: 0 14px 0 0; border-bottom: 1px solid var(--line); background: var(--paper);
  width: 100%; text-align: left;
}
.rank-row .r-no {
  width: 56px; height: 36px; display: grid; place-items: center;
  background: var(--panel-2); color: var(--ink); font-size: 22px;
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
}
.rank-row.is-1 .r-no { background: var(--hot); }
.rank-row.is-top .r-no { background: var(--ink); color: #fff; }
.rank-row .r-name { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; min-width: 0; }
.rank-row .r-name i { width: 10px; height: 10px; border-radius: 50%; background: var(--dot, var(--team)); flex: none; }
.rank-row .r-score { font-size: 26px; }
.rank-row.is-me { background: var(--ink); color: #fff; border-radius: var(--r-md); border-bottom: 0; }
.rank-row.is-me .r-no { background: var(--team); color: var(--team-on); }
.rank-row.is-me .r-my { font-size: 12px; color: var(--hot); }

/* ---------- ⑤C 사진 타일 / 사진 자리 ---------- */
.img-slot {
  position: relative; overflow: hidden; background: var(--panel-2) var(--hatch);
  display: grid; place-items: center; text-align: center;
  color: var(--ink-3); font-size: 13px; font-weight: 700;
  font-family: var(--font-num); letter-spacing: 0.1em; text-transform: uppercase;
}
.img-slot.has-img { background-size: cover; background-position: center; }
.img-slot.has-img > span { display: none; }

/* 잠김 / 비공개 */
.is-hatch { background-image: var(--hatch); }
