* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  overflow-x: hidden;
}

:root {
  --app-header-height: 132px;

  --font-family-base: Arial, Helvetica, sans-serif;
  --color-action: #2563eb;
  --color-action-hover: #1d4ed8;
  --color-action-soft: #eff6ff;
  --color-background: #f5f7fb;
  --color-surface: #ffffff;
  --color-surface-muted: #f8fafc;
  --color-surface-raised: #ffffff;
  --color-text: #1f2937;
  --color-text-strong: #111827;
  --color-text-muted: #6b7280;
  --color-text-subtle: #9ca3af;
  --color-border: #e5e7eb;
  --color-border-strong: #d1d5db;
  --color-success: #16a34a;
  --color-success-strong: #15803d;
  --color-success-border: #22c55e;
  --color-success-muted-border: #bbf7d0;
  --color-success-soft: #f0fdf4;
  --color-success-badge: #dcfce7;
  --color-danger: #dc2626;
  --color-danger-border: #ef4444;
  --color-danger-soft: #fee2e2;
  --color-warning: #92400e;
  --color-warning-strong: #9a3412;
  --color-warning-border: #fdba74;
  --color-warning-soft: #fef3c7;
  --color-warning-muted: #fff7ed;
  --color-info-soft: #dbeafe;
  --color-continent: #059669;
  --color-continent-soft: #ecfdf5;
  --color-world: #2563eb;
  --color-world-soft: #eff6ff;
  --color-expert: #b45309;
  --color-expert-soft: #fffbeb;

  --shadow-soft: 0 8px 24px rgba(15, 23, 42, .06);
  --shadow-card: 0 12px 32px rgba(15, 23, 42, .08);
  --shadow-raised: 0 18px 44px rgba(15, 23, 42, .12);
  --shadow-focus: 0 0 0 4px rgba(37, 99, 235, .18);
  --shadow-action: 0 14px 34px rgba(37, 99, 235, .14);
  --shadow-action-soft: 0 10px 24px rgba(37, 99, 235, .18);
  --shadow-success: 0 10px 26px rgba(34, 197, 94, .18);
  --shadow-danger: 0 10px 26px rgba(239, 68, 68, .15);
  --shadow-mode: 0 18px 42px rgba(15, 23, 42, .1);
  --shadow-flag: 0 18px 44px rgba(15, 23, 42, .16);
  --focus-outline: 3px solid rgba(37, 99, 235, .38);

  --radius-sm: 10px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 999px;

  --space-8: 32px;

  --font-size-xs: .82rem;
  --font-weight-medium: 600;
  --font-weight-bold: 700;

  --control-height: 44px;
  --transition-base: .22s ease;
  --z-loader: 20;
  --z-toast: 30;

  --primary: var(--color-action);
  --text: var(--color-text);
  --text-light: var(--color-text-muted);
  --border: var(--color-border);
  --success: var(--color-success);
  --transition: var(--transition-base);
}

body {
  min-height: 100vh;
  font-family: var(--font-family-base);
  background: var(--color-background);
  color: var(--color-text);
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
}

button,
select,
input {
  font: inherit;
}

button {
  touch-action: manipulation;
}

button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: .64;
}

.app {
  min-height: 100vh;
  transition: opacity .2s ease;
}

.app-loading .app {
  opacity: 0;
}

.app-loader {
  position: fixed;
  inset: 0;
  z-index: var(--z-loader);
  background: var(--color-background);

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;

  color: var(--color-text-muted);
  font-weight: var(--font-weight-bold);
}

.app-loader div {
  width: 42px;
  height: 42px;
  border: 4px solid var(--color-info-soft);
  border-top-color: var(--color-action);
  border-radius: 50%;
  animation: girar .8s linear infinite;
}

.app-ready .app-loader {
  display: none;
}

.topo {
  position: relative;
  min-height: var(--app-header-height);
  padding: 14px 6%;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);

  display: grid;
  grid-template-columns: minmax(86px, 1fr) auto minmax(86px, 1fr);
  gap: 18px;
  align-items: center;
}

.topo::before {
  content: "";
  min-width: 0;
}

.logo {
  grid-column: 2;
  justify-self: center;
  display: flex;
  align-items: center;
  min-width: 0;
}

.logo-home-link {
  display: block;
  border-radius: var(--radius-sm);
  line-height: 0;
}

.logo-home-link:focus-visible {
  outline: var(--focus-outline);
  outline-offset: 4px;
}

.brand-logo {
  display: block;
  width: clamp(230px, 18vw, 290px);
  height: auto;
  object-fit: contain;
}

.brand-logo {
  max-height: 96px;
}

.topo-controles {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.sound-toggle {
  width: var(--control-height);
  height: var(--control-height);
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition:
    background var(--transition-base),
    border-color var(--transition-base),
    box-shadow var(--transition-base),
    transform var(--transition-base);
}

.sound-toggle:hover {
  border-color: var(--color-action);
  box-shadow: var(--shadow-focus);
}

.sound-toggle.ativo {
  background: var(--color-action-soft);
  border-color: var(--color-action);
}

#idioma {
  min-height: var(--control-height);
  max-width: min(46vw, 230px);
  padding: 10px 14px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 15px;
  cursor: pointer;
  text-overflow: ellipsis;
}

button:focus-visible,
select:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: var(--focus-outline);
  outline-offset: 3px;
}

.inicio {
  position: relative;
  isolation: isolate;
  max-width: 1180px;
  margin: 0 auto;
  padding: 58px 24px 82px;
  text-align: center;
}

.inicio::before {
  content: "";
  position: absolute;
  inset: 24px 24px auto;
  z-index: -1;
  height: 260px;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, .1), rgba(22, 163, 74, .06)),
    linear-gradient(180deg, rgba(255, 255, 255, .85), rgba(255, 255, 255, 0));
  border: 1px solid rgba(255, 255, 255, .75);
  border-radius: 28px;
}

.inicio h1 {
  max-width: 780px;
  margin: 0 auto 14px;
  color: var(--color-text-strong);
  font-size: 46px;
  line-height: 1.08;
}

.inicio > p {
  max-width: 620px;
  margin: 0 auto 46px;
  font-size: 19px;
  line-height: 1.6;
  color: var(--color-text-muted);
}

.modos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.modo {
  --mode-accent: var(--color-action);
  --mode-accent-soft: var(--color-action-soft);

  position: relative;
  min-height: 176px;
  padding: 26px 22px 24px;
  overflow: hidden;

  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);

  box-shadow: var(--shadow-card);

  display: grid;
  grid-template-areas:
    "icon"
    "title"
    "subtitle";
  grid-template-rows: 76px minmax(24px, auto) minmax(22px, auto);
  align-items: center;
  align-content: center;
  justify-content: center;
  justify-items: center;
  gap: 12px;

  cursor: pointer;
  transition:
    transform .2s ease,
    border-color .2s ease,
    box-shadow .2s ease;
}

