/* ──────────────────────────────────────────────
   Preparatório HSK 1 — estilos do jogo
   (top bar / progress / stats vêm do design-system.css)
   ────────────────────────────────────────────── */

:root {
  --hsk-green: var(--m3-success, #00C853);
  --hsk-red:   var(--m3-error,   #FF5A5F);
  --hsk-card-bg: #1f1d24;
  --hsk-card-bd: #2c2a33;
  --hsk-muted:   var(--m3-on-secondary-container, #dce2f9);
  --hsk-text:    var(--m3-on-primary-container, #d9e2ff);
}

/* prova: oculta pontos/acertos, mantém só o progresso */
.game-status { display: none; }

/* destrava o scroll interno da exercise-area:
   cada nível flex acima dela precisa de min-height:0,
   senão o #game-screen cresce com o conteúdo e nada rola */
#game-screen { min-height: 0; }

/* ── área do exercício ───────────────────────── */
.exercise-area {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0rem 1.25rem 0rem;
  overflow-y: auto;
  gap: 16px;
}

.grow { margin-bottom: auto; }
.grow-title { margin-right: auto; }

/* títulos / prompts */
.title-row { display: flex; align-items: center; gap: 0.75rem;  }
.title-row.spaced    { }
.title-row.spaced-lg {  }
.h1 { font-size: 1rem; font-weight: 600; color: var(--hsk-text); margin: 0; }
.prompt { font-size: 0.875rem; font-weight: 400; color: var(--hsk-muted); margin-block: auto; text-align: center;}
.prompt.center { text-align: center; }
/*.prompt.above { margin-block: 0; }  prompt acima das opções: anula o margin auto que empurraria a grade */
.big-prompt { font-size: 0.875rem; font-weight: 500; line-height: 1.25; text-align: center; color: var(--hsk-text); margin: 0; }
.big-prompt.centered { margin-top: auto; }

/* botão de ícone genérico dentro do exercício */
.ex-icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--hsk-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
  border-radius: 50%;
}
.ex-icon-btn .material-symbols-rounded { font-size: 1.4rem; }
.ex-icon-btn.active { color: var(--m3-primary); }

/* ── completar a frase ───────────────────────── */
.sentence {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  
  margin-bottom: 1.5rem;
  justify-content: center;
}
.sentence.centered { margin-block: auto; }
.punct {
  font-size: 1rem;
  color: var(--hsk-text);
  font-family: 'Noto Sans SC', var(--font-main);
  padding-bottom: 0.5rem;
}
.wcol { display: flex; flex-direction: column; align-items: center; }
.wrap { position: relative; display: flex; flex-direction: column; align-items: center; }
.word {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: 8px;
  padding: 0 0.2rem;
  color: inherit;
  font-family: var(--font-main);
}
.word.active { background: var(--m3-secondary-container); }
.word.active .wpy, .word.active .whz { color: var(--hsk-green); }
.wpy {
  font-size: 0.675rem;
  color: var(--hsk-muted);
  margin-bottom: 0.25rem;
  min-height: 1.125rem;
  white-space: nowrap;
}
.whz {
  position: relative;
  font-size: 1.3rem;
  color: var(--hsk-text);
  white-space: nowrap;
  font-family: 'Noto Sans SC', var(--font-main);
  padding-bottom: 0.5rem;
}
.whz::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  border-radius: 999px;
  background: #66666646;
}
.whz.blank {
  min-width: 2rem;
  text-align: center;
  color: transparent;
}
.whz.blank::after { background: #7a7a7a; }
.whz.blank.filled { color: var(--hsk-text); }
.whz.blank.filled::after { background: #ffffff; }

.tooltip { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 0.5rem; z-index: 20; }
.tip-tail {
  position: absolute; left: 50%;
  transform: translateX(-50%) rotate(45deg);
  top: -6px; width: 12px; height: 12px;
  background: var(--hsk-card-bg);
  border-left: 1px solid var(--hsk-card-bd);
  border-top: 1px solid var(--hsk-card-bd);
}
.tip-body {
  position: relative;
  background: var(--hsk-card-bg);
  border: 1px solid var(--hsk-card-bd);
  color: var(--hsk-text);
  border-radius: 1rem;
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
  white-space: nowrap;
}

/* ── cards de escolha (completar + escolher) ── */
.choices { display: flex; flex-direction: column; gap: 0.5rem; margin: 1.5rem 0 1rem; }
.choices.centered { margin-block: auto; }
.card {
  border: 3px solid var(--hsk-card-bd);
  background: transparent;
  border-radius: 2rem; /* 32px */
  min-height: 3.7rem;
  /*padding: 0.75rem 1rem;*/
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  cursor: pointer;
  color: var(--hsk-text);
  text-align: center;
  width: 100%;
  font-family: var(--font-main);
  transition: border-color 0.15s, background-color 0.15s, color 0.15s;
  padding-inline: 16px;
  padding-block: 12px;
}
.card.center { text-align: center; }

.card.sel {
  border-color: var(--m3-primary);
  background: rgba(59, 71, 101, 0.2);
}
.card.sel .card-hanzi,
.card.sel .token-hz { color: var(--m3-primary); }

.card.correct {
  border-color: #82e46f;
  background: rgba(130, 228, 111, 0.05);
  color: #82e46f;
}

.card.wrong {
  border-color: #ffb4ab;
  background: rgba(255, 180, 171, 0.05);
  color: #ffb4ab;
}

.card-pinyin { font-size: 0.875rem; font-weight: 500; letter-spacing: 0.15px; }
.card-hanzi {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5rem;
  letter-spacing: 0.1875rem; /* 3px */
  font-family: 'Noto Sans SC', var(--font-main);
}

.token-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: 0.2rem; }
.token-hz {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5rem;
  letter-spacing: 0.1875rem;
  font-family: 'Noto Sans SC', var(--font-main);
}
.tpy.small { font-size: 0.875rem; font-weight: 500; line-height: 1.1; letter-spacing: 0.15px; color: inherit; }

/* ── traduzir ────────────────────────────────── */
.answer-area { margin-bottom: 1.25rem; margin-top: auto; }
.answer-line {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  align-items: flex-end;
  column-gap: 0.5rem;
  row-gap: 0;
  min-height: 8.5rem; /* 2 linhas × 3.75rem */
  background-image:
    linear-gradient(var(--hsk-card-bd), var(--hsk-card-bd)),
    linear-gradient(var(--hsk-card-bd), var(--hsk-card-bd));
  background-size: 100% 2px;
  background-position: 0 calc(3.75rem - 2px), 0 calc(8rem - 2px);
  background-repeat: no-repeat;
}
.answer-line .tile { min-height: 3.25rem; margin-bottom: 1rem; }
.bank { display: flex; flex-wrap: wrap; gap: 0.625rem; justify-content: center; margin-bottom: auto; margin-top: auto; }
.tile {
  border: 2px solid var(--hsk-card-bd);
  background: #1a181f;
  border-radius: 0.75rem;
  padding: 0.5rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--hsk-text);
  font-family: var(--font-main);
}
.tile.ghost { border-color: transparent; background: #17151b; cursor: default; }
.tile.ghost .tpy, .tile.ghost .thz { visibility: hidden; }
.tpy {
  font-size: 0.875rem;
  color: var(--hsk-muted);
  white-space: nowrap;
  text-align: center;
  line-height: 1.1;
}
.thz {
  font-size: 1rem;
  color: var(--hsk-text);
  white-space: nowrap;
  text-align: center;
  line-height: 1.1;
  margin-top: 0.125rem;
  font-family: 'Noto Sans SC', var(--font-main);
}

/* permite empilhar o Confirmar + Pular no rodapé */
#game-footer { flex-direction: column; align-items: center; gap: 0.25rem; }
#game-footer .btn-action-m3 { width: 100%; }
.btn-tertiary {
  background: transparent;
  border: none;
  font-family: var(--font-main);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--hsk-muted);
  cursor: pointer;
  padding: 0.5rem;
  transition: transform 0.2s, opacity 0.2s;
}
.btn-tertiary:active { transform: scale(0.95); opacity: 0.8; }

/* ── ditado de tons (mesma UI do jogo de Tons) ── */
/* área central: sílabas → seta → hanzi/tradução/play, centralizada e crescendo */
.td-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(0.25rem, 2vh, 1.5rem);
  width: 100%;
}

/* sílabas (= word-container-m3) */
.td-syllables {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.syllable-box {
  background-color: var(--m3-secondary-container);
  color: var(--m3-on-secondary-container);
  border: none;
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
  border-radius: 6.25rem;
  min-width: clamp(4rem, 20vw, 6.25rem);
  height: clamp(2.5rem, 7vh, 3.5rem);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem 0.75rem;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}
.syllable-box:active:not(:disabled) { transform: scale(0.95); }
.syllable-box .pinyin-text {
  font-size: clamp(0.8rem, 2.5vh, 1rem);
  font-weight: 500;
  text-align: center;
}
.syllable-box.has-tone {
  background-color: var(--m3-primary-container);
  color: var(--m3-on-primary-container);
}
.syllable-box.selected {
  background-color: var(--m3-on-secondary-container);
  color: var(--m3-secondary-container);
}
.syllable-box.correct { background-color: #82e46f; color: #43533e; }
.syllable-box.correct .pinyin-text { color: #43533e; }
.syllable-box.incorrect { background-color: #f2b8b5; color: #601410; }
.syllable-box.incorrect .pinyin-text { color: #601410; }

/* seta (= arrow-container) */
.td-arrow { display: flex; justify-content: center; align-items: center; height: 24px; }
.td-arrow img { height: 100%; }

/* hanzi + tradução + play (= ideogram-group-m3) */
.td-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
  width: 100%;
}
.td-hanzi {
  font-family: "Noto Sans SC", var(--font-main);
  font-size: clamp(2.5rem, 10vh, 4rem);
  font-weight: 400;
  letter-spacing: 6px;
  line-height: 1.1;
  color: var(--m3-on-primary-container);
}
.td-trans {
  font-size: 1rem;
  font-weight: 500;
  color: var(--m3-on-primary-container);
  margin-bottom: 1rem;
}
.td-play {
  background-color: var(--m3-primary);
  color: var(--m3-on-primary);
  border: none;
  border-radius: 6.25rem;
  width: 70px;
  height: 50px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: transform 0.2s;
}
.td-play:active { transform: scale(0.95); }
.td-play .material-symbols-rounded { font-size: 1.5rem; }

/* drawer inferior de seleção de tom (= bottom-drawer-m3) */
.bottom-drawer-m3 {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 26rem;
  background-color: #232428;
  border-top-left-radius: 1.75rem;
  border-top-right-radius: 1.75rem;
  box-shadow: 0px 4px 8px 3px rgba(0, 0, 0, 0.15), 0px 1px 3px 0px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  padding-inline: 0.5rem;
  animation: drawerSlideUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.1);
}
.drawer-header-m3 {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 16px;
  cursor: pointer;
}
.drawer-handle-m3 {
  width: 2rem;
  height: 0.25rem;
  background-color: #a0a1aa;
  border-radius: 6.25rem;
}
.drawer-content-m3 {
  display: flex;
  flex-direction: column;
  gap: 1.5625rem;
  align-items: center;
  width: 100%;
  padding: 0 0.2rem 1.5rem;
}
.drawer-title-m3 {
  font-weight: 700;
  font-size: 1rem;
  color: #fcfaff;
  width: 100%;
  text-align: left;
}
.drawer-tones-grid-m3 { display: flex; gap: 0.5rem; width: 100%; }
.btn-tone-m3 {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  height: 6.25rem;
  align-items: center;
  justify-content: center;
  background: #36373b;
  border: none;
  border-radius: 1.75rem;
  color: #fcfaff;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
}
.btn-tone-m3.selected { background-color: #c2c9e0; color: #36373b; border: none; }
.btn-tone-m3:active { transform: scale(0.96); }
.tone-mark-display-m3 {
  font-family: "Noto Sans SC", var(--font-main);
  font-size: 1.375rem;
  font-weight: 500;
}
.tone-label-m3 { font-size: 1rem; font-weight: 500; }
.btn-clear-m3 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  height: clamp(3rem, 7vh, 3.5rem);
  background: transparent;
  border: 1px solid #fcfaff;
  border-radius: 6.25rem;
  color: #fcfaff;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}
.btn-clear-m3:active { background-color: rgba(255, 255, 255, 0.08); }

/* ── escreva os caracteres (campo aberto) ────── */
/* pinyin no topo (visual de prompt above, mas grudado no topo) e campo logo abaixo,
   pra que o teclado do celular não cubra o campo */
.wp-prompt { margin-block: 0 1rem; }
.wp-trans {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--hsk-muted);
  text-align: center;
  margin-block: 0 1rem;
}
.wp-input {
  width: 100%;
  box-sizing: border-box;
  min-height: 2.75rem;
  resize: none;
  overflow: hidden;            /* sem barra de rolagem; cresce via JS (autoGrow) */
  font-family: "Noto Sans SC", var(--font-main);
  font-size: 1.4rem;
  line-height: 1.4;
  text-align: center;
  color: var(--hsk-text);
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--hsk-card-bd);
  border-radius: 0;
  padding: 0.25rem 0.25rem 0.5rem;
  outline: none;
  transition: border-color 0.2s;
}
.wp-input:focus { border-bottom-color: var(--m3-primary); }
.wp-input::placeholder {
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-style: italic;
  color: var(--hsk-muted);
  opacity: 0.45;
}
.wp-input:focus::placeholder { opacity: 0; }   /* some ao focar */

/* ── compreensão auditiva (transcrição/legenda) ── */
.cp-transcript {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  width: 100%;
  margin-block: 0.25rem 0.75rem;
  padding: 1rem;
  background: var(--hsk-card-bg);
  border: 1px solid var(--hsk-card-bd);
  border-radius: 1rem;
}
.cp-turn { display: flex; flex-direction: column; gap: 0.0625rem; }
.cp-rotulo { font-size: 0.75rem; font-weight: 600; color: var(--m3-primary); margin-bottom: 0.125rem; }
.cp-py { font-size: 0.8125rem; color: var(--hsk-muted); }
.cp-hz { font-family: "Noto Sans SC", var(--font-main); font-size: 1.125rem; color: var(--hsk-text); }

/* ── odd one out ─────────────────────────────── */
.odd-wrap { display: flex; flex-wrap: wrap; gap: 0.5rem; padding-top: 0.75rem; margin-block: auto; }
.otile {
  position: relative;
  border: 2px solid var(--hsk-card-bd);
  border-radius: 1rem;
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  color: var(--hsk-text);
  background: none;
  font-family: var(--font-main);
}
.otile.reveal { border-color: var(--hsk-green); color: var(--hsk-green); }
.otile.marked { border-color: var(--hsk-red); color: var(--hsk-red); }
.opy { font-size: 0.875rem; white-space: nowrap; }
.ohz { font-size: 1rem; margin-top: 0.125rem; font-family: 'Noto Sans SC', var(--font-main); }
.ohz.big { font-size: 1rem; }
.minus {
  position: absolute;
  top: -8px; right: -8px;
  width: 1.5rem; height: 1.5rem;
  border-radius: 999px;
  background: var(--hsk-red);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.minus .material-symbols-rounded { font-size: 1rem; }
.xover {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 1rem;
  background: rgba(0, 0, 0, 0.3);
}
.xover .material-symbols-rounded { font-size: 2.25rem; font-weight: 700; }

/* ── listen ──────────────────────────────────── */
.avatar-row { display: flex; align-items: center; gap: 1.5rem; margin-bottom: 16px; }
.avatar-logo { width: 60px; height: 60px; flex-shrink: 0; }
.bubble {
  position: relative;
  flex: 1;
  min-width: 0; /* permite encolher até o espaço disponível (evita scroll lateral) */
  border: 2px solid var(--hsk-card-bd);
  border-radius: 1rem;
  padding: 1.5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  background: none;
  font-family: var(--font-main);
  color: var(--hsk-green);
}
.bubble-tail {
  position: absolute;
  left: -8px; top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 1rem; height: 1rem;
  background: var(--m3-background);
  border-left: 2px solid var(--hsk-card-bd);
  border-bottom: 2px solid var(--hsk-card-bd);
}
.bubble-icon { display: flex; align-items: center; justify-content: center; }
.bubble-icon .material-symbols-rounded { font-size: 2rem; }
.bubble-wave { display: flex; align-items: center; gap: 0.25rem; min-width: 0; overflow: hidden; }
.wavebar {
  width: 4px;
  border-radius: 999px;
  background: var(--hsk-green);
  transform-origin: center;
  animation: wave 1s ease-in-out infinite;
  animation-play-state: paused;
  opacity: 0.4;
  transition: opacity 0.2s;
}
.bubble.playing .wavebar {
  animation-play-state: running;
  opacity: 1;
}
.listen-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-top: auto; }
.lcard {
  position: relative;
  border: 3px solid var(--hsk-card-bd);
  background: transparent;
  border-radius: 2rem; /* 32px */
  padding: 0.75rem 1rem;
  min-height: 5.6875rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  cursor: pointer;
  color: var(--hsk-text);
  font-family: var(--font-main);
  transition: border-color 0.15s, background-color 0.15s, color 0.15s;
}

.lcard.sel {
  border-color: var(--m3-primary);
  background: rgba(59, 71, 101, 0.2);
}
.lcard.sel .card-hanzi { color: var(--m3-primary); }

.lcard.correct {
  border-color: #82e46f;
  background: rgba(130, 228, 111, 0.05);
  color: #82e46f;
}
.lcard.wrong {
  border-color: #ffb4ab;
  background: rgba(255, 180, 171, 0.05);
  color: #ffb4ab;
}

.lspk {
  position: absolute;
  top: 0.75rem; right: 0.75rem;
  color: var(--m3-primary);
  display: flex;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}
.lspk .material-symbols-rounded { font-size: 1.5rem; }
.cant {
  background: none;
  border: none;
  color: var(--hsk-muted);
  font-weight: 600;
  padding: 0.75rem 0;
  margin-top: 1rem;
  cursor: pointer;
  width: 100%;
  font-family: var(--font-main);
  font-size: 0.875rem;
}

/* ── drawer de feedback ──────────────────────── */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 900;
  animation: overlayFade 0.25s ease-out;
}

.drawer {
  position: fixed;
  bottom: 0;
  left: 50%;
  width: 100%;
  max-width: 26rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-top-left-radius: 1.75rem;
  border-top-right-radius: 1.75rem;
  box-shadow: 0px 4px 8px 3px rgba(0, 0, 0, 0.15), 0px 1px 3px 0px rgba(0, 0, 0, 0.3);
  padding-inline: 0.5rem;
  transform: translate(-50%, 0);
  animation: drawerSlideUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.1);
}
.drawer.no { background-color: #f2b8b5; color: #601410; }
.drawer.ok { background-color: #b9e8c2; color: #003919; }

.drawer-handle {
  width: 2rem;
  height: 0.25rem;
  border-radius: 6.25rem;
  margin-block: 0.8rem;
}
.drawer.no .drawer-handle { background-color: #601410; }
.drawer.ok .drawer-handle { background-color: #003919; }

.drawer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 380px;
  padding: 0 0.2rem 1.5rem;
  padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
  gap: 1rem;
}

.drawer-title-row {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
}
.drawer-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-main);
  font-size: 1rem;
  font-weight: 600;
}
.drawer-title .material-symbols-rounded { font-size: 2rem; }

.drawer-answer-section {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 0.25rem;
}
.drawer-answer-label {
  font-family: var(--font-main);
  font-size: 0.875rem;
  font-weight: 700;
}
.drawer-answer-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.125rem;
  font-family: var(--font-main);
  font-weight: 500;
}
.drawer-answer-row .ans-hanzi {
  font-family: 'Noto Sans SC', var(--font-main);
  font-size: 1rem;
  font-weight: 600;
}
.drawer-answer-row .ans-pinyin { font-size: 0.875rem; opacity: 0.85; }
.drawer-answer-row .ans-traducao {
  font-size: 0.875rem;
  font-style: italic;
  opacity: 0.75;
  margin-top: 0.25rem;
}

/* lista de respostas no drawer (memory) */
.drawer-list {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  width: 100%;
}
.drawer-list-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-family: var(--font-main);
}
.drawer-list-row .ans-hanzi {
  font-family: 'Noto Sans SC', var(--font-main);
  font-size: 1rem;
  font-weight: 600;
  min-width: 2.5rem;
}
.drawer-list-row .ans-pinyin {
  font-size: 0.875rem;
  font-weight: 500;
  opacity: 0.85;
}
.drawer-list-row .ans-traducao {
  font-size: 0.875rem;
  font-style: italic;
  opacity: 0.75;
  margin-left: auto;
}

