/* 먹방 월드컵 (worldcup.html): two dish cards at a time, each with its name, other-language name, up
   to two flavour tags and a credited free photo, a thin progress line, then the winner. */
*, *::before, *::after { margin: 0; padding: 0; }

.wc-page {
  position: relative;
  z-index: 1;
  flex: 1 0 auto;
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 0 16px var(--space-12);
}

.wc-back {
  margin-bottom: var(--space-2);
  font-size: 14px;
  font-weight: 600;
}

.wc-back a {
  color: var(--color-ink-muted);
  text-decoration: none;
}

.wc-back a:hover {
  color: var(--color-ink);
  text-decoration: underline;
}

.wc-stage {
  margin-top: var(--space-8);
}

.wc-view[hidden],
.wc-photo[hidden],
.wc-credit[hidden],
.wc-winner-photo[hidden],
.wc-history[hidden],
.wc-error[hidden],
.wc-card-tags[hidden],
.wc-btn[hidden],
#wcLoadingText[hidden] {
  display: none;
}

.wc-loading,
.wc-result {
  padding: var(--space-8) var(--space-6);
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
}

.wc-loading {
  color: var(--color-ink-muted);
}

/* The start screen's height while js/worldcup.js loads (755 px on a phone, 915 px from 561 px), so the
   photo note and the footer below do not jump when it replaces this (owner 2026-10-16, layout shift). */
.wc-page .wc-loading {
  min-height: 755px;
}

@media (min-width: 561px) {
  .wc-page .wc-loading {
    min-height: 915px;
  }
}

.wc-error {
  color: var(--color-accent);
  font-weight: 600;
}

/* The game being played, "한식 32강": a small accent line over the round, and over the winner. */
.wc-game {
  margin-bottom: var(--space-1);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--color-accent);
  overflow-wrap: anywhere;
}

.wc-game[hidden] {
  display: none;
}

.wc-result .wc-game {
  margin-top: var(--space-1);
  margin-bottom: 0;
}

.wc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

.wc-btn--main {
  border-color: var(--color-ink);
  background: var(--color-ink);
  color: #fffdf8;
}

.wc-btn--main:hover {
  background: #36332d;
}

.wc-card:focus-visible,
.wc-text:focus-visible,
.wc-tool:focus-visible,
.wc-back a:focus-visible,
.wc-winner:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
}

/* A match: round, count and a thin line for the whole bracket, then the two cards. */
.wc-match {
  scroll-margin-top: calc(var(--nav-h) + 12px);
}

.wc-progress {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
}

.wc-round {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.wc-count {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-ink-muted);
  font-variant-numeric: tabular-nums;
}

.wc-track {
  height: 4px;
  margin-top: var(--space-3);
  border-radius: 999px;
  background: var(--color-divider);
  overflow: hidden;
}

.wc-track span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--color-accent);
  transition: width 200ms ease;
}

/* Both cards share the first row (so they are always the same height and their photos line up)
   and both credits the second, however long a credit is. */
.wc-pair {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
  gap: var(--space-2) var(--space-4);
  margin-top: var(--space-6);
}

.wc-slot {
  display: contents;
}

.wc-slot .wc-card { grid-row: 1; }
.wc-slot .wc-credit { grid-row: 2; }
.wc-slot:first-child > * { grid-column: 1; }
.wc-slot:last-child > * { grid-column: 3; }

.wc-vs {
  grid-column: 2;
  grid-row: 1;
}

/* The photo sits under the words (owner, 2026-10-13); 4:3 crops, cover keeps any stray size tidy. */
.wc-photo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  margin-top: auto;          /* words at the top, photos level across the two cards */
  border-radius: var(--radius-md);
  object-fit: cover;
  background: var(--color-surface-muted);
}

.wc-credit {
  font-size: 11px;
  line-height: 1.4;
  color: var(--color-ink-muted);
  text-align: center;
  overflow-wrap: anywhere;
}

.wc-credit a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.wc-winner-photo {
  max-width: 420px;
  margin: var(--space-4) auto 0;
}

.wc-winner-photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  margin-bottom: var(--space-2);
  border-radius: var(--radius-md);
  object-fit: cover;
}