.modo::before {
  content: "";
  position: absolute;
  inset: 0;
  height: 5px;
  background: var(--mode-accent);
  opacity: .86;
}

.modo:hover {
  transform: translateY(-5px);
  border-color: var(--mode-accent);
  box-shadow: var(--shadow-mode);
}

.modo:focus-visible {
  border-color: var(--mode-accent);
}

#btn-continentes {
  --mode-accent: var(--color-continent);
  --mode-accent-soft: var(--color-continent-soft);
}

#btn-mundo {
  --mode-accent: var(--color-world);
  --mode-accent-soft: var(--color-world-soft);
}

#btn-experiente {
  --mode-accent: var(--color-expert);
  --mode-accent-soft: var(--color-expert-soft);
}

.icone {
  grid-area: icon;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 76px;
  margin: 0;
  background: var(--mode-accent-soft);
  border: 1px solid var(--color-border);
  border-radius: 24px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .85);
  font-size: 42px;
}

.modo strong {
  grid-area: title;
  color: var(--color-text-strong);
  font-size: 20px;
  line-height: 1.2;
}

.modo small {
  grid-area: subtitle;
  max-width: 210px;
  font-size: 15px;
  line-height: 1.45;
  color: var(--color-text-muted);
}

.modo-recorde {
  display: block;
}

.modo-recorde {
  margin-top: 0;
  color: var(--color-text-muted);
  font-size: 12px;
  line-height: 1.35;
}

.modo-recorde {
  color: var(--color-expert);
  font-weight: var(--font-weight-bold);
}

.platform-disclosure {
  max-width: 680px;
  margin: 24px auto 0;
  padding: 16px 18px;
  background: var(--color-world-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  text-align: left;
}

.platform-disclosure[hidden] {
  display: none;
}

.platform-disclosure p {
  margin: 0;
  line-height: 1.45;
}

.platform-disclosure .btn-secundario {
  flex: 0 0 auto;
  white-space: nowrap;
}

.cloud-sync-status {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  margin: 12px auto 0;
  padding: 6px 12px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface-raised);
  color: var(--color-text-muted);
  font-size: 0.84rem;
  font-weight: var(--font-weight-bold);
}

.cloud-sync-status[hidden] {
  display: none;
}

.cloud-sync-status[data-state="syncing"] {
  color: var(--color-primary);
}

.cloud-sync-status[data-state="synced"] {
  color: var(--color-success);
}

.cloud-sync-status[data-state="pending"] {
  color: var(--color-warning);
}

.cloud-sync-status[data-state="error"] {
  color: var(--color-danger);
}

.challenge-entry {
  max-width: 680px;
  margin: 32px auto 0;
  padding: 20px;
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  text-align: left;
}

.challenge-entry strong {
  display: block;
  margin-bottom: 14px;
  color: var(--color-text-strong);
  font-size: 16px;
}

.challenge-entry div {
  display: flex;
  gap: 12px;
}

.challenge-entry input {
  flex: 1;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  color: var(--color-text-strong);
  font-size: 16px;
  letter-spacing: .04em;
  text-transform: uppercase;
  transition:
    border-color var(--transition-base),
    box-shadow var(--transition-base),
    background var(--transition-base);
}

.challenge-entry input::placeholder {
  color: var(--color-text-subtle);
}

.challenge-entry input:focus {
  border-color: var(--color-action);
  box-shadow: var(--shadow-focus);
}

.challenge-entry span {
  display: block;
  min-height: 20px;
  margin-top: 10px;
  color: var(--color-danger);
  font-weight: var(--font-weight-bold);
}

@media (max-width: 750px) {
  :root {
    --app-header-height: 116px;
  }

  .topo {
    height: auto;
    min-height: 116px;
    grid-template-columns: 1fr;
    gap: 12px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .topo::before {
    display: none;
  }

  .brand-logo {
    width: 220px;
  }

  .logo {
    grid-column: 1;
    width: 100%;
    justify-content: center;
  }

  .topo-controles {
    grid-column: 1;
    justify-self: stretch;
    justify-content: center;
    width: 100%;
  }

  #idioma {
    flex: 1;
    min-width: 0;
    max-width: 280px;
  }

  .inicio {
    padding: 42px 18px 58px;
  }

  .inicio::before {
    inset: 16px 10px auto;
    height: 220px;
    border-radius: 22px;
  }

  .inicio h1 {
    font-size: 34px;
    line-height: 1.12;
  }

  .inicio > p {
    margin-bottom: 34px;
    font-size: 17px;
  }

  .modos {
    grid-template-columns: 1fr;
  }

  .platform-disclosure {
    align-items: stretch;
    flex-direction: column;
  }

  .platform-disclosure .btn-secundario {
    width: 100%;
  }

  .modo {
    min-height: 132px;
    padding: 22px 18px;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "icon title"
      "icon subtitle";
    grid-template-rows: minmax(22px, auto) minmax(22px, auto);
    column-gap: 16px;
    row-gap: 5px;
    text-align: left;
    align-items: center;
    align-content: center;
    justify-content: stretch;
  }

  .modo::before {
    width: 5px;
    height: auto;
  }

  .icone {
    width: 62px;
    height: 62px;
    margin: 0;
    border-radius: 18px;
    font-size: 34px;
  }

  .modo small {
    max-width: none;
  }

  .modo strong,
  .modo small {
    justify-self: start;
  }

  .challenge-entry div {
    flex-direction: column;
  }

  .challenge-entry {
    padding: 18px;
    text-align: center;
  }
}

@media (max-width: 520px) {
  .topo {
    padding-left: 14px;
    padding-right: 14px;
  }

  .logo {
    min-width: 0;
  }

  .brand-logo {
    width: clamp(170px, 58vw, 200px);
  }

  .sound-toggle {
    flex: 0 0 var(--control-height);
  }

  .inicio {
    padding-top: 34px;
  }

  .inicio h1 {
    font-size: 30px;
  }

  .inicio > p {
    font-size: 16px;
  }

  .modo {
    min-height: 126px;
    padding: 20px 16px;
  }

  .modo strong {
    font-size: 18px;
  }

  .modo small {
    font-size: 14px;
  }

  .challenge-entry {
    margin-top: 24px;
  }
}
.tela-continentes {
  display: none;
  max-width: 1100px;
  margin: 0 auto;
  padding: 50px 24px;
}

