:root {
  color-scheme: light;
  --wc-ink: #211f1b;
  --wc-muted: #6e675e;
  --wc-paper: #fffdf7;
  --wc-line: #d9d2c7;
  --wc-yellow: #ffdf5d;
  --wc-coral: #ef6b5b;
  --wc-teal: #248b78;
  --wc-blue: #4a68bd;
  --wc-shadow: 0 7px 0 rgba(33, 31, 27, .12);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-width: 320px;
  margin: 0;
  background: #f7f2e9;
  color: var(--wc-ink);
  font-family: "Segoe UI", "Malgun Gothic", "Apple SD Gothic Neo", Arial, sans-serif;
  letter-spacing: 0;
  line-height: 1.5;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(33, 31, 27, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(33, 31, 27, .035) 1px, transparent 1px);
  background-size: 28px 28px;
  content: "";
}

[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button { color: inherit; font: inherit; }
h1, h2, p { margin: 0; }

.wc-site-header,
.wc-app {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.wc-site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
}

.wc-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.wc-brand img {
  width: 42px;
  height: 42px;
  border: 1px solid var(--wc-ink);
  border-radius: 7px;
  background: var(--wc-yellow);
  object-fit: contain;
  box-shadow: 0 3px 0 rgba(33, 31, 27, .18);
}

.wc-brand span { display: grid; line-height: 1.12; }
.wc-brand strong { font-size: 16px; }
.wc-brand small { margin-top: 3px; color: var(--wc-muted); font-size: 10px; font-weight: 700; }

.wc-home-link {
  display: inline-grid;
  place-items: center;
  min-width: 52px;
  min-height: 44px;
  border-bottom: 3px solid var(--wc-coral);
  font-size: 13px;
  font-weight: 900;
}

.wc-app { padding: 18px 0 54px; }

.wc-state-view {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  min-height: min(650px, calc(100vh - 110px));
  text-align: center;
}

.wc-state-view p { color: var(--wc-muted); }

.wc-loading-mark { display: flex; align-items: flex-end; gap: 6px; height: 40px; }
.wc-loading-mark span { width: 12px; background: var(--wc-ink); animation: wcLoading 700ms ease-in-out infinite alternate; }
.wc-loading-mark span:nth-child(1) { height: 18px; background: var(--wc-coral); }
.wc-loading-mark span:nth-child(2) { height: 32px; background: var(--wc-yellow); animation-delay: 120ms; }
.wc-loading-mark span:nth-child(3) { height: 24px; background: var(--wc-teal); animation-delay: 240ms; }

.wc-start {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, .92fr);
  gap: clamp(24px, 5vw, 70px);
  align-items: center;
  min-height: min(720px, calc(100vh - 110px));
  padding: 22px 0 48px;
}

.wc-start-copy { min-width: 0; }
.wc-eyebrow { color: var(--wc-coral); font-size: 13px; font-weight: 950; }

.wc-start h1,
.wc-result > h1 {
  max-width: 740px;
  margin-top: 8px;
  font-size: 68px;
  line-height: 1.04;
  overflow-wrap: normal;
  word-break: keep-all;
}

.wc-lead {
  max-width: 680px;
  margin-top: 18px;
  color: #524b43;
  font-size: 18px;
  font-weight: 700;
  word-break: keep-all;
}

.wc-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 22px;
}

.wc-facts span {
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid var(--wc-line);
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
  font-weight: 900;
}

.wc-start-actions,
.wc-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 25px;
}

.wc-button,
.wc-icon-command,
.wc-pick-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--wc-ink);
  border-radius: 7px;
  background: #fff;
  color: var(--wc-ink);
  font-weight: 950;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(33, 31, 27, .14);
}

.wc-button:hover,
.wc-button:focus-visible,
.wc-icon-command:hover,
.wc-icon-command:focus-visible,
.wc-pick-button:hover,
.wc-pick-button:focus-visible {
  outline: 3px solid rgba(74, 104, 189, .24);
  outline-offset: 2px;
  transform: translateY(-1px);
}

