:root {
  color-scheme: dark;
  --ink: #f5f8ff;
  --muted: #9bacbf;
  --deep: #0a2340;
  --navy: #10385e;
  --panel: #154568;
  --panel-2: #1b527a;
  --line: rgba(198, 225, 247, 0.22);
  --teal: #2dd4bf;
  --teal-soft: rgba(45, 212, 191, 0.15);
  --gold: #f8c85a;
  --green: #42d392;
  --red: #fb7185;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--deep); }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 12% 14%, rgba(45, 212, 191, 0.20), transparent 27%),
    radial-gradient(circle at 88% 10%, rgba(93, 167, 224, 0.35), transparent 32%),
    radial-gradient(circle at 52% 92%, rgba(100, 72, 170, 0.20), transparent 30%),
    linear-gradient(145deg, #123b60 0%, var(--deep) 52%, #0d3153 100%);
  background-attachment: fixed;
}

button { font: inherit; }
button:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

.app-shell {
  width: min(1160px, 100%);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 28px max(18px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

.topbar {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  border: 0;
  background: transparent;
  color: inherit;
  display: inline-flex;
  align-items: center;
  gap: 13px;
  padding: 0;
  cursor: pointer;
}

.brand-logo { width: 66px; height: 66px; display: block; flex: 0 0 auto; border-radius: 16px; box-shadow: 0 10px 28px rgba(0,0,0,.4); }

.brand-name { font-weight: 750; letter-spacing: -0.02em; }

.topbar-actions { display: flex; align-items: center; gap: 10px; }

.score-button,
.install-button,
.reset-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(12, 32, 57, 0.72);
  padding: 11px 17px;
  display: inline-flex;
  gap: 9px;
  align-items: center;
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease;
}
.install-button { color: var(--teal); }
.install-button span:first-child { font-size: 1.12rem; font-weight: 900; }
.score-button span:first-child { color: var(--gold); }
.reset-button span:first-child { color: var(--red); font-size: 1.08rem; font-weight: 900; }
.score-button:hover,
.install-button:hover,
.reset-button:hover { border-color: var(--teal); transform: translateY(-2px); }
.install-button.installed { display: none; }

.wqc-balance {
  min-height: 43px;
  border: 1px solid rgba(248, 200, 90, .36);
  border-radius: 999px;
  background: rgba(248, 200, 90, .08);
  padding: 8px 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--gold);
}
.wqc-balance strong { font-size: 1.05rem; }
.wqc-balance small { color: var(--muted); font-size: .7rem; font-weight: 850; letter-spacing: .06em; }

main { flex: 1; display: flex; }
.screen { width: 100%; flex: 1; }
.hidden { display: none !important; }

.home-screen {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(520px, 1.14fr);
  grid-template-rows: 1fr auto;
  gap: 48px 64px;
  align-items: center;
  padding: 5vh 0 18px;
  position: relative;
}

.continent-progress-heading h1,
.section-heading h2,
.result-card h2,
.dialog-head h2 {
  margin: 0;
  font-size: clamp(2.2rem, 6vw, 5rem);
  letter-spacing: -0.065em;
  line-height: 0.98;
}

.continent-progress-card { align-self: stretch; display: grid; align-content: center; padding: clamp(24px, 4vw, 42px); border: 1px solid var(--line); border-radius: 4px 32px 4px 32px; background: linear-gradient(150deg, rgba(21,69,104,.94), rgba(7,25,45,.96)); box-shadow: var(--shadow); }
.home-intro { margin: 0 0 30px; color: var(--ink); font-size: clamp(1.02rem, 2vw, 1.25rem); line-height: 1.55; }
.continent-progress-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.continent-progress-heading h1 { font-size: clamp(2rem, 4vw, 3.4rem); }
.continent-progress-heading .eyebrow { margin-bottom: 8px; }
.continent-progress-heading > strong { color: var(--gold); font-size: clamp(2.2rem, 5vw, 3.8rem); line-height: 1; letter-spacing: -.06em; }
.continent-progress-chart { display: grid; gap: 16px; }
.continent-progress-row { display: grid; grid-template-columns: minmax(82px, 110px) 1fr 45px; align-items: center; gap: 12px; }
.continent-progress-label { display: grid; gap: 2px; }
.continent-progress-label strong { font-size: .92rem; }
.continent-progress-label span { color: var(--muted); font-size: .72rem; }
.continent-progress-track { height: 13px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.09); box-shadow: inset 0 0 0 1px rgba(255,255,255,.05); }
.continent-progress-track span { display: block; height: 100%; min-width: 0; border-radius: inherit; background: var(--continent-color); box-shadow: 0 0 18px color-mix(in srgb, var(--continent-color) 45%, transparent); transition: width 420ms ease; }
.continent-progress-percent { color: var(--continent-color); text-align: right; font-size: .9rem; }

.eyebrow {
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  display: inline-block;
  margin-bottom: 14px;
}

.mode-grid { display: grid; gap: 16px; }

.mode-card {
  width: 100%;
  min-height: 152px;
  padding: 25px;
  border: 1px solid var(--line);
  border-radius: 4px 28px 4px 28px;
  color: var(--ink);
  background: linear-gradient(135deg, rgba(16, 42, 72, 0.96), rgba(9, 27, 50, 0.96));
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 22px;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  position: relative;
  transition: transform 180ms ease, border-color 180ms ease;
}
.mode-card::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  right: -96px;
  top: -90px;
  border: 28px solid rgba(45, 212, 191, 0.07);
  border-radius: 50%;
}
.mode-card:hover { transform: translateY(-4px); border-color: rgba(45, 212, 191, 0.58); }
.mode-number { color: var(--teal); font-size: 0.8rem; font-weight: 900; letter-spacing: 0.14em; align-self: start; }
.mode-content { display: grid; gap: 10px; }
.mode-content strong { font-size: clamp(1.6rem, 3vw, 2.25rem); letter-spacing: -0.04em; }
.mode-content small { color: var(--muted); font-size: 0.92rem; line-height: 1.4; }
.mode-arrow { font-size: 2rem; color: var(--teal); z-index: 1; }

.training-card { background: linear-gradient(135deg, rgba(20, 64, 78, 0.96), rgba(9, 31, 48, 0.96)); }
.challenge-card { background: linear-gradient(135deg, rgba(73, 48, 100, .96), rgba(18, 27, 54, .96)); }
.duel-card { background: linear-gradient(135deg, rgba(20, 94, 91, .94), rgba(8, 36, 62, .96)); }

.home-stats {
  grid-column: 1 / -1;
  display: flex;
  gap: 42px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.home-stats div { display: flex; align-items: baseline; gap: 8px; }
.home-stats strong { font-size: 1.25rem; color: var(--gold); }
.home-stats span { color: var(--muted); font-size: 0.86rem; }
.signature {
  grid-column: 1 / -1;
  justify-self: end;
  position: static;
  margin-top: -28px;
  padding: 12px 4px 2px;
  color: rgba(255,255,255,.62);
  font-family: Georgia, serif;
  font-style: italic;
  font-weight: 700;
  z-index: 2;
}

.section-heading {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 22px;
  align-items: center;
  margin: 46px 0 38px;
}
.section-heading h2 { font-size: clamp(2rem, 4.5vw, 3.8rem); }
.section-heading .eyebrow { margin-bottom: 8px; }

.back-button,
.quit-button,
.dialog-head button {
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  color: var(--ink);
  font-size: 1.6rem;
  cursor: pointer;
}
.back-button:hover, .quit-button:hover, .dialog-head button:hover { border-color: var(--teal); }

.choice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding-bottom: 35px; }
.choice-card {
  min-height: 146px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
  background: rgba(12, 32, 57, 0.78);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  text-align: left;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}
.choice-card:hover { transform: translateY(-3px); background: var(--panel-2); border-color: var(--teal); }
.choice-card strong { font-size: 1.22rem; }
.choice-card small { color: var(--muted); line-height: 1.4; }
.choice-code { color: var(--teal); font-weight: 900; letter-spacing: .12em; font-size: .76rem; }
.challenge-intro { margin: -16px 0 28px 70px; color: var(--muted); line-height: 1.55; }
.challenge-grid .challenge-choice { min-height: 190px; position: relative; }
.challenge-status {
  position: absolute;
  top: 18px;
  right: 18px;
  border: 1px solid rgba(248, 200, 90, .34);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--gold);
  background: rgba(248, 200, 90, .08);
  font-size: .76rem;
  font-weight: 850;
}
.challenge-status.joined { color: var(--teal); border-color: rgba(45, 212, 191, .35); background: var(--teal-soft); }