.tela-continentes.ativa {
  display: block;
}

.tela-continentes h1 {
  margin-top: 35px;
  font-size: 38px;
  text-align: center;
}

.tela-continentes > p {
  margin: 12px 0 40px;
  color: var(--color-text-muted);
  font-size: 18px;
  text-align: center;
}

.voltar {
  min-height: var(--control-height);
  padding: 10px 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  color: var(--color-text);
  cursor: pointer;
}

.continentes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.continente {
  min-height: 170px;
  padding: 24px;
  background: var(--color-surface-raised);
  border: 2px solid transparent;
  border-radius: var(--radius-lg);
  cursor: pointer;

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;

  box-shadow: var(--shadow-soft);
  transition: var(--transition-base);
}

.continente:hover {
  transform: translateY(-4px);
  border-color: var(--color-action);
  box-shadow: var(--shadow-action);
}

.continente span {
  font-size: 42px;
}

.continente strong {
  font-size: 18px;
}

.continente small {
  color: var(--color-text-muted);
}

@media (max-width: 750px) {
  .continentes {
    grid-template-columns: 1fr;
  }
}
.tela-jogo {
  display: none;
  --game-progress: 0%;
  --game-progress-scale: 0;
  max-width: 980px;
  margin: 0 auto;
  padding: 34px 24px 58px;
}

.tela-jogo.ativa {
  display: block;
}

.jogo-topo {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
  padding: 18px;
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
}

.jogo-topo::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: -14px;
  height: 7px;
  overflow: hidden;
  background: var(--color-border);
  border-radius: var(--radius-pill);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, .08);
}

.jogo-topo::before {
  content: "";
  position: absolute;
  left: 18px;
  bottom: -14px;
  z-index: 1;
  width: calc(100% - 36px);
  height: 7px;
  background: linear-gradient(90deg, var(--color-action), var(--color-continent));
  border-radius: var(--radius-pill);
  transform: scaleX(var(--game-progress-scale));
  transform-origin: left center;
  transition: transform var(--transition-base);
}

.placar {
  justify-self: end;
  display: flex;
  gap: 12px;
  align-items: center;
}

.placar span,
.placar strong {
  min-width: 96px;
  padding: 10px 14px;
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);
}

.placar span {
  color: var(--color-text-muted);
  font-size: 14px;
  font-weight: var(--font-weight-bold);
}

.placar strong {
  color: var(--color-action);
  font-size: 16px;
}

.pergunta {
  margin-top: 46px;
  text-align: center;
}

.pergunta > p {
  max-width: 620px;
  margin: 0 auto;
  color: var(--color-text-strong);
  font-size: 23px;
  font-weight: var(--font-weight-bold);
  line-height: 1.35;
}

.bandeira {
  min-height: 318px;
  margin: 28px 0 30px;
  padding: 26px;

  display: flex;
  align-items: center;
  justify-content: center;

  background:
    linear-gradient(180deg, rgba(255, 255, 255, .95), rgba(248, 250, 252, .9));
  border: 1px solid var(--color-border);
  border-radius: 28px;
  box-shadow: var(--shadow-card);
}

.bandeira img {
  display: block;
  max-width: min(560px, 100%);
  max-height: 292px;
  width: auto;
  height: auto;

  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-flag);
}

.alternativas {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.alternativa {
  min-height: 62px;
  padding: 18px 20px;
  background: var(--color-surface-raised);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  color: var(--color-text-strong);
  font-size: 18px;
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition:
    transform .16s ease,
    border-color .2s ease,
    background .2s ease,
    box-shadow .2s ease;
}

.alternativa:hover {
  border-color: var(--color-action);
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

.alternativa:disabled {
  cursor: default;
}

.alternativa.correta:disabled,
.alternativa.errada:disabled {
  opacity: 1;
}

.alternativa.correta {
  background: var(--color-success-soft);
  border-color: var(--color-success-border);
  color: var(--color-success-strong);
  animation: resposta-correta .34s ease;
  box-shadow: var(--shadow-success);
}

.alternativa.errada {
  background: var(--color-danger-soft);
  border-color: var(--color-danger-border);
  color: var(--color-danger);
  animation: resposta-errada .28s ease;
  box-shadow: var(--shadow-danger);
}

@media (max-width: 600px) {
  .tela-jogo {
    padding: 24px 16px 44px;
  }

  .jogo-topo {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px;
  }

  .jogo-topo .voltar {
    justify-self: start;
  }

  .placar {
    justify-self: stretch;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .placar span,
  .placar strong {
    min-width: 0;
  }

  .pergunta {
    margin-top: 40px;
  }

  .pergunta > p {
    font-size: 19px;
  }

  .alternativas {
    grid-template-columns: 1fr;
  }

  .challenge-code-box,
  .challenge-code-box.ativo,
  .challenge-metrics,
  .share-actions {
    grid-template-columns: 1fr;
  }

  .bandeira {
    min-height: 230px;
    margin: 22px 0 24px;
    padding: 18px;
    border-radius: var(--radius-xl);
  }

  .bandeira img {
    max-width: 100%;
    max-height: 190px;
  }

  .alternativa {
    min-height: 56px;
    padding: 16px;
    font-size: 16px;
  }
}
.tela-resultado {
  display: none;
  min-height: calc(100vh - var(--app-header-height));
  padding: 50px 24px;

  align-items: center;
  justify-content: center;
}

.tela-resultado.ativa {
  display: flex;
}

.resultado-card {
  width: 100%;
  max-width: 760px;
  padding: 40px;

  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  text-align: center;

  box-shadow: var(--shadow-card);
}

.resultado-icone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 86px;
  height: 86px;
  margin-bottom: 16px;
  background: var(--color-action-soft);
  border: 1px solid var(--color-border);
  border-radius: 28px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .86);
  font-size: 56px;
}

.resultado-card h1 {
  margin-bottom: 8px;
  color: var(--color-text-strong);
  font-size: 34px;
  line-height: 1.12;
}

.resultado-mensagem {
  max-width: 520px;
  margin: 0 auto;
  color: var(--color-text-muted);
  font-size: 18px;
  line-height: 1.5;
}

.resultado-motivacao {
  max-width: 560px;
  min-height: 24px;
  margin: 12px auto 0;
  color: var(--color-text);
  font-size: 15px;
  line-height: 1.55;
}

.resultado-numero {
  margin-top: 28px;
}

.resultado-numero strong {
  font-size: clamp(64px, 10vw, 92px);
  line-height: .95;
  color: var(--color-action);
}

.resultado-numero span {
  font-size: clamp(28px, 4vw, 38px);
  color: var(--color-text-subtle);
}

.resultado-percentual {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
  padding: 8px 14px;
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  color: var(--color-text-strong);
  font-size: 18px;
  font-weight: var(--font-weight-bold);
}

.resultado-resumo {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 28px;
}

.resultado-resumo__item {
  padding: 15px 12px;
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  text-align: center;
}

.resultado-resumo__item strong {
  display: block;
  margin-bottom: 4px;
  color: var(--color-text-strong);
  font-size: 24px;
  line-height: 1.1;
}

.resultado-resumo__item span {
  color: var(--color-text-muted);
  font-size: 13px;
  font-weight: var(--font-weight-bold);
}

.resultado-resumo__item--destaque {
  background: var(--color-action-soft);
  border-color: rgba(37, 99, 235, .2);
}

.resultado-resumo__item--destaque strong {
  color: var(--color-action);
}

.resultado-recorde {
  display: none;

  margin: 24px auto 0;
  padding: 12px 18px;

  background: var(--color-warning-soft);
  border: 1px solid var(--color-warning-border);
  border-radius: var(--radius-pill);

  color: var(--color-warning);
  font-weight: var(--font-weight-bold);
}

.resultado-recorde.ativo {
  display: inline-block;
  animation: recorde-destaque .7s ease both;
}

.resultado-recorde--mantido {
  background: var(--color-surface-muted);
  border-color: var(--color-border);
  color: var(--color-text-muted);
  animation: none;
}

.resultado-conquistas {
  margin-top: 22px;
  padding: 18px;
  background: linear-gradient(180deg, var(--color-warning-soft), var(--color-surface));
  border: 1px solid var(--color-warning-border);
  border-radius: var(--radius-xl);
  text-align: left;
  box-shadow: var(--shadow-soft);
}

.resultado-conquistas[hidden] {
  display: none;
}

.resultado-conquistas > strong {
  display: block;
  margin-bottom: 12px;
  color: var(--color-warning);
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

#resultado-conquistas-lista {
  display: grid;
  gap: 10px;
}

.resultado-conquista {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: rgba(255, 255, 255, .72);
  border: 1px solid rgba(253, 186, 116, .55);
  border-radius: var(--radius-lg);
}

.resultado-conquista__icone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: var(--color-warning-soft);
  border: 1px solid var(--color-warning-border);
  border-radius: 50%;
  color: var(--color-warning);
  font-weight: var(--font-weight-bold);
}

