/* ===================== TEMA / VARIÁVEIS ===================== */
:root {
  --bg: #312a35;
  --surface: #3d3442;
  --surface-2: #483e4f;
  --slot-bg: #221d27;
  --slot-border: #6a5b70;
  --slot-border-filled: #8a7a90;
  --accent: #3aa394;
  --accent-dark: #2f8478;
  --present: #b59f3b;
  --correct: #57a05a;
  --wrong: #d64545;
  --text: #ffffff;
  --text-dim: #b8adbe;
  --text-faint: #8a7f90;
  --key-bg: #756a7a;
  --key-active: #5b515f;
  --radius: 8px;
  --radius-lg: 14px;
  --kb-height: 190px;
  /* Tetos de tamanho (crescem em telas maiores via media queries) */
  --slot-max: 44px;
  --clue-slot-max: 34px;
  --letter-gap: 5px;
  /* Largura do slot: nunca deixa a maior palavra (9 caracteres) estourar a tela */
  --slot-w: min(var(--slot-max), calc((100vw - 40px - 8 * var(--letter-gap)) / 9));
}

/* Alto contraste */
body.high-contrast {
  --bg: #100d13;
  --surface: #1c1720;
  --slot-bg: #000000;
  --slot-border: #b6a9bd;
  --text-dim: #e2dae6;
  --accent: #45c9b6;
}

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

html, body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Fredoka", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

/* ===================== HEADER ===================== */
.header {
  display: flex;
  justify-content: center;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  flex: 0 0 auto;
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  max-width: 640px;
}

.header__side {
  display: flex;
  gap: 8px;
  flex: 1 1 0;
}
.header__side--right { justify-content: flex-end; }

.header__title {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-align: center;
  white-space: nowrap;
  flex: 0 0 auto;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.15s, color 0.15s, transform 0.1s;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); }
.icon-btn:active { transform: scale(0.92); }
.icon-btn svg { width: 22px; height: 22px; fill: currentColor; }

/* ===================== SELETOR DE IDIOMA ===================== */
.lang-wrap { position: relative; }

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 168px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
  animation: pop 0.16s ease;
}
.lang-menu[hidden] { display: none; }

.lang-menu__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.lang-menu__item:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); }
.lang-menu__item--active {
  color: var(--text);
  background: rgba(58, 163, 148, 0.18);
}
.lang-menu__item--active::after {
  content: "✓";
  margin-left: auto;
  color: var(--accent);
  font-weight: 700;
}

/* ===================== TOAST DE NOVO DESAFIO ===================== */
.newday-toast {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100vw - 28px);
  padding: 10px 12px 10px 16px;
  background: var(--accent);
  color: #062622;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.45);
  animation: pop 0.22s ease;
}
.newday-toast button {
  border: none;
  border-radius: 6px;
  background: #062622;
  color: #fff;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 7px 12px;
  cursor: pointer;
  white-space: nowrap;
}
.newday-toast button:hover { filter: brightness(1.15); }

/* ===================== STATUS (estrelas / erros) ===================== */
.status {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  max-width: 860px;
  margin: 10px auto 0;
  padding: 0 16px;
}

