:root {
  --bg-pagina: #e4ebe0;
  --bg-card: #fcfdfb;
  --verde-escuro: #234a1f;
  --verde-medio: #3d7a34;
  --verde-miolo: #6aad5e;
  --verde-claro: #c5e4b8;
  --verde-fundo: #ecf6e8;
  --accento: #b84318;
  --accento-suave: #e8a090;
  --texto: #152214;
  --texto-suave: #3a4d36;
  --borda: #b8ccb0;
  --borda-forte: #8faa84;
  --erro: #9c2626;
  --ok: #1a6b38;
  --sombra: rgba(21, 34, 20, 0.07);
  --sombra-forte: rgba(21, 34, 20, 0.12);
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --raio: 14px;
  --raio-sm: 10px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg-pagina);
  color: var(--texto);
  line-height: 1.5;
}

.pagina {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.25rem clamp(0.75rem, 3vw, 1.5rem) 2.5rem;
}

.topo-marca {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.logo {
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 14px;
  background: linear-gradient(155deg, var(--verde-miolo) 0%, var(--verde-escuro) 100%);
  color: #fff;
  font-weight: 700;
  font-size: 1.6rem;
  flex-shrink: 0;
  box-shadow: 0 6px 20px var(--sombra-forte);
}

.topo h1 {
  margin: 0;
  font-size: clamp(1.4rem, 4vw, 1.95rem);
  font-weight: 800;
  color: var(--verde-escuro);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.subtitulo {
  margin: 0.35rem 0 0;
  font-size: 0.92rem;
  color: var(--texto-suave);
  font-weight: 500;
}

.intro {
  margin: 0;
  padding: 1.1rem 1.25rem;
  background: var(--bg-card);
  border-radius: var(--raio);
  border: 1px solid var(--borda);
  box-shadow: 0 8px 28px var(--sombra);
  font-size: 0.98rem;
  border-left: 4px solid var(--verde-medio);
}

.jogo-principal {
  margin-top: 1.5rem;
}

.grade-wrap {
  background: var(--bg-card);
  border-radius: var(--raio);
  border: 1px solid var(--borda);
  box-shadow: 0 10px 36px var(--sombra);
  overflow: hidden;
}

.grade-cabecalho {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 1rem 1.15rem;
  background: linear-gradient(180deg, var(--verde-fundo) 0%, #fff 55%);
  border-bottom: 1px solid var(--borda);
}

.titulo-secao {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--verde-escuro);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn {
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
  border-radius: var(--raio-sm);
  border: 2px solid transparent;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.15s ease, transform 0.1s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primario {
  background: var(--verde-medio);
  color: #fff;
  border-color: var(--verde-escuro);
}

.btn-primario:hover {
  background: var(--verde-escuro);
}

.btn-secundario {
  background: #fff;
  color: var(--verde-escuro);
  border-color: var(--borda-forte);
}

.btn-secundario:hover {
  background: var(--verde-claro);
}

.grade-scroll {
  overflow-x: auto;
  padding: 0.35rem;
  background: #fafcf8;
}

.grade {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.86rem;
  min-width: 620px;
}

.grade th,
.grade td {
  border: 1px solid var(--borda);
  padding: 0.4rem 0.45rem;
  text-align: center;
  vertical-align: middle;
}

.grade thead th {
  background: linear-gradient(180deg, #dff0d6 0%, var(--verde-claro) 100%);
  color: var(--verde-escuro);
  font-weight: 700;
  padding: 0.65rem 0.4rem;
  border-bottom-color: var(--borda-forte);
}

.th-sala {
  display: block;
  font-size: 0.82rem;
}

.th-sala-meio {
  color: var(--accento);
}

.grade tbody tr:first-child td,
.grade tbody tr:first-child th {
  border-top: none;
}

.rotulo-cat {
  text-align: left !important;
  padding: 0.55rem 0.75rem !important;
  min-width: 9rem;
  width: 22%;
  background: linear-gradient(90deg, #f0f7ec 0%, #fafcf8 100%) !important;
  font-weight: 650;
  color: var(--verde-escuro);
  font-size: 0.84rem;
  border-right: 2px solid var(--borda-forte) !important;
}

.grade tbody tr:nth-child(even) .rotulo-cat {
  background: linear-gradient(90deg, #e8f3e2 0%, #f7fbf4 100%) !important;
}

.grade tbody td:not(.rotulo-cat) {
  background: #fff;
}

.grade tbody tr:hover td:not(.rotulo-cat) {
  background: #f6fbf3;
}

.grade select {
  width: 100%;
  max-width: 12rem;
  margin: 0 auto;
  display: block;
  font-family: inherit;
  font-size: 0.8rem;
  padding: 0.45rem 0.4rem;
  border-radius: 8px;
  border: 1px solid #93ae88;
  background: #fff;
  color: var(--texto);
  cursor: pointer;
}

.grade select:hover {
  border-color: var(--verde-medio);
}

.grade select:focus {
  outline: 2px solid var(--verde-miolo);
  outline-offset: 2px;
}

.feedback {
  margin-top: 1rem;
  padding: 0.85rem 1.05rem;
  border-radius: var(--raio-sm);
  font-weight: 600;
  font-size: 0.95rem;
  min-height: 2.6rem;
  display: flex;
  align-items: center;
}

.feedback.vazio {
  background: transparent;
  min-height: 0;
  padding: 0;
}

.feedback.ok {
  background: #d4efdc;
  color: var(--ok);
  border: 1px solid #8fd4a2;
}

.feedback.erro {
  background: #fde8ea;
  color: var(--erro);
  border: 1px solid #f0b4ba;
}

.feedback.aviso {
  background: #fff8e6;
  color: #7a5a10;
  border: 1px solid #edd78a;
}

.dicas {
  margin-top: 2rem;
  padding: 1.35rem 1.4rem 1.5rem;
  background: var(--bg-card);
  border-radius: var(--raio);
  border: 1px solid var(--borda);
  box-shadow: 0 8px 32px var(--sombra);
}

.dicas-cabecalho {
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 2px dashed var(--verde-claro);
}

.dicas h2 {
  margin: 0 0 0.35rem;
  font-size: 1.2rem;
  color: var(--verde-escuro);
  font-weight: 800;
}

.dicas-progresso {
  margin: 0;
  font-size: 0.9rem;
  color: var(--texto-suave);
  font-weight: 600;
}

.lista-dicas {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
  counter-reset: dica;
}

@media (min-width: 760px) {
  .lista-dicas {
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem 1.25rem;
  }
}

.dica-item {
  counter-increment: dica;
  position: relative;
  margin: 0;
  padding: 0.7rem 0.85rem 0.7rem 2.65rem;
  background: var(--verde-fundo);
  border-radius: var(--raio-sm);
  border: 1px solid var(--borda);
  font-size: 0.9rem;
  line-height: 1.4;
  transition: opacity 0.2s ease, background 0.2s ease;
}

.dica-item::before {
  content: counter(dica);
  position: absolute;
  left: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.55rem;
  height: 1.55rem;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 800;
  color: #fff;
  background: var(--accento);
  border-radius: 8px;
}

.dica-item.dica-atendida {
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--verde-escuro);
  opacity: 0.62;
  background: #e8f0e3;
  border-color: #a8c9a0;
}

.dica-item.dica-atendida::before {
  content: "✓";
  font-size: 0.95rem;
  background: var(--ok);
  text-decoration: none;
}

.dica-item.dica-atendida strong {
  font-weight: 600;
}

.rodape {
  margin-top: 2rem;
  font-size: 0.82rem;
  color: var(--texto-suave);
}

.rodape a {
  color: var(--verde-escuro);
  font-weight: 600;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 520px) {
  .grade select {
    max-width: none;
    font-size: 0.76rem;
  }

  .dica-item {
    font-size: 0.86rem;
    padding-left: 2.45rem;
  }
}