.wc-button.primary,
.wc-pick-button { background: var(--wc-yellow); }
.wc-button.large { min-width: 180px; min-height: 54px; font-size: 16px; }
.wc-button.ghost { border-color: transparent; background: transparent; box-shadow: none; }
.wc-button:disabled,
.wc-icon-command:disabled { cursor: not-allowed; opacity: .38; transform: none; }

.wc-disclaimer {
  max-width: 680px;
  margin-top: 18px;
  color: var(--wc-muted);
  font-size: 11px;
}

.wc-start-visuals {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-height: 520px;
  padding: 18px;
  border: 2px solid var(--wc-ink);
  background: var(--wc-yellow);
  box-shadow: 12px 12px 0 var(--wc-coral);
  transform: rotate(1deg);
}

.wc-start-thumb {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--wc-ink);
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 5px 0 rgba(33, 31, 27, .16);
}

.wc-start-thumb:nth-child(2),
.wc-start-thumb:nth-child(3) { transform: translateY(12px); }
.wc-start-thumb wio-zoomable-image { width: 100%; height: 100%; --wio-image-fit: cover; }

.wc-game { max-width: 1040px; margin: 0 auto; padding: 10px 0 40px; }

.wc-game-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.wc-game-bar > div { display: grid; }
.wc-round-label { color: var(--wc-coral); font-size: 12px; font-weight: 950; }
.wc-game-bar strong { font-size: 20px; }

.wc-icon-command { gap: 6px; min-width: 118px; padding: 8px 12px; box-shadow: none; }
.wc-icon-command > span { font-size: 12px; }

.wc-progress {
  height: 10px;
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid var(--wc-ink);
  background: #fff;
}

.wc-progress span { display: block; width: 0; height: 100%; background: var(--wc-teal); transition: width 220ms ease; }

.wc-match-heading { margin: 28px 0 18px; text-align: center; }
.wc-match-heading p { color: var(--wc-muted); font-size: 13px; font-weight: 800; }
.wc-match-heading h2 { margin-top: 3px; font-size: 28px; }

.wc-match-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.wc-candidate {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  min-width: 0;
  min-height: 560px;
  overflow: hidden;
  border: 2px solid var(--wc-ink);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--wc-shadow);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.wc-candidate:hover { transform: translateY(-3px); box-shadow: 0 10px 0 rgba(33, 31, 27, .16); }
.wc-candidate.is-picked { border-color: var(--wc-teal); transform: scale(.98); }

.wc-candidate-visual {
  position: relative;
  min-height: 360px;
  overflow: hidden;
  border-bottom: 1px solid var(--wc-line);
  background: #f4f1eb;
}

.wc-candidate-visual wio-zoomable-image { width: 100%; height: 100%; --wio-image-fit: cover; }

.wc-text-tile {
  display: grid;
  place-items: center;
  align-content: center;
  width: 100%;
  height: 100%;
  min-height: 360px;
  padding: 24px;
  border-bottom: 9px solid var(--tile-accent);
  background: var(--tile-bg);
  color: var(--tile-text);
  text-align: var(--tile-align);
}

.wc-text-tile strong { font-size: 60px; line-height: 1; }
.wc-text-tile span { margin-top: 12px; font-size: 15px; font-weight: 800; }

.wc-candidate-copy { display: grid; gap: 7px; padding: 17px 18px 12px; }
.wc-candidate-code { color: var(--wc-blue); font-size: 27px; font-weight: 950; line-height: 1; }
.wc-candidate-copy h3 { margin: 0; font-size: 20px; line-height: 1.2; }
.wc-candidate-copy p { color: var(--wc-muted); font-size: 13px; }
.wc-pick-button { margin: 0 18px 18px; min-height: 52px; }

.wc-match-note { margin-top: 15px; color: var(--wc-muted); font-size: 11px; text-align: center; }

.wc-result {
  position: relative;
  display: grid;
  justify-items: center;
  max-width: 820px;
  margin: 0 auto;
  padding: 68px 0 50px;
  text-align: center;
}