.drawer-action {
  width: 100%;
  height: 3.5rem;
  border-radius: var(--border-radius-btn);
  border: none;
  font-family: var(--font-main);
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: transform 0.2s;
}
.drawer.no .drawer-action { background-color: #601410; color: #f9dedc; }
.drawer.ok .drawer-action { background-color: #003919; color: #b9e8c2; }
.drawer-action:active { transform: scale(0.98); }
.drawer-action .material-symbols-rounded { font-size: 1.5rem; }

/* ── review list (portado do /memory/) ──────── */
.review-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0 1rem;
}
.review-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--m3-on-surface-variant);
  text-align: center;
}
#review-words {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.word-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--m3-secondary-container);
  border-radius: 1.75rem;
  padding: 1rem;
}
.word-card-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}
.word-character {
  font-family: 'Noto Sans SC', var(--font-main);
  font-size: 1rem;
  font-weight: 400;
  color: var(--m3-on-secondary-container);
  min-width: 3rem;
  text-align: center;
  flex-shrink: 0;
  line-height: 2.875rem;
  white-space: nowrap;
}
.word-pronunciation {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--m3-on-secondary-container);
  flex-shrink: 0;
}
.word-divider {
  width: 1px;
  height: 1.75rem;
  background-color: var(--m3-on-surface-variant);
  opacity: 0.3;
  flex-shrink: 0;
}
.word-meaning {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--m3-on-surface-variant);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.word-audio-btn {
  background-color: var(--m3-on-surface-variant);
  border: none;
  border-radius: 100px;
  width: 1.75rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--m3-background);
  transition: opacity 0.15s;
}
.word-audio-btn.disabled {
  background-color: rgba(226, 226, 233, 0.1);
  opacity: 0.38;
  cursor: not-allowed;
}
.word-audio-btn .material-symbols-rounded { font-size: 1.25rem; }

