/* ── 이상형 월드컵 (design.md · Ably 라이트) ──
   핑크는 액션·진행률·승자 링·강조 칩에만. 나머지는 흰 바탕과 뉴트럴. */
.wc-screen { display: none; }
.wc-screen.is-on { display: block; animation: wcIn .26s ease; }
@keyframes wcIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
body.wc-in-game { background: var(--subtle); }

/* ── 0 인트로 ── */
.wc-intro.is-on { min-height: 100dvh; display: flex; flex-direction: column; }
.wc-intro-body { flex: 1; width: 100%; max-width: 560px; margin: 0 auto; padding: 28px 20px 40px; display: flex; flex-direction: column; justify-content: center; text-align: center; }
.wc-eyebrow { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .02em; color: var(--pink); margin-bottom: 12px; }
.wc-title { font-size: clamp(26px, 7vw, 38px); font-weight: 800; line-height: 1.22; letter-spacing: -.025em; color: var(--fg); }
.wc-title b { color: var(--pink); font-weight: 800; }
.wc-sub { margin-top: 12px; font-size: 15px; color: var(--secondary); line-height: 1.6; }
.wc-preview { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin: 26px auto 0; width: 100%; max-width: 380px; }
.wc-pv { margin: 0; }
.wc-pv img { aspect-ratio: 1; width: 100%; object-fit: cover; border-radius: var(--r-lg); box-shadow: var(--sh-standard); }
.wc-pv figcaption { margin-top: 6px; font-size: 12px; font-weight: 600; color: var(--secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wc-vs { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: var(--r-full); background: var(--canvas); color: var(--pink); font-size: 14px; font-weight: 900; letter-spacing: .02em; box-shadow: 0 6px 16px rgba(250, 46, 95, .22); }
.wc-round-label { margin: 30px 0 10px; font-size: 13px; font-weight: 700; color: var(--fg); }
.wc-rounds { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.wc-chip { padding: 10px 16px; font-size: 14px; font-weight: 700; color: var(--secondary); background: var(--canvas); border: 1.5px solid var(--hairline); border-radius: var(--r-full); cursor: pointer; transition: border-color .15s, color .15s, background .15s; }
.wc-chip:hover { border-color: var(--muted); color: var(--fg); }
.wc-chip.is-on { color: var(--pink); background: var(--pink-soft); border-color: var(--pink); }
.wc-chip:focus-visible, .wc-more:focus-visible, .wc-scard:focus-visible, .wc-photo:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; }
.wc-round-note { margin-top: 10px; font-size: 13px; color: var(--muted); min-height: 1.5em; }
.wc-start { width: 100%; max-width: 360px; margin: 26px auto 0; font-size: 17px; padding: 18px 22px; }
.wc-intro-foot { margin-top: 18px; font-size: 12.5px; color: var(--muted); }
.wc-intro-foot a { color: var(--secondary); text-decoration: underline; text-underline-offset: 3px; }

/* ── 1 대결 ── */
.wc-gamebar { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--hairline); }
.wc-gamebar-in { display: flex; align-items: center; min-height: 52px; padding: 0 8px; max-width: var(--maxw); margin: 0 auto; }
.wc-gamebar .tb-back { width: 40px; height: 40px; border: none; background: transparent; cursor: pointer; border-radius: var(--r-md); }
.wc-gamebar .tb-back:hover { background: var(--fill); }
.wc-gamebar-mid { flex: 1; text-align: center; line-height: 1.2; }
.wc-round { display: block; font-size: 16px; font-weight: 800; color: var(--fg); letter-spacing: -.01em; }
.wc-count { display: block; margin-top: 2px; font-size: 12px; font-weight: 600; color: var(--muted); }
.wc-pbar { height: 3px; background: var(--hairline); }
.wc-pfill { height: 100%; width: 0; background: var(--pink); transition: width .35s ease; }

.wc-arena { position: relative; display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 16px; max-width: var(--maxw); margin: 20px auto 40px; padding: 0 16px; }
.wc-arena > .wc-vs { align-self: center; margin-top: 90px; transition: transform .2s; }
.wc-arena.is-hit > .wc-vs { transform: scale(1.3); }
.wc-cand { position: relative; display: flex; flex-direction: column; background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--r-xl); overflow: hidden; box-shadow: var(--sh-subtle); transition: transform .18s, box-shadow .18s, opacity .22s; will-change: transform, opacity; }
.wc-photo { position: relative; aspect-ratio: 16 / 11; background: var(--fill); overflow: hidden; cursor: pointer; }
.wc-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.wc-photo::after { content: ""; position: absolute; inset: 0; background: rgba(250, 46, 95, 0); transition: background .15s; pointer-events: none; }
.wc-photo-name { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 12px 10px; font-size: 14px; font-weight: 700; color: #fff; background: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, .55)); display: none; }
.wc-hint { position: absolute; top: 10px; right: 10px; display: inline-flex; align-items: center; gap: 4px; padding: 6px 9px; font-size: 11.5px; font-weight: 700; color: #fff; background: rgba(34, 34, 34, .62); border-radius: var(--r-full); backdrop-filter: blur(4px); animation: wcHint 1.8s ease-in-out infinite; }
@keyframes wcHint { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.wc-stamp { position: absolute; inset: 0; margin: auto; width: 72px; height: 72px; display: flex; align-items: center; justify-content: center; border-radius: var(--r-full); background: var(--pink); color: #fff; box-shadow: 0 10px 26px rgba(250, 46, 95, .4); opacity: 0; transform: scale(.4); }
.wc-stamp .icon { width: 36px; height: 36px; stroke-width: 3; }
.wc-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; }
.wc-nmrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wc-nm { font-size: 17px; font-weight: 800; letter-spacing: -.015em; color: var(--fg); line-height: 1.3; }
.wc-meta { font-size: 12.5px; color: var(--muted); }
.wc-price { margin-top: 4px; padding: 9px 12px; border-radius: var(--r-md); background: var(--fill); font-size: 13px; }
.wc-price-v { font-weight: 700; color: var(--fg); }
.wc-price-na { font-weight: 600; color: var(--secondary); }
.wc-pc { display: flex; flex-direction: column; gap: 5px; margin-top: 4px; }
.wc-pc li { display: flex; gap: 6px; align-items: flex-start; font-size: 12.5px; line-height: 1.45; color: var(--body); }
.wc-pc li .icon { width: 15px; height: 15px; margin-top: 2px; stroke-width: 2.5; }
.wc-pc li.pro .icon { color: var(--success); }
.wc-pc li.con .icon { color: var(--error); }
.wc-more { align-self: flex-start; margin-top: 6px; padding: 8px 12px; font-size: 12.5px; font-weight: 700; color: var(--fg); background: var(--canvas); border: 1px solid #DDDDDD; border-radius: var(--r-md); cursor: pointer; transition: background .15s, border-color .15s; }
.wc-more:hover { background: var(--subtle); border-color: var(--muted); }

@media (hover: hover) and (pointer: fine) {
  .wc-cand:hover { transform: translateY(-2px); box-shadow: var(--sh-standard); }
  .wc-photo:hover img { transform: scale(1.03); }
  .wc-photo:hover::after { background: rgba(250, 46, 95, .10); }
}
/* 승·패 */
.wc-cand.is-win { z-index: 2; transform: scale(1.06); box-shadow: 0 0 0 3px var(--pink), 0 18px 44px rgba(250, 46, 95, .32); }
.wc-cand.is-win .wc-stamp { opacity: 1; transform: scale(1); animation: wcStamp .36s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes wcStamp { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: scale(1); } }
.wc-cand.is-lose { opacity: 0; transition: transform .28s cubic-bezier(.4, 0, .9, .5), opacity .26s; }
#wcC0 .wc-cand.is-lose { transform: translateX(-36%) scale(.84) rotate(-3deg); }
#wcC1 .wc-cand.is-lose { transform: translateX(36%) scale(.84) rotate(3deg); }
.wc-arena.is-swap #wcC0 .wc-cand { animation: wcInL .26s cubic-bezier(.2, .9, .3, 1.03) both; }
.wc-arena.is-swap #wcC1 .wc-cand { animation: wcInR .26s cubic-bezier(.2, .9, .3, 1.03) both; }
@keyframes wcInL { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
@keyframes wcInR { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }

/* 모바일 아레나 — 카드 둘을 붙이고 VS 를 이음새 위에 */
@media (max-width: 640px) {
  .wc-arena { grid-template-columns: 1fr 1fr; gap: 0; padding: 0 14px; margin-top: 14px; align-items: stretch; }
  #wcC0, #wcC1 { display: flex; }
  #wcC0 .wc-cand, #wcC1 .wc-cand { flex: 1; width: 100%; }
  .wc-cand { border-radius: 0; }
  #wcC0 .wc-cand { border-radius: var(--r-xl) 0 0 var(--r-xl); border-right: none; }
  #wcC1 .wc-cand { border-radius: 0 var(--r-xl) var(--r-xl) 0; border-left: none; }
  .wc-photo { aspect-ratio: 3 / 4; }
  .wc-photo-name { display: block; }
  .wc-arena > .wc-vs { position: absolute; left: 50%; top: calc((100vw - 28px) / 3); margin: 0; transform: translate(-50%, -50%); z-index: 3; width: 38px; height: 38px; font-size: 12.5px; }
  .wc-arena.is-hit > .wc-vs { transform: translate(-50%, -50%) scale(1.3); }
  .wc-hint { top: 8px; right: 8px; font-size: 10.5px; padding: 5px 7px; }
  .wc-hint .icon { display: none; }
  .wc-stamp { width: 56px; height: 56px; }
  .wc-stamp .icon { width: 28px; height: 28px; }
  .wc-body { padding: 10px 10px 12px; gap: 5px; }
  .wc-nmrow { flex-direction: column; align-items: flex-start; gap: 4px; }
  .wc-nm { font-size: 14px; }
  .wc-meta { font-size: 11.5px; }
  .wc-price { font-size: 12px; padding: 7px 9px; }
  .wc-pc li { font-size: 11.5px; }
  .wc-pc li.con { display: none; }
  .wc-more { width: 100%; text-align: center; }
  .wc-cand.is-win { transform: scale(1.03); }
  #wcC0 .wc-cand.is-lose { transform: translateX(-24%) scale(.9); }
  #wcC1 .wc-cand.is-lose { transform: translateX(24%) scale(.9); }
}

/* ── 2 결과 ── */
.wc-result-hero { position: relative; padding: 36px 20px 26px; text-align: center; background: linear-gradient(180deg, var(--pink-soft) 0%, var(--canvas) 100%); }
.wc-crown { display: inline-flex; color: var(--pink); }
.wc-crown .icon { width: 44px; height: 44px; stroke-width: 1.8; }
.wc-result-sub { margin-top: 8px; font-size: 13px; font-weight: 700; color: var(--pink); letter-spacing: .02em; }
.wc-result-name { margin-top: 6px; font-size: clamp(24px, 6.5vw, 34px); font-weight: 800; letter-spacing: -.025em; line-height: 1.2; color: var(--fg); overflow-wrap: anywhere; }
.wc-result-meta { margin-top: 6px; font-size: 13.5px; color: var(--secondary); }
.wc-result-meta b { color: var(--fg); }
.wc-taste { max-width: 480px; margin: 12px auto 0; font-size: 14.5px; line-height: 1.6; color: var(--body); }
.wc-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 12px; }
.wc-result-grid { max-width: var(--maxw); margin: 0 auto; padding: 8px 16px 40px; display: grid; gap: 16px; }
.wc-result-main, .wc-result-side { display: grid; gap: 16px; align-content: start; min-width: 0; }
.wc-result-grid > *, .wc-block, .wc-detail { min-width: 0; }
.wc-block { background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--r-xl); padding: 18px; }
.wc-block > h3 { font-size: 15px; font-weight: 800; letter-spacing: -.01em; color: var(--fg); margin-bottom: 12px; }
.wc-detail { padding: 0 20px 8px; overflow: hidden; }
.wc-fallback { padding: 18px; font-size: 14px; line-height: 1.6; }
.wc-fallback .muted { margin-top: 8px; color: var(--secondary); font-size: 13px; }
.wc-compare { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; line-height: 1.55; background: var(--pink-soft); border-color: transparent; color: var(--body); overflow-wrap: anywhere; }
.wc-compare .icon { color: var(--pink); margin-top: 2px; }
.wc-compare b { color: var(--fg); }
.wc-sgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.wc-scard { display: flex; flex-direction: column; gap: 5px; padding: 0; text-align: left; background: transparent; border: none; cursor: pointer; font-family: inherit; }
.wc-scard img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r-md); background: var(--fill); transition: transform .18s, box-shadow .18s; }
.wc-scard:hover img { transform: translateY(-2px); box-shadow: var(--sh-standard); }
.wc-scard .sn { font-size: 13px; font-weight: 700; color: var(--fg); line-height: 1.3; }
.wc-scard .sg { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wc-cta-card { text-align: center; }
.wc-cta-card p { font-size: 15px; font-weight: 700; color: var(--fg); margin-bottom: 12px; }
.wc-cta-card .btn-primary { width: 100%; }
.wc-cta-note { display: block; margin-top: 8px; font-size: 12px; color: var(--muted); }
.wc-share p { font-size: 13px; color: var(--secondary); margin: -6px 0 12px; }
.wc-share-row { display: flex; gap: 8px; margin-bottom: 10px; }
.wc-share-row input { flex: 1; min-width: 0; height: 42px; padding: 0 12px; font: inherit; font-size: 13px; color: var(--secondary); background: var(--fill); border: 1px solid var(--hairline); border-radius: var(--r-md); cursor: pointer; }
.wc-share-row input:focus { outline: 2px solid var(--pink); outline-offset: 1px; }
.wc-share-row .btn-secondary { white-space: nowrap; }
.wc-share-btn { width: 100%; }
.wc-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.wc-actions > :first-child { grid-column: 1 / -1; }
.wc-sticky { position: fixed; left: 0; right: 0; bottom: 0; z-index: 80; padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); background: rgba(255, 255, 255, .96); border-top: 1px solid var(--hairline); backdrop-filter: blur(8px); }
.wc-sticky .btn-primary { width: 100%; min-height: 54px; font-size: 16.5px; font-weight: 800; }
@media (max-width: 899px) {
  .wc-cta-card { display: none; }
  .wc-result-grid { padding-bottom: 110px; }
}
@media (min-width: 900px) {
  .wc-result-grid { grid-template-columns: 1fr 320px; gap: 20px; padding-top: 16px; }
  .wc-result-side { position: sticky; top: 16px; }
  .wc-sticky { display: none; }
  .wc-result-hero { padding: 44px 20px 30px; }
}
@media (max-width: 480px) { .wc-sgrid { grid-template-columns: repeat(2, 1fr); } }

/* ── 결과 화면 모바일 최적화 ──
   상단 바 · 정리본 접기/펼치기 · 하단 고정 바(공유+CTA) · 좁은 화면 여백 */
.wc-result-bar .tb-x .icon { width: 20px; height: 20px; }
.wc-detail-more { display: none; }
.wc-detail.is-open .wc-detail-more { display: block; }
.wc-detail-toggle {
  display: flex; align-items: center; gap: 10px; width: 100%; margin: 4px 0 14px; padding: 14px 16px;
  font-family: inherit; text-align: left; color: var(--fg); background: var(--subtle);
  border: 1px solid var(--hairline); border-radius: var(--r-lg); cursor: pointer;
  transition: background .15s, border-color .15s;
}
.wc-detail-toggle:hover { background: var(--fill); border-color: var(--muted); }
.wc-detail-toggle:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; }
.wc-detail-toggle .t-main { font-size: 15px; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; }
.wc-detail-toggle .t-sub { flex: 1; min-width: 0; font-size: 12px; line-height: 1.35; color: var(--muted); }
.wc-detail-toggle .icon { flex: 0 0 auto; color: var(--secondary); transition: transform .2s; }
.wc-detail.is-open .wc-detail-toggle .icon { transform: rotate(180deg); }
.wc-detail.is-open .wc-detail-more > .vd-pg:first-child > .vd-sec:first-child { border-top: none; padding-top: 4px; }
.wc-sticky-in { display: flex; gap: 8px; max-width: var(--maxw); margin: 0 auto; }
.wc-sticky-in .btn-primary { flex: 1; width: auto; min-width: 0; }
.wc-sticky-share {
  flex: 0 0 54px; width: 54px; min-height: 54px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--fg); background: var(--canvas); border: 1px solid #DDDDDD; border-radius: var(--r-md); cursor: pointer;
  transition: background .15s, border-color .15s;
}
.wc-sticky-share:hover { background: var(--subtle); border-color: var(--muted); }
.wc-sticky-share:active { transform: scale(.97); }
.wc-sticky-share .icon { width: 22px; height: 22px; }
@media (max-width: 640px) {
  .wc-result-hero { padding: 22px 16px 20px; }
  .wc-crown .icon { width: 36px; height: 36px; }
  .wc-result-sub { margin-top: 6px; font-size: 12.5px; }
  .wc-result-meta { font-size: 13px; }
  .wc-taste { margin-top: 10px; font-size: 14px; line-height: 1.55; }
  .wc-chips { margin-top: 10px; }
  .wc-result-grid { padding: 6px 12px 120px; gap: 12px; }
  .wc-result-main, .wc-result-side { gap: 12px; }
  .wc-block { padding: 16px 14px; border-radius: var(--r-lg); }
  .wc-block > h3 { font-size: 14.5px; margin-bottom: 10px; }
  .wc-detail { padding: 0 14px 4px; }
  .wc-detail .vd-photo { margin-top: 14px; }
  .wc-detail .vd-sec { padding: 22px 0; }
  .wc-detail .vd-eyebrow { font-size: 17px; margin-bottom: 12px; }
  .wc-detail .vd-eyebrow::before { height: 17px; }
  .wc-detail .vd-price-num { font-size: 27px; }
  .wc-detail .vd-ai { padding: 14px 15px; }
  .wc-detail .vd-ai p { font-size: 14px; line-height: 1.7; }
  .wc-sgrid { gap: 8px; }
  .wc-actions { gap: 8px; }
  .wc-share-row .btn-secondary { padding-left: 12px; padding-right: 12px; }
}
@media (min-width: 900px) {
  .wc-detail-more { display: block; }
  .wc-detail-toggle { display: none; }
}