.resultado-conquista strong,
.resultado-conquista span {
  display: block;
}

.resultado-conquista strong {
  color: var(--color-text-strong);
}

.resultado-conquista span {
  margin-top: 3px;
  color: var(--color-text-muted);
  font-size: 13px;
  line-height: 1.45;
}

.resultado-botoes {
  margin-top: 28px;

  display: flex;
  flex-direction: column;
  gap: 12px;
}

.share-panel {
  margin-top: 24px;
  padding: 18px;
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  text-align: left;
}

.share-panel h2 {
  margin-bottom: 8px;
  color: var(--color-text-strong);
  font-size: 20px;
}

.share-panel > p {
  color: var(--color-text-muted);
  line-height: 1.5;
}

.share-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.share-feedback {
  display: block;
  min-height: 22px;
  margin-top: 10px;
  color: var(--color-success);
  font-weight: var(--font-weight-bold);
  opacity: 0;
  transition: var(--transition-base);
}

.share-feedback.ativo {
  opacity: 1;
}

.challenge-result {
  margin-top: 18px;
  padding: 18px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  text-align: left;
}

.challenge-result h2 {
  margin-bottom: 8px;
  color: var(--color-text-strong);
  font-size: 20px;
}

.challenge-result > p {
  color: var(--color-text-muted);
  line-height: 1.5;
}

.challenge-code-box {
  display: none;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}

.challenge-code-box.ativo {
  display: grid;
}

.challenge-code-box strong {
  padding: 14px;
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-strong);
  letter-spacing: 1px;
}

.challenge-code-box span {
  grid-column: 1 / -1;
  min-height: 20px;
  color: var(--color-success);
  font-weight: var(--font-weight-bold);
  opacity: 0;
  transition: var(--transition-base);
}

.challenge-code-box span.ativo {
  opacity: 1;
}

.challenge-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 16px;
}

.challenge-metrics div {
  padding: 12px 8px;
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.challenge-metrics span {
  display: block;
  margin-bottom: 4px;
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
}

.challenge-metrics strong {
  color: var(--color-text-strong);
}

.challenge-comparison {
  min-height: 22px;
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--color-action-soft);
  border: 1px solid rgba(37, 99, 235, .18);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-weight: var(--font-weight-medium);
  line-height: 1.5;
}

@media (max-width: 600px) {
  .resultado-card {
    padding: 28px 18px;
  }

  .resultado-card h1 {
    font-size: 28px;
  }

  .resultado-icone {
    width: 72px;
    height: 72px;
    border-radius: 22px;
    font-size: 46px;
  }

  .resultado-resumo {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .resultado-resumo__item {
    padding: 13px 10px;
  }

  .resultado-resumo__item strong {
    font-size: 21px;
  }

  .resultado-botoes,
  .share-actions {
    gap: 10px;
  }

  .share-panel,
  .challenge-result,
  .resultado-conquistas {
    padding: 16px;
  }
}

.btn-principal,
.btn-secundario {
  min-height: var(--control-height);
  padding: 16px 20px;

  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: var(--font-weight-bold);

  cursor: pointer;
}

.btn-principal {
  background: var(--color-action);
  color: var(--color-surface);
  border: none;
  box-shadow: var(--shadow-action-soft);
}

.btn-principal:hover {
  background: var(--color-action-hover);
}

.btn-secundario {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border-strong);
}
.tela-mundo {
  display: none;
  padding: 50px 24px;
  text-align: center;
}

.tela-mundo.ativa {
  display: block;
}

.tela-mundo h1 {
  margin-top: 45px;
  margin-bottom: 10px;
  font-size: 36px;
}

.tela-mundo > p {
  color: var(--color-text-muted);
  font-size: 18px;
}

.opcoes-quantidade {
  max-width: 700px;
  margin: 40px auto 0;

  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.quantidade {
  min-height: 140px;
  padding: 24px;

  background: var(--color-surface-raised);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-xl);

  cursor: pointer;
  transition: var(--transition-base);
}

.quantidade:hover {
  transform: translateY(-3px);
  border-color: var(--color-action);
  box-shadow: var(--shadow-action);
}