/* ── result screen ───────────────────────────── */
#result-screen.screen.active {
  /* garante que o screen seja exatamente o tamanho disponível, sem expandir */
  min-height: 0;
  overflow: hidden;
}
.result-content {
  flex: 1 1 0;
  height: 0;          /* truque: força flex a determinar a altura, em vez de usar conteúdo */
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding-block: 2rem;
  -webkit-overflow-scrolling: touch;
}

.end-content-header {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 0 1.5rem;
  width: 100%;
}

.stats-card {
  background-color: #D9DFF6;
  border-radius: 1.75rem;
  padding: 1.0625rem 1.125rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: #1d192b;
  width: 100%;
}
.stats-card h2 {
  font-size: 1rem;
  font-weight: 500;
  text-align: center;
  line-height: 2rem;
}
.stats-row {
  display: flex;
  align-items: center;
  justify-content: space-around;
  width: 100%;
  flex-wrap: wrap;
  text-align: center;
}
.stats-card .stat { display: grid; align-items: center; gap: 0.125rem; }
.stats-card .stat span { font-size: 0.875rem; font-weight: 500; }
.stats-card .stat strong { font-size: 0.875rem; font-weight: 500; }
.stat-divider {
  width: 80%;
  height: 1px;
  background-color: rgba(29, 25, 43, 0.2);
  margin-block: 0.3rem;
}