.status__stars {
  display: flex;
  gap: 4px;
  font-size: 1.4rem;
  line-height: 1;
}
.star {
  transition: transform 0.2s, color 0.2s, opacity 0.2s;
}
.star--full { color: #f2c94c; }
.star--empty { color: var(--slot-border); opacity: 0.55; }
@keyframes starLose {
  0% { transform: scale(1); }
  40% { transform: scale(1.5) rotate(-15deg); }
  100% { transform: scale(1); }
}
.star--losing { animation: starLose 0.4s ease; }

.status__errors {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
  font-weight: 600;
  font-size: 1rem;
}
.status__errors svg { width: 18px; height: 18px; fill: var(--wrong); }
.status__errors--bump { animation: errBump 0.35s ease; }
@keyframes errBump {
  0% { transform: scale(1); }
  50% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

/* ===================== BOARD ===================== */
.board {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 18px 14px calc(var(--kb-height) + 24px);
  display: flex;
  flex-direction: column;
  gap: 22px;
  align-items: center;
}

.panel {
  width: 100%;
  max-width: 820px;
}

.panel__theme {
  text-align: center;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 6px;
}

.panel__label {
  font-size: 0.7rem;
  letter-spacing: 2px;
  color: var(--text-faint);
  text-align: center;
  margin-bottom: 12px;
  text-transform: uppercase;
}

/* ===================== FRASE PRINCIPAL ===================== */
.phrase {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 16px; /* linha x espaço entre palavras */
}

.word {
  display: flex;
  gap: var(--letter-gap);
}

/* ===================== CARD DE CARACTERE (SLOT) ===================== */
.slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: var(--slot-w);
  perspective: 500px;
}

.slot__box {
  width: 100%;
  aspect-ratio: 4 / 5;
  min-height: 30px;
  border: 2px solid var(--slot-border);
  border-radius: var(--radius);
  background: var(--slot-bg);
  display: grid;
  place-items: center;
  font-size: calc(var(--slot-w) * 0.56);
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, transform 0.08s;
  user-select: none;
}
.slot__box:active { transform: scale(0.95); }

.slot--filled .slot__box {
  border-color: var(--slot-border-filled);
  color: var(--text);
}

.slot--focused .slot__box {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 0 12px rgba(58, 163, 148, 0.35);
}

.slot__num {
  font-size: clamp(0.62rem, calc(var(--slot-w) * 0.3), 0.95rem);
  color: var(--text-faint);
  font-weight: 600;
  line-height: 1;
}

.slot--focused .slot__num { color: var(--accent); }

/* opção: destaque de slot desativado */
body.no-highlight .slot--focused .slot__box {
  box-shadow: none;
  border-color: var(--slot-border-filled);
}
body.no-highlight .slot--focused .slot__num { color: var(--text-faint); }

/* pulso quando é preenchido por sincronização */
@keyframes slotPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.12); }
  100% { transform: scale(1); }
}
.slot--pop .slot__box { animation: slotPop 0.22s ease; }

/* Caractere especial (espaço, pontuação) exibido aberto */
.static-char {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 8px;
  width: calc(var(--slot-w) * 0.45);
  align-self: stretch;
  padding-bottom: calc(var(--slot-w) * 0.45); /* alinha à altura da caixa, ignorando o número */
  font-size: calc(var(--slot-w) * 0.56);
  font-weight: 700;
  color: var(--text-dim);
}

/* ===================== PISTAS ===================== */
/* Sempre em lista de coluna única (web e mobile), nunca em grade */
.clues {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 560px;
  margin-inline: auto;
}