.levels-heading { grid-template-columns: auto 1fr auto; }
.progress-summary { text-align: right; color: var(--muted); }
.progress-summary strong { display: block; color: var(--gold); font-size: 1.6rem; }
.difficulty-legend {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  padding: 14px 0 20px;
  border-top: 1px solid var(--line);
}
.legend-stars { color: var(--gold); white-space: nowrap; }
.levels-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 9px; padding-bottom: 35px; }
.level-button {
  aspect-ratio: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel);
  color: var(--ink);
  display: grid;
  place-items: center;
  gap: 1px;
  cursor: pointer;
  position: relative;
}
.level-button:hover:not(:disabled) { border-color: var(--teal); background: var(--panel-2); }
.level-button:disabled { opacity: .34; cursor: not-allowed; }
.level-button.current { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.level-button.completed { background: var(--teal-soft); }
.level-button strong { font-size: 1.08rem; }
.level-button small { color: var(--gold); font-size: .62rem; letter-spacing: -1px; }
.level-lock { font-size: .8rem; color: var(--muted); }
.challenge-levels-grid { grid-template-columns: repeat(5, 1fr); }
.challenge-levels-grid .level-button { aspect-ratio: 1.7; }
.challenge-levels-grid .level-button small { letter-spacing: 0; }

.quiz-screen { padding: 35px 0 24px; max-width: 880px; margin: 0 auto; }
.quiz-header { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; }
.quiz-context { display: grid; gap: 3px; }
.quiz-context span, .live-score span { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .11em; }
.quiz-context strong { font-size: 1.05rem; }
.live-score { text-align: right; display: grid; }
.live-score strong { color: var(--gold); font-size: 1.65rem; line-height: 1; }
.progress-track { height: 5px; background: rgba(255,255,255,.08); margin: 24px 0 0; overflow: hidden; border-radius: 5px; }
.progress-track div { height: 100%; width: 10%; background: var(--teal); transition: width 260ms ease; }

.question-panel { padding: clamp(42px, 8vh, 82px) 0 30px; text-align: center; }
.question-kicker { color: var(--teal); font-weight: 800; text-transform: uppercase; letter-spacing: .16em; font-size: .78rem; }
.question-panel h2 { margin: 18px auto 38px; max-width: 760px; font-size: clamp(1.75rem, 4.5vw, 3.15rem); line-height: 1.12; letter-spacing: -.045em; }
.answers-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.answer-button {
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(12, 32, 57, .88);
  color: var(--ink);
  padding: 17px 20px;
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: center;
  gap: 14px;
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease, transform 150ms ease, background 150ms ease;
}
.answer-button:hover:not(:disabled) { border-color: var(--teal); transform: translateY(-2px); }
.answer-index { color: var(--muted); font-weight: 850; }
.answer-text { font-size: 1rem; font-weight: 650; }
.answer-button.correct { border-color: var(--green); background: rgba(66, 211, 146, .18); }
.answer-button.wrong { border-color: var(--red); background: rgba(251, 113, 133, .17); }
.answer-button.erased { opacity: .17; pointer-events: none; }
.feedback { min-height: 25px; margin: 18px 0 0; font-weight: 750; }
.feedback.good { color: var(--green); }
.feedback.bad { color: var(--red); }

.answer-fact-toast {
  position: fixed;
  z-index: 90;
  left: 50%;
  bottom: max(24px, calc(env(safe-area-inset-bottom) + 16px));
  width: min(520px, calc(100% - 28px));
  transform: translateX(-50%);
  display: grid;
  gap: 5px;
  padding: 17px 20px;
  border: 1px solid rgba(45, 212, 191, .48);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(11, 42, 65, .98), rgba(4, 18, 34, .98));
  box-shadow: 0 20px 70px rgba(0, 0, 0, .55), 0 0 28px rgba(45, 212, 191, .12);
  pointer-events: none;
  animation: answer-fact-in 180ms ease-out;
}
.answer-fact-toast small { color: var(--teal); font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.answer-fact-toast strong { color: var(--ink); font-size: 1.2rem; }
.answer-fact-toast span { color: var(--muted); line-height: 1.35; }
@keyframes answer-fact-in {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.joker-dock { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.joker-dock button {
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  background: rgba(8, 25, 45, .9);
  padding: 12px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0 10px;
  align-items: center;
  text-align: left;
  cursor: pointer;
}
.joker-dock button:hover:not(:disabled) { border-color: var(--gold); }
.joker-dock button:disabled { opacity: .3; cursor: not-allowed; }
.joker-icon { grid-row: 1 / 3; width: 36px; height: 36px; border-radius: 50%; background: rgba(248,200,90,.13); color: var(--gold); display: grid; place-items: center; font-weight: 900; }
.joker-dock small { color: var(--muted); }

.result-screen { display: grid; place-items: center; padding: 30px 0; }
.result-card { width: min(620px, 100%); text-align: center; background: linear-gradient(150deg, var(--panel-2), var(--navy)); border: 1px solid var(--line); border-radius: 4px 38px 4px 38px; padding: clamp(30px, 7vw, 60px); box-shadow: var(--shadow); }
.result-ring { width: 126px; height: 126px; border: 8px solid var(--teal); border-radius: 50%; margin: 0 auto 30px; display: flex; align-items: baseline; justify-content: center; padding-top: 35px; box-shadow: 0 0 40px rgba(45,212,191,.15); }
.result-ring strong { font-size: 2.7rem; line-height: 1; }
.result-ring span { color: var(--muted); }
.result-card h2 { font-size: clamp(2rem, 5vw, 3.2rem); }
.result-card p { color: var(--muted); line-height: 1.55; margin: 18px auto 30px; max-width: 460px; }
.result-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.primary-button, .secondary-button, .danger-button { border-radius: 999px; padding: 13px 21px; cursor: pointer; font-weight: 800; }
.primary-button { background: var(--teal); color: #04201d; border: 1px solid var(--teal); }
.secondary-button { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.danger-button { background: var(--red); color: #2a0710; border: 1px solid var(--red); }
.danger-outline { color: #ffd3da; border-color: rgba(251,113,133,.55); }
.primary-button:disabled { opacity: .38; cursor: not-allowed; }

dialog {
  color: var(--ink);
  background: linear-gradient(145deg, #1b527a, #0c2d4d);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(1, 6, 14, .78); backdrop-filter: blur(6px); }
.scores-dialog { width: min(650px, calc(100% - 28px)); max-height: min(740px, calc(100dvh - 30px)); border-radius: 24px; padding: 0; overflow: hidden; }
.dialog-head { padding: 27px; display: flex; align-items: flex-start; justify-content: space-between; border-bottom: 1px solid var(--line); }
.dialog-head h2 { font-size: 2.1rem; }
.dialog-head .eyebrow { margin-bottom: 6px; }
.score-tabs { display: grid; grid-template-columns: repeat(4, 1fr); padding: 13px 27px 0; gap: 7px; }
.score-tabs button { border: 0; border-bottom: 2px solid transparent; color: var(--muted); background: transparent; padding: 12px; cursor: pointer; }
.score-tabs button.active { color: var(--ink); border-color: var(--teal); }
#scores-content { padding: 22px 27px 30px; overflow-y: auto; max-height: 520px; }
.score-overview { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.score-stat { background: rgba(255,255,255,.045); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.score-stat span { color: var(--muted); display: block; font-size: .8rem; margin-bottom: 5px; }
.score-stat strong { font-size: 1.45rem; color: var(--gold); }
.score-list { display: grid; gap: 8px; }
.score-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.score-row span { color: var(--muted); }
.score-empty { color: var(--muted); padding: 35px 0; text-align: center; }

.confirm-dialog { width: min(430px, calc(100% - 28px)); border-radius: 22px; padding: 28px; }
.confirm-dialog h2 { margin-top: 0; }
.confirm-dialog p { color: var(--muted); line-height: 1.5; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.install-dialog { width: min(540px, calc(100% - 28px)); border-radius: 24px; padding: 0; }
.install-copy { padding: 24px 28px 30px; color: var(--muted); line-height: 1.6; }
.install-copy p { margin-top: 0; }
.install-copy ol { margin: 18px 0 0; padding-left: 22px; }
.install-copy strong { color: var(--ink); }
.data-error { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); padding: 14px 18px; border-radius: 12px; background: var(--red); color: #28070e; font-weight: 800; }

.profile-button {
  border: 1px solid rgba(45,212,191,.35); border-radius: 999px; color: var(--ink); background: rgba(45,212,191,.08);
  padding: 10px 14px; display: inline-flex; gap: 8px; align-items: center; cursor: pointer; font-weight: 750;
}
.profile-icon { display: block; width: 22px; height: 22px; flex: 0 0 22px; color: #fff; }
.duel-heading { grid-template-columns: auto 1fr auto; }
.notify-button { white-space: nowrap; }
.duel-layout { display: grid; grid-template-columns: minmax(280px, .72fr) minmax(360px, 1.28fr); gap: 24px; padding-bottom: 35px; }
.duel-tools { display: grid; gap: 16px; align-content: start; }
.duel-create-card, .duel-list-section, .loading-card {
  background: rgba(12,32,57,.8); border: 1px solid var(--line); border-radius: 20px; padding: 24px;
}
.duel-create-card { align-self: start; display: grid; gap: 14px; }
.duel-create-card h3, .duel-list-section h3 { margin: 0; font-size: 1.35rem; }
.duel-card-copy { margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.5; }
.duel-create-card label, .profile-dialog label { color: var(--muted); font-size: .84rem; font-weight: 750; }
.duel-create-card > input, .friend-add-form input, .profile-dialog input {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; background: rgba(4,13,27,.72); color: var(--ink); padding: 13px 14px; font: inherit;
}
.duel-create-card fieldset { margin: 2px 0; padding: 0; border: 0; }
.duel-create-card legend { color: var(--muted); font-size: .84rem; font-weight: 750; margin-bottom: 9px; }
.duel-difficulties { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.duel-difficulties label { position: relative; cursor: pointer; }
.duel-difficulties input { position: absolute; opacity: 0; }
.duel-difficulties span { display: grid; gap: 3px; border: 1px solid var(--line); border-radius: 12px; padding: 11px; color: var(--ink); }
.duel-difficulties small { color: var(--muted); font-weight: 500; }
.duel-difficulties input:checked + span { border-color: var(--teal); background: var(--teal-soft); }
.form-message { min-height: 1.3em; margin: 0; color: var(--gold); font-size: .88rem; }
.request-expiry { color: var(--muted); line-height: 1.45; }
.friend-add-form { display: grid; gap: 10px; }
.friend-add-form > div { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.friends-card { gap: 12px; }
.friend-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line); }
.friend-row > div { display: flex; align-items: center; gap: 7px; }
.friend-row button { padding: 8px 11px; }
.friend-remove { width: 34px; height: 34px; border: 1px solid rgba(251,113,133,.25); border-radius: 9px; color: var(--red); background: transparent; cursor: pointer; font-size: 1.2rem; }
.friend-remove:hover { background: rgba(251,113,133,.1); }
.duel-lists { display: grid; gap: 14px; align-content: start; }
.duel-list-section { padding: 18px; }
.duel-list-section h3 { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.duel-list-section h3 span { min-width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--teal-soft); color: var(--teal); font-size: .82rem; }
.duel-list-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0; border-top: 1px solid var(--line); }
.duel-list-card > div:first-child { display: grid; gap: 3px; }
.duel-list-card span, .duel-empty { color: var(--muted); font-size: .82rem; }
.duel-empty { margin: 0; padding: 7px 0; }
.duel-card-actions { display: flex; gap: 7px; }
.duel-card-actions button { padding: 9px 13px; }
.duel-card-safety { border: 0; background: transparent; color: var(--muted); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.duel-card-safety:hover { color: #ffd3da; }
.error-card { color: var(--red); }
.duel-score { display: flex; gap: 9px; align-items: baseline; font-size: 1.35rem; font-weight: 900; color: var(--gold); }
.duel-score small { color: var(--muted); }
.duel-reveal { margin: 18px auto 0; max-width: 570px; padding: 15px 18px; border: 1px solid rgba(248,200,90,.35); border-radius: 13px; background: rgba(248,200,90,.08); display: grid; gap: 5px; }
.duel-reveal span { color: var(--muted); font-size: .82rem; }
#duel-next { display: block; margin: 20px auto 0; }
.duel-joker-dock { grid-template-columns: minmax(190px, 290px); justify-content: center; }
.duel-result-screen { display: grid; place-items: center; padding: 36px 0; }
.duel-result-card { position: relative; overflow: hidden; }
.duel-result-card::before { content: ""; position: absolute; width: 210px; height: 210px; border-radius: 50%; top: -130px; right: -80px; background: rgba(45,212,191,.13); }
.duel-result-state { display: grid; place-items: center; width: 112px; min-height: 112px; margin: 0 auto 28px; padding: 12px; border: 7px solid var(--gold); border-radius: 50%; color: var(--gold); font-weight: 950; font-size: 1.08rem; text-transform: uppercase; letter-spacing: .05em; }
.duel-result-card.won .duel-result-state { color: var(--green); border-color: var(--green); box-shadow: 0 0 38px rgba(66,211,146,.2); }
.duel-result-card.lost .duel-result-state { color: var(--red); border-color: var(--red); box-shadow: 0 0 38px rgba(251,113,133,.17); }
.duel-result-card.draw .duel-result-state { color: var(--gold); border-color: var(--gold); box-shadow: 0 0 38px rgba(248,200,90,.17); }
.duel-safety-action { margin-top: 20px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: .8rem; text-decoration: underline; text-underline-offset: 3px; }
.duel-safety-action:hover { color: #ffd3da; }
.duel-final-score { margin: 24px auto 2px; color: var(--gold); font-size: clamp(2.2rem, 7vw, 4.2rem); font-weight: 950; letter-spacing: -.06em; }
.review-answers-grid .answer-button { cursor: default; grid-template-columns: 30px 1fr auto; }
.review-answers-grid .answer-button:hover { transform: none; }
.review-answers-grid .opponent-choice { box-shadow: inset 0 0 0 2px rgba(248,200,90,.58); }
.answer-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.answer-badge { padding: 4px 7px; border-radius: 999px; font-size: .67rem; font-weight: 900; white-space: nowrap; }
.answer-badge.mine { color: #04201d; background: var(--teal); }
.answer-badge.opponent { color: #332400; background: var(--gold); }
.duel-review-legend { margin: 18px auto 0; max-width: 740px; display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; }
.duel-review-legend > span { padding: 9px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .8rem; background: rgba(255,255,255,.045); }
.duel-review-legend strong { color: var(--ink); }
.legend-dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; }
.correct-dot { background: var(--green); }
.review-navigation { display: flex; justify-content: center; gap: 10px; margin-top: 25px; }
.review-navigation button:disabled { opacity: .35; cursor: not-allowed; }
.profile-dialog { width: min(480px, calc(100% - 28px)); border-radius: 24px; padding: 28px; }
#profile-setup-dialog[open] { width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: max(24px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom)); border: 0; border-radius: 0; display: grid; place-items: center; overflow-y: auto; background: radial-gradient(circle at 50% 18%, rgba(45,107,145,.42), transparent 30%), radial-gradient(circle at 18% 88%, rgba(255,51,71,.13), transparent 27%), linear-gradient(155deg, #07182a, #010205 62%); }
#profile-setup-dialog::backdrop { background: #010205; }
.profile-launch-card { position: relative; width: min(540px, 100%); padding: clamp(28px, 6vw, 48px); text-align: center; border: 1px solid rgba(255,255,255,.17); border-radius: 8px 38px 8px 38px; background: linear-gradient(150deg, rgba(21,69,104,.78), rgba(1,2,5,.94)); box-shadow: 0 32px 100px rgba(0,0,0,.55); overflow: hidden; }
.profile-launch-card::before { content: ""; position: absolute; width: 210px; height: 210px; top: -145px; right: -95px; border: 24px solid rgba(255,214,92,.08); border-radius: 50%; }
.profile-launch-card .profile-logo { width: 140px; height: 140px; margin: 0 auto 18px; border-radius: 31px; box-shadow: 0 22px 58px rgba(0,0,0,.55); }
.profile-launch-name { display: block; margin-bottom: 30px; color: var(--ink); font-size: 1.05rem; letter-spacing: .08em; text-transform: uppercase; }
.profile-launch-card > .eyebrow { display: block; margin: 0 0 8px; }
.profile-launch-card h2 { font-size: clamp(2rem, 7vw, 3rem); }
.profile-launch-card > p { max-width: 440px; margin: 18px auto 0; }
.profile-launch-card form { text-align: left; }
.profile-launch-card form .primary-button { width: 100%; margin-top: 4px; }
.profile-launch-card .terms-check { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 9px; font-weight: 500; line-height: 1.45; }
.profile-launch-card .terms-check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--teal); }
.profile-launch-card .terms-check a { color: var(--teal); text-underline-offset: 3px; }
.profile-dialog > .eyebrow { display: block; margin: 18px 0 6px; }
.profile-dialog h2 { margin: 0; font-size: 2rem; }
.profile-dialog p, .privacy-note { color: var(--muted); line-height: 1.5; }
.profile-dialog form { display: grid; gap: 12px; margin: 22px 0; }
.profile-dialog .dialog-head { padding: 0 0 20px; margin-bottom: 20px; }
.profile-status { display: flex; justify-content: space-between; gap: 15px; border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin: 18px 0; }
.profile-status span { color: var(--muted); }
.profile-data-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 20px; }
.profile-data-actions a { color: var(--teal); font-size: .86rem; text-underline-offset: 3px; }
.profile-delete-button { width: 100%; margin-top: 20px; }
#profile-delete-dialog form { display: grid; gap: 12px; margin-top: 20px; }
#profile-delete-dialog label { color: var(--muted); line-height: 1.5; }
#profile-delete-dialog label strong { color: var(--ink); }
#profile-delete-dialog input { width: 100%; border: 1px solid var(--line); border-radius: 12px; background: rgba(4,13,27,.72); color: var(--ink); padding: 13px 14px; font: inherit; }
#report-block-dialog form { display: grid; gap: 12px; margin-top: 20px; }
#report-block-dialog label { color: var(--muted); }
#report-block-dialog select { width: 100%; border: 1px solid var(--line); border-radius: 12px; background: #07182a; color: var(--ink); padding: 13px 14px; font: inherit; }
.duel-score-overview { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 900px) {
  .home-screen { grid-template-columns: 1fr; gap: 34px; padding-top: 35px; align-items: start; }
  .continent-progress-card { min-height: 430px; }
  .home-stats { grid-column: 1; }
  .choice-grid { grid-template-columns: 1fr 1fr; }
  .levels-grid { grid-template-columns: repeat(8, 1fr); }
  .duel-layout { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .app-shell { padding-left: 16px; padding-right: 16px; }
  .topbar { min-height: 72px; }
  .brand-name { display: none; }
  .brand-logo { width: 56px; height: 56px; border-radius: 14px; }
  .profile-launch-card { padding: 28px 20px; }
  .profile-launch-card .profile-logo { width: 116px; height: 116px; border-radius: 27px; }
  .profile-launch-name { margin-bottom: 24px; font-size: .88rem; }
  .score-button span:last-child,
  .install-button span:last-child,
  .reset-button span:last-child { display: none; }
  .profile-button span:last-child { display: none; }
  .score-button,
  .install-button,
  .reset-button { width: 42px; height: 42px; justify-content: center; padding: 0; }
  .profile-button { width: 42px; height: 42px; justify-content: center; padding: 0; }
  .topbar-actions { gap: 6px; }
  .wqc-balance { min-height: 42px; padding: 6px 9px; gap: 4px; }
  .wqc-balance small { display: none; }
  .home-screen { padding-top: 28px; gap: 28px; }
  .continent-progress-card { min-height: auto; padding: 22px 18px; }
  .home-intro { margin-bottom: 24px; }
  .continent-progress-heading { margin-bottom: 24px; }
  .continent-progress-row { grid-template-columns: 86px 1fr 40px; gap: 9px; }
  .mode-card { min-height: 130px; padding: 20px 17px; gap: 13px; }
  .home-stats { gap: 18px; justify-content: space-between; }
  .home-stats div { display: grid; gap: 1px; }
  .signature { margin-top: -12px; padding-bottom: 8px; }
  .section-heading { margin: 28px 0 27px; gap: 14px; }
  .choice-grid { grid-template-columns: 1fr; }
  .choice-card { min-height: 115px; }
  .challenge-intro { margin: -10px 0 22px; }
  .levels-heading { grid-template-columns: auto 1fr; }
  .progress-summary { grid-column: 2; text-align: left; display: flex; gap: 7px; align-items: baseline; }
  .progress-summary strong { font-size: 1.1rem; }
  .difficulty-legend { display: grid; font-size: .86rem; }
  .levels-grid { grid-template-columns: repeat(5, 1fr); gap: 7px; }
  .challenge-levels-grid { grid-template-columns: repeat(2, 1fr); }
  .challenge-levels-grid .level-button { aspect-ratio: 1.8; }
  .quiz-screen { padding-top: 22px; }
  .question-panel { padding-top: 45px; }
  .question-panel h2 { margin-bottom: 28px; }
  .answers-grid { grid-template-columns: 1fr; gap: 9px; }
  .answer-button { min-height: 64px; }
  .joker-dock button { grid-template-columns: 1fr; place-items: center; text-align: center; padding: 9px 4px; }
  .joker-icon { grid-row: auto; width: 33px; height: 33px; }
  .joker-dock small { display: none; }
  .result-actions { display: grid; }
  .score-overview { grid-template-columns: 1fr; }
  .score-tabs { grid-template-columns: repeat(2, 1fr); }
  .duel-heading { grid-template-columns: auto 1fr; }
  .notify-button { grid-column: 2; justify-self: start; }
  .duel-create-card, .duel-list-section { padding: 17px; }
  .duel-list-card { align-items: flex-start; flex-direction: column; }
  .duel-card-actions { flex-wrap: wrap; }
  .duel-difficulties { grid-template-columns: 1fr; }
  .friend-add-form > div { grid-template-columns: 1fr; }
  .duel-score-overview { grid-template-columns: repeat(3, 1fr); }
  .review-answers-grid .answer-button { grid-template-columns: 26px 1fr; }
  .answer-badges { grid-column: 2; justify-content: flex-start; }
  .review-navigation { display: grid; grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}


.startup-splash { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; background: #080807; }
.startup-splash img { display: block; width: min(100%, 800px); height: auto; max-height: 100dvh; object-fit: contain; }
.home-legal-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 22px; padding: 12px 16px 24px; }
.home-legal-links a { color: var(--muted); font-size: .875rem; text-decoration: underline; text-underline-offset: 3px; }
.home-legal-links a:hover { color: var(--ink); }

.home-footer { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; text-align: center; }
.home-footer .signature { margin: 0; padding: 0; }
.home-footer .home-legal-links { width: 100%; padding: 0 16px 12px; }

.home-footer .signature { text-align: center; }
.rights-reserved { display: inline; font-family: var(--font-body, sans-serif); font-size: .85rem; font-style: normal; font-weight: 400; }

/* IOPTA WQC HOME UI BEGIN 2026-10-21 */

/* L'arrière-plan clair s'applique seulement quand le menu d'accueil est visible. */
html:has(.wqc-reimagined:not(.hidden)) { background: #6ebbf7; }
body:has(.wqc-reimagined:not(.hidden)) {
  background:
    radial-gradient(circle at 12% 15%, rgba(179,232,255,.72), transparent 22%),
    radial-gradient(circle at 88% 12%, rgba(98,195,255,.42), transparent 26%),
    radial-gradient(circle at 18% 78%, rgba(115,225,208,.28), transparent 24%),
    radial-gradient(circle at 82% 88%, rgba(178,167,255,.25), transparent 24%),
    linear-gradient(145deg,#80cdfd 0%,#4ba4eb 34%,#2f79c9 62%,#4aa8e8 100%);
  background-attachment: fixed;
}

/* WQC — Nouvelle page d'accueil. Règles limitées à .wqc-reimagined. */
.wqc-reimagined {
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 26px;
  padding: 22px 0 18px;
  position: relative;
}
.wqc-reimagined > :not(.wqc-home-atmosphere) { position: relative; z-index: 1; }
.wqc-reimagined .wqc-home-atmosphere {
  position: absolute; top: -115px; bottom: -45px; left: calc((100% - 100vw) / 2); right: calc((100% - 100vw) / 2);
  z-index: -1; pointer-events: none; overflow: hidden;
  background:
    radial-gradient(ellipse 42% 30% at 84% 9%, rgba(255,255,255,.34), transparent 100%),
    radial-gradient(ellipse 42% 34% at 16% 18%, rgba(138, 227, 255, .42), transparent 100%),
    radial-gradient(ellipse 44% 34% at 8% 62%, rgba(89, 210, 188, .28), transparent 100%),
    radial-gradient(ellipse 38% 34% at 92% 74%, rgba(137, 178, 255, .34), transparent 100%),
    radial-gradient(ellipse 30% 24% at 52% 52%, rgba(224, 245, 255, .16), transparent 100%),
    linear-gradient(145deg, #b3e3ff 0%, #86cdfb 25%, #59adef 50%, #468fdc 75%, #72bdf3 100%);
}
.wqc-reimagined .wqc-home-atmosphere::before {
  content: ""; position: absolute; inset: 0; opacity: .26;
  background-image:
    radial-gradient(circle, rgba(255,255,255,.55) .9px, transparent 1.1px),
    linear-gradient(135deg, rgba(255,255,255,.10) 0, rgba(255,255,255,0) 38%);
  background-size: 24px 24px, 100% 100%;
  mask-image: linear-gradient(to bottom, transparent 2%, black 16%, black 82%, transparent 100%);
}
.wqc-reimagined .wqc-home-atmosphere::after {
  content: ""; position: absolute; inset: 0;
  background-image:
    url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20viewBox%3D%270%200%201600%201400%27%20preserveAspectRatio%3D%27none%27%3E%0A%3Cg%20fill%3D%27none%27%20stroke-linecap%3D%27round%27%3E%0A%20%20%3Cpath%20d%3D%27M-220%20244%20C%20120%20132%2C%20418%20174%2C%20724%20274%20S%201226%20452%2C%201610%20388%27%20stroke%3D%27%23ffffff%27%20stroke-width%3D%2714%27%20opacity%3D%27.10%27/%3E%0A%20%20%3Cpath%20d%3D%27M-240%20624%20C%2080%20512%2C%20400%20548%2C%20726%20668%20S%201268%20860%2C%201636%20786%27%20stroke%3D%27%23d7f6ff%27%20stroke-width%3D%2710%27%20opacity%3D%27.08%27/%3E%0A%20%20%3Cpath%20d%3D%27M-160%201038%20C%20170%20948%2C%20488%20986%2C%20792%201094%20S%201296%201246%2C%201610%201188%27%20stroke%3D%27%23ffffff%27%20stroke-width%3D%2712%27%20opacity%3D%27.08%27/%3E%0A%3C/g%3E%0A%3C/svg%3E"),
    url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20viewBox%3D%270%200%201600%201400%27%20preserveAspectRatio%3D%27none%27%3E%0A%3Cdefs%3E%0A%20%20%3ClinearGradient%20id%3D%27g1%27%20x1%3D%270%27%20y1%3D%270%27%20x2%3D%271%27%20y2%3D%271%27%3E%0A%20%20%20%20%3Cstop%20offset%3D%270%27%20stop-color%3D%27%232b6ab1%27/%3E%3Cstop%20offset%3D%271%27%20stop-color%3D%27%233b82d3%27/%3E%0A%20%20%3C/linearGradient%3E%0A%20%20%3ClinearGradient%20id%3D%27g2%27%20x1%3D%270%27%20y1%3D%270%27%20x2%3D%271%27%20y2%3D%270%27%3E%0A%20%20%20%20%3Cstop%20offset%3D%270%27%20stop-color%3D%27%232e5ea7%27/%3E%3Cstop%20offset%3D%271%27%20stop-color%3D%27%234f8fd9%27/%3E%0A%20%20%3C/linearGradient%3E%0A%3C/defs%3E%0A%3Cg%20fill%3D%27none%27%20stroke-linecap%3D%27round%27%3E%0A%20%20%3Cpath%20d%3D%27M-180%20165%20C%2080%2060%2C%20355%2068%2C%20626%20174%20S%201175%20378%2C%201535%20278%20S%201772%20197%2C%201830%20225%27%20stroke%3D%27url%28%23g1%29%27%20stroke-width%3D%2742%27%20opacity%3D%27.23%27/%3E%0A%20%20%3Cpath%20d%3D%27M-220%20318%20C%2088%20214%2C%20332%20240%2C%20620%20342%20S%201190%20548%2C%201530%20442%20S%201795%20352%2C%201860%20378%27%20stroke%3D%27url%28%23g2%29%27%20stroke-width%3D%2728%27%20opacity%3D%27.18%27/%3E%0A%20%20%3Cpath%20d%3D%27M-260%20515%20C%2052%20406%2C%20328%20430%2C%20648%20545%20S%201188%20744%2C%201525%20645%20S%201800%20565%2C%201868%20598%27%20stroke%3D%27url%28%23g1%29%27%20stroke-width%3D%2736%27%20opacity%3D%27.18%27/%3E%0A%20%20%3Cpath%20d%3D%27M-230%20745%20C%2035%20662%2C%20286%20675%2C%20560%20768%20S%201130%20984%2C%201490%20900%20S%201770%20824%2C%201840%20850%27%20stroke%3D%27url%28%23g2%29%27%20stroke-width%3D%2724%27%20opacity%3D%27.18%27/%3E%0A%20%20%3Cpath%20d%3D%27M-280%20975%20C%2065%20890%2C%20390%20930%2C%20700%201046%20S%201215%201228%2C%201524%201160%20S%201784%201102%2C%201865%201128%27%20stroke%3D%27url%28%23g1%29%27%20stroke-width%3D%2738%27%20opacity%3D%27.17%27/%3E%0A%20%20%3Cpath%20d%3D%27M-200%201178%20C%20110%201108%2C%20420%201138%2C%20760%201242%20S%201270%201390%2C%201600%201330%27%20stroke%3D%27url%28%23g2%29%27%20stroke-width%3D%2726%27%20opacity%3D%27.15%27/%3E%0A%3C/g%3E%0A%3C/svg%3E"),
    radial-gradient(ellipse 88% 62% at 12% 26%, rgba(59, 119, 186, .12) 0 56%, transparent 60%),
    radial-gradient(ellipse 92% 68% at 86% 78%, rgba(44, 96, 164, .12) 0 58%, transparent 62%);
  background-size: 100% 100%, 100% 100%, 100% 100%, 100% 100%;
  background-repeat: no-repeat;
  background-position: center;
  opacity: .96;
  mix-blend-mode: multiply;
  pointer-events: none;
}
.wqc-reimagined .wqc-hero {
  display: grid; grid-template-columns: 1fr 405px; align-items: center; gap: 4px;
  min-height: 298px; padding: 17px 29px 23px 33px;
  border: 1px solid rgba(255, 255, 255, .28); border-radius: 25px;
  background: linear-gradient(106deg, rgba(57, 125, 182, .88) 0%, rgba(56, 132, 195, .80) 42%, rgba(49, 110, 175, .62) 100%);
  box-shadow: 0 18px 44px rgba(12, 69, 128, .22), inset 0 1px 0 rgba(255, 255, 255, .16);
  overflow: hidden;
}
.wqc-reimagined .wqc-hero::before {
  content: ""; position: absolute; width: 340px; height: 340px; right: 18%; top: -175px;
  border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .26), transparent 66%);
  pointer-events: none;
}
.wqc-reimagined .wqc-hero-copy { z-index: 1; max-width: 660px; }
.wqc-reimagined .wqc-kicker {
  display: inline-flex; align-items: center; gap: 10px;
  color: #8feadd; font-size: .72rem; font-weight: 900; letter-spacing: .16em;
}
.wqc-reimagined .wqc-signal { width: 8px; height: 8px; border-radius: 50%; background: #58ebc4; box-shadow: 0 0 0 5px rgba(91, 246, 212, .09), 0 0 16px #4ef5cb; }
.wqc-reimagined .wqc-hero h1 {
  max-width: 660px; margin: 16px 0 12px; font-size: clamp(2.75rem, 4.2vw, 4.15rem);
  letter-spacing: -.065em; line-height: 1.08; font-weight: 900;
}
.wqc-reimagined .wqc-hero h1 span {
  display: inline; background: linear-gradient(100deg, #66eecf 5%, #78dfff 58%, #c3d5ff 100%);
  color: transparent; -webkit-background-clip: text; background-clip: text;
}
.wqc-reimagined .wqc-hero p { max-width: 585px; margin: 0; color: #bbd3e4; line-height: 1.65; font-size: .95rem; }
.wqc-reimagined .home-stats {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px; border: 0;
  margin: 21px 0 0; padding: 0;
}
.wqc-reimagined .home-stats div { display: flex; align-items: baseline; gap: 7px; }
.wqc-reimagined .home-stats strong { color: #f2d685; font-size: 1.3rem; line-height: 1; font-weight: 900; }
.wqc-reimagined .home-stats span:not(.metric-separator) { color: #aac6d9; font-size: .78rem; }
.wqc-reimagined .home-stats .metric-separator { height: 15px; width: 1px; background: rgba(215, 235, 255, .22); }
.wqc-reimagined .wqc-globe-stage { width: 395px; height: 290px; position: relative; display: grid; place-items: center; margin: -20px -2px -18px 0; }
.wqc-reimagined .globe-svg { width: 350px; height: 350px; max-width: none; filter: drop-shadow(0 25px 30px rgba(0,0,0,.35)); animation: wqc-globe-float 8s ease-in-out infinite; }
.wqc-reimagined .wqc-globe-label {
  position: absolute; z-index: 1; display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid rgba(155, 236, 229, .27); border-radius: 10px; padding: 9px 12px;
  color: #d8f6f7; background: rgba(63, 128, 187, .52); box-shadow: 0 10px 24px rgba(0, 10, 26, .35);
  backdrop-filter: blur(8px); font-size: .67rem; font-weight: 800; white-space: nowrap;
}
.wqc-reimagined .wqc-globe-label span { color: #ffda7b; }
.wqc-reimagined .globe-label-top { top: 32px; right: 5px; transform: rotate(5deg); }
.wqc-reimagined .globe-label-bottom { bottom: 27px; left: 1px; transform: rotate(-3deg); }
.wqc-reimagined .wqc-globe-label .globe-label-dot { background: #53eac8; border-radius: 50%; width: 7px; height: 7px; }
.wqc-reimagined .wqc-modes-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 1px 4px -9px; }
.wqc-reimagined .wqc-modes-head h2 { font-size: clamp(1.55rem, 3vw, 2.15rem); line-height: 1; letter-spacing: -.05em; margin: 7px 0 0; }
.wqc-reimagined .eyebrow { font-size: .67rem; margin-bottom: 0; letter-spacing: .18em; color: #73e1d0; }
.wqc-reimagined .wqc-modes-head p { margin: 0 0 4px; color: #8eafc5; font-size: .81rem; }
.wqc-reimagined .wqc-modes-head p span { color: #85e2d6; margin-left: 5px; font-size: 1.05rem; }
.wqc-reimagined .mode-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.wqc-reimagined .mode-card {
  --card-accent: #63edcf; --card-rgb: 64, 211, 187;
  position: relative; min-height: 153px; display: grid;
  grid-template-columns: 76px minmax(0,1fr) 34px; grid-template-rows: 26px 1fr;
  gap: 6px 15px; padding: 21px 19px;
  border: 1px solid rgba(var(--card-rgb), .35); border-radius: 17px;
  background: linear-gradient(115deg, rgba(var(--card-rgb), .22), rgba(50, 104, 160, .78) 62%), rgba(58, 114, 170, .80);
  box-shadow: 0 12px 30px rgba(18, 74, 130, .18), inset 0 1px 0 rgba(255,255,255,.14);
  text-align: left; color: #f5faff; overflow: hidden; cursor: pointer;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.wqc-reimagined .mode-card::after { content: none; }
.wqc-reimagined .challenge-card { --card-accent: #ffc073; --card-rgb: 226, 142, 84; }
.wqc-reimagined .duel-card { --card-accent: #c9a5ff; --card-rgb: 157, 109, 226; }
.wqc-reimagined .training-card { --card-accent: #77c9ff; --card-rgb: 78, 163, 235; }
.wqc-reimagined .mode-ambient {
  position: absolute; width: 175px; height: 175px; border: 1px solid rgba(var(--card-rgb), .13);
  border-radius: 50%; right: -43px; top: -69px; box-shadow: 0 0 0 27px rgba(var(--card-rgb), .036);
  pointer-events: none;
}
.wqc-reimagined .mode-emblem {
  width: 69px; height: 69px; display: grid; place-items: center;
  grid-column: 1; grid-row: 1 / 3; align-self: center; border: 1px solid rgba(var(--card-rgb), .44);
  border-radius: 15px; color: var(--card-accent);
  background: radial-gradient(circle at 20% 15%, rgba(var(--card-rgb), .28), rgba(var(--card-rgb), .06) 85%);
  box-shadow: 0 6px 20px rgba(var(--card-rgb), .1), inset 0 1px 0 rgba(255,255,255,.1);
}
.wqc-reimagined .mode-emblem svg { width: 51px; height: 51px; }
.wqc-reimagined .mode-number {
  grid-column: 2; grid-row: 1; color: var(--card-accent); font-size: .65rem; font-weight: 900; letter-spacing: .17em; align-self: center;
}
.wqc-reimagined .mode-content { grid-column: 2; grid-row: 2; align-self: center; display: grid; gap: 8px; }
.wqc-reimagined .mode-content strong { font-size: clamp(1.2rem, 2.1vw, 1.64rem); letter-spacing: -.045em; font-weight: 850; }
.wqc-reimagined .mode-content small { max-width: 270px; color: #adc4d7; line-height: 1.45; font-size: .74rem; }
.wqc-reimagined .mode-arrow {
  display: grid; place-items: center; width: 31px; height: 31px; border: 1px solid rgba(var(--card-rgb), .32);
  border-radius: 50%; background: rgba(var(--card-rgb), .09);
  grid-column: 3; grid-row: 1 / 3; align-self: end; justify-self: end;
  color: var(--card-accent); font-size: 1.17rem; line-height: 1; z-index: 1;
}
.wqc-reimagined .mode-card:hover, .wqc-reimagined .mode-card:focus-visible {
  transform: translateY(-5px); border-color: rgba(var(--card-rgb), .85);
  box-shadow: 0 21px 44px rgba(0, 8, 22, .36), 0 0 25px rgba(var(--card-rgb), .10);
}
.wqc-reimagined .mode-card:active { transform: translateY(-1px) scale(.995); }
.wqc-reimagined .continent-progress-card {
  min-height: unset; align-self: stretch; display: grid; align-content: center; grid-template-columns: 310px minmax(0,1fr); gap: 34px;
  padding: 29px 32px; margin-top: 3px;
  border-radius: 18px; border: 1px solid rgba(136, 193, 229, .20);
  background: linear-gradient(117deg, rgba(70, 137, 195, .82), rgba(47, 111, 174, .84));
  box-shadow: 0 14px 36px rgba(26, 83, 140, .20);
}
.wqc-reimagined .continent-progress-heading { display: flex; flex-direction: column; align-items: start; justify-content: center; gap: 0; margin: 0; }
.wqc-reimagined .continent-progress-heading h2 { margin: 8px 0 8px; line-height: 1.04; font-size: 1.85rem; letter-spacing: -.055em; }
.wqc-reimagined .wqc-progress-description { color: #91afc6; font-size: .8rem; line-height: 1.5; margin: 0 0 14px; max-width: 260px; }
.wqc-reimagined .continent-progress-heading > strong { color: #f2ce78; font-size: 2.55rem; font-weight: 900; letter-spacing: -.06em; }
.wqc-reimagined .continent-progress-chart { display: grid; gap: 10px; align-content: center; }
.wqc-reimagined .continent-progress-row { display: grid; grid-template-columns: 99px minmax(0,1fr) 42px; align-items: center; gap: 12px; }
.wqc-reimagined .continent-progress-label strong { color: #e1f2fb; font-size: .77rem; }
.wqc-reimagined .continent-progress-label span { color: #779bb5; font-size: .58rem; }
.wqc-reimagined .continent-progress-track { height: 8px; border-radius: 99px; }
.wqc-reimagined .continent-progress-percent { font-size: .73rem; font-weight: 900; }
.wqc-reimagined .home-footer { display: flex; flex-direction: column; gap: 9px; align-items: center; margin-top: -8px; }
.wqc-reimagined .home-footer .signature { margin: 0; padding: 0; font-family: Georgia, serif; font-style: italic; color: #d5edff; font-size: .88rem; }
.wqc-reimagined .rights-reserved { font-style: normal; font-family: system-ui, sans-serif; font-weight: 400; font-size: .73rem; }
.wqc-reimagined .home-legal-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px 20px; padding: 6px 0 11px; }
.wqc-reimagined .home-legal-links a { font-size: .72rem; color: #d5edff; text-decoration: underline; text-underline-offset: 3px; }
@keyframes wqc-globe-float { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-7px) rotate(1deg); } }
@media (max-width: 1070px) {
  .wqc-reimagined .wqc-hero { grid-template-columns: 1fr 330px; padding-left: 26px; }
  .wqc-reimagined .wqc-globe-stage { width: 325px; }
  .wqc-reimagined .globe-svg { width: 315px; height: 315px; }
  .wqc-reimagined .mode-card { grid-template-columns: 64px minmax(0,1fr) 28px; gap: 7px 11px; padding: 18px 15px; }
  .wqc-reimagined .mode-emblem { width: 60px; height: 60px; }
  .wqc-reimagined .mode-emblem svg { width: 45px; height: 45px; }
}
@media (max-width: 900px) {
  body:has(.wqc-reimagined:not(.hidden)) .brand-name { display: none; }
  .wqc-reimagined { gap: 21px; padding-top: 12px; }
  .wqc-reimagined .wqc-hero { grid-template-columns: minmax(0,1fr); min-height: 250px; padding: 29px 24px; }
  .wqc-reimagined .wqc-hero-copy { max-width: 550px; }
  .wqc-reimagined .wqc-globe-stage { position: absolute; right: -58px; top: -50px; width: 310px; height: 310px; opacity: .25; pointer-events: none; }
  .wqc-reimagined .wqc-globe-label { display: none; }
  .wqc-reimagined .wqc-hero h1 { font-size: clamp(2.5rem, 6.5vw, 4rem); }
  .wqc-reimagined .mode-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
  .wqc-reimagined .mode-card { min-height: 178px; grid-template-columns: 1fr auto; grid-template-rows: 66px auto 1fr; padding: 17px; gap: 5px 8px; }
  .wqc-reimagined .mode-emblem { grid-column: 1; grid-row: 1; width: 59px; height: 59px; }
  .wqc-reimagined .mode-number { grid-column: 2; grid-row: 1; justify-self: end; align-self: start; }
  .wqc-reimagined .mode-content { grid-column: 1 / 3; grid-row: 2 / 4; align-self: start; padding-top: 10px; }
  .wqc-reimagined .mode-content strong { font-size: 1.35rem; }
  .wqc-reimagined .mode-arrow { grid-column: 2; grid-row: 3; }
  .wqc-reimagined .continent-progress-card { grid-template-columns: 1fr; gap: 20px; }
  .wqc-reimagined .continent-progress-heading { display: grid; grid-template-columns: 1fr auto; align-items: center; }
  .wqc-reimagined .continent-progress-heading > div { grid-column: 1; }
  .wqc-reimagined .continent-progress-heading > strong { grid-column: 2; grid-row: 1; }
  .wqc-reimagined .wqc-progress-description { max-width: none; margin-bottom: 0; }
}
@media (max-width: 480px) {
  .wqc-reimagined { padding-top: 7px; gap: 19px; }
  .wqc-reimagined .wqc-hero { padding: 24px 21px; min-height: 277px; border-radius: 18px; }
  .wqc-reimagined .wqc-hero h1 { font-size: clamp(2.35rem, 10.5vw, 3.2rem); max-width: 350px; }
  .wqc-reimagined .wqc-kicker { font-size: .56rem; letter-spacing: .13em; }
  .wqc-reimagined .wqc-hero p { font-size: .83rem; line-height: 1.58; }
  .wqc-reimagined .wqc-globe-stage { right: -123px; top: -70px; opacity: .2; }
  .wqc-reimagined .home-stats { gap: 9px; margin-top: 20px; }
  .wqc-reimagined .home-stats strong { font-size: 1.04rem; }
  .wqc-reimagined .home-stats span:not(.metric-separator) { font-size: .65rem; }
  .wqc-reimagined .home-stats .metric-separator { height: 12px; }
  .wqc-reimagined .wqc-modes-head { align-items: start; }
  .wqc-reimagined .wqc-modes-head h2 { font-size: 1.66rem; }
  .wqc-reimagined .wqc-modes-head p { display: none; }
  .wqc-reimagined .mode-grid { grid-template-columns: 1fr; gap: 11px; }
  .wqc-reimagined .mode-card {
    min-height: 120px; grid-template-columns: 66px minmax(0,1fr) 29px;
    grid-template-rows: 20px 1fr; padding: 16px; gap: 4px 12px; border-radius: 15px;
  }
  .wqc-reimagined .mode-emblem { grid-column: 1; grid-row: 1 / 3; align-self: center; width: 61px; height: 61px; }
  .wqc-reimagined .mode-number { grid-column: 2; grid-row: 1; justify-self: start; }
  .wqc-reimagined .mode-content { grid-column: 2; grid-row: 2; padding: 0; align-self: center; gap: 6px; }
  .wqc-reimagined .mode-content strong { font-size: 1.24rem; }
  .wqc-reimagined .mode-content small { font-size: .7rem; }
  .wqc-reimagined .mode-arrow { grid-column: 3; grid-row: 1 / 3; align-self: end; }
  .wqc-reimagined .continent-progress-card { padding: 22px 16px; border-radius: 16px; }
  .wqc-reimagined .continent-progress-heading h2 { font-size: 1.5rem; }
  .wqc-reimagined .continent-progress-heading > strong { font-size: 2.05rem; }
  .wqc-reimagined .continent-progress-row { grid-template-columns: 78px minmax(0,1fr) 33px; gap: 8px; }
  .wqc-reimagined .continent-progress-label strong { font-size: .7rem; }
}
@media (prefers-reduced-motion: reduce) {
  .wqc-reimagined .globe-svg { animation: none; }
  .wqc-reimagined .mode-card { transition: none; }
}

/* Optimisation mobile supplémentaire */
@media (max-width: 620px) {
  body:has(.wqc-reimagined:not(.hidden)) .topbar { min-height: auto; padding-top: 4px; gap: 10px; align-items: center; }
  body:has(.wqc-reimagined:not(.hidden)) .topbar-actions { margin-left: auto; }
}
@media (max-width: 480px) {
  body:has(.wqc-reimagined:not(.hidden)) .app-shell { padding-left: 14px; padding-right: 14px; }
  body:has(.wqc-reimagined:not(.hidden)) .topbar { padding-top: 2px; gap: 8px; }
  body:has(.wqc-reimagined:not(.hidden)) .topbar-actions { gap: 7px; }
  body:has(.wqc-reimagined:not(.hidden)) .wqc-balance { min-width: 58px; justify-content: center; }

  .wqc-reimagined { padding-top: 4px; gap: 16px; }
  .wqc-reimagined .wqc-home-atmosphere { top: -95px; bottom: -20px; }

  .wqc-reimagined .wqc-hero {
    min-height: 252px;
    padding: 20px 18px 18px;
    border-radius: 18px;
  }
  .wqc-reimagined .wqc-kicker { display: inline-flex; margin-bottom: 2px; }
  .wqc-reimagined .wqc-hero h1 {
    font-size: clamp(2.2rem, 10.2vw, 3rem);
    line-height: 1.02;
    max-width: 295px;
    margin: 12px 0 10px;
  }
  .wqc-reimagined .wqc-hero p {
    max-width: 290px;
    font-size: .81rem;
    line-height: 1.52;
  }
  .wqc-reimagined .wqc-globe-stage {
    right: -136px;
    top: -82px;
    opacity: .14;
    transform: scale(.92);
  }

  .wqc-reimagined .home-stats {
    gap: 8px;
    margin-top: 16px;
  }
  .wqc-reimagined .home-stats .metric-separator { display: none; }
  .wqc-reimagined .home-stats div {
    min-width: calc(33.333% - 6px);
    flex: 1 1 0;
    display: grid;
    gap: 2px;
    padding: 8px 9px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.08);
    backdrop-filter: blur(6px);
  }
  .wqc-reimagined .home-stats strong { font-size: 1.02rem; }
  .wqc-reimagined .home-stats span:not(.metric-separator) { font-size: .62rem; line-height: 1.2; }

  .wqc-reimagined .wqc-modes-head {
    margin: 2px 2px -2px;
    gap: 6px;
  }
  .wqc-reimagined .wqc-modes-head h2 { font-size: 1.78rem; }
  .wqc-reimagined .eyebrow { font-size: .62rem; }

  .wqc-reimagined .mode-grid { gap: 10px; }
  .wqc-reimagined .mode-card {
    min-height: 114px;
    grid-template-columns: 60px minmax(0,1fr) 28px;
    grid-template-rows: 18px 1fr;
    gap: 4px 11px;
    padding: 14px;
    border-radius: 16px;
  }
  .wqc-reimagined .mode-emblem {
    width: 55px; height: 55px;
    border-radius: 14px;
  }
  .wqc-reimagined .mode-emblem svg { width: 43px; height: 43px; }
  .wqc-reimagined .mode-number { font-size: .61rem; letter-spacing: .16em; }
  .wqc-reimagined .mode-content { gap: 5px; }
  .wqc-reimagined .mode-content strong { font-size: 1.14rem; line-height: 1.05; }
  .wqc-reimagined .mode-content small { font-size: .66rem; line-height: 1.35; max-width: none; }
  .wqc-reimagined .mode-arrow {
    width: 30px; height: 30px;
    align-self: center;
    justify-self: end;
  }
  .wqc-reimagined .mode-ambient {
    width: 140px; height: 140px; right: -48px; top: -56px;
  }

  .wqc-reimagined .continent-progress-card {
    padding: 18px 14px 16px;
    gap: 16px;
    border-radius: 17px;
  }
  .wqc-reimagined .continent-progress-heading {
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: start;
  }
  .wqc-reimagined .continent-progress-heading h2 {
    font-size: 1.34rem;
    margin: 6px 0 4px;
  }
  .wqc-reimagined .wqc-progress-description {
    font-size: .73rem;
    line-height: 1.42;
    color: #b9d8ee;
  }
  .wqc-reimagined .continent-progress-heading > strong {
    font-size: 1.9rem;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.12);
    padding: 7px 10px;
    border-radius: 12px;
    line-height: 1;
  }
  .wqc-reimagined .continent-progress-chart { gap: 9px; }
  .wqc-reimagined .continent-progress-row {
    grid-template-columns: 64px minmax(0,1fr) 34px;
    gap: 7px;
    align-items: center;
  }
  .wqc-reimagined .continent-progress-label strong { font-size: .71rem; }
  .wqc-reimagined .continent-progress-label span { font-size: .53rem; }
  .wqc-reimagined .continent-progress-track { height: 10px; }
  .wqc-reimagined .continent-progress-percent { font-size: .70rem; }

  .wqc-reimagined .home-footer { gap: 8px; margin-top: -2px; }
  .wqc-reimagined .home-footer .signature {
    font-size: .82rem;
    text-align: center;
  }
  .wqc-reimagined .rights-reserved { font-size: .68rem; }
  .wqc-reimagined .home-legal-links {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 10px;
    padding: 4px 0 8px;
  }
  .wqc-reimagined .home-legal-links a {
    display: block;
    text-align: center;
    font-size: .70rem;
    padding: 2px 0;
  }
}
/* IOPTA WQC HOME UI END 2026-10-21 */

/* IOPTA WQC SHARED THEME BEGIN 2026-10-21 */
/* Apparence globale de l'application; aucune modification des fonctionnalités. */
html:has(.wqc-reimagined.hidden) { background: #74bff0; }
body:has(.wqc-reimagined.hidden) {
  --ink: #f8fcff;
  --muted: #d4e9f8;
  --line: rgba(229, 246, 255, .34);
  --deep: #367bb6;
  --navy: #2c76b6;
  --panel: #3e87c0;
  --panel-2: #5298cd;
  --teal: #80f4da;
  --teal-soft: rgba(113, 241, 219, .16);
  --gold: #ffe09c;
  --shadow: 0 20px 48px rgba(21, 77, 132, .22);
  background:

    radial-gradient(ellipse 42% 30% at 84% 9%, rgba(255,255,255,.34), transparent 100%),
    radial-gradient(ellipse 42% 34% at 16% 18%, rgba(138, 227, 255, .42), transparent 100%),
    radial-gradient(ellipse 44% 34% at 8% 62%, rgba(89, 210, 188, .28), transparent 100%),
    radial-gradient(ellipse 38% 34% at 92% 74%, rgba(137, 178, 255, .34), transparent 100%),
    radial-gradient(ellipse 30% 24% at 52% 52%, rgba(224, 245, 255, .16), transparent 100%),
    linear-gradient(145deg, #b3e3ff 0%, #86cdfb 25%, #59adef 50%, #468fdc 75%, #72bdf3 100%);
  background-attachment: fixed;
}
/* Les mêmes courbes diagonales et reflets que l'accueil apparaissent
   uniquement dans les écrans de jeu (l'accueil conserve son fond existant). */
body:has(.wqc-reimagined.hidden)::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20viewBox%3D%270%200%201600%201400%27%20preserveAspectRatio%3D%27none%27%3E%0A%3Cg%20fill%3D%27none%27%20stroke-linecap%3D%27round%27%3E%0A%20%20%3Cpath%20d%3D%27M-220%20244%20C%20120%20132%2C%20418%20174%2C%20724%20274%20S%201226%20452%2C%201610%20388%27%20stroke%3D%27%23ffffff%27%20stroke-width%3D%2714%27%20opacity%3D%27.10%27/%3E%0A%20%20%3Cpath%20d%3D%27M-240%20624%20C%2080%20512%2C%20400%20548%2C%20726%20668%20S%201268%20860%2C%201636%20786%27%20stroke%3D%27%23d7f6ff%27%20stroke-width%3D%2710%27%20opacity%3D%27.08%27/%3E%0A%20%20%3Cpath%20d%3D%27M-160%201038%20C%20170%20948%2C%20488%20986%2C%20792%201094%20S%201296%201246%2C%201610%201188%27%20stroke%3D%27%23ffffff%27%20stroke-width%3D%2712%27%20opacity%3D%27.08%27/%3E%0A%3C/g%3E%0A%3C/svg%3E"),
    url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20viewBox%3D%270%200%201600%201400%27%20preserveAspectRatio%3D%27none%27%3E%0A%3Cdefs%3E%0A%20%20%3ClinearGradient%20id%3D%27g1%27%20x1%3D%270%27%20y1%3D%270%27%20x2%3D%271%27%20y2%3D%271%27%3E%0A%20%20%20%20%3Cstop%20offset%3D%270%27%20stop-color%3D%27%232b6ab1%27/%3E%3Cstop%20offset%3D%271%27%20stop-color%3D%27%233b82d3%27/%3E%0A%20%20%3C/linearGradient%3E%0A%20%20%3ClinearGradient%20id%3D%27g2%27%20x1%3D%270%27%20y1%3D%270%27%20x2%3D%271%27%20y2%3D%270%27%3E%0A%20%20%20%20%3Cstop%20offset%3D%270%27%20stop-color%3D%27%232e5ea7%27/%3E%3Cstop%20offset%3D%271%27%20stop-color%3D%27%234f8fd9%27/%3E%0A%20%20%3C/linearGradient%3E%0A%3C/defs%3E%0A%3Cg%20fill%3D%27none%27%20stroke-linecap%3D%27round%27%3E%0A%20%20%3Cpath%20d%3D%27M-180%20165%20C%2080%2060%2C%20355%2068%2C%20626%20174%20S%201175%20378%2C%201535%20278%20S%201772%20197%2C%201830%20225%27%20stroke%3D%27url%28%23g1%29%27%20stroke-width%3D%2742%27%20opacity%3D%27.23%27/%3E%0A%20%20%3Cpath%20d%3D%27M-220%20318%20C%2088%20214%2C%20332%20240%2C%20620%20342%20S%201190%20548%2C%201530%20442%20S%201795%20352%2C%201860%20378%27%20stroke%3D%27url%28%23g2%29%27%20stroke-width%3D%2728%27%20opacity%3D%27.18%27/%3E%0A%20%20%3Cpath%20d%3D%27M-260%20515%20C%2052%20406%2C%20328%20430%2C%20648%20545%20S%201188%20744%2C%201525%20645%20S%201800%20565%2C%201868%20598%27%20stroke%3D%27url%28%23g1%29%27%20stroke-width%3D%2736%27%20opacity%3D%27.18%27/%3E%0A%20%20%3Cpath%20d%3D%27M-230%20745%20C%2035%20662%2C%20286%20675%2C%20560%20768%20S%201130%20984%2C%201490%20900%20S%201770%20824%2C%201840%20850%27%20stroke%3D%27url%28%23g2%29%27%20stroke-width%3D%2724%27%20opacity%3D%27.18%27/%3E%0A%20%20%3Cpath%20d%3D%27M-280%20975%20C%2065%20890%2C%20390%20930%2C%20700%201046%20S%201215%201228%2C%201524%201160%20S%201784%201102%2C%201865%201128%27%20stroke%3D%27url%28%23g1%29%27%20stroke-width%3D%2738%27%20opacity%3D%27.17%27/%3E%0A%20%20%3Cpath%20d%3D%27M-200%201178%20C%20110%201108%2C%20420%201138%2C%20760%201242%20S%201270%201390%2C%201600%201330%27%20stroke%3D%27url%28%23g2%29%27%20stroke-width%3D%2726%27%20opacity%3D%27.15%27/%3E%0A%3C/g%3E%0A%3C/svg%3E"),
    radial-gradient(ellipse 88% 62% at 12% 26%, rgba(59, 119, 186, .12) 0 56%, transparent 60%),
    radial-gradient(ellipse 92% 68% at 86% 78%, rgba(44, 96, 164, .12) 0 58%, transparent 62%);
  background-size: 100% 100%, 100% 100%, 100% 100%, 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
  opacity: .96;
  mix-blend-mode: multiply;
}
body:has(.wqc-reimagined.hidden) .app-shell {
  position: relative;
  z-index: 1;
}
body:has(.wqc-reimagined.hidden) .topbar {
  border-bottom: 1px solid rgba(255,255,255,.19);
  margin-bottom: 6px;
}
body:has(.wqc-reimagined.hidden) :is(.score-button, .reset-button, .profile-button, .wqc-balance) {
  background: rgba(37, 95, 156, .52);
  border-color: rgba(223, 247, 255, .3);
  color: #f8fcff;
}
body:has(.wqc-reimagined.hidden) :is(.section-heading h2, .question-panel h2, .result-card h2) {
  color: #fff;
  text-shadow: 0 2px 14px rgba(20, 74, 133, .28);
}
body:has(.wqc-reimagined.hidden) .eyebrow,
body:has(.wqc-reimagined.hidden) .question-kicker,
body:has(.wqc-reimagined.hidden) .choice-code {
  color: #d5fff0;
}
body:has(.wqc-reimagined.hidden) :is(.back-button, .quit-button) {
  color: #fff;
  background: rgba(38, 96, 156, .66);
  border-color: rgba(233, 249, 255, .4);
  box-shadow: 0 10px 22px rgba(28, 78, 140, .18);
}
body:has(.wqc-reimagined.hidden) :is(.choice-card, .level-button, .duel-create-card, .duel-list-section, .loading-card) {
  background: linear-gradient(135deg, rgba(54, 124, 184, .91), rgba(30, 88, 148, .92));
  border-color: rgba(233, 249, 255, .26);
  box-shadow: 0 13px 32px rgba(28, 75, 136, .19), inset 0 1px 0 rgba(255,255,255,.10);
  color: #fff;
}
body:has(.wqc-reimagined.hidden) :is(.choice-card, .level-button):hover:not(:disabled) {
  border-color: #c1fff0;
  background: linear-gradient(135deg, rgba(57, 133, 188, .98), rgba(45, 102, 166, .98));
}
body:has(.wqc-reimagined.hidden) .level-button.current {
  border-color: #ffe5a6;
  box-shadow: inset 0 0 0 1px #ffe5a6, 0 9px 22px rgba(27, 75, 135, .2);
}
body:has(.wqc-reimagined.hidden) .level-button.completed {
  background: rgba(64, 147, 170, .88);
}
body:has(.wqc-reimagined.hidden) .quiz-screen .question-panel {
  border: 1px solid rgba(231, 249, 255, .25);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(48, 115, 175, .87), rgba(33, 88, 147, .89));
  padding: clamp(26px, 5vw, 58px) clamp(16px, 4vw, 40px) 28px;
  margin: 20px 0 18px;
  box-shadow: 0 17px 42px rgba(29, 75, 136, .2);
}
body:has(.wqc-reimagined.hidden) .progress-track {
  background: rgba(239, 252, 255, .25);
}
body:has(.wqc-reimagined.hidden) .answer-button:not(.correct):not(.wrong),
body:has(.wqc-reimagined.hidden) .joker-dock button {
  background: linear-gradient(125deg, rgba(36, 96, 159, .91), rgba(29, 78, 138, .94));
  border-color: rgba(227, 246, 255, .31);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07);
}
body:has(.wqc-reimagined.hidden) .answer-button:hover:not(:disabled) {
  border-color: #b5fff2;
}
body:has(.wqc-reimagined.hidden) .result-card {
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(58, 129, 185, .96), rgba(33, 88, 152, .96));
  border-color: rgba(223, 246, 255, .31);
  box-shadow: 0 23px 55px rgba(23, 74, 136, .26);
}
body:has(.wqc-reimagined.hidden) :is(.duel-difficulties span, .score-stat, .profile-status) {
  border-color: rgba(228, 245, 255, .32);
  background: rgba(35, 89, 149, .40);
}
body:has(.wqc-reimagined.hidden) :is(.duel-create-card input, .friend-add-form input) {
  color: #fff;
  background: rgba(23, 69, 127, .65);
  border-color: rgba(226, 245, 255, .4);
}
body:has(.wqc-reimagined.hidden) :is(.duel-create-card input, .friend-add-form input)::placeholder { color: #e1edf8; }
body:has(.wqc-reimagined.hidden) .secondary-button {
  background: rgba(33, 94, 156, .32);
  border-color: rgba(229, 247, 255, .38);
}
/* Toutes les fenêtres, y compris la création du profil, restent lisibles
   en dialog natif. La logique JavaScript est conservée intégralement. */
body dialog:not(#profile-setup-dialog) {
  background:
    radial-gradient(circle at 90% 0%, rgba(131, 226, 249, .16), transparent 35%),
    linear-gradient(145deg, #418dca 0%, #2f75b5 50%, #235e9c 100%);
  border-color: rgba(236, 251, 255, .34);
  box-shadow: 0 26px 70px rgba(20, 58, 111, .34);
}
body dialog::backdrop { background: rgba(20, 55, 105, .66); backdrop-filter: blur(7px); }
body dialog :is(.dialog-head h2, h2, h3, label, p, strong) { text-shadow: none; }
body dialog :is(.privacy-note, .profile-status span, .score-row span, .score-stat span) { color: #d7eaf9; }
body dialog :is(input:not([type='checkbox']):not([type='radio']), select) {
  color: #fff;
  background: rgba(24, 76, 132, .73);
  border: 1px solid rgba(226, 248, 255, .40);
  border-radius: 12px;
}
body dialog input::placeholder { color: #d3e8f8; }
body dialog :is(input, select):focus-visible { outline: 3px solid #ffe0a1; outline-offset: 2px; }
body dialog :is(.secondary-button, .dialog-head button) {
  color: #fff;
  background: rgba(28, 87, 147, .40);
  border-color: rgba(236, 250, 255, .42);
}
body dialog .score-tabs button { color: #e1eff9; }
body dialog .score-tabs button.active { color: #fff; border-color: #95f6e2; }
body #profile-setup-dialog[open] {
  isolation: isolate;
  background:

    radial-gradient(ellipse 42% 30% at 84% 9%, rgba(255,255,255,.34), transparent 100%),
    radial-gradient(ellipse 42% 34% at 16% 18%, rgba(138, 227, 255, .42), transparent 100%),
    radial-gradient(ellipse 44% 34% at 8% 62%, rgba(89, 210, 188, .28), transparent 100%),
    radial-gradient(ellipse 38% 34% at 92% 74%, rgba(137, 178, 255, .34), transparent 100%),
    radial-gradient(ellipse 30% 24% at 52% 52%, rgba(224, 245, 255, .16), transparent 100%),
    linear-gradient(145deg, #b3e3ff 0%, #86cdfb 25%, #59adef 50%, #468fdc 75%, #72bdf3 100%);
  border: 0;
}
body #profile-setup-dialog[open]::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20viewBox%3D%270%200%201600%201400%27%20preserveAspectRatio%3D%27none%27%3E%0A%3Cg%20fill%3D%27none%27%20stroke-linecap%3D%27round%27%3E%0A%20%20%3Cpath%20d%3D%27M-220%20244%20C%20120%20132%2C%20418%20174%2C%20724%20274%20S%201226%20452%2C%201610%20388%27%20stroke%3D%27%23ffffff%27%20stroke-width%3D%2714%27%20opacity%3D%27.10%27/%3E%0A%20%20%3Cpath%20d%3D%27M-240%20624%20C%2080%20512%2C%20400%20548%2C%20726%20668%20S%201268%20860%2C%201636%20786%27%20stroke%3D%27%23d7f6ff%27%20stroke-width%3D%2710%27%20opacity%3D%27.08%27/%3E%0A%20%20%3Cpath%20d%3D%27M-160%201038%20C%20170%20948%2C%20488%20986%2C%20792%201094%20S%201296%201246%2C%201610%201188%27%20stroke%3D%27%23ffffff%27%20stroke-width%3D%2712%27%20opacity%3D%27.08%27/%3E%0A%3C/g%3E%0A%3C/svg%3E"),
    url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20viewBox%3D%270%200%201600%201400%27%20preserveAspectRatio%3D%27none%27%3E%0A%3Cdefs%3E%0A%20%20%3ClinearGradient%20id%3D%27g1%27%20x1%3D%270%27%20y1%3D%270%27%20x2%3D%271%27%20y2%3D%271%27%3E%0A%20%20%20%20%3Cstop%20offset%3D%270%27%20stop-color%3D%27%232b6ab1%27/%3E%3Cstop%20offset%3D%271%27%20stop-color%3D%27%233b82d3%27/%3E%0A%20%20%3C/linearGradient%3E%0A%20%20%3ClinearGradient%20id%3D%27g2%27%20x1%3D%270%27%20y1%3D%270%27%20x2%3D%271%27%20y2%3D%270%27%3E%0A%20%20%20%20%3Cstop%20offset%3D%270%27%20stop-color%3D%27%232e5ea7%27/%3E%3Cstop%20offset%3D%271%27%20stop-color%3D%27%234f8fd9%27/%3E%0A%20%20%3C/linearGradient%3E%0A%3C/defs%3E%0A%3Cg%20fill%3D%27none%27%20stroke-linecap%3D%27round%27%3E%0A%20%20%3Cpath%20d%3D%27M-180%20165%20C%2080%2060%2C%20355%2068%2C%20626%20174%20S%201175%20378%2C%201535%20278%20S%201772%20197%2C%201830%20225%27%20stroke%3D%27url%28%23g1%29%27%20stroke-width%3D%2742%27%20opacity%3D%27.23%27/%3E%0A%20%20%3Cpath%20d%3D%27M-220%20318%20C%2088%20214%2C%20332%20240%2C%20620%20342%20S%201190%20548%2C%201530%20442%20S%201795%20352%2C%201860%20378%27%20stroke%3D%27url%28%23g2%29%27%20stroke-width%3D%2728%27%20opacity%3D%27.18%27/%3E%0A%20%20%3Cpath%20d%3D%27M-260%20515%20C%2052%20406%2C%20328%20430%2C%20648%20545%20S%201188%20744%2C%201525%20645%20S%201800%20565%2C%201868%20598%27%20stroke%3D%27url%28%23g1%29%27%20stroke-width%3D%2736%27%20opacity%3D%27.18%27/%3E%0A%20%20%3Cpath%20d%3D%27M-230%20745%20C%2035%20662%2C%20286%20675%2C%20560%20768%20S%201130%20984%2C%201490%20900%20S%201770%20824%2C%201840%20850%27%20stroke%3D%27url%28%23g2%29%27%20stroke-width%3D%2724%27%20opacity%3D%27.18%27/%3E%0A%20%20%3Cpath%20d%3D%27M-280%20975%20C%2065%20890%2C%20390%20930%2C%20700%201046%20S%201215%201228%2C%201524%201160%20S%201784%201102%2C%201865%201128%27%20stroke%3D%27url%28%23g1%29%27%20stroke-width%3D%2738%27%20opacity%3D%27.17%27/%3E%0A%20%20%3Cpath%20d%3D%27M-200%201178%20C%20110%201108%2C%20420%201138%2C%20760%201242%20S%201270%201390%2C%201600%201330%27%20stroke%3D%27url%28%23g2%29%27%20stroke-width%3D%2726%27%20opacity%3D%27.15%27/%3E%0A%3C/g%3E%0A%3C/svg%3E"),
    radial-gradient(ellipse 88% 62% at 12% 26%, rgba(59, 119, 186, .12) 0 56%, transparent 60%),
    radial-gradient(ellipse 92% 68% at 86% 78%, rgba(44, 96, 164, .12) 0 58%, transparent 62%);
  background-size: 100% 100%, 100% 100%, 100% 100%, 100% 100%;
  background-repeat: no-repeat;
  opacity: .96;
  mix-blend-mode: multiply;
}
body #profile-setup-dialog .profile-launch-card {
  position: relative;
  z-index: 1;
  border: 1px solid rgba(242, 252, 255, .36);
  border-radius: 26px;
  background: linear-gradient(142deg, rgba(61, 131, 188, .93), rgba(34, 88, 151, .96));
  box-shadow: 0 24px 65px rgba(18, 69, 127, .31), inset 0 1px 0 rgba(255,255,255,.13);
}
body #profile-setup-dialog .profile-launch-card::before {
  border-color: rgba(176, 246, 255, .12);
}
body #profile-setup-dialog .profile-launch-name { color: #fff; }
body #profile-setup-dialog .profile-launch-card .eyebrow { color: #acffe8; }
body #profile-setup-dialog .profile-launch-card :is(p, .privacy-note, label) { color: #e5f2fb; }
body #profile-setup-dialog .profile-launch-card .terms-check a { color: #b7ffe9; }
body #profile-setup-dialog .profile-launch-card input:not([type='checkbox']) {
  background: rgba(24, 76, 132, .68);
  color: #fff;
  border: 1px solid rgba(235, 249, 255, .52);
  border-radius: 13px;
}
body #profile-setup-dialog .profile-launch-card input::placeholder { color: #dfecf7; }
@media (max-width: 620px) {
  body:has(.wqc-reimagined.hidden) .quiz-screen .question-panel {
    margin: 16px 0 18px;
    padding: 24px 14px 18px;
    border-radius: 18px;
  }
  body:has(.wqc-reimagined.hidden) .question-panel h2 { margin: 10px auto 22px; }
  body:has(.wqc-reimagined.hidden) .section-heading { margin-top: 25px; }
  body:has(.wqc-reimagined.hidden) .joker-dock {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }
  body:has(.wqc-reimagined.hidden) .joker-dock button {
    min-width: 0;
    grid-template-columns: 1fr;
    place-items: center;
    text-align: center;
    padding: 10px 4px;
    overflow-wrap: anywhere;
    font-size: .78rem;
  }
  body:has(.wqc-reimagined.hidden) .joker-dock .joker-icon { grid-row: auto; }
  body:has(.wqc-reimagined.hidden) .joker-dock small { display: none; }

  body #profile-setup-dialog[open] { place-items: start center; }
  body #profile-setup-dialog .profile-launch-card { margin: 0 auto; padding: 24px 20px; border-radius: 20px; }
  body #profile-setup-dialog .profile-launch-card h2 { font-size: clamp(1.75rem, 6vw, 2.35rem); }
  body .profile-dialog:not(#profile-setup-dialog) { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  body:has(.wqc-reimagined.hidden)::before,
  body #profile-setup-dialog[open]::before { transition: none; }
}
/* IOPTA WQC SHARED THEME END 2026-10-21 */

/* IOPTA WQC GOOGLE V6 */
/* WQC Google Identity Services - scoped auth controls */
.wqc-google-login-box {
  margin: 18px 0 6px; padding: 15px;
  border: 1px solid rgba(164,223,255,.27); border-radius: 16px;
  background: linear-gradient(135deg,rgba(52,130,197,.27),rgba(17,65,122,.25));
  display: grid; justify-items: center; gap: 10px;
}
.wqc-google-login-box p { margin: 0; font-size: .84rem; color: #dcf2ff; line-height: 1.45; }
.wqc-google-login-box .wqc-google-secondary {font-size: .74rem; color: #bedbec;}
.wqc-google-login-box [role="status"] {font-size: .79rem; color: #ffe49a; min-height:1.2em;}
.wqc-google-profile {margin: 18px 0; padding:16px; display:grid; gap:11px; border:1px solid rgba(164,223,255,.28);border-radius:16px;background:rgba(40,100,167,.2);}
.wqc-google-profile p {margin:0; color:#d8efff;}
.wqc-google-profile #wqc-google-link-status {font-weight:700; color:#ccf7ff;}
.wqc-google-profile [role="status"] {color:#ffdc91;min-height:1.2em; font-size:.82rem;}
.wqc-google-delete-login {margin-top:15px; padding:14px 0; display:grid; gap:12px;}
.wqc-google-delete-login p {color:#d4ebff;}
.wqc-google-delete-login [role="status"] {color:#ffe6a4;}


/* WQC GOOGLE V6.4 — explicit first-time signup and Google nickname confirmation */
.wqc-google-signup-panel[hidden], #profile-form[hidden], #wqc-google-login[hidden] { display: none !important; }
.wqc-google-signup-panel {
  width: 100%; margin-top: 14px; padding: 17px 15px; display: grid; gap: 12px;
  text-align: left; border: 1px solid rgba(180,230,255,.48); border-radius: 16px;
  background: linear-gradient(150deg,rgba(16,65,124,.65),rgba(32,106,164,.56));
}
.wqc-google-signup-panel strong { color: #fff; font-size: 1.08rem; }
.wqc-google-signup-panel p { color: #d8edff; font-size: .82rem; line-height: 1.55; margin: 0; }
.wqc-google-signup-panel label:not(.terms-check) { font-size: .84rem; font-weight: 750; color: #f1f8ff; }
.wqc-google-signup-panel input[type="text"] {
  width:100%; min-height: 46px; border: 1px solid rgba(204,238,255,.55);
  border-radius: 11px; padding: 12px; color:#fff;
  background: rgba(7,39,88,.55); font-size: 1rem;
}
.wqc-google-signup-panel .terms-check { display: flex; gap:10px; align-items:flex-start; font-size: .82rem; line-height:1.55; }
.wqc-google-signup-panel .terms-check input { width: 19px; height: 19px; flex:0 0 19px; margin-top: 2px; accent-color: #35e0cf; }
.wqc-google-signup-panel a { color: #bbfff4; text-underline-offset:3px; }
.wqc-google-signup-actions { display:flex; flex-wrap:wrap; gap:9px; }
.wqc-google-signup-actions button { border-radius: 999px; min-height:44px; padding:11px 17px; cursor:pointer; font:inherit; font-weight:800; }
.wqc-google-signup-actions .primary-button:disabled { opacity:.45; cursor:not-allowed; }
.wqc-google-signup-panel [role="status"] { color:#ffe8a3; min-height:1.3em; font-size:.83rem; }
@media (max-width:480px) {
 .wqc-google-signup-panel { padding: 14px 12px; }
 .wqc-google-signup-actions {display:grid;grid-template-columns:1fr;}
 .wqc-google-signup-actions button {width:100%;}
}


/* WQC V30 loading overlay — scoped styles, no existing V6 rules replaced. */
.wqc-loading.hidden { display: none !important; }
.wqc-loading {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
  color: #f7f8fd;
  background: linear-gradient(155deg, #09162d, #071c34);
}
.wqc-loading-card {
  width: min(100%, 440px);
  padding: clamp(26px, 6vw, 42px) 22px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 24px;
  background: linear-gradient(145deg,#152c4d,#0a1932);
  box-shadow: 0 16px 50px rgba(0,0,0,.22);
  text-align: center;
}
.wqc-loading-logo {
  display: block;
  width: clamp(112px, 30vw, 160px);
  height: clamp(112px, 30vw, 160px);
  margin: 0 auto 20px;
  border-radius: 22px;
  object-fit: contain;
}
.wqc-loading h1 { margin: 0; font-size: clamp(1.3rem, 5vw, 1.8rem); letter-spacing: -.035em; }
#wqc-loading-status { min-height: 2.8em; margin: 16px 0 7px; line-height: 1.4; opacity: .92; }
#wqc-loading-progress {
  display: block;
  width: 100%;
  height: 13px;
  margin: 18px auto 4px;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,.15);
  color: var(--wqc-load-accent, #f8c85a);
}
#wqc-loading-progress::-webkit-progress-bar { background: rgba(255,255,255,.15); border-radius: 999px; }
#wqc-loading-progress::-webkit-progress-value {
  background: var(--wqc-load-accent, #f8c85a);
  border-radius: 999px;
  transition: width 160ms ease;
}
#wqc-loading-progress::-moz-progress-bar { background: var(--wqc-load-accent, #f8c85a); border-radius: 999px; }
.wqc-loading-retry {
  margin: 18px auto 0;
  padding: 12px 25px;
  border: 1px solid var(--wqc-load-accent,#f8c85a);
  border-radius: 999px;
  background: rgba(0,0,0,.3);
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.wqc-loading-retry:focus-visible { outline: 3px solid var(--wqc-load-accent,#f8c85a); outline-offset: 4px; }
@media (prefers-reduced-motion: reduce) {
  #wqc-loading-progress::-webkit-progress-value { transition: none; }
}


/* WQC-MENU-FLUIDITE-V3 — fond du menu mis en calque fixe, dessin inchangé. */
@media (max-width: 900px) {
  body:has(.wqc-reimagined:not(.hidden)) {
    background-attachment: scroll;
    isolation: isolate;
  }
  body:has(.wqc-reimagined:not(.hidden))::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
    radial-gradient(circle at 12% 15%, rgba(179,232,255,.72), transparent 22%),
    radial-gradient(circle at 88% 12%, rgba(98,195,255,.42), transparent 26%),
    radial-gradient(circle at 18% 78%, rgba(115,225,208,.28), transparent 24%),
    radial-gradient(circle at 82% 88%, rgba(178,167,255,.25), transparent 24%),
    linear-gradient(145deg,#80cdfd 0%,#4ba4eb 34%,#2f79c9 62%,#4aa8e8 100%);
  }
}

/* WQC-DUEL-DIFFICULTY-SELECT-V1 */
body:has(.wqc-reimagined.hidden) .duel-difficulties input[type="radio"]:checked + span {
  border-color: var(--teal);
  background: var(--teal-soft);
}
body:has(.wqc-reimagined.hidden) .duel-difficulties input[type="radio"]:focus-visible + span {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