.final-actions {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  gap: 1rem;
  margin-top: 1rem;
  padding: 0 1.5rem;
  flex-shrink: 0;
}
.btn-primary-large {
  width: 100%;
  height: 3.5rem;
  border-radius: var(--border-radius-btn);
  background-color: var(--m3-primary);
  color: var(--m3-on-primary);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: var(--font-main);
  cursor: pointer;
  transition: transform 0.2s;
}
.btn-primary-large:active { transform: scale(0.98); }
.btn-primary-large .material-symbols-rounded { font-size: 1.25rem; }

.btn-text-sair {
  background: transparent;
  border: none;
  font-family: var(--font-main);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--hsk-muted);
  cursor: pointer;
  padding: 0.5rem;
  transition: transform 0.2s, opacity 0.2s;
  text-align: center;
}
.btn-text-sair:active { transform: scale(0.95); opacity: 0.8; }

/* ── animações ───────────────────────────────── */
@keyframes overlayFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes drawerSlideUp { from { transform: translate(-50%, 120%); } to { transform: translate(-50%, 0); } }
@keyframes wave { 0%, 100% { transform: scaleY(0.35); } 50% { transform: scaleY(1); } }

/* ──────────────────────────────────────────────
   Desktop: restaura os valores originais (fontes, paddings,
   ícones e tamanho das opções). No celular valem os valores
   base (menores) definidos acima. Ajuste o breakpoint (768px)
   se quiser outro corte.
   ────────────────────────────────────────────── */
