:root {
  --fg: #f6eeed;
  --muted: #b39d9a;
  --panel: #150b0bf0;
  --accent: #ff3b30;
  --line: #ff3b3036;
  --chip: #2e1414;
  --chip-hover: #4a1a1a;
  --link: #ff9d96;
  --font: "Outfit", system-ui, sans-serif;
  --painel-w: min(420px, 100vw - 32px);
}
* { box-sizing: border-box; }
html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #000;
  color: var(--fg);
  font-family: var(--font);
  overscroll-behavior: none;
}
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

#tela {
  position: fixed; inset: 0; display: block;
  width: 100%; height: 100dvh;
  touch-action: none; cursor: grab; outline: none;
}
#tela.arrastando { cursor: grabbing; }
#tela.sobre-palavra { cursor: pointer; }

.topo {
  position: fixed; left: 16px; top: max(16px, env(safe-area-inset-top));
  max-width: 420px; pointer-events: none;
  text-shadow: 0 1px 12px #000;
  transition: opacity .6s;
}
.topo::before {
  content: ""; position: fixed; z-index: -1; top: 0; left: 0; right: 0; height: 150px;
  background: linear-gradient(#000 40%, #0000);
}
.topo h1 {
  margin: 0; text-transform: uppercase; letter-spacing: 0;
  font: 800 clamp(34px, 6.5vw, 54px)/.95 "Big Shoulders Display", var(--font);
}
.topo h1 span { display: block; }
.topo h1 span:last-child { color: var(--accent); }
body.focado .topo { opacity: 0; }
body.abertura .topo, body.abertura .controles { opacity: 0; }

.controles {
  position: fixed; right: 16px; bottom: max(16px, env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 8px;
  transition: right .3s, bottom .3s, opacity .6s;
}
.controles button {
  width: 44px; height: 44px; display: grid; place-items: center;
  color: var(--fg); font: 500 20px var(--font); cursor: pointer;
  background: #1a0c0cd9; border: 1px solid var(--line); border-radius: 999px;
}
.controles button:hover { background: var(--chip-hover); }
.controles button.info { font: italic 600 18px Georgia, "Times New Roman", serif; }
body.focado .controles { right: calc(var(--painel-w) + 32px); }

.painel {
  position: fixed; top: 16px; bottom: 16px; right: 16px; width: var(--painel-w);
  padding: 22px 20px; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 20px;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  box-shadow: 0 20px 60px #0009;
}
.painel[hidden] { display: none; }
.painel .fechar {
  position: sticky; top: 0; float: right; width: 36px; height: 36px;
  color: var(--fg); font-size: 18px; cursor: pointer; background: var(--chip); border: 0; border-radius: 999px;
}
.painel h2 { margin: 0 44px 10px 0; font-size: 20px; font-weight: 600; line-height: 1.25; }
.painel .selo + .ano { margin-top: 10px; }
.painel .ano {
  margin-right: 44px; color: var(--accent); font-size: 13px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
}
.painel dl { display: grid; gap: 10px; margin: 14px 0 0; font-size: 14px; line-height: 1.45; }
.painel dt { color: var(--muted); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.painel dd { margin: 2px 0 0; }
.painel ul { margin: 4px 0 0; padding-left: 18px; }
.painel li + li { margin-top: 4px; }
.painel a { color: var(--link); }
.painel .passos {
  display: flex; align-items: center; gap: 10px; margin: 0 48px 14px 0;
  color: var(--muted); font-size: 13px;
}
.painel .passos button {
  width: 32px; height: 32px; color: var(--fg); font-size: 18px; cursor: pointer;
  background: var(--chip); border: 0; border-radius: 999px;
}
.painel .passos button:hover { background: var(--chip-hover); }
.painel .passos .compartilhar {
  display: inline-flex; align-items: center; gap: 6px; width: auto; margin-left: auto;
  padding: 0 12px; font-size: 13px;
}
.painel.sobre p { margin: 0 0 12px; font-size: 14px; line-height: 1.5; }
.painel.sobre h2 { margin: 0 44px 14px 0; }

.selo {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; background: var(--chip); color: #e8d2cf;
}
.selo.em-andamento { color: #ffd166; background: #3a2a0c; }
.selo.condenado { color: #fff; background: #c4161c; }
.selo.absolvido { color: #8fe3a8; background: #10301b; }
.selo.condenacao-anulada, .selo.provas-anuladas, .selo.suspenso { color: #ffc98a; background: #36230d; }

.aviso {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 5;
  transform: translateX(-50%); padding: 10px 18px; border-radius: 999px;
  color: #111; font-size: 14px; font-weight: 500; background: #f2f2f2;
  box-shadow: 0 10px 30px #00000080;
}
.aviso[hidden] { display: none; }

@media (width <= 600px) {
  .painel {
    inset: auto 8px 8px; width: auto; max-height: 48dvh; border-radius: 20px 20px 16px 16px;
  }
  .topo h1 { font-size: 40px; }
  body.focado .controles { opacity: 0; pointer-events: none; }
}
@media (prefers-reduced-motion: reduce) {
  .topo, .controles { transition: none; }
}