.quantidade strong {
  display: block;
  margin-bottom: 8px;

  color: var(--color-action);
  font-size: 40px;
}

.quantidade span {
  color: var(--color-text-muted);
  font-size: 16px;
}

@media (max-width: 600px) {
  .opcoes-quantidade {
    grid-template-columns: 1fr;
  }
}

/* =========================
   MODO EXPERIENTE
========================= */

.tela-experiente {
  display: none;
  --expert-progress: 0%;
  --expert-progress-scale: 0;
  min-height: 100vh;
  padding: 34px 40px 56px;
}

.tela-experiente.ativa {
  display: block;
}

.experiente-topo {
  position: relative;
  max-width: 980px;
  margin: 0 auto;
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
}

.experiente-topo::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: -14px;
  height: 7px;
  background: var(--color-border);
  border-radius: var(--radius-pill);
}

.experiente-topo::before {
  content: "";
  position: absolute;
  left: 18px;
  bottom: -14px;
  z-index: 1;
  width: calc(100% - 36px);
  height: 7px;
  background: linear-gradient(90deg, var(--color-expert), var(--color-action));
  border-radius: var(--radius-pill);
  transform: scaleX(var(--expert-progress-scale));
  transform-origin: left center;
  transition: transform var(--transition-base);
}

.experiente-status {
  display: flex;
  align-items: center;
  gap: 12px;
}

.experiente-vidas {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 8px 14px;
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  gap: 6px;
}

.vida {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: var(--color-danger);
  font-size: 22px;
  line-height: 1;
}

.vida--perdida {
  color: var(--color-text-subtle);
}

.experiente-progresso,
.experiente-cronometro {
  padding: 10px 18px;
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  font-size: 17px;
  font-weight: var(--font-weight-bold);
}

.experiente-progresso span,
.experiente-cronometro span {
  display: block;
  margin-bottom: 2px;
  font-size: 11px;
  line-height: 1.2;
  text-transform: uppercase;
}

.experiente-cronometro strong {
  color: var(--color-text-strong);
  font-size: 22px;
}

.experiente-conteudo {
  width: 100%;
  max-width: 780px;
  margin: 48px auto 0;
  text-align: center;
}

.experiente-marca {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  padding: 8px 14px;
  background: var(--color-expert-soft);
  border: 1px solid var(--color-warning-border);
  border-radius: var(--radius-pill);
  color: var(--color-expert);
  font-size: 14px;
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.experiente-conteudo h1 {
  margin-bottom: 8px;
  color: var(--color-text-strong);
  font-size: 42px;
  line-height: 1.05;
}

.experiente-intro {
  max-width: 620px;
  margin: 0 auto 24px;
  color: var(--color-text-muted);
  font-size: 17px;
  line-height: 1.5;
}

.experiente-bandeira {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 318px;
  margin-bottom: 24px;
  padding: 26px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .95), rgba(248, 250, 252, .9));
  border: 1px solid var(--color-border);
  border-radius: 28px;
  box-shadow: var(--shadow-card);
}

.experiente-bandeira img {
  max-width: min(560px, 100%);
  max-height: 292px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-flag);
}

.experiente-pergunta {
  margin-bottom: 18px;
  color: var(--color-text-strong);
  font-size: 23px;
  font-weight: var(--font-weight-bold);
  line-height: 1.35;
}

.experiente-form {
  display: flex;
  gap: 12px;
}

.experiente-form input {
  flex: 1;
  min-width: 0;
  padding: 16px 18px;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-strong);
  outline: none;
  font-size: 18px;
  box-shadow: var(--shadow-soft);
  transition:
    border-color var(--transition-base),
    box-shadow var(--transition-base),
    background var(--transition-base);
}

.experiente-form input:focus {
  border-color: var(--color-action);
  box-shadow: var(--shadow-focus);
}

.experiente-form .btn-principal {
  padding: 0 26px;
}

.experiente-alternativas {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.experiente-alternativa {
  min-height: 58px;
  padding: 14px 16px;
  background: var(--color-surface-raised);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-strong);
  cursor: pointer;
  font-size: 16px;
  font-weight: var(--font-weight-bold);
  line-height: 1.25;
  text-align: center;
  transition:
    border-color var(--transition-base),
    box-shadow var(--transition-base),
    transform var(--transition-base),
    background var(--transition-base);
}

.experiente-alternativa:hover {
  border-color: var(--color-action);
  transform: translateY(-2px);
}

.experiente-alternativa:focus-visible {
  border-color: var(--color-action);
  box-shadow: var(--shadow-focus);
}

.experiente-alternativa:disabled {
  cursor: default;
  opacity: .88;
}

.experiente-alternativa.correta {
  background: var(--color-success-soft);
  border-color: var(--color-success);
}

.experiente-alternativa.errada {
  background: var(--color-danger-soft);
  border-color: var(--color-danger);
}

.experiente-feedback {
  min-height: 36px;
  margin: 14px 0 8px;
  color: var(--color-text-strong);
  font-size: 24px;
  font-weight: var(--font-weight-bold);
}

.experiente-feedback.correto,
.experiente-feedback.erro {
  min-height: 44px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 17px;
  line-height: 1.35;
}

.experiente-feedback.correto {
  background: var(--color-success-soft);
  color: var(--color-success);
}

.experiente-feedback.erro {
  background: var(--color-danger-soft);
  color: var(--color-danger);
}

.experiente-restaurado {
  margin: 6px 0 10px;
  color: var(--color-text-muted);
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
  text-align: center;
}

.experiente-restaurado[hidden] {
  display: none;
}

.world-continue-panel {
  display: grid;
  gap: 12px;
  margin: 14px 0 16px;
  padding: 14px;
  background: var(--color-warning-muted);
  border: 1px solid var(--color-warning-border);
  border-radius: var(--radius-md);
}

.world-continue-panel[hidden] {
  display: none;
}

.world-continue-panel p {
  margin: 0;
  color: var(--color-text-strong);
  font-weight: var(--font-weight-bold);
  line-height: 1.4;
}

.world-continue-panel button {
  min-height: var(--control-height);
}

.btn-pular {
  min-height: var(--control-height);
  padding: 10px 18px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 15px;
  font-weight: var(--font-weight-bold);
  transition:
    background var(--transition-base),
    border-color var(--transition-base),
    color var(--transition-base),
    transform var(--transition-base);
}

.btn-pular:hover {
  background: var(--color-surface-muted);
  border-color: var(--color-border-strong);
  color: var(--color-text-strong);
}

.experiente-estatisticas {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 28px;
}