.clue {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Dica bloqueada: conteúdo borrado + botão para revelar */
.clue--blurred .clue__hint,
.clue--blurred .clue__answer {
  filter: blur(6px);
  opacity: 0.45;
  pointer-events: none;
  user-select: none;
}

.clue__unlock {
  position: absolute;
  inset: 0;
  margin: auto;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: fit-content;
  height: fit-content;
  padding: 10px 16px;
  border: none;
  border-radius: var(--radius);
  background: var(--accent);
  color: #062622;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  transition: filter 0.12s, transform 0.06s;
}
.clue--blurred .clue__unlock { display: inline-flex; }
.clue__unlock:hover { filter: brightness(1.08); }
.clue__unlock:active { transform: scale(0.96); }
.clue__unlock .cost {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: #7a5a00;
}
.clue__unlock:disabled {
  background: var(--surface-2);
  color: var(--text-faint);
  cursor: not-allowed;
  box-shadow: none;
}
.clue__unlock:disabled .cost { color: var(--text-faint); }

.clue--solved {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* Pista resolvida: células viram verde com animação de flip escalonada */
.clue--solved .slot__box {
  background: var(--correct);
  border-color: var(--correct);
  color: #ffffff;
  cursor: default;
  box-shadow: none;
  animation: flipGreen 0.55s ease both;
}
.clue--solved .slot:nth-child(2) .slot__box { animation-delay: 0.08s; }
.clue--solved .slot:nth-child(3) .slot__box { animation-delay: 0.16s; }
.clue--solved .slot:nth-child(4) .slot__box { animation-delay: 0.24s; }
.clue--solved .slot:nth-child(5) .slot__box { animation-delay: 0.32s; }
.clue--solved .slot:nth-child(6) .slot__box { animation-delay: 0.40s; }

@keyframes flipGreen {
  0% {
    transform: rotateX(0deg);
    background: var(--slot-bg);
    border-color: var(--slot-border-filled);
  }
  45% {
    transform: rotateX(90deg);
    background: var(--slot-bg);
    border-color: var(--slot-border-filled);
  }
  55% {
    transform: rotateX(90deg);
    background: var(--correct);
    border-color: var(--correct);
  }
  100% {
    transform: rotateX(0deg);
    background: var(--correct);
    border-color: var(--correct);
  }
}

/* Vitória: revelação em flip verde de toda a frase (delay escalonado via JS) */
.slot--reveal .slot__box {
  background: var(--correct);
  border-color: var(--correct);
  color: #ffffff;
  box-shadow: none;
  animation: flipGreen 0.55s ease both;
  animation-delay: var(--reveal-delay, 0ms);
}

/* Pista errada ao completar: shake + contorno vermelho */
.clue--wrong {
  outline: 2px solid var(--wrong);
  outline-offset: -2px;
  animation: clueShake 0.4s ease;
}

@keyframes clueShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.clue__hint {
  font-size: 0.92rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 8px;
}
.clue__hint::before {
  content: var(--clue-badge, "DICA");
  font-size: 0.6rem;
  letter-spacing: 1px;
  background: var(--surface-2);
  color: var(--text-faint);
  padding: 3px 6px;
  border-radius: 5px;
  flex: 0 0 auto;
}

.clue__answer {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
}
.clue .slot { --slot-w: min(var(--clue-slot-max), calc((100vw - 110px) / 6)); }

/* ===================== TECLADO ===================== */
.keyboard {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 20;
  margin-inline: auto;
  max-width: var(--kb-max, none);
  background: var(--bg);
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: var(--key-gap, 6px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.kb-row {
  display: flex;
  justify-content: center;
  gap: var(--key-gap, 5px);
}

.key {
  flex: 1 1 auto;
  max-width: var(--key-w, 44px);
  height: var(--key-h, 52px);
  border: none;
  border-radius: var(--radius);
  background: var(--key-bg);
  color: var(--text);
  font-family: inherit;
  font-size: var(--key-font, 1rem);
  font-weight: 600;
  text-transform: uppercase;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.1s, transform 0.06s;
  user-select: none;
}
.key:active,
.key.key--pressed { background: var(--key-active); transform: translateY(1px); }

/* Letra já usada: some do teclado, mas mantém o espaço para não deslocar o layout */
.key--used {
  visibility: hidden;
  pointer-events: none;
}

.key--wide { max-width: var(--key-wide-w, 72px); flex: 1.6 1 auto; font-size: 0.72rem; letter-spacing: 0.5px; }
.key svg { width: 22px; height: 22px; fill: currentColor; }

/* ===================== MODAIS ===================== */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.6);
  display: grid;
  place-items: center;
  padding: 20px;
  backdrop-filter: blur(2px);
  animation: fade 0.18s ease;
}
.overlay[hidden] { display: none; }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(0.97); } to { opacity: 1; transform: none; } }

.modal {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 26px 24px 24px;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  text-align: center;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
  animation: pop 0.22s ease;
}
.modal[hidden] { display: none; }

.modal__close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}
.modal__close:hover { color: var(--text); }

.modal__title { font-size: 1.4rem; margin-bottom: 14px; font-weight: 700; }
.modal__text { color: var(--text-dim); line-height: 1.5; margin-bottom: 10px; font-weight: 500; }
.modal__text--small { font-size: 0.82rem; }

