:root {
  color-scheme: dark;
  font: 16px/1.4 system-ui, sans-serif;
  color: #f2e8d1;
  background: #1b251f;
  --borda: #455348;
  --ouro: #f7ca79;
  --muted: #bfcbba;
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; }
button, select, textarea { font: inherit; }
:focus-visible { outline: 2px solid var(--ouro); outline-offset: 3px; }

.topo {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px max(28px, calc((100% - 1320px) / 2));
  background: #141e18;
  border-bottom: 1px solid var(--borda);
}
.marca {
  color: var(--ouro);
  font: bold 22px Georgia, serif;
  text-decoration: none;
  white-space: nowrap;
}
nav { display: flex; gap: 20px; color: var(--muted); font-size: 14px; }
nav a { text-decoration: none; }
nav a:hover { text-decoration: underline; }
nav [aria-current] { color: #f2e8d1; }

main { max-width: 1376px; margin: 0 auto; padding: 30px 28px; }
.intro, .barra-mapa, .seletor {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.intro { margin-bottom: 18px; }
h1, h2, h3, p, dl, dd { margin: 0; }
h1 { font: normal clamp(33px, 4vw, 48px)/1.06 Georgia, serif; }
h2 { font: normal 35px/1.05 Georgia, serif; }
h3 { font: bold 19px/1.15 Georgia, serif; }
.seletor label { color: var(--muted); font-size: 14px; }
select {
  min-width: 130px;
  max-width: 220px;
  min-height: 42px;
  padding: 6px 12px;
  border: 1px solid var(--borda);
  border-radius: 5px;
  background: #29382e;
  color: #f2e8d1;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 316px);
  gap: 18px;
  align-items: start;
}
.ilha, .painel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--borda);
  border-radius: 8px;
  background: #26352a;
}
.barra-mapa { min-height: 45px; padding: 9px 14px; color: var(--muted); font-size: 13px; }
#conexao::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 50%;
  background: #c0a674;
}
#conexao[data-estado="conectado"]::before { background: #b5d280; }
#conexao[data-estado="erro"]::before { background: #f09983; }
#palco { position: relative; aspect-ratio: 1.42; background: #192c35; }
#canvas { display: block; width: 100%; height: 100%; }
#carregamento {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  text-align: center;
  background: #192c35;
  color: #d4decc;
}
#carregamento[hidden] { display: none; }
[data-sugestoes="0"] #sugestao,
[data-sugestoes="1"] #sugestoes-fechadas { display: none; }

.painel > * { padding: 17px 18px; }
.painel > * + * { border-top: 1px solid var(--borda); }
.ficha p { color: var(--muted); margin-top: 6px; overflow-wrap: anywhere; }
.ficha h2 { overflow-wrap: anywhere; }
.ficha dl { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.ficha dt { color: var(--muted); font-size: 13px; align-self: center; }
.ficha dd { color: var(--ouro); font-weight: 600; overflow-wrap: anywhere; }
.ficha details { margin-top: 10px; font-size: 14px; }
.ficha summary { cursor: pointer; }
.ficha #fala { white-space: pre-line; }
.diario ul { list-style: none; margin: 10px 0 0; padding: 0; }
.diario li { padding: 8px 0; font-size: 14px; overflow-wrap: anywhere; }
.diario li:last-child { padding-bottom: 0; }
.diario li + li { border-top: 1px solid #39483c; }
.diario time { color: var(--muted); font-size: 12px; }
#sugestao label { display: block; margin: 9px 0 6px; color: var(--muted); font-size: 13px; }
textarea {
  display: block;
  width: 100%;
  resize: vertical;
  padding: 9px 10px;
  border: 1px solid #5b6859;
  border-radius: 5px;
  background: #1c2a21;
  color: #f2e8d1;
}
textarea::placeholder { color: #b4bfad; }
button {
  width: 100%;
  min-height: 43px;
  margin-top: 9px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: var(--ouro);
  color: #241e12;
  font-weight: 700;
  cursor: pointer;
}
button:disabled { color: #efe3c6; background: #3b4638; border-color: #5b6859; cursor: default; }
#recibo { margin-top: 8px; font-size: 13px; color: var(--muted); }
#recibo[data-estado="erro"] { color: #ffb7a2; }

@media (max-width: 780px) {
  .topo { min-height: 54px; padding: 10px 16px; }
  .marca { font-size: 18px; }
  nav { font-size: 13px; }
  nav [aria-current] { display: none; }
  main { padding: 18px 12px 26px; }
  .intro { margin-bottom: 13px; }
  .seletor { flex-direction: column; align-items: start; gap: 2px; }
  select { min-width: 100px; max-width: 148px; }
  .layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  #palco { aspect-ratio: 1.04; }
}
