:root {
  --bg: #0f1020;
  --panel: #1a1b28;
  --panel-2: #212233;
  --accent: #6842ff;
  --text: #fff;
  --muted: #aaadbe;
  --good: #22c55e;
  --bad: #ff4d6d;
  --c-africa: #ff9a1f;
  --c-africa-2: #e0590b;
  --c-asia: #ff4d7a;
  --c-asia-2: #c0194d;
  --c-europe: #4d8dff;
  --c-europe-2: #2448d6;
  --c-namerica: #2fd07f;
  --c-namerica-2: #0f9a52;
  --c-samerica: #ffcf2e;
  --c-samerica-2: #e09100;
  --c-oceania: #22d3e6;
  --c-oceania-2: #0891b2;
  --c-world: #8b6bff;
  --c-world-2: #5130e6;
  font-family: "Nunito", ui-rounded, "SF Pro Rounded", system-ui, -apple-system,
    "Segoe UI", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { min-height: 100%; overflow-x: hidden; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; }
button:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
  box-shadow: 0 0 0 6px rgba(104, 66, 255, 0.7);
}
kbd {
  font: inherit;
  font-weight: 900;
  font-size: 0.8em;
  padding: 0 0.4em;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.14);
}
.wc-sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.wc-app {
  max-width: 940px;
  margin: 0 auto;
  padding: 10px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* HUD */
.wc-hud { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.wc-brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.wc-brand-globe { width: 34px; height: 34px; flex: none; filter: drop-shadow(0 3px 6px rgba(0,0,0,.4)); }
.wc-brand h1 { margin: 0; font-size: 1.3rem; font-weight: 900; letter-spacing: -0.01em; white-space: nowrap; }
.wc-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.wc-chip {
  display: flex; align-items: baseline; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  background: linear-gradient(180deg, #2a2b40, #212233);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 2px 0 rgba(0,0,0,.35);
  min-width: 0;
}
.wc-chip span { font-size: 0.68rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.wc-chip strong { font-size: 1rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.wc-chip-streak.hot strong { color: #ffb020; text-shadow: 0 0 10px rgba(255,160,0,.7); }
.wc-chip.bump strong { animation: wc-bump .35s ease; display: inline-block; }

/* Stage */
.wc-stage {
  position: relative;
  border-radius: 24px;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(104,66,255,.35), transparent 60%),
    linear-gradient(180deg, #1d1e30, #151626);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 10px 30px rgba(0,0,0,.4);
  padding: 16px;
  overflow: hidden;
  min-height: 480px;
}
.wc-screen[hidden] { display: none !important; }

/* Menu */
.wc-menu { display: flex; flex-direction: column; gap: 14px; }
.wc-menu-hero { display: flex; align-items: center; gap: 18px; }
.wc-globe { width: 150px; height: 150px; flex: none; filter: drop-shadow(0 12px 20px rgba(20,40,160,.5)); }
.wc-globe-land { animation: wc-spin 16s linear infinite; }
.wc-pin { animation: wc-pin 2.4s ease-in-out infinite; transform-origin: 154px 70px; }
.wc-kicker { margin: 0; color: #b9a8ff; font-weight: 900; text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; }
.wc-menu-copy h2 { margin: 4px 0 6px; font-size: clamp(1.35rem, 3.4vw, 2rem); font-weight: 900; line-height: 1.1; }
.wc-sub { margin: 0; color: var(--muted); font-weight: 700; }
.wc-options { display: flex; flex-direction: column; gap: 10px; }
.wc-row { display: flex; flex-wrap: wrap; gap: 8px; }
.wc-seg {
  flex: 1 1 0;
  min-height: 44px;
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  background: #2a2b3d;
  font-weight: 900;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 3px 0 #16172a;
  transition: transform .12s ease, background .15s ease;
  white-space: nowrap;
}
.wc-seg:active { transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 1px 0 #16172a; }
.wc-seg[aria-checked="true"] {
  background: linear-gradient(180deg, #8a6bff, #5a2fff);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.3), 0 3px 0 #3a1bb8, 0 6px 16px rgba(104,66,255,.45);
}
.wc-regions .wc-seg { flex: 1 1 auto; padding: 8px 12px; font-size: .92rem; }
.wc-regions .wc-seg::before {
  content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  margin-right: 6px; background: var(--dot, #fff); vertical-align: 0;
  box-shadow: 0 0 0 2px rgba(255,255,255,.25);
}
.wc-regions .wc-seg[aria-checked="true"] {
  background: linear-gradient(180deg, var(--c1), var(--c2));
  box-shadow: inset 0 2px 0 rgba(255,255,255,.35), 0 3px 0 rgba(0,0,0,.35), 0 6px 14px rgba(0,0,0,.3);
  text-shadow: 0 1px 2px rgba(0,0,0,.35);
}
.wc-play-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.wc-best-line { margin: 0; color: var(--muted); font-weight: 800; }

.wc-btn {
  min-height: 46px;
  padding: 10px 24px;
  border: 0;
  border-radius: 999px;
  font-weight: 900;
  font-size: 1rem;
  cursor: pointer;
  transition: transform .12s ease, filter .15s ease;
}
.wc-btn:active { transform: translateY(2px) scale(.98); }
.wc-btn-primary {
  background: linear-gradient(180deg, #8a6bff, #6842ff 55%, #5530f0);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.35), 0 4px 0 #3a1bb8, 0 10px 24px rgba(104,66,255,.45);
}
.wc-btn-secondary {
  background: #2a2b3d;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 4px 0 #16172a;
}
.wc-btn-big { font-size: 1.3rem; padding: 12px 56px; min-height: 56px; letter-spacing: .02em; }
@media (hover: hover) {
  .wc-btn:hover, .wc-seg:hover, .wc-ans:not(:disabled):hover { filter: brightness(1.1); }
}

/* Mastery bars */
.wc-mastery { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 8px; }
.wc-m {
  padding: 8px 10px; border-radius: 14px; background: rgba(255,255,255,.05);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}
.wc-m-top { display: flex; justify-content: space-between; font-size: .78rem; font-weight: 800; color: var(--muted); gap: 6px; }
.wc-m-top b { color: #fff; }
.wc-m-bar { height: 8px; margin-top: 5px; border-radius: 99px; background: rgba(0,0,0,.35); overflow: hidden; }
.wc-m-bar i {
  display: block; height: 100%; width: 0; border-radius: inherit;
  background: linear-gradient(90deg, var(--c2), var(--c1));
  transition: width .6s cubic-bezier(.2,.8,.2,1);
}
.wc-mastery-list { grid-template-columns: 1fr 1fr; }

/* Play */
.wc-play { display: flex; flex-direction: column; gap: 14px; }
.wc-card {
  --c1: var(--c-europe); --c2: var(--c-europe-2);
  position: relative;
  border-radius: 22px;
  padding: 14px 18px 16px;
  text-align: center;
  background:
    radial-gradient(90% 120% at 20% 0%, rgba(255,255,255,.35), transparent 55%),
    linear-gradient(160deg, var(--c1), var(--c2));
  box-shadow: inset 0 2px 0 rgba(255,255,255,.35), inset 0 -4px 0 rgba(0,0,0,.18), 0 10px 24px rgba(0,0,0,.35);
  overflow: hidden;
}
.wc-card::after {
  content: ""; position: absolute; right: -40px; bottom: -60px; width: 180px; height: 180px;
  border-radius: 50%; border: 14px solid rgba(255,255,255,.12);
  box-shadow: 0 0 0 26px rgba(255,255,255,.05);
  pointer-events: none;
}
.wc-card.enter { animation: wc-pop .35s cubic-bezier(.2,1.4,.4,1); }
.wc-card.shake { animation: wc-shake .42s ease; }
.wc-card-top { display: flex; justify-content: space-between; align-items: center; min-height: 28px; }
.wc-cont-tag {
  padding: 3px 12px; border-radius: 999px; font-weight: 900; font-size: .78rem;
  text-transform: uppercase; letter-spacing: .08em;
  background: rgba(0,0,0,.22); box-shadow: inset 0 1px 0 rgba(255,255,255,.2);
}
.wc-lives { display: flex; gap: 4px; }
.wc-lives svg { width: 24px; height: 22px; filter: drop-shadow(0 2px 0 rgba(0,0,0,.25)); }
.wc-lives .lost { opacity: .3; filter: grayscale(1); }
.wc-ask { margin: 6px 0 0; font-weight: 800; opacity: .92; text-shadow: 0 1px 2px rgba(0,0,0,.25); }
.wc-prompt {
  margin: 2px 0 12px; font-weight: 900; line-height: 1.05;
  font-size: clamp(1.7rem, 5.6vw, 2.9rem);
  text-shadow: 0 3px 0 rgba(0,0,0,.22);
  overflow-wrap: anywhere;
}
.wc-timer { height: 12px; border-radius: 99px; background: rgba(0,0,0,.3); overflow: hidden; box-shadow: inset 0 2px 3px rgba(0,0,0,.3); }
.wc-timer-fill {
  height: 100%; width: 100%; border-radius: inherit;
  background: linear-gradient(180deg, #fff, #e8e8ff);
  box-shadow: 0 0 10px rgba(255,255,255,.6);
  transform-origin: left center;
}
.wc-timer-fill.low { background: linear-gradient(180deg, #ffd0d8, #ff4d6d); }

.wc-answers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.wc-ans {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  min-height: 64px;
  padding: 10px 16px 12px 12px;
  border: 0; border-radius: 20px;
  text-align: left; font-weight: 900; font-size: clamp(1rem, 2.4vw, 1.2rem); line-height: 1.15;
  cursor: pointer;
  background:
    linear-gradient(180deg, rgba(255,255,255,.16), rgba(255,255,255,0) 50%),
    linear-gradient(180deg, #34365a, #282a45);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.18), 0 5px 0 #15162a, 0 10px 18px rgba(0,0,0,.3);
  transition: transform .1s ease, box-shadow .1s ease, background .2s ease;
  overflow: hidden;
}
.wc-ans span { overflow-wrap: anywhere; }
.wc-ans kbd {
  flex: none; width: 32px; height: 32px; display: grid; place-items: center; padding: 0;
  border-radius: 10px; font-size: .95rem;
  background: linear-gradient(180deg, var(--c1, #8a6bff), var(--c2, #5130e6));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 2px 0 rgba(0,0,0,.3);
}
.wc-ans:active:not(:disabled) { transform: translateY(4px); box-shadow: inset 0 2px 0 rgba(255,255,255,.18), 0 1px 0 #15162a; }
.wc-ans:disabled { cursor: default; }
.wc-ans.dim { opacity: .45; }
.wc-ans.right {
  background: linear-gradient(180deg, rgba(255,255,255,.3), rgba(255,255,255,0) 55%), linear-gradient(180deg, #3ee07f, #14a452);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.35), 0 5px 0 #0b6b35, 0 0 24px rgba(46,208,127,.55);
  opacity: 1;
}
.wc-ans.right.picked { animation: wc-pop .35s cubic-bezier(.2,1.4,.4,1); }
.wc-ans.wrong {
  background: linear-gradient(180deg, rgba(255,255,255,.25), rgba(255,255,255,0) 55%), linear-gradient(180deg, #ff6b86, #d61f48);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.3), 0 5px 0 #8a0f2c;
  animation: wc-shake .4s ease;
  opacity: 1;
}
.wc-ans.right kbd, .wc-ans.wrong kbd { background: rgba(0,0,0,.2); }

.wc-feedback { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; }
.wc-feedback p { margin: 0; color: var(--muted); font-weight: 800; }
.wc-feedback p.good { color: #6ff0a6; }
.wc-feedback p.bad { color: #ff91a6; }
.wc-feedback p small { display: block; font-weight: 700; color: var(--muted); font-size: .82rem; margin-top: 2px; }

/* Summary */
.wc-summary { display: flex; flex-direction: column; gap: 12px; animation: wc-pop .4s cubic-bezier(.2,1.3,.4,1); }
.wc-sum-head { display: flex; align-items: center; gap: 14px; }
.wc-medal {
  flex: none; width: 64px; height: 64px; border-radius: 50%;
  display: grid; place-items: center; font-size: 2rem; font-weight: 900;
  background: radial-gradient(circle at 35% 30%, #fff6c2, #ffcc2e 45%, #e08a00);
  color: #8a4b00;
  box-shadow: inset 0 -4px 0 rgba(0,0,0,.18), 0 6px 18px rgba(255,190,40,.45);
  animation: wc-medal 1.2s ease-in-out infinite alternate;
}
.wc-medal.lost { background: radial-gradient(circle at 35% 30%, #fff, #b9bdd6 45%, #6c7090); color: #3b3e56; box-shadow: inset 0 -4px 0 rgba(0,0,0,.18); animation: none; }
.wc-sum-head h2 { margin: 0; font-size: clamp(1.3rem, 3.5vw, 1.8rem); font-weight: 900; }
.wc-sum-sub { margin: 2px 0 0; color: var(--muted); font-weight: 800; }
.wc-sum-score { margin-left: auto; text-align: right; display: flex; flex-direction: column; align-items: flex-end; }
.wc-sum-score span { font-size: .72rem; font-weight: 900; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.wc-sum-score strong { font-size: 2.2rem; font-weight: 900; line-height: 1; background: linear-gradient(180deg, #fff, #c9bcff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.wc-sum-score em { font-style: normal; font-weight: 900; font-size: .8rem; padding: 2px 10px; border-radius: 99px; background: linear-gradient(180deg, #ffd84a, #ff9f1c); color: #4a2300; margin-top: 4px; animation: wc-pop .5s .2s both; }
.wc-sum-body { display: grid; grid-template-columns: 1.2fr 1fr; gap: 12px; min-height: 0; }
.wc-sum-col { background: rgba(0,0,0,.18); border-radius: 18px; padding: 10px 12px; min-width: 0; }
.wc-sum-col h3 { margin: 0 0 8px; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 900; }
.wc-mistakes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 250px; overflow-y: auto; }
.wc-mistakes li {
  display: grid; grid-template-columns: 8px 1fr; gap: 8px; align-items: stretch;
  padding: 7px 10px 7px 7px; border-radius: 12px; background: rgba(255,255,255,.05);
  font-weight: 800; font-size: .92rem;
}
.wc-mistakes li i { border-radius: 99px; background: linear-gradient(180deg, var(--c1), var(--c2)); }
.wc-mistakes li b { color: #fff; }
.wc-mistakes .ans { color: #6ff0a6; }
.wc-mistakes .pick { color: #ff91a6; font-size: .8rem; display: block; }
.wc-mistakes .none { color: var(--muted); font-weight: 800; padding: 6px 2px; background: none; display: block; }
.wc-sum-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

@media (min-width: 641px) {
  .wc-play { gap: 18px; padding-top: 4px; }
  .wc-card { padding: 18px 22px 20px; }
  .wc-prompt { margin: 6px 0 18px; }
  .wc-ans { min-height: 88px; padding-left: 16px; }
  .wc-ans kbd { width: 38px; height: 38px; font-size: 1.05rem; }
  .wc-answers { gap: 14px; }
}

/* FX */
.wc-fx { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.wc-spark {
  position: absolute; width: 10px; height: 10px; border-radius: 3px;
  animation: wc-spark .75s cubic-bezier(.2,.7,.3,1) forwards;
}
.wc-float {
  position: absolute; font-weight: 900; font-size: 1.4rem; color: #fff;
  text-shadow: 0 2px 0 rgba(0,0,0,.35), 0 0 12px rgba(111,240,166,.8);
  animation: wc-float .9s ease-out forwards; white-space: nowrap;
}

@keyframes wc-spin { from { transform: translateX(0); } to { transform: translateX(-200px); } }
@keyframes wc-pin { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes wc-pop { 0% { transform: scale(.9); } 60% { transform: scale(1.04); } 100% { transform: scale(1); } }
@keyframes wc-bump { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
@keyframes wc-shake {
  0%, 100% { transform: translateX(0); } 20% { transform: translateX(-8px); }
  40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); }
}
@keyframes wc-spark {
  from { transform: translate(0, 0) rotate(0) scale(1); opacity: 1; }
  to { transform: translate(var(--dx), var(--dy)) rotate(260deg) scale(.4); opacity: 0; }
}
@keyframes wc-float { from { transform: translate(-50%, 0); opacity: 1; } to { transform: translate(-50%, -50px); opacity: 0; } }
@keyframes wc-medal { from { transform: rotate(-6deg) scale(1); } to { transform: rotate(6deg) scale(1.06); } }

@media (max-width: 640px) {
  .wc-app { padding: 8px 10px 12px; }
  .wc-brand h1 { font-size: 1.1rem; }
  .wc-chip { padding: 5px 9px; gap: 4px; }
  .wc-chip span { font-size: .6rem; }
  .wc-stage { padding: 12px; border-radius: 20px; min-height: 0; }
  .wc-menu-hero { gap: 12px; }
  .wc-globe { width: 96px; height: 96px; }
  .wc-sub { font-size: .9rem; }
  .wc-seg { white-space: normal; font-size: .9rem; padding: 8px 10px; }
  .wc-regions .wc-seg { font-size: .85rem; flex: 1 1 40%; }
  .wc-btn-big { width: 100%; }
  .wc-answers { grid-template-columns: 1fr; gap: 10px; }
  .wc-ans { min-height: 56px; }
  .wc-sum-body { grid-template-columns: 1fr; }
  .wc-sum-head { flex-wrap: wrap; row-gap: 8px; }
  .wc-sum-titles { order: 3; flex-basis: 100%; }
  .wc-medal { width: 54px; height: 54px; font-size: 1.6rem; }
  .wc-mistakes { max-height: 200px; }
}
@media (max-width: 360px) {
  .wc-chip span { display: none; }
  .wc-mastery-list { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .wc-globe-land, .wc-pin, .wc-medal, .wc-card.enter, .wc-card.shake, .wc-ans.wrong,
  .wc-ans.right.picked, .wc-summary, .wc-chip.bump strong, .wc-sum-score em { animation: none !important; }
  .wc-m-bar i { transition: none; }
  .wc-fx { display: none; }
}