.modal__legend {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  background: var(--slot-bg);
  border-radius: var(--radius);
  padding: 12px;
  margin: 16px 0;
}
.legend-slot { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.legend-slot__box {
  width: 36px; height: 44px;
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  display: grid; place-items: center;
  font-weight: 700; font-size: 1.3rem;
}
.legend-slot__num { font-size: 0.68rem; color: var(--accent); font-weight: 600; }

/* Regras de pontuação no tutorial */
.tut-rule {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  background: var(--slot-bg);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 8px;
}
.tut-rule__icon {
  flex: 0 0 auto;
  font-size: 1rem;
  line-height: 1;
  min-width: 2.4em;
  text-align: center;
}
.tut-rule .modal__text { margin-bottom: 0; }

.modal__reveal {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent);
  margin: 14px 0 20px;
  letter-spacing: 1px;
}

.btn {
  border: none;
  border-radius: var(--radius);
  padding: 12px 20px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  margin-top: 8px;
  transition: filter 0.12s, transform 0.06s;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); color: #062622; }
.btn--primary:hover { filter: brightness(1.08); }
.btn--ghost { background: transparent; border: 1px solid var(--slot-border); color: var(--text-dim); margin-top: 18px; }
.btn--ghost:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }

/* Estatísticas */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: 10px 0 18px;
}
.stat { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.stat__num { font-size: 1.7rem; font-weight: 700; line-height: 1; }
.stat__label {
  font-size: 0.64rem;
  color: var(--text-faint);
  text-align: center;
  line-height: 1.2;
}

.stats-subtitle {
  font-size: 0.72rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 700;
  margin: 4px 0 12px;
}

/* Distribuição por estrelas */
.dist { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.dist-row { display: flex; align-items: center; gap: 8px; }
.dist-row__label {
  flex: 0 0 auto;
  font-size: 0.85rem;
  color: var(--present);
  letter-spacing: 1px;
  width: 3.4em;
  text-align: left;
}
.dist-row__track { flex: 1 1 auto; display: flex; }
.dist-row__bar {
  background: var(--slot-border);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
  min-width: 1.7rem;
  padding: 3px 8px;
  border-radius: 4px;
  text-align: right;
  box-sizing: border-box;
  transition: width 0.5s ease;
}
.dist-row__bar--current { background: var(--correct); }

/* Botão compartilhar */
.btn--share {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn--share svg { width: 18px; height: 18px; fill: currentColor; }
.btn--copied { background: var(--correct); color: #fff; }

/* Ações do modal de vitória */
.win-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}
.win-actions .btn { margin-top: 0; }
.win-actions .btn--ghost { margin-top: 0; order: 2; }
.win-actions .btn--share { order: 1; }

.win-countdown {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin: 14px 0 0;
  padding: 10px 12px;
  background: var(--slot-bg);
  border-radius: var(--radius);
  font-size: 0.88rem;
  color: var(--text-dim);
  text-align: center;
}

.win-countdown__time {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}

.no-challenge {
  text-align: center;
  color: var(--text-dim);
  font-size: 1rem;
  padding: 24px 12px;
}

.win-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 14px 0 0;
  padding: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  text-align: center;
}

.win-hint__text {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.45;
}

.win-hint__btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.win-hint__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  background: var(--slot-bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.win-hint__btn:hover {
  background: rgba(58, 163, 148, 0.18);
  border-color: rgba(58, 163, 148, 0.45);
}

.win-hint__btn:active {
  transform: scale(0.96);
}

/* Jogo travado após vitória do dia */
body.game--locked .board,
body.game--locked .keyboard,
body.game--locked .status {
  pointer-events: none;
  user-select: none;
}

body.game--locked #btn-help,
body.game--locked #btn-stats,
body.game--locked #btn-settings {
  pointer-events: none;
  opacity: 0.35;
}

body.game--locked .lang-wrap {
  pointer-events: auto;
}

.overlay--win-locked {
  cursor: default;
}

.overlay--win-locked .modal--win .modal__close {
  display: none;
}

/* Configurações */
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-dim);
  cursor: pointer;
  font-weight: 500;
}
.setting-row input { width: 20px; height: 20px; accent-color: var(--accent); cursor: pointer; }

