* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
}

body {
  font-family: -apple-system, system-ui, sans-serif;
  background: linear-gradient(180deg, #fff6e9 0%, #ffe9d6 100%);
  color: #4a3826;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
}

#app {
  width: 100%;
  max-width: 420px;
  padding: 16px;
}

.topo {
  text-align: center;
  margin-bottom: 12px;
}

.topo h1 {
  margin: 0 0 4px;
  font-size: 1.4rem;
}

.instrucoes {
  color: #8a6f57;
  font-size: 0.82rem;
  margin: 4px 0;
}

.progresso {
  font-weight: 700;
  color: #b5651d;
  margin: 4px 0 0;
}

.area-jogo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.mala {
  display: grid;
  gap: 2px;
  background: #d9a066;
  border: 4px solid #a9682f;
  border-radius: 12px;
  padding: 4px;
  position: relative;
  box-shadow: inset 0 4px 12px rgba(0, 0, 0, 0.25);
}

.celula-fundo {
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 4px;
}

.bandeja {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 10px;
  justify-content: center;
  height: 270px;
  width: 100%;
  padding: 10px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 12px;
  border: 2px dashed #d9a066;
}

.peca {
  display: grid;
  gap: 2px;
  cursor: grab;
  touch-action: none;
  position: relative;
}

.peca.fantasma {
  opacity: 0.8;
  cursor: grabbing;
}

.celula-peca {
  border-radius: 6px;
}

.celula-peca.preenchida {
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.15), inset 0 2px 0 rgba(255, 255, 255, 0.4);
}

.peca-emoji {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.tela-fim {
  position: fixed;
  inset: 0;
  background: rgba(74, 56, 38, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tela-fim[hidden] {
  display: none;
}

.tela-fim-cartao {
  background: #fff6e9;
  border-radius: 16px;
  padding: 32px;
  text-align: center;
  max-width: 320px;
}

.tela-fim-cartao h2 {
  margin-top: 0;
}

.botao-reiniciar {
  background: #b5651d;
  color: #fff;
  border: none;
  padding: 14px 28px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  margin-top: 12px;
}
