.wc {
  --wc-ink: #183149;
  --wc-muted: #546679;
  --wc-action: #86421e;
  --wc-line: #eadbd0;
  --wc-orange: #f9b887;
  --wc-soft: #fff0e5;
  color: var(--wc-ink);
}
.wc :is(button, summary, a, input):focus-visible { outline: 3px solid #ac5424; outline-offset: 3px; }
.wc [tabindex="-1"]:focus { outline: none; }
.wc h2, .wc h3, .wc p { margin: 0; }
.wc h2 { font-size: clamp(1.62rem, 5vw, 2.65rem); line-height: 1.17; letter-spacing: -.035em; }
.wc h3 { font-size: clamp(1.15rem, 3.7vw, 1.36rem); }
.wc-button, .wc-sound {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border: 1px solid var(--wc-line);
  border-radius: 12px;
  padding: 9px 14px;
  background: #fff;
  color: var(--wc-ink);
  font: inherit;
  font-weight: 720;
  cursor: pointer;
}
.wc-button[data-primary] {
  border-color: #e8a06c;
  background: var(--wc-orange);
  color: #512812;
  box-shadow: 0 3px 0 #df9562;
}
.wc :is(.wc-button, .wc-sound):hover:not(:disabled) { border-color: #ce885a; }
.wc-button[data-primary]:hover:not(:disabled) { background: #f6aa73; }
.wc-button:disabled { cursor: default; }
.wc-button[data-primary]:disabled {
  border-color: #ebdfd4;
  background: #f7f0e9;
  color: #665e57;
  box-shadow: none;
  opacity: 1;
}
.wc :is(.wc-button, .wc-sound)[aria-pressed="true"] {
  border-color: #cb8552;
  background: var(--wc-soft);
  color: var(--wc-action);
  box-shadow: inset 0 0 0 1px #cb8552;
}
.wc progress {
  display: block;
  width: 100%;
  height: 10px;
  overflow: hidden;
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: #f0e6de;
  accent-color: #e98149;
}
.wc progress::-webkit-progress-bar { background: #f0e6de; border-radius: 999px; }
.wc progress::-webkit-progress-value { background: #e98149; border-radius: 999px; }
.wc progress::-moz-progress-bar { background: #e98149; border-radius: 999px; }

.wc-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: clamp(12px, 2.1vw, 24px);
  color: #183149;
}
.wc-topbar a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; }
.wc-topbar a:hover { text-decoration: underline; text-underline-offset: 4px; }
.wc-topbar a svg { rotate: 180deg; }
.wc-topbar img { width: clamp(72px, 13vw, 106px); height: auto; }

.wc-path {
  padding: clamp(10px, 2.3vw, 22px);
  border: 1px solid #ede9e5;
  border-radius: 21px;
  background: #fff;
}
.wc-path-head, .wc-pages { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wc-path-head { margin-block: 2px 14px; }
.wc-path-head .wc-button, .wc-pages .wc-button { border-radius: 999px; }
.wc-pages { margin-block-start: 14px; color: var(--wc-muted); font-size: .92rem; }
.wc-pages button:disabled { color: #665e57; background: #f7f0e9; opacity: 1; }
.wc-collection { display: inline-flex; margin-block-start: 14px; color: var(--wc-action); text-decoration: underline; text-underline-offset: 3px; }

.wc-landscape {
  --wc-disc-light: #ffd6aa;
  --wc-disc-face: #faac77;
  --wc-disc-edge: #d98653;
  --wc-disc-ink: #743714;
  background: #fff;
}
.wc-landscape[data-stage="primary"] {
  --wc-disc-light: #ffd8ca;
  --wc-disc-face: #f6a08f;
  --wc-disc-edge: #d58072;
  --wc-disc-ink: #73342d;
}
.wc-landscape[data-stage="middle"] {
  --wc-disc-light: #c5eaf3;
  --wc-disc-face: #8bc9e2;
  --wc-disc-edge: #5899b3;
  --wc-disc-ink: #184a68;
}
.wc-levels {
  --wc-tile: clamp(78px, 17vw, 110px);
  width: min(100%, 674px);
  margin: 0 auto;
  padding: 17px 0 8px;
  list-style: none;
}
.wc-levels > li {
  position: relative;
  min-height: calc(var(--wc-tile) + 52px);
  padding-bottom: 17px;
}
.wc-levels > li:last-child { min-height: 0; }
.wc-level {
  --wc-depth: clamp(6px, 1vw, 9px);
  z-index: 1;
  position: relative;
  left: var(--stop);
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: calc(var(--wc-depth) + 5px);
  width: min(130px, 38%);
  min-height: 44px;
  padding: 3px 1px 0;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--wc-ink);
  font: inherit;
  cursor: pointer;
}
.wc-level-disc {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  width: var(--wc-tile);
  aspect-ratio: 1.18;
  border: 1px solid color-mix(in srgb, var(--wc-disc-edge) 53%, transparent);
  border-radius: 50%;
  background: radial-gradient(ellipse at 40% 13%, var(--wc-disc-light), var(--wc-disc-face) 74%);
  color: var(--wc-disc-ink);
  box-shadow: inset 0 2px 1px #fff8, 0 var(--wc-depth) 0 var(--wc-disc-edge), 0 calc(var(--wc-depth) + 3px) 9px #59452d25;
  transition: transform .14s ease, box-shadow .14s ease;
}
.wc-level-disc::before {
  content: "";
  position: absolute;
  top: 13%;
  left: 17%;
  width: 32%;
  height: 17%;
  border-radius: 50%;
  background: #fff9;
  transform: rotate(-23deg);
}
.wc-level-disc svg {
  position: relative;
  width: clamp(24px, 5vw, 34px);
  height: auto;
  stroke-width: 2.3;
}
.wc-level-label {
  display: grid;
  gap: 2px;
  justify-items: center;
  max-width: 100%;
  color: var(--wc-ink);
  line-height: 1.23;
}
.wc-level-label small { display: block; color: #576675; font-size: .8rem; font-weight: 570; }
.wc-level[data-state="available"] .wc-level-disc {
  outline: 2px solid color-mix(in srgb, var(--wc-disc-edge) 38%, white);
  outline-offset: 4px;
}
.wc-level[data-state="available"] .wc-level-label small:last-child { color: var(--wc-disc-ink); font-weight: 720; }
.wc-level:disabled {
  --wc-disc-light: #f4f5f7;
  --wc-disc-face: #e0e5eb;
  --wc-disc-edge: #c8cfd8;
  --wc-disc-ink: #667483;
  opacity: 1;
  cursor: default;
}
.wc-level:disabled .wc-level-disc::before { opacity: .6; }
.wc-level:not(:disabled):active .wc-level-disc {
  transform: translateY(calc(var(--wc-depth) - 2px));
  box-shadow: inset 0 2px 1px #fff8, 0 2px 0 var(--wc-disc-edge), 0 4px 5px #59452d19;
}

.wc-trail-friend {
  position: absolute;
  inset-block-start: 8px;
  left: 18%;
  display: grid;
  justify-items: center;
  align-items: end;
  width: clamp(62px, 20vw, 132px);
  height: clamp(78px, 24vw, 138px);
  transform: translateX(-50%);
  pointer-events: none;
}
.wc-trail-friend[data-side="end"] { left: 80%; }
.wc-trail-friend::after {
  content: "";
  grid-area: 1 / 1;
  width: 51%;
  height: 8%;
  border-radius: 50%;
  background: #63758b20;
  transform: translateY(35%);
}
.wc-trail-friend img {
  grid-area: 1 / 1;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: bottom;
}
.wc-friend-moving img { animation: wc-friend-hop 1.45s ease-in-out .13s 2; }
.wc-friend-moving[data-side="start"] img { animation-delay: .37s; }
@keyframes wc-friend-hop {
  0%, 74%, 100% { transform: translateY(0); }
  42% { transform: translateY(-10px); }
}

#main.ws-cloud-page:has(.wc-warmup-stage) { background: linear-gradient(#fff0e2, #fff8f0 460px, #fffdfb); }
#main.ws-cloud-page:has(.wc-round) { background: #fff; }
#main.ws-cloud-page .ws-cloud-content:has(.wc-warmup-stage, .wc-round) { padding-block-end: 14px; }
#main .ws-cloud-content:has(.wc-warmup-stage, .wc-round) > .wc-topbar { display: none; }

.wc-warmup-stage { max-width: 628px; margin-inline: auto; }
.wc-warmup-nav { display: flex; align-items: center; gap: 11px; margin-block-end: 15px; color: var(--wc-muted); }
.wc-warmup-nav button, .wc-round-head button { width: 44px; flex-shrink: 0; padding: 0; border-radius: 50%; }
.wc-bookmark {
  position: relative;
  padding: 0 clamp(13px, 4vw, 29px) 8px;
  border: 1px solid #eed6c1;
  border-radius: 17px 17px 13px 13px;
  background: #fff;
  box-shadow: 0 5px 0 #f4e0ce, 0 12px 30px #a16a3a14;
}
.wc-bookmark::before {
  content: "";
  position: absolute;
  inset: -1px clamp(17px, 4vw, 35px) auto auto;
  width: clamp(21px, 5vw, 32px);
  height: clamp(32px, 7vw, 50px);
  background: var(--wc-orange);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 73%, 0 100%);
}
.wc-bookmark-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
  min-height: 106px;
  padding: 10px 22px 7px 0;
  border-block-end: 1px dashed #e8ceba;
}
.wc-bookmark-head h2 { width: fit-content; background: linear-gradient(transparent 70%, #ffe0c8 70%); }
.wc-bookmark-head p { margin-block-start: 7px; color: var(--wc-muted); }
.wc-bookmark-head img { flex: 0 0 auto; width: clamp(70px, 19vw, 106px); height: auto; margin-inline-end: 13px; }
.wc-warmup { margin: 0; padding: 0; list-style: none; }
.wc-warmup li {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  min-height: 63px;
  padding: 9px 1px;
  overflow-wrap: anywhere;
}
.wc-warmup li + li { border-block-start: 1px dashed #eadbcf; }
.wc-warmup li:has(details) .wc-word-main { padding-inline-end: 52px; }
.wc-word-main strong { color: var(--wc-ink); font-size: clamp(1.08rem, 5vw, 1.35rem); line-height: 1.25; }
.wc-gloss { display: block; margin-block-start: 2px; color: var(--wc-muted); line-height: 1.3; }
.wc summary { width: fit-content; color: var(--wc-action); font-size: .88rem; cursor: pointer; }
.wc-word-example summary { position: absolute; inset-inline-end: 0; inset-block-start: 14px; padding: 4px 0; }
.wc-word-example > div {
  display: grid;
  gap: 3px;
  margin-block-start: 7px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff5ed;
  font-size: .92rem;
}
.wc-word-example .wc-sound { margin-block-start: 2px; }
.wc-warmup-foot {
  position: sticky;
  bottom: 0;
  z-index: 2;
  padding: 14px 0 max(12px, env(safe-area-inset-bottom));
  background: linear-gradient(transparent, #fff8f1 25%);
}
.wc-warmup-foot .wc-button { width: 100%; min-height: 49px; border-radius: 999px; }

.wc-round {
  display: flex;
  flex-direction: column;
  max-width: 634px;
  min-height: calc(100dvh - clamp(27px, 7vw, 51px));
  margin-inline: auto;
  padding: 0 clamp(3px, 2.6vw, 26px);
  background: #fff;
}
.wc-round-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.wc-round-head > span { min-width: 5ch; color: var(--wc-muted); text-align: right; font-variant-numeric: tabular-nums; }
.wc-round .wc-round-label { margin: 20px 0 7px; color: var(--wc-muted); font-size: .9rem; }
.wc-round .wc-hint { margin: 7px 0 10px; color: var(--wc-muted); }
.wc-sound { border-color: #f1c5a6; background: #fff0e4; color: #8e441f; }
.wc-sound-small { width: 44px; padding: 0; }
.wc-prompt {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  min-height: clamp(118px, 26vw, 178px);
  padding: 10px 6px 17px;
  text-align: center;
}
.wc-word-prompt { display: flex; align-items: center; justify-content: center; gap: clamp(8px, 3vw, 16px); max-width: 100%; }
.wc-word-prompt div { min-width: 0; text-align: left; }
.wc-word-prompt .wc-sound { flex-shrink: 0; border-radius: 50%; }
.wc-prompt-word { font-size: clamp(1.8rem, 8vw, 3.4rem); font-weight: 790; line-height: 1.14; overflow-wrap: anywhere; }
.wc-prompt-zh { font-size: 1.18rem; font-weight: 690; }
.wc-ipa { color: var(--wc-muted); font-size: .94rem; }
.wc-sentence { font-size: clamp(1.05rem, 4vw, 1.35rem); }
.wc-blank { color: var(--wc-action); font-weight: 800; }
.wc-listen-text p { margin-top: 4px; font-size: 1.15rem; }
.wc-choices, .wc-pair-column { display: grid; gap: 9px; }
.wc-choices button, .wc-pairs button {
  min-height: 51px;
  border-color: #ecdfd6;
  border-radius: 15px;
  box-shadow: 0 2px 0 #f4eae2;
  overflow-wrap: anywhere;
}
.wc-pairs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.wc .wc-pair-status { min-height: 1.5em; margin-top: 8px; }
.wc-button[data-state="right"], .wc-feedback[data-state="right"] {
  border-color: #a9d2b7;
  background: #e7f5eb;
  color: #195735;
  opacity: 1;
}
.wc-button[data-state="wrong"], .wc-feedback[data-state="wrong"] {
  border-color: #e8b498;
  background: #ffebe1;
  color: #7f3d23;
  opacity: 1;
}
.wc-spelling { display: grid; justify-items: center; gap: 8px; }
.wc-spell-hint { color: var(--wc-muted); }
.wc-letter-row {
  display: flex;
  align-items: center;
  max-width: 100%;
  gap: 4px;
  font-size: clamp(1.2rem, 5.5vw, 1.65rem);
  font-family: ui-monospace, monospace;
  font-weight: 750;
}
.wc-letter-row input {
  width: calc(var(--letters) * 1ch + 26px);
  min-width: 0;
  min-height: 49px;
  padding: 8px;
  border: 1px solid #e6b897;
  border-radius: 10px;
  background: #fffaf6;
  color: var(--wc-ink);
  font: inherit;
  text-align: center;
}
.wc-feedback, .wc-error { margin-top: 13px; padding: 10px 13px; border: 1px solid; border-radius: 12px; }
.wc-feedback span { display: block; }
.wc .wc-error { margin-top: 13px; border-color: #e6bf9c; background: #fff2e2; color: #744216; }
.wc-foot { display: flex; flex-wrap: wrap; justify-content: end; gap: 8px; margin-top: auto; padding: 24px 0 8px; }
.wc-foot .wc-button { min-width: 138px; border-radius: 999px; }
.wc-foot .wc-button:only-child { width: 100%; min-height: 49px; }
.wc-result { margin-top: 18px; }
.wc-result-mark {
  overflow: hidden;
  width: min(100%, 390px);
  margin-bottom: 14px;
  border: 1px solid #ecc0ad;
  border-radius: 16px;
}
.wc-result-mark img { display: block; width: 100%; height: auto; }
.wc-result p strong { color: var(--wc-action); font-size: 1.35rem; }
.wc-result h3 { margin-top: 13px; }
.wc-result ul { display: grid; gap: 7px; padding-left: 0; list-style: none; }
.wc-result li { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }

@media (max-width: 510px) {
  .wc-path-head .wc-button, .wc-pages .wc-button { padding-inline: 10px; }
  .wc-bookmark-head { min-height: 95px; }
  .wc-foot .wc-button { flex: 1; }
}
@media (max-width: 350px) {
  .wc-bookmark-head img { width: 58px; margin-inline-end: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .wc-level-disc { transition: none; }
  .wc-friend-moving img { animation: none; }
}

.wc-game {
  --wc-map-ink:#315f5a; --wc-map-wash:#e7f4df; --wc-map-far:#d7ebeb;
  --wc-trail:#dfc487;
}
.wc-game[data-stage="primary"] {
  --wc-map-ink:#773f60; --wc-map-wash:#fbe3ee; --wc-map-far:#fbecd7;
  --wc-trail:#e8b6ae;
}
.wc-game[data-stage="middle"] {
  --wc-map-ink:#2d5e88; --wc-map-wash:#e2f4fb; --wc-map-far:#e8e5fa;
  --wc-trail:#a7ccde;
}
.wc-game-banner {
  display:grid; grid-template-columns:minmax(0,1.2fr) minmax(0,1fr); align-items:center;
  min-height:182px; margin-bottom:20px; overflow:hidden;
  border:1px solid #cbdad7; border-radius:22px;
  background:linear-gradient(150deg,var(--wc-map-wash),var(--wc-map-far));
  box-shadow:0 5px 0 color-mix(in srgb,var(--wc-map-ink) 16%,white);
}
.wc-game-copy { padding:clamp(14px,3vw,32px); color:var(--wc-map-ink); }
.wc-game-copy h1 { font-size:clamp(1.35rem,4.5vw,2.72rem); line-height:1.14; }
.wc-game-copy p { margin-top:5px; font-weight:650; }
.wc-game-progress { display:grid; gap:4px; margin-top:10px; font-size:.86rem; }
.wc-game-progress progress { width:min(100%,230px); height:11px; accent-color:var(--wc-map-ink); }
.wc-game-cover { align-self:stretch; position:relative; min-width:0; }
.wc-game-cover img { position:absolute; inset:0; width:100%; height:100%; object-fit:contain; }
.wc-game .wc-path {
  padding:clamp(9px,2vw,18px); border-color:#d4e2dd; border-radius:22px; background:#fffdf4;
}
.wc-game .wc-path-head {
  padding:6px 6px 10px; margin-bottom:6px; border-bottom:1px dashed #d6e4d9;
  color:var(--wc-map-ink);
}
.wc-path-head h2 { font-size:clamp(1.21rem,2.7vw,1.75rem); }
.wc-game .wc-path-head [data-primary] {
  min-height:44px; color:white; background:var(--wc-map-ink); border-color:var(--wc-map-ink);
  box-shadow:0 3px 0 color-mix(in srgb,var(--wc-map-ink) 72%,#132c2b);
}
.wc-game .wc-path-head [data-primary]:hover { filter:brightness(1.12); }
.wc-game .wc-landscape {
  position:relative; isolation:isolate; min-height:180px; overflow:hidden; border-radius:15px;
  background:
    radial-gradient(ellipse 78px 44px at 12% 15%,#ffffffa0 53%,transparent 56%),
    radial-gradient(ellipse 95px 54px at 87% 36%,#ffffff90 53%,transparent 55%),
    radial-gradient(ellipse 90px 51px at 12% 65%,#ffffff9c 53%,transparent 55%),
    radial-gradient(ellipse 66px 43px at 88% 82%,#ffffffa0 53%,transparent 55%),
    radial-gradient(circle,#ffffffc9 2px,transparent 3px) 0 0 / 38px 38px,
    linear-gradient(150deg,var(--wc-map-wash),var(--wc-map-far));
}
.wc-trail { position:absolute; z-index:-1; width:100%; height:100%; inset:0; pointer-events:none; }
.wc-game .wc-levels { --wc-tile:clamp(72px,13vw,101px); }
.wc-game .wc-levels > li { min-height:calc(var(--wc-tile) + 41px); }
.wc-game .wc-levels > li:last-child { min-height:0; }
.wc-game .wc-level-label {
  padding:4px 7px; border:1px solid #fff; border-radius:11px; background:#fffcf0ed; box-shadow:0 2px 5px #2d45401b;
}
.wc-game .wc-level[data-state="available"] .wc-level-disc {
  outline:3px solid #ffffffce; outline-offset:5px; animation:wc-active-node 2.6s ease-in-out infinite;
}
@keyframes wc-active-node {
  0%,100% { outline-offset:4px; } 50% { outline-offset:8px; }
}
@media(max-width:600px) {
  .wc-game-banner { min-height:139px; grid-template-columns:minmax(0,1.16fr) minmax(0,.85fr); margin-bottom:16px; border-radius:16px; }
  .wc-game-copy { padding:12px; }
  .wc-game-copy p { font-size:.79rem; }
  .wc-game-progress { font-size:.77rem; }
  .wc-game .wc-path { border-radius:16px; }
  .wc-game .wc-path-head [data-primary] { padding-inline:9px; font-size:.88rem; }
}
@media(prefers-reduced-motion:reduce) {
  .wc-game .wc-level[data-state="available"] .wc-level-disc { animation:none; }
}