@media (min-width: 768px) {
  /* títulos */
  .h1 { font-size: 1.5rem; }
  .drawer-title { font-size: 1.3rem; }
  .stats-card h2 { font-size: 1.5rem; }

  /* hanzi */
  .punct { font-size: 1.75rem; }
  .whz { font-size: 1.75rem; }
  .card-hanzi { font-size: 1.5rem; }
  .token-hz { font-size: 1.5rem; }
  .thz { font-size: 1.5rem; }
  .ohz { font-size: 1.5rem; }
  .ohz.big { font-size: 1.75rem; }
  .drawer-answer-row .ans-hanzi { font-size: 1.5rem; }
  .drawer-list-row .ans-hanzi { font-size: 1.25rem; }
  .word-character { font-size: 2.25rem; }

  /* texto de interface */
  .prompt { font-size: 1.125rem; }
  .big-prompt { font-size: 1.625rem; }
  .tip-body { font-size: 1.125rem; }
  .btn-tertiary { font-size: 1rem; }
  .cant { font-size: 1rem; }
  .drawer-answer-label { font-size: 1rem; }
  .drawer-answer-row .ans-pinyin { font-size: 1rem; }
  .drawer-answer-row .ans-traducao { font-size: 0.9375rem; }
  .drawer-action { font-size: 1rem; }
  .word-pronunciation { font-size: 1rem; }
  .stats-card .stat span { font-size: 1rem; }
  .stats-card .stat strong { font-size: 1.5rem; }
  .btn-primary-large { font-size: 1rem; }
  .btn-text-sair { font-size: 1rem; }

  /* layout: paddings, espaçamentos, ícones e tamanho das opções */
  .exercise-area { padding: 1rem 1.25rem 1.5rem; }
  .title-row { margin-block: 0.5rem; }
  .ex-icon-btn .material-symbols-rounded { font-size: 1.625rem; }
  .word { padding: 0 0.375rem; }
  .card { min-height: 5.6875rem; padding: 0.75rem 1rem; }
}