.wc-result-burst { position: absolute; inset: 12px 0 auto; height: 38px; pointer-events: none; }
.wc-result-burst i { position: absolute; width: 8px; height: 26px; background: var(--wc-coral); transform: rotate(18deg); }
.wc-result-burst i:nth-child(1) { left: 8%; top: 8px; }
.wc-result-burst i:nth-child(2) { left: 21%; top: 0; background: var(--wc-teal); transform: rotate(-25deg); }
.wc-result-burst i:nth-child(3) { left: 36%; top: 7px; background: var(--wc-yellow); }
.wc-result-burst i:nth-child(4) { right: 36%; top: 0; background: var(--wc-blue); transform: rotate(-12deg); }
.wc-result-burst i:nth-child(5) { right: 20%; top: 8px; background: var(--wc-yellow); transform: rotate(28deg); }
.wc-result-burst i:nth-child(6) { right: 8%; top: 1px; background: var(--wc-teal); transform: rotate(-24deg); }

.wc-result > h1 { max-width: 760px; font-size: 58px; }

.wc-result-visual {
  width: min(430px, 82vw);
  aspect-ratio: 1;
  margin-top: 24px;
  overflow: hidden;
  border: 2px solid var(--wc-ink);
  border-radius: 8px;
  background: #fff;
  box-shadow: 10px 10px 0 var(--wc-yellow);
}

.wc-result-visual wio-zoomable-image { width: 100%; height: 100%; --wio-image-fit: cover; }
.wc-result-visual .wc-text-tile { min-height: 100%; }

.wc-result-copy { display: grid; justify-items: center; gap: 8px; max-width: 660px; margin-top: 30px; }
.wc-result-copy > strong { color: var(--wc-coral); font-size: 40px; line-height: 1; }
.wc-result-copy h2 { font-size: 25px; }
.wc-result-copy > p { color: #4f4840; }
.wc-winner-copy { margin-top: 8px; padding: 10px 12px; border-left: 5px solid var(--wc-teal); background: #edf8f4; font-weight: 850; }
.wc-result-actions { justify-content: center; }

.wc-toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 10020;
  max-width: calc(100% - 32px);
  padding: 10px 14px;
  border: 1px solid var(--wc-ink);
  border-radius: 7px;
  background: var(--wc-ink);
  color: #fff;
  font-size: 12px;
  font-weight: 850;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.wc-toast.show { opacity: 1; transform: translate(-50%, 0); }

@keyframes wcLoading {
  to { height: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

@media (max-width: 820px) {
  .wc-start { grid-template-columns: 1fr; min-height: auto; padding-top: 16px; }
  .wc-start-visuals { order: -1; min-height: 420px; }
  .wc-start h1 { font-size: 52px; }
  .wc-result > h1 { font-size: 48px; }
  .wc-text-tile strong { font-size: 52px; }
  .wc-match-grid { gap: 10px; }
  .wc-candidate { min-height: 500px; }
  .wc-candidate-visual,
  .wc-text-tile { min-height: 320px; }
}

@media (max-width: 620px) {
  .wc-site-header,
  .wc-app { width: min(100% - 22px, 1120px); }
  .wc-app { padding-top: 6px; }
  .wc-brand small { display: none; }
  .wc-start { gap: 28px; }
  .wc-start h1 { font-size: 40px; }
  .wc-result > h1 { font-size: 38px; }
  .wc-text-tile strong { font-size: 44px; }
  .wc-start-visuals { min-height: 350px; padding: 10px; gap: 8px; box-shadow: 7px 7px 0 var(--wc-coral); }
  .wc-lead { font-size: 16px; }
  .wc-start-actions .wc-button { width: 100%; }
  .wc-game-bar strong { font-size: 17px; }
  .wc-icon-command { min-width: 48px; padding: 8px; }
  .wc-icon-command > span { display: none; }
  .wc-match-heading { margin: 20px 0 12px; }
  .wc-match-heading h2 { font-size: 22px; }
  .wc-match-grid { grid-template-columns: 1fr; }
  .wc-candidate { min-height: 0; }
  .wc-candidate-visual,
  .wc-text-tile { min-height: min(92vw, 420px); }
  .wc-candidate-copy { padding: 14px 14px 10px; }
  .wc-pick-button { margin: 0 14px 14px; }
  .wc-result { padding-top: 22px; }
  .wc-result-burst { display: none; }
  .wc-result-actions .wc-button { width: 100%; }
}