.experiente-estatisticas div {
  padding: 18px;
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.experiente-estatisticas strong {
  display: block;
  margin-bottom: 5px;
  color: var(--color-action);
  font-size: 28px;
}

.experiente-estatisticas span {
  color: var(--color-text-muted);
  font-size: 14px;
}

@media (max-width: 650px) {
  .tela-experiente {
    padding: 24px 16px 44px;
  }

  .experiente-topo {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
  }

  .experiente-status {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 8px;
  }

  .experiente-vidas {
    min-height: 44px;
  }

  .experiente-progresso,
  .experiente-cronometro {
    padding: 10px 12px;
    text-align: center;
    font-size: 14px;
  }

  .experiente-cronometro strong {
    font-size: 17px;
  }

  .experiente-conteudo {
    margin-top: 42px;
  }

  .experiente-conteudo h1 {
    font-size: 32px;
  }

  .experiente-intro {
    font-size: 15px;
  }

  .experiente-bandeira {
    min-height: 230px;
    padding: 18px;
    border-radius: var(--radius-xl);
  }

  .experiente-bandeira img {
    max-height: 190px;
  }

  .experiente-pergunta {
    font-size: 19px;
  }

  .experiente-form {
    flex-direction: column;
  }

  .experiente-form .btn-principal {
    padding: 15px;
  }

  .experiente-alternativas {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .experiente-alternativa {
    min-height: 54px;
    padding: 13px;
    font-size: 15px;
  }

  .experiente-estatisticas {
    gap: 8px;
  }

  .experiente-estatisticas div {
    padding: 12px 6px;
  }
}

@media (max-width: 360px) {
  .experiente-estatisticas {
    grid-template-columns: 1fr;
  }

  .resultado-experiente-grid {
    grid-template-columns: 1fr;
  }
}
.experiente-form input.erro {
  border-color: var(--color-danger);
  animation: tremer 0.3s;
}

@keyframes tremer {
  0%,
   100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-6px);
  }

  75% {
    transform: translateX(6px);
  }
}

.experiente-form input.correto {
  border-color: var(--color-success);
  background: var(--color-success-soft);
}

/* =========================
   RESULTADO - MODO EXPERIENTE
========================= */

.tela-resultado-experiente {
  display: none;
  min-height: 100vh;
  padding: 50px 24px;
  align-items: center;
  justify-content: center;
}

.tela-resultado-experiente.ativa {
  display: flex;
}

.resultado-experiente-card {
  width: 100%;
  max-width: 700px;
  padding: 40px;
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  text-align: center;
  box-shadow: var(--shadow-card);
}

.resultado-experiente-icone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 82px;
  height: 82px;
  margin-bottom: 14px;
  background: var(--color-expert-soft);
  border: 1px solid var(--color-warning-border);
  border-radius: 28px;
  color: var(--color-expert);
  font-size: 52px;
}

.resultado-experiente-card h1 {
  margin-bottom: 10px;
  color: var(--color-text-strong);
  font-size: 34px;
  line-height: 1.12;
}

.resultado-experiente-card > p {
  max-width: 520px;
  margin: 0 auto;
  color: var(--color-text-muted);
  font-size: 17px;
  line-height: 1.5;
}

.resultado-experiente-destaque {
  margin: 30px 0 24px;
}

.resultado-experiente-destaque strong {
  color: var(--color-action);
  font-size: clamp(64px, 10vw, 92px);
  line-height: .95;
}

.resultado-experiente-destaque span {
  color: var(--color-text-muted);
  font-size: clamp(28px, 4vw, 38px);
  font-weight: var(--font-weight-bold);
}

.resultado-experiente-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.resultado-experiente-grid div {
  padding: 20px;
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  text-align: center;
}

.resultado-experiente-grid strong {
  display: block;
  margin-bottom: 5px;
  color: var(--color-text-strong);
  font-size: 30px;
}

.resultado-experiente-grid span {
  color: var(--color-text-muted);
  font-size: 14px;
}

@media (max-width: 600px) {
  .resultado-experiente-card {
    padding: 28px 18px;
  }

  .resultado-experiente-card h1 {
    font-size: 28px;
  }

  .resultado-experiente-icone {
    width: 72px;
    height: 72px;
    border-radius: 22px;
    font-size: 44px;
  }

  .resultado-experiente-destaque strong {
    font-size: 58px;
  }

  .resultado-experiente-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}


/* Destaque da resposta exibida ao pular uma bandeira */
.experiente-feedback.pulado {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-width: 220px;
  margin: 14px auto 8px;
  padding: 12px 22px;

  background: var(--color-warning-muted);
  border: 1px solid var(--color-warning-border);
  border-radius: var(--radius-md);

  color: var(--color-warning-strong);
  font-size: 17px;
  font-weight: var(--font-weight-bold);

  box-shadow: var(--shadow-soft);
}
/* =====================================================
   CARD
===================================================== */

.card{
  width: min(92vw, 650px);
  margin: auto;
  padding: var(--space-8);
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
}

/* =====================================================
   FOOTER
===================================================== */

.app-footer{
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}
.footer-link{
  min-height: var(--control-height);
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--color-action);
  cursor: pointer;
  font-size: .95rem;
  transition: var(--transition-base);
}
.footer-link:hover{
  color: var(--color-action-hover);
  background: var(--color-action-soft);
}
.app-version{
  color: var(--color-text-muted);
  font-size: .85rem;
}

/* =====================================================
   ABOUT
===================================================== */

.tela-about {
  display: none;
  min-height: calc(100vh - var(--app-header-height));
  padding: 50px 24px;
  align-items: center;
  justify-content: center;
}

.tela-about.ativa {
  display: flex;
}

#about-content {
  margin-top: 24px;
}

.about-intro {
  color: var(--text-light);
  line-height: 1.6;
  text-align: center;
}

