/* Cores do Telegram quando disponíveis; padrão azul-marinho da marca fora dele. */
:root {
  --fundo: var(--tg-theme-bg-color, #10142e);
  --fundo2: var(--tg-theme-secondary-bg-color, #1b2147);
  --texto: var(--tg-theme-text-color, #f2f3fa);
  --apagado: var(--tg-theme-hint-color, #9aa0c3);
  --botao: var(--tg-theme-button-color, #f0901e);
  --botao-texto: var(--tg-theme-button-text-color, #ffffff);
  --ouro: #f5b922;
  --certo: #2fb36b;
  --errado: #e2504c;
  --c-constitucional: #2e9e5b;
  --c-civil: #2f6fd6;
  --c-processo_civil: #d4a017;
  --c-penal: #d64545;
  --c-processo_penal: #b07a45;
  --c-jurisprudencia: #2b2b2b;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--fundo); color: var(--texto); }
body { font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-tap-highlight-color: transparent; }
main { max-width: 520px; margin: 0 auto; padding: 16px 16px 32px; }
h1 { font-size: 22px; margin: 4px 0 12px; }
h2 { font-size: 18px; margin: 16px 0 8px; }
p { margin: 8px 0; }
.carregando, .apagado { color: var(--apagado); }
.centro { text-align: center; }

button {
  font: inherit; font-weight: 600; border: 0; border-radius: 12px; padding: 14px 16px; width: 100%;
  background: var(--botao); color: var(--botao-texto); cursor: pointer; margin-top: 10px;
}
button:disabled { opacity: .5; }
button.secundario { background: var(--fundo2); color: var(--texto); }
button.link { background: none; color: var(--apagado); font-weight: 400; padding: 8px; }

.cartao { background: var(--fundo2); border-radius: 14px; padding: 14px; margin: 10px 0; }
.partida { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.partida .info { flex: 1; min-width: 0; }
.partida .nome { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.selo { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 99px; background: var(--fundo); color: var(--apagado); }
.selo.vez { background: var(--botao); color: var(--botao-texto); }

.coruja { display: block; width: 150px; height: 150px; margin: 0 auto; object-fit: contain; }
.coruja.grande { width: 200px; height: 200px; }

/* Placar com as coroas de cada jogador */
.placar .linha { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.placar .quem { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.coroas { display: flex; gap: 4px; }
.coroa { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 14px;
         background: var(--fundo); opacity: .35; border: 2px solid transparent; }
.coroa.ganha { opacity: 1; border-color: var(--ouro); }
.rodada { color: var(--apagado); font-size: 14px; text-align: center; }

/* Roleta */
.roleta-caixa { position: relative; width: 260px; height: 260px; margin: 16px auto 4px; }
.ponteiro { position: absolute; top: -6px; left: 50%; transform: translateX(-50%); width: 0; height: 0; z-index: 2;
            border-left: 14px solid transparent; border-right: 14px solid transparent; border-top: 26px solid var(--ouro); }
.roleta { position: relative; width: 100%; height: 100%; border-radius: 50%; border: 6px solid var(--ouro);
          box-shadow: 0 0 24px rgba(245, 185, 34, .35); transition: transform 2.2s cubic-bezier(.17, .67, .21, 1); }
.roleta img { position: absolute; width: 58px; height: 58px; }
.miolo { position: absolute; inset: 0; margin: auto; width: 46px; height: 46px; border-radius: 50%;
         background: var(--ouro); box-shadow: inset 0 -4px 0 rgba(0,0,0,.2); }

/* Questão */
.topo-questao { display: flex; align-items: center; gap: 10px; }
.topo-questao img { width: 64px; height: 64px; }
.topo-questao .materia { font-weight: 700; }
.cabecalho { color: var(--apagado); font-size: 14px; }
.tempo { height: 8px; border-radius: 99px; background: var(--fundo); overflow: hidden; margin: 10px 0; }
.tempo div { height: 100%; background: var(--certo); transition: width 1s linear, background .3s; }
.tempo div.pouco { background: var(--errado); }
.contexto { font-style: italic; color: var(--apagado); }
.pergunta { font-size: 17px; white-space: pre-wrap; }
.opcao { text-align: left; background: var(--fundo2); color: var(--texto); font-weight: 500; border: 2px solid transparent; }
.opcao.certa, .opcao.errada { opacity: 1; }
.opcao.certa { border-color: var(--certo); background: color-mix(in srgb, var(--certo) 22%, var(--fundo2)); }
.opcao.errada { border-color: var(--errado); background: color-mix(in srgb, var(--errado) 22%, var(--fundo2)); }
.resultado { font-size: 20px; font-weight: 700; text-align: center; margin: 8px 0; }
.resultado.ok { color: var(--certo); }
.resultado.nao { color: var(--errado); }
details { background: var(--fundo2); border-radius: 12px; padding: 10px 12px; margin: 10px 0; }
summary { cursor: pointer; font-weight: 600; }
.dispositivo { white-space: pre-wrap; font-size: 14px; color: var(--apagado); }

/* Escolha da coroa */
.grade { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.grade button { margin: 0; padding: 8px 4px; font-size: 13px; background: var(--fundo2); color: var(--texto);
                border: 2px solid var(--cor, transparent); }
.grade img { width: 64px; height: 64px; display: block; margin: 0 auto 4px; }
button.pequeno { width: auto; margin: 0; padding: 10px 14px; }
.chave { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.chave input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--botao); flex: none; }
.erro { background: color-mix(in srgb, var(--errado) 25%, var(--fundo2)); border-radius: 12px; padding: 12px; }
