/* ===== Stop (a folha de responder, no lugar da DM) ===== */
@font-face {
  font-family: "Caderno"; font-display: swap;
  src: url("PatrickHand-Regular.ttf") format("truetype");
}

body.modo-stop .cena { background: radial-gradient(900px 600px at 50% 0%, rgba(50,84,150,.5), transparent 70%),
  linear-gradient(180deg, #12203c, #0b1426); }
body.modo-stop .tint:not(.base) { opacity: 0 !important; }

.stop {
  --st-papel: #fbf6e4; --st-pauta: #bfd0e6; --st-tinta: #223a86; --st-lapis: #5f6373; --st-texto: #2b2a33;
  --st-vermelho: #d6372f; --st-margem: rgba(214,55,47,.42);
  --st-mao: "Caderno", "Bradley Hand", "Segoe Print", "Chalkboard SE", cursive;
  /* A folha toda anda nesta grade: cada texto ocupa uma linha da pauta e tudo o
     que não é texto mede um número inteiro de linhas, senão a escrita sai da
     pauta dali para baixo. */
  --st-linha: 32px;
  position: fixed; inset: 0; z-index: 4; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  /* As margens --in-* incluem a barra do Discord no celular (Virtuoso / Sair). */
  padding: max(12px, var(--in-top)) max(12px, var(--in-right)) max(12px, var(--in-bottom)) max(12px, var(--in-left));
}

.st-folha {
  position: relative; width: min(100%, 560px); flex: none; box-sizing: border-box; color: var(--st-texto);
  padding: 0 16px 16px 38px; border-radius: 6px;
  font: 400 21px/var(--st-linha) var(--st-mao);
  background: linear-gradient(90deg, transparent 27px, var(--st-margem) 27px 29px, transparent 29px),
    repeating-linear-gradient(180deg, transparent 0 calc(var(--st-linha) - 1px), var(--st-pauta) calc(var(--st-linha) - 1px) var(--st-linha)),
    var(--st-papel);
  box-shadow: 0 1px 0 rgba(255,255,255,.7) inset, 0 16px 40px rgba(0,0,0,.45);
}
/* Com a linha do texto centrada, a letra flutua entre duas pautas: `--st-apoio`
   a desce até encostar na de baixo. Letra maior já cai mais baixo e desce menos. */
.st-folha p, .st-folha h2, .st-tit b, .st-tit small, .st-rotulo, .st-cat, .st-texto, .st-relogio b, .st-lista-cats {
  position: relative; top: var(--st-apoio, 3px);
}

.st-topo { display: flex; align-items: center; gap: 12px; height: calc(var(--st-linha) * 2); }
.st-letra {
  flex: none; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; margin-left: -4px;
  border: 3.5px solid var(--st-vermelho); color: var(--st-vermelho); background: var(--st-papel);
  font: 900 33px/1 system-ui, sans-serif; transform: rotate(-7deg);
}
.st-letra.girando { filter: blur(.6px); opacity: .75; }
.st-letra.caiu { animation: st-carimbo .32s cubic-bezier(.2, 1.5, .4, 1); }
@keyframes st-carimbo { from { transform: rotate(-20deg) scale(1.9); opacity: 0; } to { transform: rotate(-7deg) scale(1); opacity: 1; } }

.st-tit { flex: 1; min-width: 0; display: flex; flex-direction: column; align-self: flex-start; }
.st-tit b { font-size: 25px; font-weight: 400; color: var(--st-tinta); line-height: var(--st-linha); --st-apoio: 2px; }
.st-tit small { font-size: 19px; color: var(--st-lapis); line-height: var(--st-linha); }
.st-relogio b { display: block; font-size: 38px; font-weight: 400; line-height: 1; color: var(--st-tinta); --st-apoio: 0; }
.st-relogio b.urgente, .st-relogio.graca b { color: var(--st-vermelho); animation: st-pulso 1s ease-in-out infinite; }
@keyframes st-pulso { 50% { transform: scale(1.12); } }

.st-pips { display: flex; gap: 5px; height: var(--st-linha); align-items: center; }
.st-pips i { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--st-tinta); opacity: .35; }
.st-pips i.feito { background: var(--st-tinta); opacity: .75; }
.st-pips i.agora { opacity: 1; box-shadow: 0 0 0 3px rgba(34,58,134,.2); }
.st-pips small { font-size: 19px; color: var(--st-vermelho); }
.st-rotulo { display: block; font-size: 30px; color: var(--st-texto); line-height: var(--st-linha); --st-apoio: 0; }
/* O campo é a própria linha do caderno: sem caixa, a tinta direto na pauta. */
.st-input {
  display: block; width: 100%; height: var(--st-linha); box-sizing: border-box; margin: 0; padding: 5px 0 0;
  border: 0; border-radius: 0; outline: 0; background: transparent; color: var(--st-tinta);
  font: 400 27px/1 var(--st-mao);
}
.st-input::placeholder { color: #9ca2b3; }
.st-input:focus { box-shadow: inset 0 -2px 0 var(--st-tinta); }
.st-input.erra { animation: st-erra .3s; box-shadow: inset 0 -2px 0 var(--st-vermelho); }
@keyframes st-erra { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.st-acoes { display: flex; gap: 8px; height: calc(var(--st-linha) * 2); align-items: center; }
.st-bt {
  flex: 1; height: 48px; border-radius: 8px; border: 2px solid var(--st-tinta); background: var(--st-papel);
  color: var(--st-tinta); font: 400 22px/1 var(--st-mao); cursor: pointer;
}
.st-bt.forte { flex: 2; background: var(--st-tinta); color: #fff; }
.st-bt:active { transform: translateY(1px); }

.st-corpo:empty { display: none; }
.st-corpo h2 { margin: 0; font-size: 30px; font-weight: 400; color: var(--st-tinta); line-height: var(--st-linha); --st-apoio: 0; }
.st-corpo p { margin: 0; }
.st-lista-cats { color: var(--st-tinta); }
.st-lista-cats b { font-weight: 400; color: var(--st-lapis); }

.st-corpo p b { font-weight: 400; color: var(--st-tinta); }
.st-lista { list-style: none; margin: 0; padding: 0; }
.st-lista li { position: relative; }
.st-lista li > :is(div, button) {
  all: unset; box-sizing: border-box; width: 100%; height: var(--st-linha); display: flex; align-items: baseline; gap: 8px;
  font: 400 21px/var(--st-linha) var(--st-mao);
}
/* A correção: caneta vermelha por cima da tinta azul, e o marca-texto na
   categoria que está no chat. */
.st-lista li.agora { background: linear-gradient(transparent 3px, rgba(255,225,70,.55) 3px calc(var(--st-linha) - 3px), transparent calc(var(--st-linha) - 3px)); }
.st-marca {
  position: absolute; left: -34px; top: 5px; width: 21px; height: 21px; fill: none; stroke: #1f8a5b;
  stroke-width: 3.6; stroke-linecap: round; stroke-linejoin: round;
}
.st-marca.xis { stroke: var(--st-vermelho); }
.st-marca path { stroke-dasharray: 40; }
li.novo .st-marca path { animation: st-traco .45s ease-out both; }
@keyframes st-traco { from { stroke-dashoffset: 40; } to { stroke-dashoffset: 0; } }
.st-pts { flex: none; margin-left: auto; position: relative; top: 2px; font-size: 25px; color: var(--st-vermelho); }
.st-pts.zero { color: #9195a3; }
li.novo .st-pts { animation: st-ponto .35s cubic-bezier(.2, 1.6, .4, 1) .2s both; }
@keyframes st-ponto { from { transform: scale(2); opacity: 0; } }
.st-empate { flex: none; position: relative; top: 2px; font-size: 19px; color: var(--st-lapis); }
.st-lista li.errada .st-texto:not(.vazia) { color: #8a8e9d; text-decoration: line-through 2px var(--st-vermelho); }
.st-motivo { margin: 0; font-size: 19px; color: var(--st-vermelho); --st-apoio: 4px; }
.st-total { margin: 0; font-size: 25px; text-align: right; --st-apoio: 2px; }
.st-numero { position: relative; display: inline-block; min-width: 2.4em; text-align: right; }
.st-numero b { display: inline-block; font-size: 30px; font-weight: 400; color: #3b3b48; }
/* A borracha: esfrega de um lado a outro, o grafite some aos poucos e o farelo cai. */
.st-borracha {
  position: absolute; right: -2px; top: 6px; width: 38px; height: 18px; border-radius: 4px; opacity: 0; pointer-events: none;
  background: linear-gradient(90deg, #f4a3ad 0 62%, #4a70c8 62% 100%); box-shadow: 0 2px 3px rgba(0,0,0,.28);
}
.st-farelo {
  position: absolute; left: 50%; top: 22px; width: 3px; height: 2px; border-radius: 1px; opacity: 0; pointer-events: none; color: #c98f97;
  box-shadow: -14px 0 currentColor, -7px 2px currentColor, 5px -1px currentColor, 12px 1px currentColor, 19px 0 currentColor;
}
.st-numero.apaga b { animation: st-apagando .62s linear .55s forwards; }
.st-numero.apaga .st-borracha { animation: st-esfrega .62s ease-in-out .55s; }
.st-numero.apaga .st-farelo { animation: st-cai .55s ease-in .8s; }
@keyframes st-apagando {
  0% { opacity: 1; }
  30% { opacity: .62; filter: blur(.3px); }
  65% { opacity: .3; filter: blur(.7px); }
  100% { opacity: 0; filter: blur(1px); }
}
@keyframes st-esfrega {
  0% { opacity: 0; transform: translateX(6px) rotate(-16deg); }
  12% { opacity: 1; transform: translateX(0) rotate(-16deg); }
  30% { transform: translateX(-34px) rotate(-11deg); }
  48% { transform: translateX(-2px) rotate(-16deg); }
  66% { transform: translateX(-34px) rotate(-11deg); }
  84% { opacity: 1; transform: translateX(-4px) rotate(-16deg); }
  100% { opacity: 0; transform: translateX(10px) rotate(-16deg); }
}
@keyframes st-cai {
  0% { opacity: .9; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(16px); }
}
/* Papel apagado nunca fica limpo: sobra a sombra do que estava escrito. */
.st-numero.usado::before {
  content: ""; position: absolute; right: 0; top: 7px; width: 100%; height: 22px; border-radius: 40%;
  background: rgba(120,120,130,.13); filter: blur(4px);
}
.st-numero.escreve b { animation: st-escreve .5s steps(9, end) both; }
@keyframes st-escreve { from { clip-path: inset(-6px 100% -6px 0); } to { clip-path: inset(-6px 0 -6px 0); } }
.st-lista button { cursor: pointer; }
.st-lista button:hover, .st-lista button:focus-visible { background: rgba(34,58,134,.08); }
/* A linha já alinha as duas pela base da letra: o apoio é um só. */
.st-cat { flex: none; width: 38%; font-size: 19px; color: var(--st-lapis); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; --st-apoio: 2px; }
.st-texto { flex: 1; min-width: 0; font-size: 25px; color: var(--st-tinta); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; --st-apoio: 2px; }
.st-texto.vazia { font-size: 19px; color: #9195a3; }
.st-torta {
  flex: none; align-self: center; display: grid; place-items: center; width: 19px; height: 19px; border-radius: 50%;
  background: var(--st-vermelho); color: #fff; font: 900 13px/1 system-ui, sans-serif;
}
.st-sem { color: var(--st-lapis); }

/* A placa de pare de verdade: mede 5 linhas, para a folha seguir na pauta. */
.st-parar {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  width: calc(var(--st-linha) * 5); height: calc(var(--st-linha) * 5); margin: 0 auto; border: 0; color: #fff; cursor: pointer;
  background: linear-gradient(160deg, #e7473e, #b5211b);
  clip-path: polygon(29% 0, 71% 0, 100% 29%, 100% 71%, 71% 100%, 29% 100%, 0 71%, 0 29%);
  transition: transform .12s, filter .2s;
}
.st-parar span { font: 900 42px/1 system-ui, sans-serif; letter-spacing: .02em; }
.st-parar small { font-size: 12px; font-weight: 700; }
.st-parar:not(:disabled) { animation: st-chama 1.1s ease-in-out infinite; }
.st-parar:not(:disabled):active { transform: scale(.94); }
.st-parar:disabled { filter: grayscale(.85) brightness(.85); cursor: default; }
.st-parar.raio:not(:disabled) { animation-duration: .6s; background: linear-gradient(160deg, #ff8a3c, #e0261c); }
.st-relampago { color: var(--st-vermelho); }
@keyframes st-chama { 50% { transform: scale(1.05); } }

.st-fim { position: relative; }
.st-fim canvas.confete { position: absolute; inset: -60px -20px; width: calc(100% + 40px); height: calc(100% + 120px); pointer-events: none; }

/* O placar da competição: telão escuro ao lado do papel. */
.st-lado {
  position: relative; width: min(100%, 560px); flex: none; box-sizing: border-box; padding: 10px; border-radius: 12px; color: #eef1f8;
  background: linear-gradient(180deg, rgba(20,34,64,.96), rgba(10,18,36,.96));
  border: 1px solid rgba(255,255,255,.12); box-shadow: 0 14px 34px rgba(0,0,0,.42);
}
.st-lado-topo { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 24px; padding: 0 4px 8px; }
.st-titulo-placar { font-size: 13px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: #aeb9d3; }
.st-aovivo { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; color: #ff6a60; }
.st-aovivo i { width: 8px; height: 8px; border-radius: 50%; background: #ff4438; box-shadow: 0 0 8px #ff4438; animation: st-vivo 1.1s ease-in-out infinite; }
@keyframes st-vivo { 50% { opacity: .3; } }
.st-agora { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; color: #cfd8ec; }

.st-faixa {
  position: absolute; left: 8px; right: 8px; top: -14px; z-index: 5; padding: 7px 12px; border-radius: 9px; text-align: center;
  font-size: 14px; font-weight: 800; color: #fff; box-shadow: 0 8px 20px rgba(0,0,0,.4);
  animation: st-faixa .4s cubic-bezier(.2, 1.5, .4, 1);
}
.st-faixa.lider { color: #3a2a00; background: linear-gradient(90deg, #ffd24a, #fff0a0, #ffd24a); }
.st-faixa.subiu { background: #17925f; }
.st-faixa.caiu { background: #b5322b; }
@keyframes st-faixa { from { transform: translateY(-12px) scale(.9); opacity: 0; } }

.st-placar { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.st-placar li {
  position: relative; display: flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 8px 0 6px; box-sizing: border-box;
  border-radius: 8px; background: rgba(255,255,255,.055); font-size: 14px;
}
.st-placar li.st-sep { min-height: 0; padding: 0; background: none; justify-content: center; font-size: 18px; line-height: .8; color: #8d99b6; letter-spacing: .2em; }
.st-placar li.eu { background: rgba(255,214,90,.14); box-shadow: inset 0 0 0 1.5px rgba(255,214,90,.6); }
.st-placar li.eu .st-nome { color: #ffe08a; font-weight: 700; }
.st-placar .ava { width: 26px; height: 26px; flex: none; font-size: 12px; }
.st-pos {
  flex: none; display: grid; place-items: center; width: 23px; height: 23px; border-radius: 50%;
  font-size: 12.5px; font-weight: 800; font-variant-numeric: tabular-nums; color: #aeb9d3; background: rgba(255,255,255,.08);
}
.st-pos.ouro { color: #4a3300; background: linear-gradient(145deg, #ffe680, #e0a81c); box-shadow: 0 0 10px rgba(255,205,70,.55); }
.st-pos.prata { color: #30343e; background: linear-gradient(145deg, #eef1f6, #a9b1be); }
.st-pos.bronze { color: #3e2211; background: linear-gradient(145deg, #eeb384, #b4703d); }
.st-nome { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-mudou { flex: none; }
.st-seta { display: inline-flex; align-items: center; gap: 2px; font-weight: 800; }
.st-seta small { font-size: 12px; font-variant-numeric: tabular-nums; }
.st-setas { display: inline-flex; flex-direction: column; }
.st-setas svg { display: block; width: 13px; height: 8px; margin-top: -2px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.st-setas svg:first-child { margin-top: 0; }
.st-seta.sobe { color: #3fdc93; }
.st-seta.desce { color: #ff6a60; }
.st-seta.desce .st-setas { transform: rotate(180deg); }
.subiu .st-setas svg, .caiu .st-setas svg { animation: st-pisca .5s ease-out both; }
.subiu .st-setas svg:nth-child(3), .caiu .st-setas svg:nth-child(1) { animation-delay: .3s; }
.subiu .st-setas svg:nth-child(2), .caiu .st-setas svg:nth-child(2) { animation-delay: .4s; }
.subiu .st-setas svg:nth-child(1), .caiu .st-setas svg:nth-child(3) { animation-delay: .5s; }
@keyframes st-pisca { from { opacity: 0; transform: translateY(5px) scale(.7); } }
.st-ganhou { flex: none; min-width: 2.4em; text-align: right; font-size: 13px; font-weight: 800; color: #3fdc93; font-variant-numeric: tabular-nums; }
.st-ganhou:empty { display: none; }
.marcou .st-ganhou { animation: st-ponto .4s cubic-bezier(.2, 1.6, .4, 1) both; }
.st-soma { flex: none; min-width: 2.7em; text-align: right; font-size: 15px; font-variant-numeric: tabular-nums; }
.st-placar li.subiu::after, .st-placar li.caiu::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; animation: st-rastro 1.7s ease-out both;
}
.st-placar li.subiu::after { background: rgba(63,220,147,.34); box-shadow: 0 0 16px rgba(63,220,147,.45); }
.st-placar li.caiu::after { background: rgba(255,90,80,.26); }
.st-placar li.salto::after { background: linear-gradient(90deg, rgba(255,214,90,.6), rgba(63,220,147,.5)); box-shadow: 0 0 24px rgba(255,214,90,.7); }
@keyframes st-rastro { from { opacity: 1; } to { opacity: 0; } }

/* STOP de alguém: a tela inteira leva a placa. */
.st-flash {
  position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; background: rgba(120,14,10,.82); color: #fff; pointer-events: none; animation: st-apaga 1.5s forwards;
}
.st-flash b { font-size: 19px; text-align: center; padding: 0 16px; }
.st-placa {
  display: grid; place-items: center; width: 200px; height: 200px; background: linear-gradient(160deg, #ef4b41, #b5211b);
  clip-path: polygon(29% 0, 71% 0, 100% 29%, 100% 71%, 71% 100%, 29% 100%, 0 71%, 0 29%);
  animation: st-bate .3s cubic-bezier(.2, 1.6, .4, 1);
}
.st-placa span { font: 900 58px/1 system-ui, sans-serif; }
@keyframes st-bate { from { transform: scale(3); opacity: 0; } }
@keyframes st-apaga { 75% { opacity: 1; } to { opacity: 0; } }

/* Janelinha (Atividade minimizada): letra e tempo grandes. */
body[data-layout="mini"] .stop { display: none !important; }
.st-mini { --fase-c: #3f6fd8; }
.st-mini .mini-fase { font-size: clamp(11px, 7vmin, 18px); }
.st-mini-linha { display: flex; align-items: center; justify-content: center; gap: 5vmin; min-width: 0; max-width: 100%; }
.st-mini-letra {
  flex: none; display: grid; place-items: center; width: min(32vmin, 86px); aspect-ratio: 1; border-radius: 50%;
  border: max(2px, 1.2vmin) solid #d6372f; background: #fbf6e4; color: #d6372f; transform: rotate(-7deg);
  font: 900 min(19vmin, 50px)/1 system-ui, sans-serif;
}
.st-mini-tempo {
  font: 800 min(30vmin, 76px)/1 system-ui, sans-serif; font-variant-numeric: tabular-nums; color: #fff;
}
.st-mini-tempo.texto { font-size: min(15vmin, 34px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-mini-tempo.urgente, .st-mini-tempo.graca { color: #ff5a4f; animation: st-pulso 1s ease-in-out infinite; }
/* A janelinha do celular: só o tempo, o maior possível. */
@media (max-height: 130px) {
  .st-mini { gap: 1vmin; }
  .st-mini-tempo { font-size: min(44vmin, 76px); }
  .st-mini-letra { width: 44vmin; font-size: 26vmin; }
  .st-mini .mini-status { font-size: clamp(9px, 13vmin, 13px); }
}
@media (max-height: 90px) {
  .st-mini .mini-status, .st-mini-letra { display: none; }
  .st-mini-tempo { font-size: 62vmin; }
  .st-mini-tempo.texto { font-size: 30vmin; }
}

/* Respondendo no celular, o teclado ocupa metade da tela: só a pergunta fica. */
@media (max-width: 899px) {
  body.st-respondendo .st-lado { display: none; }
}
/* No PC, a folha no centro e o placar ao lado. */
@media (min-width: 900px) {
  /* `safe`: o que não couber nem encolhido (ver stEncaixar) rola, em vez de o
     topo da folha sumir acima da tela, fora do alcance da rolagem. */
  .stop { flex-direction: row; justify-content: center; align-items: center; align-items: safe center; gap: 20px;
    padding: max(24px, var(--in-top)) max(24px, var(--in-right)) max(24px, var(--in-bottom)) max(24px, var(--in-left)); }
  .st-folha { padding: 0 26px 16px 56px;
    background: linear-gradient(90deg, transparent 41px, var(--st-margem) 41px 43px, transparent 43px),
      repeating-linear-gradient(180deg, transparent 0 calc(var(--st-linha) - 1px), var(--st-pauta) calc(var(--st-linha) - 1px) var(--st-linha)),
      var(--st-papel); }
  .st-lado { width: 320px; }
}
@media (prefers-reduced-motion: reduce) {
  .st-letra.caiu, .st-relogio b.urgente, .st-relogio.graca b, .st-parar:not(:disabled), .st-placa,
  li.novo .st-marca path, li.novo .st-pts, .st-numero b, .st-borracha, .st-farelo,
  .st-aovivo i, .st-faixa, .st-setas svg, .st-ganhou, .st-placar li::after { animation: none !important; }
}