.about-list {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.about-list div,
.about-meta div {
  padding: 16px;
  background: var(--color-surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.about-list strong,
.about-meta strong {
  display: block;
  margin-bottom: 5px;
  color: var(--text);
}

.about-list span,
.about-meta span {
  color: var(--text-light);
  line-height: 1.5;
}

.about-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 18px;
  text-align: center;
}

@media (max-width: 600px) {
  .about-meta {
    grid-template-columns: 1fr;
  }
}

/* =====================================================
   PRIVACY POLICY
===================================================== */

.tela-privacy {
  display: none;
  min-height: calc(100vh - var(--app-header-height));
  padding: 50px 24px;
  align-items: center;
  justify-content: center;
}

.tela-privacy.ativa {
  display: flex;
}

#privacy-content {
  margin-top: 24px;
}

.privacy-intro,
.privacy-contact,
.privacy-updated {
  color: var(--text-light);
  line-height: 1.6;
  text-align: center;
}

.privacy-list {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.privacy-list div {
  padding: 16px;
  background: var(--color-surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.privacy-list strong {
  display: block;
  margin-bottom: 5px;
  color: var(--text);
}

.privacy-list span {
  color: var(--text-light);
  line-height: 1.5;
}

.privacy-contact {
  margin-top: 22px;
}

.privacy-contact a {
  color: var(--primary);
  font-weight: var(--font-weight-bold);
}

.privacy-updated {
  margin-top: 14px;
  font-size: .9rem;
}

/* =====================================================
   PROFILE
===================================================== */

.tela-profile {
  display: none;
  min-height: calc(100vh - var(--app-header-height));
  padding: 44px 24px;
  align-items: center;
  justify-content: center;
}

.tela-profile.ativa {
  display: flex;
}

.profile-card {
  position: relative;
  overflow: hidden;
  width: min(94vw, 880px);
  padding: clamp(24px, 4vw, 38px);
}

.profile-card::before,
.achievements-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(
    90deg,
    var(--color-continent),
    var(--color-action),
    var(--color-expert)
  );
}

.profile-title,
.achievements-title {
  color: var(--color-text-strong);
  text-align: center;
  letter-spacing: 0;
}

#profile-content {
  display: grid;
  gap: 18px;
  margin-top: 22px;
}

.profile-intro,
.profile-note {
  color: var(--text-light);
  line-height: 1.6;
  text-align: center;
}

.profile-intro {
  max-width: 620px;
  margin: 0 auto;
}

.ranking-identity {
  display: grid;
  grid-template-columns: 1.2fr 1fr .45fr auto;
  gap: 12px;
  align-items: end;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(37, 99, 235, .06), transparent 70%),
    var(--color-surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
}

.ranking-identity > strong {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.ranking-identity > strong::before {
  content: "";
  width: 10px;
  height: 10px;
  background: var(--color-action);
  border-radius: 50%;
  box-shadow: 0 0 0 5px var(--color-action-soft);
}

.ranking-identity label {
  display: grid;
  gap: 6px;
  color: var(--text-light);
  font-size: .9rem;
  font-weight: var(--font-weight-bold);
}

.ranking-identity input {
  width: 100%;
  min-height: var(--control-height);
  padding: 12px 14px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: 15px;
}

.ranking-identity input[readonly] {
  background: var(--color-surface-raised);
  color: var(--text-light);
  font-family: Consolas, "Courier New", monospace;
  font-size: .9rem;
}

#ranking-player-feedback {
  grid-column: 1 / -1;
  min-height: 20px;
  color: var(--success);
  font-weight: var(--font-weight-bold);
  text-align: right;
}

.play-games-panel {
  display: grid;
  gap: 10px;
  padding: 18px;
  background: var(--color-surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
}

.play-games-panel[hidden] {
  display: none;
}

.play-games-panel > strong {
  color: var(--text);
}

#play-games-status {
  color: var(--text-light);
  font-size: .92rem;
  font-weight: var(--font-weight-bold);
}

#play-games-status[data-state="authenticated"],
#play-games-status[data-state="submitted"] {
  color: var(--color-success-strong);
}

#play-games-status[data-state="pending"] {
  color: var(--color-warning-strong);
}

.play-games-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.profile-stat,
.profile-continents {
  position: relative;
  min-height: 118px;
  padding: 18px;
  overflow: hidden;
  background: var(--color-surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
}

.profile-stat::before,
.profile-continents::before {
  content: "";
  position: absolute;
  inset: 14px auto auto 14px;
  width: 9px;
  height: 9px;
  background: var(--profile-accent, var(--color-action));
  border-radius: 50%;
  box-shadow: 0 0 0 5px var(--profile-accent-soft, var(--color-action-soft));
}

.profile-stat--games,
.profile-stat--correct {
  --profile-accent: var(--color-continent);
  --profile-accent-soft: var(--color-continent-soft);
}

.profile-stat--average,
.profile-stat--streak {
  --profile-accent: var(--color-action);
  --profile-accent-soft: var(--color-action-soft);
}

.profile-stat--time,
.profile-stat--mode {
  --profile-accent: var(--color-expert);
  --profile-accent-soft: var(--color-expert-soft);
}

.profile-stat span,
.profile-continents span {
  display: block;
  margin: 0 0 12px 22px;
  color: var(--text-light);
  font-size: .9rem;
  font-weight: var(--font-weight-bold);
  line-height: 1.35;
}

.profile-stat strong,
.profile-continents strong {
  display: block;
  color: var(--text);
  font-size: clamp(1.6rem, 2.4vw, 2rem);
  line-height: 1;
  overflow-wrap: anywhere;
}

.profile-continents {
  display: grid;
  min-height: auto;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  --profile-accent: var(--color-success);
  --profile-accent-soft: var(--color-success-soft);
}

.profile-continents span {
  margin-bottom: 0;
}

.profile-continents strong {
  padding: 10px 14px;
  background: var(--color-success-soft);
  border: 1px solid var(--color-success-muted-border);
  border-radius: var(--radius-pill);
  color: var(--color-success-strong);
  font-size: 1.1rem;
  white-space: nowrap;
}

.profile-note {
  max-width: 620px;
  margin: 0 auto;
  font-size: .92rem;
}

.profile-empty .profile-stat,
.profile-empty .profile-continents {
  box-shadow: none;
}

.profile-empty .profile-stat:not(.profile-stat--games),
.profile-empty .profile-continents {
  background: var(--color-surface-muted);
}

@media (max-width: 820px) {
  .ranking-identity {
    grid-template-columns: 1fr 1fr;
  }

  .ranking-identity .btn-secundario {
    grid-column: 1 / -1;
  }

  .profile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* =====================================================
   ACHIEVEMENTS
===================================================== */

.tela-achievements {
  display: none;
  min-height: calc(100vh - var(--app-header-height));
  padding: 44px 24px;
  align-items: center;
  justify-content: center;
}

.tela-achievements.ativa {
  display: flex;
}

.achievements-card {
  position: relative;
  overflow: hidden;
  width: min(94vw, 920px);
  max-width: 920px;
  padding: clamp(24px, 4vw, 38px);
}

#achievements-content {
  display: grid;
  gap: 18px;
  margin-top: 22px;
}

.achievements-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.achievement-summary-card,
.achievement-item {
  position: relative;
  padding: 18px;
  background: var(--color-surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
}

.achievement-summary-card {
  overflow: hidden;
}

.achievement-summary-card::after {
  content: "";
  position: absolute;
  inset: auto 18px 16px 18px;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--color-action),
    var(--color-continent)
  );
  border-radius: var(--radius-pill);
  opacity: .35;
}