.wc-card,
.wc-fighter-face {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-2);
  min-width: 0;
  min-height: 220px;
  padding: var(--space-4);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  color: var(--color-ink);
  font: inherit;
  text-align: center;
  cursor: pointer;
  transition: border-color 150ms ease, transform 150ms ease, background-color 150ms ease;
}

.wc-card:hover {
  border-color: var(--color-ink);
  transform: translateY(-2px);
}

.wc-card.is-picked {
  border-color: var(--color-accent);
  background: var(--color-accent-wash);
}

.wc-card-name {
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.wc-card-sub {
  font-size: 14px;
  color: var(--color-ink-muted);
  overflow-wrap: anywhere;
}

.wc-card-tags {
  margin-top: var(--space-1);
  font-size: 13px;
  font-weight: 700;
  color: var(--color-accent);
}

.wc-vs {
  align-self: center;
  justify-self: center;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: var(--color-ink-muted);
}

.wc-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

/* Undo and restart under the match: a line icon and a bold short label on a 12px control (owner
   2026-10-13: fewer words, livelier lettering than a plain underline). 되돌리기 steps back one pick,
   or takes back a restart, and is used often: the warm one, accent-wash fill and an accent arrow.
   처음부터 draws a new bracket: quieter (outline, muted label) and on the far side, so a slip is less
   likely, and 되돌리기 still brings the old bracket back. Never red: nothing here is final. */
.wc-tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 var(--space-4) 0 var(--space-3);
  border: 1px solid transparent;         /* transparent, so forced colours still draw the edge */
  border-radius: 12px;
  background: none;
  color: var(--color-ink);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  white-space: nowrap;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.wc-tool-icon {
  display: block;
  flex: none;
  width: 18px;
  height: 18px;
}

.wc-tool--undo {
  background: var(--color-accent-wash);
}

.wc-tool--undo .wc-tool-icon {
  color: var(--color-accent);
}

.wc-tool--restart {
  margin-inline-start: auto;             /* far right, and still right when the row wraps */
  border-color: var(--color-divider);
  color: var(--color-ink-muted);
}

/* Hover only with a real pointer, so a tap never leaves a sticky hover. The tints are the tokens
   at low alpha (accent #be185d, ink #1e1d1a), as at .wc-card.is-picked. */
@media (hover: hover) and (pointer: fine) {
  .wc-tool--undo:hover:not(:disabled) {
    background: rgba(190, 24, 93, 0.14);
  }

  .wc-tool--restart:hover:not(:disabled) {
    background: rgba(30, 29, 26, 0.06);
    color: var(--color-ink);
  }
}

/* Press, for touch and mouse alike; after the hover rules, so it also shows under the pointer. */
.wc-tool--undo:active:not(:disabled) {
  background: rgba(190, 24, 93, 0.2);
}

.wc-tool--restart:active:not(:disabled) {
  background: rgba(30, 29, 26, 0.1);
  color: var(--color-ink);
}

/* First match of a fresh game: nothing to take back. Faded, muted and without the fill, so the
   state is not opacity alone. */
.wc-tool:disabled {
  background: none;
  color: var(--color-ink-muted);
  opacity: 0.45;
  cursor: default;
}

.wc-tool:disabled .wc-tool-icon {
  color: inherit;
}

/* Motion only for people who have not asked for less: a quick tint, a small press, the undo arrow
   leans back and the restart arrows turn half a circle (the glyph lands on itself). */
@media (prefers-reduced-motion: no-preference) {
  .wc-tool {
    transition: background-color var(--ease), color var(--ease), transform var(--ease);
  }

  .wc-tool-icon {
    transition: transform var(--ease);
  }

  .wc-tool:active:not(:disabled) {
    transform: scale(0.97);
  }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .wc-tool--undo:hover:not(:disabled) .wc-tool-icon {
    transform: translateX(-2px);
  }

  .wc-tool--restart:hover:not(:disabled) .wc-tool-icon {
    transform: rotate(180deg);
  }
}

/* High contrast: system colours only (the accent arrow follows the label). */
@media (forced-colors: active) {
  .wc-tool .wc-tool-icon {
    color: inherit;
  }

  .wc-tool:disabled {
    opacity: 1;
    color: GrayText;
  }
}

/* 기록 지우기 under the past winners stays a quiet underlined text button. */
.wc-text {
  min-height: 44px;
  padding: 0 var(--space-1);
  border: 0;
  background: none;
  color: var(--color-ink-muted);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.wc-text:hover:not(:disabled) {
  color: var(--color-ink);
}

.wc-text:disabled {
  opacity: 0.45;
  cursor: default;
}

/* The winner */
.wc-result {
  text-align: center;
}

.wc-result .wc-actions {
  justify-content: center;
}

.wc-result-kicker {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--color-accent);
}

.wc-winner {
  margin-top: var(--space-3);
  font-size: clamp(36px, 7vw, 56px);
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.wc-winner-sub {
  margin-top: var(--space-2);
  font-size: 16px;
  color: var(--color-ink-muted);
}

.wc-finalist {
  margin-top: var(--space-4);
  font-size: 14px;
  color: var(--color-ink-muted);
}

/* The story card (js/worldcup.js prepareStory, owner 2026-10-14): its preview, tilted like a photo
   just printed, beside 📥 스토리 이미지 저장 and 📤 공유하기 and the one-line Instagram hint. While it
   is being drawn a gradient placeholder holds its place. */
.wc-story {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-6);
  max-width: 520px;
  margin: var(--space-6) auto 0;
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius-lg);
  background: linear-gradient(150deg, #fdf2f8, #f5f3ff 55%, #eff6ff);
  text-align: left;
}

.wc-story-preview,
.wc-story[aria-busy="true"]::before {
  flex: none;
  width: 128px;
  height: auto;
  aspect-ratio: 9 / 16;
  border-radius: 14px;
  rotate: -3deg;
}

.wc-story-preview {
  box-shadow: 0 16px 32px rgba(79, 70, 229, 0.24), 0 3px 8px rgba(30, 29, 26, 0.12);
  animation: wc-story-in 460ms cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

.wc-story-preview[hidden] {
  display: none;
}

.wc-story[aria-busy="true"]::before {
  content: "";
  background: var(--wc-grad);
  opacity: 0.35;
}

@keyframes wc-story-in {
  from { transform: translateY(14px) scale(0.86); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.wc-story-side {
  display: flex;
  flex: 1 1 220px;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
  max-width: 280px;
}

.wc-story-side .wc-btn {
  gap: var(--space-2);
  width: 100%;
  padding: 0 var(--space-4);
  word-break: keep-all;
  text-wrap: balance;
}

.wc-btn--share {
  border-color: transparent;
  background: var(--wc-grad);
  color: #fff;
}

.wc-btn--share:hover {
  border-color: transparent;
  background: linear-gradient(115deg, #be185d, #86198f 48%, #4338ca);
}

.wc-btn--kakao {
  border-color: #f2d800;
  background: #fee500;
  color: #191600;
}

.wc-btn--kakao:hover {
  border-color: #e6cc00;
  background: #f5dc00;
}

.wc-btn-icon {
  flex: none;
  font-size: 18px;
  line-height: 1;
}

.wc-story-hint {
  font-size: 12px;
  line-height: 1.5;
  color: var(--color-ink-muted);
  word-break: keep-all;
  overflow-wrap: anywhere;
}

/* 사진 출처: the author and licence, linked, of the four photos on the story card (renderCredits). */
.wc-credits {
  max-width: 520px;
  margin: var(--space-3) auto 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--color-ink-muted);
  text-align: left;
}

.wc-credits[hidden] {
  display: none;
}

.wc-credits summary {
  cursor: pointer;
  width: fit-content;
  margin: 0 auto;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
}

.wc-credits-list {
  display: grid;
  gap: var(--space-1);
  margin: var(--space-2) 0 0;
  padding: 0;
  list-style: none;
}

.wc-credits-item {
  overflow-wrap: anywhere;
}

.wc-credits-role {
  margin-right: var(--space-2);
  font-weight: 700;
}

.wc-credits-dish {
  margin-right: var(--space-2);
}

.wc-credits a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* 저장했어요 / 링크를 복사했어요: a toast at the bottom of the screen, and the same words read out once. */
.wc-toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  max-width: calc(100% - 32px);
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--color-ink);
  color: #fffdf8;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  box-shadow: 0 10px 30px rgba(30, 29, 26, 0.25);
  opacity: 0;
  transform: translate(-50%, 12px);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

.wc-toast.is-shown {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* A friend's shared result over the start screen: "친구의 최애는 ○○! 🏆 너도 해봐". */
.wc-friend {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  max-width: min(100%, 560px);
  margin: -20px auto 16px;
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--color-ink);
  color: #fffdf8;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  box-shadow: 0 10px 26px rgba(79, 70, 229, 0.25), 0 2px 6px rgba(30, 29, 26, 0.12);
}

.wc-friend[hidden],
.wc-friend-photo[hidden] {
  display: none;
}

.wc-friend-photo {
  flex: none;
  width: 40px;
  height: 40px;
  margin: -2px 0 -2px -10px;
  border: 2px solid #fff;
  border-radius: 50%;
  object-fit: cover;
}

.wc-friend-text {
  min-width: 0;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.wc-friend-dish {
  color: #f9a8d4;
}

.wc-history {
  margin-top: var(--space-8);
}

.wc-history h3 {
  font-size: 16px;
  font-weight: 800;
}

.wc-history-list {
  list-style: none;
  margin-top: var(--space-3);
  border-top: 1px solid var(--color-divider);
}

.wc-history-list li {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-divider);
  font-size: 15px;
}

.wc-history-list time {
  color: var(--color-ink-muted);
  font-variant-numeric: tabular-nums;
}

/* Pick feedback: the chosen card pops with a check, the other steps back. */
.wc-card {
  position: relative;
}

.wc-card.is-picked {
  border-color: var(--color-accent);
  background: var(--color-accent-wash);
  box-shadow: 0 0 0 3px var(--color-accent-wash), 0 12px 28px rgba(190, 24, 93, 0.18);
  transform: scale(1.03);
}

.wc-card.is-picked::after {
  content: "✓";
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fffdf8;
  font-size: 18px;
  font-weight: 900;
  animation: wc-stamp 260ms ease-out;
}

.wc-card.is-dropped {
  opacity: 0.35;
  filter: grayscale(0.6);
  transform: scale(0.96);
}

/* The round splash (js/worldcup.js showSplash, owner 2026-10-14): from the quarterfinals on, a
   black stage in the top layer, above the navigation, with the round in Jua; the final adds the
   crash of the two finalists under a VS stamp. The script builds it only while it plays and moves
   only transform and opacity; with reduced motion or forced colours it is never opened. Colours:
   black and white, accents from the wordmark gradient (#ec4899, #a855f7, #6366f1). */
.wc-splash {
  display: none;                         /* where popovers are not supported: never shown */
}

.wc-splash:popover-open {
  display: block;
  position: fixed;
  inset: 0;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  overflow: hidden;
  overflow: clip;
  touch-action: pinch-zoom;              /* no scrolling under it; zoom still works */
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.wc-splash::backdrop {
  background: transparent;
}

.wc-splash-bg,
.wc-splash-stage,
.wc-splash-center,
.wc-splash-flash {
  position: absolute;
  inset: 0;
}

.wc-splash-bg {
  background: #000;
}

.wc-splash-flash {
  background: #fff;
  opacity: 0;
}

.wc-splash-center {
  display: grid;
  place-items: center;
}

.wc-splash-center > * {
  grid-area: 1 / 1;
}

.wc-splash-title,
.wc-splash-vs {
  position: relative;
  font-family: 'Jua', 'Noto Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  font-weight: 900;                      /* Jua has one weight; the fallback gets its heaviest */
  font-synthesis: none;
  line-height: 1.15;
  white-space: nowrap;
  color: #fff;
}

.wc-splash-title {
  padding: 0.12em 0.18em;
  letter-spacing: -0.01em;
  text-shadow: 0 0.04em 0.18em rgba(168, 85, 247, 0.45);
}

.wc-splash-ch {
  display: inline-block;
}

.wc-splash-gap {
  width: 0.26em;
}

/* Two gradient rules frame the title, drawn in from opposite sides. */
.wc-splash-line {
  position: absolute;
  left: 0;
  right: 0;
  height: max(3px, 0.05em);
  border-radius: 999px;
  background: linear-gradient(90deg, #ec4899, #a855f7, #6366f1);
}

.wc-splash-line--top { top: 0; }
.wc-splash-line--bottom { bottom: 0; }

.wc-splash-glow,
.wc-splash-ring,
.wc-splash-wave {
  border-radius: 50%;
}

.wc-splash-glow {
  background: radial-gradient(closest-side, rgba(168, 85, 247, 0.42), rgba(236, 72, 153, 0.16) 55%, transparent);
}

.wc-splash-ring,
.wc-splash-wave {
  border: 3px solid rgba(255, 255, 255, 0.85);
}

/* The crash: thin speed lines from the edges, coloured rays from the impact, a shock ring. */
.wc-splash-lines,
.wc-splash-burst,
.wc-splash-wave {
  position: absolute;
  border-radius: 50%;
}

.wc-splash-lines {
  background: repeating-conic-gradient(from 2deg, transparent 0deg 5.2deg, rgba(255, 255, 255, 0.5) 5.6deg 6deg);
  -webkit-mask: radial-gradient(circle, transparent 0 24%, #000 52%);
  mask: radial-gradient(circle, transparent 0 24%, #000 52%);
}

.wc-splash-burst {
  background: repeating-conic-gradient(from -4deg, #fff 0deg 3deg, transparent 3deg 22.5deg,
    #ec4899 22.5deg 26deg, transparent 26deg 45deg, #a855f7 45deg 48deg, transparent 48deg 67.5deg,
    #6366f1 67.5deg 71deg, transparent 71deg 90deg);
  -webkit-mask: radial-gradient(circle, transparent 0 9%, #000 14% 36%, transparent 70%);
  mask: radial-gradient(circle, transparent 0 9%, #000 14% 36%, transparent 70%);
}

.wc-splash-vs {
  line-height: 1;
  padding: 0 0.12em 0.14em 0;
  transform-origin: 50% 55%;
  /* A pink-to-indigo extrusion, then a dark halo so the letters hold over any photo. */
  text-shadow: 0.03em 0.03em 0 #ec4899, 0.06em 0.06em 0 #c44fd0, 0.09em 0.09em 0 #a855f7, 0.12em 0.12em 0 #6366f1,
    0.06em 0.08em 0.16em rgba(0, 0, 0, 0.75), 0 0 0.3em rgba(168, 85, 247, 0.55);
}

/* A finalist: the double of its card (same face, same box), a brand rim and speed streaks. */
.wc-fighter {
  position: absolute;
  box-sizing: border-box;
}

.wc-fighter-face {
  position: absolute;
  inset: 0;
  box-sizing: border-box;
  cursor: inherit;
  transition: none;
}

.wc-fighter-glow {
  position: absolute;
  inset: -4px;
  border-radius: calc(var(--radius-lg) + 4px);
  background: linear-gradient(160deg, #ec4899, #a855f7);
  box-shadow: 0 0 36px 4px rgba(236, 72, 153, 0.55);
}

.wc-fighter--right .wc-fighter-glow {
  background: linear-gradient(200deg, #6366f1, #a855f7);
  box-shadow: 0 0 36px 4px rgba(99, 102, 241, 0.6);
}

.wc-fighter-trail {
  position: absolute;
  top: 6%;
  bottom: 6%;
  width: 120%;
  right: 100%;
  transform-origin: right center;
}

.wc-fighter--right .wc-fighter-trail {
  right: auto;
  left: 100%;
  transform-origin: left center;
}

.wc-fighter-streak {
  position: absolute;
  right: 6px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(270deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0));
}

.wc-fighter--right .wc-fighter-streak {
  right: auto;
  left: 6px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0));
}

.wc-confetti {
  position: fixed;
  inset: 0;
  z-index: 50;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.wc-result.is-celebrating .wc-winner,
.wc-result.is-celebrating .wc-winner-photo img {
  animation: wc-pop 650ms cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

@keyframes wc-stamp {
  from { transform: scale(0.2) rotate(-30deg); opacity: 0; }
  to { transform: scale(1) rotate(0); opacity: 1; }
}

@keyframes wc-pop {
  from { transform: scale(0.85); opacity: 0.2; }
  to { transform: scale(1); opacity: 1; }
}

/* Everyone's picks (lab, stage 2): the last pick's win rates and the ranking. */
.wc-last {
  min-height: 1.5em;                     /* the line keeps its place while empty: no jump */
  margin-top: var(--space-2);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--color-accent);
}

.wc-last[hidden],
.wc-ranking[hidden],
.wc-ranking-mine[hidden] {
  display: none;
}

.wc-ranking {
  margin-top: var(--space-8);
}

.wc-ranking h3 {
  font-size: 16px;
  font-weight: 800;
}

.wc-ranking-total {
  margin-top: var(--space-1);
  font-size: 13px;
  color: var(--color-ink-muted);
}

.wc-ranking-list {
  list-style: none;
  margin-top: var(--space-3);
  border-top: 1px solid var(--color-divider);
}

.wc-ranking-list li {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-divider);
  font-size: 15px;
}

.wc-ranking-list img {
  width: 48px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
}

.wc-ranking-name {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.wc-ranking-rate {
  font-size: 13px;
  color: var(--color-ink-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.wc-ranking-mine {
  margin-top: var(--space-3);
  font-weight: 800;
  color: var(--color-accent);
}

@media (max-width: 560px) {
  .wc-loading,
  .wc-result {
    padding: var(--space-6) var(--space-4);
  }

  /* Phone: the two dishes stay side by side, square photos, VS between them. */
  .wc-pair {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--space-2) var(--space-3);
  }

  .wc-slot:last-child > * { grid-column: 2; }

  .wc-vs {
    grid-column: auto;
    grid-row: auto;
    position: absolute;
    top: 38%;
    left: 50%;
    z-index: 1;
    transform: translate(-50%, -50%);
    padding: 6px 8px;
    border-radius: 999px;
    background: var(--color-ink);
    color: #fffdf8;
    font-size: 11px;
  }

  .wc-card,
  .wc-fighter-face {
    min-height: 0;
    padding: var(--space-3) var(--space-2);
    gap: var(--space-1);
  }

  .wc-card-name {
    font-size: 19px;
  }

  .wc-card-sub,
  .wc-card-tags {
    font-size: 12px;
  }

  .wc-photo {
    aspect-ratio: 1 / 1;
  }

  .wc-ranking-list li {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .wc-ranking-list img {
    width: 40px;
    height: 30px;
    grid-row: span 2;
  }

  .wc-actions .wc-btn {
    flex: 1 1 100%;
  }

  .wc-story {
    gap: var(--space-3);
    padding: var(--space-3);
  }

  .wc-story-preview,
  .wc-story[aria-busy="true"]::before {
    width: 96px;
  }

  .wc-story-side .wc-btn {
    padding: 0 var(--space-2);
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wc-card,
  .wc-track span {
    transition: none;
  }

  .wc-card.is-picked,
  .wc-card.is-dropped {
    transform: none;
  }

  .wc-card.is-picked::after,
  .wc-story-preview,
  .wc-result.is-celebrating .wc-winner,
  .wc-result.is-celebrating .wc-winner-photo img {
    animation: none;
  }

  .wc-card:hover {
    transform: none;
  }

  .wc-toast {
    transition: none;
  }
}

/* The start gacha (js/worldcup.js showGacha, owner 2026-10-14): in the splash's popover, a night
   stage with a pink and violet glow, a capsule machine with a face (220 x 330 at --k = 1) whose
   screen counts the draw, capsules that pop open on dish photos, "너의 최애는?" on a pill, the
   first two dishes as photo cards with a VS badge, and a small 건너뛰기 hint. The script builds it
   only while it plays and moves only transform and opacity. The brand mix: pink, violet, indigo,
   with cyan and yellow only as capsule colours. */
.wc-splash[data-round="start"] .wc-splash-bg {
  background: radial-gradient(70% 55% at 50% 42%, #2b1755, #130d24 72%);
}

.wc-gacha-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(60% 45% at 50% 55%, rgba(168, 85, 247, 0.36), rgba(236, 72, 153, 0.14) 55%, transparent 75%);
  opacity: 0;
}

.wc-gacha {
  position: absolute;
  left: 50%;
  top: 56%;
  width: 220px;
  height: 330px;
  margin: -175px 0 0 -110px;
  scale: var(--k, 1);
  transform-origin: 50% 100%;
}

.wc-gacha-dome {
  position: absolute;
  left: 10px;
  top: 0;
  width: 200px;
  height: 200px;
  overflow: hidden;
  border: 4px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.5) 0 9%, rgba(255, 255, 255, 0.07) 10% 60%, rgba(99, 102, 241, 0.22) 100%);
}

.wc-gacha-ball {
  position: absolute;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.75) 0 14%, transparent 15%), linear-gradient(var(--c) 0 50%, #fffdf8 50%);
  box-shadow: inset 0 -3px 0 rgba(30, 29, 26, 0.18);
}

.wc-gacha-ball:nth-child(1) { --c: #ec4899; left: 22px; top: 120px; }
.wc-gacha-ball:nth-child(2) { --c: #06b6d4; left: 70px; top: 134px; rotate: 20deg; }
.wc-gacha-ball:nth-child(3) { --c: #a855f7; left: 118px; top: 124px; rotate: -15deg; }
.wc-gacha-ball:nth-child(4) { --c: #6366f1; left: 40px; top: 76px; rotate: 40deg; }
.wc-gacha-ball:nth-child(5) { --c: #fde047; left: 88px; top: 86px; }
.wc-gacha-ball:nth-child(6) { --c: #ec4899; left: 134px; top: 78px; rotate: -30deg; }
.wc-gacha-ball:nth-child(7) { --c: #06b6d4; left: 66px; top: 38px; rotate: 60deg; }

.wc-gacha-body {
  position: absolute;
  left: 0;
  top: 168px;
  width: 220px;
  height: 150px;
  border-radius: 30px 30px 24px 24px;
  background: linear-gradient(120deg, #ec4899, #a855f7 45%, #6366f1 80%);
  box-shadow: inset 0 6px 0 rgba(255, 255, 255, 0.28), inset 0 -8px 0 rgba(30, 29, 26, 0.22);
}

.wc-gacha-body::before,
.wc-gacha-body::after {                   /* feet */
  content: "";
  position: absolute;
  bottom: -10px;
  width: 30px;
  height: 14px;
  border-radius: 8px;
  background: #0f0e0c;
}

.wc-gacha-body::before { left: 34px; }
.wc-gacha-body::after { right: 34px; }

.wc-gacha-screen {
  position: absolute;
  left: 20px;
  top: 16px;
  width: 72px;
  height: 38px;
  overflow: hidden;
  border-radius: 10px;
  background: #0f0e0c;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.wc-gacha-count {
  display: block;
  color: #67e8f9;
  font-family: var(--wc-display);
  font-size: 26px;
  line-height: 38px;
  text-align: center;
  text-shadow: 0 0 8px rgba(34, 211, 238, 0.8);
  white-space: pre;
}

.wc-gacha-crank {
  position: absolute;
  right: 22px;
  top: 12px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #fffdf8;
  box-shadow: inset 0 -3px 0 rgba(30, 29, 26, 0.15), 0 0 0 3px rgba(30, 29, 26, 0.25);
}

.wc-gacha-crank::before {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  top: 50%;
  height: 10px;
  margin-top: -5px;
  border-radius: 5px;
  background: #4f46e5;
}

.wc-gacha-eye {
  position: absolute;
  top: 66px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(circle at 58% 58%, #0f0e0c 0 32%, #fff 34%);
  box-shadow: 0 0 0 2px #0f0e0c;
}

.wc-gacha-eye--l { left: 62px; }
.wc-gacha-eye--r { right: 62px; }

.wc-gacha-mouth {                         /* the chute: the capsules come out of it */
  position: absolute;
  left: 50%;
  top: 100px;
  width: 66px;
  height: 32px;
  margin-left: -33px;
  border-radius: 12px 12px 18px 18px;
  background: #0f0e0c;
  transform-origin: 50% 0;
}

.wc-gacha-caps {
  position: absolute;
  inset: 0;
}

.wc-cap {
  position: absolute;
  width: var(--cap, 56px);
  height: var(--cap, 56px);
  margin: calc(var(--cap, 56px) / -2) 0 0 calc(var(--cap, 56px) / -2);
}

.wc-cap-y {
  position: absolute;
  inset: 0;
}

.wc-cap-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 3px solid #fff;
  border-radius: 50%;
  object-fit: cover;
  background: #fce7f3;
  box-shadow: 0 0 0 2px #0f0e0c;
}

.wc-cap-shell {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  clip-path: inset(0 0 50% 0);
  background: radial-gradient(circle at 34% 26%, rgba(255, 255, 255, 0.75) 0 12%, transparent 13%), var(--c, #ec4899);
  box-shadow: inset 0 0 0 2px #0f0e0c;
}

/* The first two dishes: photo cards with a white ring, the size of the real match photos. */
.wc-duelist {
  position: absolute;
  margin: 0;
  border-radius: 16px;
  background: #fce7f3;
  box-shadow: 0 0 0 4px #fff, 0 0 0 7px #0f0e0c, 0 16px 34px rgba(0, 0, 0, 0.4);
}

.wc-duelist img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.wc-gacha-vs {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin: -38px 0 0 -38px;
  border: 3px solid #0f0e0c;
  border-radius: 50%;
  background: linear-gradient(135deg, #ec4899, #a855f7 50%, #6366f1);
  box-shadow: 0 0 0 4px #fff, 0 0 0 7px #0f0e0c;
}

.wc-gacha-vs b {
  color: #fff;
  font-family: var(--wc-display);
  font-size: 32px;
  font-weight: 400;
  -webkit-text-stroke: 4px #0f0e0c;
  paint-order: stroke fill;
}

/* One line of text at a time: 한식 32강 뽑는 중…, then 너의 최애는?. */
.wc-gacha-line,
.wc-gacha-ask {
  position: absolute;
  left: 16px;
  right: 16px;
  font-family: var(--wc-display);
  font-weight: 400;
  text-align: center;
  word-break: keep-all;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.wc-gacha-line {
  top: max(9%, env(safe-area-inset-top));
  font-size: clamp(20px, 5.4vw, 30px);
  line-height: 1.3;
  color: #fff;
  text-shadow: 0 2px 12px rgba(168, 85, 247, 0.6);
}

.wc-gacha-ask {
  top: 13%;
}

.wc-gacha-ask span {
  display: inline-block;
  max-width: 100%;
  padding: 6px 20px 8px;
  border-radius: 999px;
  background: linear-gradient(110deg, #be185d, #7e22ce 55%, #4338ca);
  color: #fff;
  font-size: clamp(28px, 8.5vw, 50px);
  line-height: 1.2;
  -webkit-text-stroke: 5px #0f0e0c;
  paint-order: stroke fill;
  box-shadow: 0 0 0 3px #fff, 0 0 0 6px #0f0e0c;
  rotate: -4deg;
}

.wc-gacha-skip {
  position: absolute;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 6px;
  translate: -50% 0;
  padding: 8px 16px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-family: var(--wc-display);
  font-size: 16px;
  white-space: nowrap;
}

.wc-gacha-skip-icon {
  font-size: 14px;
}

/* The music toggle (js/worldcup.js sound, owner 2026-10-14): a pill in the bottom corner, in the top
   layer (a manual popover) so it stays above the splash and the gacha; 🔇 off, 🔊 on, an icon alone
   on a phone. Off by default. */
.wc-sound-dock {
  position: fixed;
  inset: auto max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) auto;
  z-index: 10002;                        /* where popovers are not supported: above the navigation */
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  overflow: visible;
}

.wc-sound-dock[hidden] {
  display: none;
}

.wc-sound {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 14px 0 12px;
  border: 1px solid var(--color-ink);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-ink);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.wc-sound[aria-pressed="true"] {
  background: var(--color-ink);
  color: #fffdf8;
}

.wc-sound-icon {
  font-size: 18px;
  line-height: 1;
}

.wc-sound[aria-pressed="true"] .wc-sound-off,
.wc-sound[aria-pressed="false"] .wc-sound-on {
  display: none;
}

/* A dark ring on a white halo: visible on the page and on the black splash alike. */
.wc-sound:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px #fff;
}

@media (hover: hover) and (pointer: fine) {
  .wc-sound:hover {
    border-color: var(--color-accent);
  }
}

@media (max-width: 420px) {
  .wc-sound {
    padding: 0;
  }

  .wc-sound-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

@media (forced-colors: active) {
  .wc-sound {
    border-color: ButtonText;
  }

  .wc-sound:focus-visible {
    outline-color: Highlight;
  }
}