/* ── 3 내 기록 ── */
.wc-hist { max-width: 720px; margin: 0 auto; padding: 16px 16px 60px; }
.wc-hist-note { font-size: 13px; color: var(--secondary); margin: 4px 0 14px; }
.wc-table-wrap { overflow-x: auto; border: 1px solid var(--hairline); border-radius: var(--r-xl); background: var(--canvas); }
.wc-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.wc-table th { padding: 12px 10px; font-size: 12px; font-weight: 700; color: var(--muted); text-align: left; background: var(--subtle); border-bottom: 1px solid var(--hairline); white-space: nowrap; }
.wc-table th small { display: block; font-weight: 500; color: var(--lightest); }
.wc-table td { padding: 10px; border-bottom: 1px solid var(--border-subtle); vertical-align: middle; }
.wc-table tr:last-child td { border-bottom: none; }
.wc-table td.no { width: 36px; font-weight: 800; color: var(--secondary); text-align: center; }
.wc-table td.no .icon { width: 18px; height: 18px; color: var(--pink); margin: 0 auto; }
.wc-table td img { width: 48px; height: 36px; object-fit: cover; border-radius: var(--r-sm); background: var(--fill); }
.wc-table td.nm .sub { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.wc-table td.pct { font-weight: 700; color: var(--fg); text-align: right; white-space: nowrap; }
.wc-table td.empty { text-align: center; color: var(--muted); padding: 28px 10px; }
.wc-link { padding: 0; font: inherit; font-weight: 700; color: var(--fg); background: none; border: none; cursor: pointer; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; transition: text-decoration-color .15s; }
.wc-link:hover { text-decoration-color: var(--pink); }
.wc-hist-actions { display: flex; gap: 8px; margin-top: 14px; }
.wc-hist-actions .btn-secondary { flex: 1; }
.wc-hist-actions .is-armed { color: var(--error); border-color: var(--error); }

/* 좁은 화면 — 내 기록 표가 360px 안에 들어오게 (넘치면 .wc-table-wrap 이 가로 스크롤) */
@media (max-width: 480px) {
  .wc-hist { padding: 12px 12px 60px; }
  .wc-table { font-size: 13px; }
  .wc-table th { padding: 10px 7px; font-size: 11.5px; white-space: normal; line-height: 1.3; }
  .wc-table th small { font-size: 10.5px; }
  .wc-table td { padding: 9px 7px; }
  .wc-table td.no { width: 30px; }
  .wc-table td img { width: 42px; height: 32px; }
  .wc-table td.nm .sub { font-size: 11px; }
  .wc-table td.pct { font-size: 13px; }
}

/* ── 컨페티 ── */
.wc-confetti { position: fixed; inset: 0; z-index: 300; pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  .wc-hint, .wc-cand, .wc-cand.is-win .wc-stamp, .wc-arena.is-swap .wc-cand, .wc-screen.is-on { animation: none !important; }
  .wc-cand, .wc-cand.is-lose, .wc-photo img, .wc-pfill { transition: none !important; }
}