.achievements-summary span,
.achievement-item span {
  color: var(--text-light);
  font-size: .9rem;
}

.achievements-summary strong {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-size: clamp(1.8rem, 3vw, 2.2rem);
  line-height: 1;
}

.achievements-list {
  display: grid;
  gap: 12px;
}

.achievement-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 14px;
  transition:
    border-color var(--transition-base),
    box-shadow var(--transition-base),
    transform var(--transition-base),
    background var(--transition-base);
}

.achievement-item::before {
  content: "";
  grid-row: 1 / span 3;
  width: 34px;
  height: 34px;
  margin-top: 2px;
  background:
    linear-gradient(180deg, var(--color-surface), var(--color-surface-muted));
  border: 1px solid var(--color-border-strong);
  border-radius: 50%;
  box-shadow: inset 0 0 0 7px var(--color-surface-muted);
}

.achievement-item:hover {
  border-color: var(--color-border-strong);
  transform: translateY(-1px);
}

.achievement-item.unlocked {
  background:
    linear-gradient(180deg, rgba(22, 163, 74, .08), transparent 72%),
    var(--color-surface-raised);
  border-color: var(--color-success-muted-border);
  box-shadow: var(--shadow-success);
}

.achievement-item.unlocked::before {
  background: var(--color-success);
  border-color: var(--color-success-border);
  box-shadow:
    inset 0 0 0 9px var(--color-success),
    0 0 0 5px var(--color-success-soft);
}

.achievement-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.achievement-title strong {
  color: var(--text);
  line-height: 1.25;
}

.achievement-badge {
  padding: 4px 9px;
  background: var(--color-action-soft);
  border-radius: var(--radius-pill);
  color: var(--primary);
  font-size: .8rem;
  font-weight: var(--font-weight-bold);
  white-space: nowrap;
}

.achievement-item.unlocked .achievement-badge {
  background: var(--color-success-badge);
  color: var(--color-success-strong);
}

.achievement-progress {
  height: 10px;
  overflow: hidden;
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
}

.achievement-progress div {
  height: 100%;
  width: var(--progress);
  background: var(--primary);
  border-radius: inherit;
  transition: width .25s ease;
}

.achievement-item.unlocked .achievement-progress div {
  background: linear-gradient(
    90deg,
    var(--color-success),
    var(--color-continent)
  );
}

.achievements-note {
  max-width: 620px;
  margin: 0 auto;
  color: var(--text-light);
  line-height: 1.6;
  text-align: center;
}

.achievements-empty .achievement-item {
  box-shadow: none;
}

.achievement-toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: var(--z-toast);
  max-width: min(360px, calc(100vw - 44px));
  padding: 16px 18px;
  background: var(--color-text-strong);
  border-radius: var(--radius-lg);
  color: var(--color-surface);
  box-shadow: var(--shadow-raised);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: var(--transition-base);
}

.achievement-toast.ativo {
  opacity: 1;
  transform: translateY(0);
}

.achievement-toast strong {
  display: block;
  margin-bottom: 3px;
}

@media (max-width: 720px) {
  .profile-card,
  .achievements-card {
    width: min(94vw, 620px);
  }

  .ranking-identity,
  .profile-grid,
  .achievements-summary {
    grid-template-columns: 1fr;
  }

  .profile-continents {
    grid-template-columns: 1fr;
    align-items: start;
  }

  #ranking-player-feedback {
    text-align: left;
  }

  .achievement-item {
    grid-template-columns: 1fr;
  }

  .achievement-item::before {
    grid-row: auto;
  }
}

@media (max-width: 430px) {
  .tela-profile,
  .tela-achievements {
    padding: 24px 12px;
  }

  .profile-card,
  .achievements-card {
    padding: 22px 16px;
  }

  .achievement-title {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* =====================================================
   MICROINTERAÇÕES
===================================================== */

.inicio,
.tela-continentes.ativa,
.tela-mundo.ativa,
.tela-jogo.ativa,
.tela-resultado.ativa,
.tela-experiente.ativa,
.tela-resultado-experiente.ativa,
.tela-about.ativa,
.tela-profile.ativa,
.tela-achievements.ativa,
.tela-privacy.ativa {
  animation: tela-entrar .26s ease both;
}

.bandeira img,
.experiente-bandeira img {
  transition:
    transform .2s ease,
    box-shadow .2s ease;
}

.bandeira img:hover,
.experiente-bandeira img:hover {
  transform: scale(1.015);
}

.placar-feedback {
  animation: placar-pulse .32s ease;
}

.btn-principal,
.btn-secundario,
.voltar,
.quantidade,
.continente,
.footer-link {
  transition:
    transform .18s ease,
    background .2s ease,
    border-color .2s ease,
    color .2s ease,
    box-shadow .2s ease;
}

.btn-principal:hover,
.btn-secundario:hover,
.voltar:hover,
.footer-link:hover {
  transform: translateY(-1px);
}

.btn-principal:active,
.btn-secundario:active,
.voltar:active,
.quantidade:active,
.continente:active,
.modo:active,
.footer-link:active,
.sound-toggle:active {
  transform: translateY(1px) scale(.99);
}

@keyframes tela-entrar {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes girar {
  to {
    transform: rotate(360deg);
  }
}

@keyframes resposta-correta {
  45% {
    transform: scale(1.03);
  }
}

@keyframes resposta-errada {
  25% {
    transform: translateX(-5px);
  }

  75% {
    transform: translateX(5px);
  }
}

@keyframes recorde-destaque {
  0% {
    transform: scale(.96);
  }

  55% {
    transform: scale(1.04);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes placar-pulse {
  50% {
    transform: scale(1.08);
    color: var(--color-success);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }

  .inicio,
  .tela-continentes.ativa,
  .tela-mundo.ativa,
  .tela-jogo.ativa,
  .tela-resultado.ativa,
  .tela-experiente.ativa,
  .tela-resultado-experiente.ativa,
  .tela-about.ativa,
  .tela-profile.ativa,
  .tela-achievements.ativa,
  .tela-privacy.ativa,
  .btn-principal:hover,
  .btn-secundario:hover,
  .voltar:hover,
  .footer-link:hover,
  .btn-principal:active,
  .btn-secundario:active,
  .voltar:active,
  .quantidade:active,
  .continente:active,
  .modo:active,
  .footer-link:active,
  .sound-toggle:active,
  .bandeira img:hover,
  .experiente-bandeira img:hover,
  .achievement-item:hover {
    transform: none !important;
  }
}
