/* Shared look of the daily games: the site's night purple, a compact top bar, the board, then text about the game. */
:root {
  --bg: #070611;
  --surface: #120d20;
  --surface-2: #1c1530;
  --line: rgba(200, 170, 255, 0.14);
  --text: #f1ecff;
  --muted: #a49bb8;
  --soft: #d4cce6;
  --accent: #9b5cff;
  --accent-hover: #b07dff;
  --hot: #ff8a3d;
  --green: #2fbf71;
  --yellow: #e8b931;
  --red: #e5484d;
  --font: "Inter", "Segoe UI", system-ui, sans-serif;
  --display: "Exo 2", "Inter", system-ui, sans-serif;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent-hover);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--display);
}

button {
  font-family: inherit;
}

/* ---------- top bar ---------- */

.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px max(12px, calc((100% - 640px) / 2));
  background: rgba(7, 6, 17, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.bar__back {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--muted);
  border-radius: 8px;
  text-decoration: none;
}

.bar__back img {
  width: 28px;
}

.bar__title {
  flex: 1;
  min-width: 0;
  font-family: var(--display);
  font-size: 19px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar__title small {
  margin-left: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  font-size: 18px;
  color: var(--soft);
  background: none;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.icon-btn:hover,
.icon-btn:focus-visible {
  background: var(--surface-2);
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* account button (conta.js), same as the site's */
.conta {
  position: relative;
  flex: none;
  margin-left: 4px;
}
.conta__entrar,
.conta__nome {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  font: 600 13px var(--font);
  color: var(--text);
  text-decoration: none;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}
.conta__nome span:last-child {
  max-width: 7em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.conta__avatar {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--hot));
  border-radius: 50%;
}
.conta__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  display: grid;
  min-width: 150px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}
.conta__menu[hidden] {
  display: none;
}
.conta__info {
  padding: 6px 10px;
  font-size: 12px;
  color: var(--muted);
}
.conta__menu button {
  padding: 8px 10px;
  font: 600 14px var(--font);
  color: var(--text);
  text-align: left;
  background: none;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}
@media (max-width: 420px) {
  .conta__nome span:last-child {
    display: none;
  }
  .bar__title {
    font-size: 17px;
  }
  .bar__title small {
    display: none;
  }
  .bar .icon-btn {
    width: 32px;
  }
}

/* ---------- page ---------- */

.game {
  width: min(100%, 640px);
  margin: 0 auto;
  padding: 16px 16px 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  font: 700 16px var(--font);
  color: #fff;
  text-decoration: none;
  background: var(--accent);
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}

.btn:hover {
  background: var(--accent-hover);
}

.btn--ghost {
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.btn--ghost:hover {
  background: #261d40;
}

/* guess input with suggestions */
.palpite {
  position: relative;
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.palpite[hidden] {
  display: none;
}

.palpite input {
  flex: 1;
  min-width: 0;
  padding: 13px 14px;
  font: 16px var(--font);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.palpite input:focus {
  outline: 2px solid var(--accent);
  border-color: transparent;
}

.sugestoes {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 4px);
  z-index: 5;
  max-height: 240px;
  margin: 0;
  padding: 4px;
  overflow-y: auto;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
}

.sugestoes[hidden] {
  display: none;
}

.sugestoes li {
  padding: 9px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.sugestoes li[aria-selected="true"],
.sugestoes li:hover {
  background: var(--surface-2);
}

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

/* result panel */
.fim {
  margin-top: 16px;
  padding: 18px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.fim h2 {
  font-size: 22px;
}

.fim p {
  margin: 6px 0;
  color: var(--soft);
}

.fim__acoes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.fim__prox {
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
}

.fim__prox b {
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.outro {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 12px 14px;
  text-align: left;
  text-decoration: none;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.outro span:first-child {
  font-size: 28px;
}

.outro small {
  display: block;
  color: var(--muted);
}

/* ---------- dialogs, toast ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(3, 2, 8, 0.75);
  animation: fade 0.15s ease;
}

.modal__box {
  position: relative;
  width: min(100%, 460px);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.modal__box h2 {
  margin-right: 36px;
  font-size: 21px;
}

.modal__body {
  margin-top: 10px;
  color: var(--soft);
  font-size: 15px;
}

.modal__body p {
  margin: 8px 0;
}

.modal__close {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 36px;
  height: 36px;
  font-size: 24px;
  line-height: 1;
  color: var(--muted);
  background: none;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.copiar {
  width: 100%;
  padding: 10px;
  font: 14px var(--font);
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.toast {
  position: fixed;
  left: 50%;
  top: 70px;
  z-index: 200;
  padding: 10px 16px;
  font-weight: 600;
  color: #111;
  background: #f1ecff;
  border-radius: 10px;
  opacity: 0;
  pointer-events: none;
  translate: -50% -10px;
  transition: opacity 0.2s, translate 0.2s;
}

.toast--on {
  opacity: 1;
  translate: -50% 0;
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  text-align: center;
}

.stats b {
  display: block;
  font: 800 26px var(--display);
  color: var(--text);
}

.stats span {
  font-size: 12px;
  color: var(--muted);
}

.sub {
  margin: 18px 0 8px;
  font-size: 15px;
  color: var(--text);
}

.dist__row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
  font-size: 13px;
}

.dist__row > span {
  width: 24px;
  text-align: right;
}

.dist__bar {
  padding: 1px 6px;
  font-weight: 700;
  text-align: right;
  color: #fff;
  background: var(--surface-2);
  border-radius: 4px;
}

.dist__bar--on {
  background: var(--green);
}

.nota {
  font-size: 13px;
  color: var(--muted);
}

.placar {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.placar li {
  display: grid;
  grid-template-columns: 28px 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 7px 8px;
  border-radius: 8px;
}

.placar li:nth-child(odd) {
  background: rgba(255, 255, 255, 0.03);
}

.placar__eu {
  outline: 1px solid var(--accent);
}

.placar__pos {
  font-weight: 800;
  color: var(--muted);
}

.placar__nome {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  color: var(--text);
}

.placar__hora {
  font-size: 12px;
  color: var(--muted);
}

.exemplo {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}

/* ---------- text below the game (what it is, how to play, questions) ---------- */

.texto {
  width: min(100%, 640px);
  margin: 28px auto 0;
  padding: 0 16px 40px;
  color: var(--soft);
  font-size: 15px;
}

.texto h2 {
  margin: 26px 0 8px;
  font-size: 20px;
  color: var(--text);
}

.texto h3 {
  margin: 16px 0 4px;
  font-size: 16px;
  color: var(--text);
}

.texto p {
  margin: 8px 0;
}

.rodape {
  padding: 18px 16px 30px;
  font-size: 13px;
  text-align: center;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- multiple-choice games (comum/quiz.js) ---------- */

.quiz__progresso {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 4px 0 14px;
}

.quiz__ponto {
  width: 22px;
  height: 8px;
  background: var(--surface-2);
  border-radius: 4px;
}

.quiz__ponto--agora {
  background: var(--accent);
}

.quiz__ponto--certo {
  background: var(--green);
}

.quiz__ponto--errado {
  background: var(--red);
}

.quiz[hidden] {
  display: none;
}

.quiz__passo {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.quiz__pergunta {
  margin: 6px 0 14px;
  font-size: 19px;
  line-height: 1.35;
}

.quiz__opcoes {
  display: grid;
  gap: 8px;
}

.quiz__opcao {
  padding: 14px 16px;
  font: 600 16px var(--font);
  text-align: left;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.quiz__opcao:hover:not([disabled]) {
  border-color: var(--accent);
  background: var(--surface-2);
}

.quiz__opcao small {
  display: block;
  font-weight: 500;
  color: var(--muted);
}

.quiz__opcao[disabled] {
  cursor: default;
}

.quiz__opcao--certa {
  border-color: var(--green);
  background: rgba(47, 191, 113, 0.18);
}

.quiz__opcao--errada {
  border-color: var(--red);
  background: rgba(229, 72, 77, 0.18);
}

.quiz__opcao--apagada {
  opacity: 0.55;
}

.quiz__depois {
  margin: 12px 0 0;
  color: var(--soft);
  font-size: 15px;
}

.quiz__proxima {
  width: 100%;
  margin-top: 12px;
}

/* two big cards side by side (Mais ou Menos) */
.quiz--duelo .quiz__opcoes {
  grid-template-columns: 1fr 1fr;
}

.quiz--duelo .quiz__opcao {
  display: grid;
  align-content: center;
  min-height: 120px;
  text-align: center;
  font-size: 18px;
}

.quiz--duelo .quiz__opcao b {
  display: block;
  margin-top: 6px;
  font-size: 15px;
  color: var(--text);
}

.quiz--opcoes2 .quiz__opcoes {
  grid-template-columns: 1fr 1fr;
}

.quiz--grade .quiz__opcoes {
  grid-template-columns: repeat(3, 1fr);
}

.quiz--grade .quiz__opcao {
  padding: 12px 8px;
  text-align: center;
}

/* ---------- quiz animations ---------- */

.quiz__corpo--entra {
  animation: quiz-entra 0.38s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.quiz__corpo--entra .quiz__opcao {
  animation: quiz-sobe 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
}

.quiz__corpo--entra .quiz__opcao:nth-child(2) {
  animation-delay: 0.06s;
}

.quiz__corpo--entra .quiz__opcao:nth-child(3) {
  animation-delay: 0.12s;
}

.quiz__corpo--entra .quiz__opcao:nth-child(n + 4) {
  animation-delay: 0.18s;
}

.quiz__opcao {
  position: relative;
  overflow: visible;
}

.quiz__opcao:active:not([disabled]) {
  transform: scale(0.97);
}

.quiz__opcao--pulo {
  animation: quiz-pulo 0.55s cubic-bezier(0.3, 1.6, 0.5, 1);
  box-shadow: 0 0 0 2px var(--green), 0 0 28px rgba(47, 191, 113, 0.45);
}

.quiz__opcao--treme {
  animation: quiz-treme 0.45s ease;
}

.quiz__valor {
  display: block;
  margin-top: 8px;
  font: 800 17px var(--display);
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.quiz__opcao--certa .quiz__valor {
  color: #7ff0b0;
}

.quiz__depois--entra {
  animation: quiz-sobe 0.4s 0.25s ease backwards;
}

.quiz__fogo {
  margin-left: 6px;
  padding: 1px 8px;
  color: #111;
  background: linear-gradient(90deg, #ffb347, #ff6a3d);
  border-radius: 999px;
  animation: quiz-pulo 0.5s ease;
}

.quiz__ponto {
  transition: background 0.3s, transform 0.3s;
}

.quiz__ponto--agora {
  transform: scaleY(1.4);
}

.confete {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 12px;
  border-radius: 2px;
  pointer-events: none;
  animation: confete 0.9s cubic-bezier(0.1, 0.7, 0.3, 1) forwards;
}

@keyframes quiz-entra {
  from {
    opacity: 0;
    transform: translateX(28px);
  }
}

@keyframes quiz-sobe {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }
}

@keyframes quiz-pulo {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes quiz-treme {
  0%,
  100% {
    transform: translateX(0);
  }
  20%,
  60% {
    transform: translateX(-8px);
  }
  40%,
  80% {
    transform: translateX(8px);
  }
}

@keyframes confete {
  from {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(0);
  }
  to {
    opacity: 0;
    transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y) + 40px)) rotate(var(--r));
  }
}

.duelo-nome {
  font: 800 22px var(--display);
  letter-spacing: 0.01em;
}

/* ---------- ad spaces (site/anuncios.js): hidden until ads are turned on ---------- */

.anuncio {
  display: none;
}

.com-anuncios .anuncio--faixa {
  display: block;
  width: min(100% - 32px, 728px);
  min-height: 100px;
  margin: 24px auto 0;
}

/* The rails sit in the empty sides of a wide screen, beside the 640px game, and follow the scroll. */
@media (min-width: 1080px) {
  .com-anuncios .anuncio--lateral {
    position: fixed;
    top: 76px;
    display: block;
    width: 160px;
    height: 600px;
  }
  .anuncio--esquerda {
    right: calc(50% + 344px);
  }
  .anuncio--direita {
    left: calc(50% + 344px);
  }
}

@media (min-width: 1380px) {
  .com-anuncios .anuncio--lateral {
    width: 300px;
  }
}

.anuncio__rotulo {
  display: block;
  margin-bottom: 4px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
  color: var(--muted);
}

.anuncio__teste {
  display: grid;
  place-items: center;
  height: calc(100% - 18px);
  min-height: 90px;
  font: 700 13px var(--font);
  color: var(--muted);
  background: repeating-linear-gradient(45deg, #1c1530 0 10px, #241b3d 10px 20px);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.rodape a {
  color: var(--muted);
}

.curiosidades {
  display: grid;
  gap: 6px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

.curiosidades li {
  padding: 8px 12px;
  font-size: 14px;
  color: var(--soft);
  background: var(--surface-2);
  border-radius: 10px;
}

/* Touch: the first tap marks an option, the second confirms (Diario.opcoesPorToque). */
.sugestoes li.tocada {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--accent, #8b6cff);
}

.sugestoes li.tocada::after {
  content: "toque de novo ✓";
  margin-left: auto;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent, #8b6cff);
  white-space: nowrap;
}