/* Vitória */
.modal--win { overflow: hidden; }
.confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle, var(--accent) 3px, transparent 4px),
    radial-gradient(circle, var(--present) 3px, transparent 4px),
    radial-gradient(circle, #e06c9f 3px, transparent 4px);
  background-size: 60px 60px, 90px 90px, 70px 70px;
  background-position: 0 0, 20px 30px, 40px 10px;
  opacity: 0.18;
}

/* ===================== RESPONSIVO ===================== */

/* Tablet / web: elementos ocupam mais da tela (estilo term.ooo) */
@media (min-width: 720px) {
  :root {
    --kb-height: 232px;
    --slot-max: 56px;
    --clue-slot-max: 46px;
    --letter-gap: 6px;
    --kb-max: 720px;
    --key-w: 58px;
    --key-h: 64px;
    --key-font: 1.15rem;
    --key-wide-w: 96px;
    --key-gap: 8px;
  }
  .header {
    padding: 16px 24px;
  }
  .header__inner {
    max-width: 760px;
    gap: 20px;
  }
  .header__title {
    font-size: 2.15rem;
    letter-spacing: 4px;
  }
  .header__side { gap: 10px; }
  .icon-btn {
    width: 48px;
    height: 48px;
  }
  .icon-btn svg {
    width: 27px;
    height: 27px;
  }
  .panel__theme {
    font-size: 1.22rem;
    margin-bottom: 8px;
  }
  .board { padding-top: 30px; gap: 30px; }
  .panel { max-width: 860px; }
  .clue__hint { font-size: 1rem; }
  .clues { gap: 16px; }
}

/* Desktop grande */
@media (min-width: 1080px) {
  :root {
    --kb-height: 250px;
    --slot-max: 64px;
    --clue-slot-max: 52px;
    --kb-max: 820px;
    --key-w: 64px;
    --key-h: 70px;
    --key-font: 1.25rem;
    --key-wide-w: 108px;
  }
  .header__inner { max-width: 820px; }
  .header__title {
    font-size: 2.5rem;
    letter-spacing: 5px;
  }
  .icon-btn {
    width: 54px;
    height: 54px;
  }
  .icon-btn svg {
    width: 30px;
    height: 30px;
  }
  .panel__theme {
    font-size: 1.32rem;
  }
  .panel { max-width: 920px; }
}

/* Mobile: reduz respiros e empilha as pistas */
@media (max-width: 620px) {
  .board {
    padding: 12px 10px calc(var(--kb-height) + 16px);
    gap: 16px;
  }
  .clues { gap: 10px; }
  .panel__label { margin-bottom: 8px; }
}

@media (max-width: 400px) {
  :root { --kb-height: 172px; }
  .key { height: 46px; }
  .keyboard { gap: 5px; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .kb-row { gap: 4px; }
}

@media (min-height: 900px) {
  .board { justify-content: flex-start; }
}

/* ===================== SEO (conteúdo indexável) ===================== */
.seo-footer {
  width: 100%;
  max-width: 820px;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.seo-footer__text {
  margin: 0;
  padding: 0 8px;
  font-size: 0.72rem;
  line-height: 1.5;
  text-align: center;
  color: var(--text-faint);
}

.seo-footer__text[lang="en"] {
  color: color-mix(in srgb, var(--text-faint) 85%, var(--accent) 15%);
}

.seo-footer__text a {
  color: var(--accent);
  text-decoration: none;
}

.seo-footer__text a:hover {
  text-decoration: underline;
}

.seo-noscript {
  margin: 0;
  padding: 12px 16px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-faint);
}

.seo-noscript + .seo-noscript {
  padding-top: 0;
}

.seo-noscript a {
  color: var(--accent);
}
