* {
  box-sizing: border-box;
}

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

body {
  font-family: -apple-system, system-ui, sans-serif;
  background: radial-gradient(circle at top, #1e1b2e 0%, #0a0812 70%);
  color: #f1eefc;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
}

#app {
  width: 100%;
  max-width: 480px;
  height: 100%;
  max-height: 800px;
  display: flex;
  flex-direction: column;
  padding: 16px;
  position: relative;
}

.hud {
  display: flex;
  gap: 12px;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  padding: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 12px;
}

.instrucoes {
  text-align: center;
  color: #a599c9;
  font-size: 0.85rem;
  margin: 12px 0;
}

.mesa {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  gap: 12px;
}

.dica {
  font-size: 0.8rem;
  color: #6f6690;
  font-weight: 600;
  white-space: nowrap;
}

.carta {
  width: 220px;
  height: 320px;
  background: linear-gradient(160deg, #2a2540, #17132a);
  border: 2px solid #4c3f7a;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  cursor: grab;
  user-select: none;
  touch-action: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.carta.arrastando {
  cursor: grabbing;
  transition: none;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6);
}

.carta.sair-esquerda {
  transform: translateX(-600px) rotate(-30deg) !important;
  opacity: 0;
  transition: transform 0.22s ease-in, opacity 0.22s ease-in;
}

.carta.sair-direita {
  transform: translateX(600px) rotate(30deg) !important;
  opacity: 0;
  transition: transform 0.22s ease-in, opacity 0.22s ease-in;
}

.carta-emoji {
  font-size: 4rem;
}

.carta-nome {
  font-size: 1.2rem;
  font-weight: 700;
  text-align: center;
}

.carta-descricao {
  font-size: 0.85rem;
  color: #c3bde0;
  text-align: center;
}

.botoes-mobile {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.botao {
  flex: 1;
  padding: 14px;
  border-radius: 12px;
  border: none;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
}

.botao-recusar {
  background: #3a3455;
  color: #f1eefc;
}

.botao-enfrentar {
  background: #d64550;
  color: #fff;
}

.tela-fim {
  position: absolute;
  inset: 0;
  background: rgba(5, 3, 12, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
}

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

.tela-fim-cartao {
  text-align: center;
  padding: 32px;
  max-width: 320px;
}

.tela-fim-cartao h2 {
  margin-bottom: 8px;
}

.tela-fim-cartao p {
  color: #c3bde0;
  margin-bottom: 20px;
}

.botao-reiniciar {
  background: #6f5ce6;
  color: #fff;
  padding: 14px 28px;
}

@media (min-width: 640px) {
  .botoes-mobile {
    display: none;
  }
}
