/* =========================
   BASE
========================= */

* {
  box-sizing: border-box;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background: #f8f9fa;
  padding: 20px;
}

.container {
  max-width: 1100px;
  margin: auto;
  background: white;
  padding: 24px;
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
}

h1 {
  text-align: center;
  margin-bottom: 20px;
}

/* =========================
   INPUT FRASE
========================= */

.input-group {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
}

input, select {
  width: 100%;
  padding: 12px;
  font-size: 16px;
}

button {
  padding: 12px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
}

.generate { background:#667eea; color:#fff; }
.save { background:#48bb78; color:#fff; }
.pdf { background:#4299e1; color:#fff; }
.clear { background:#f56565; color:#fff; }

.actions {
  display:flex;
  gap:10px;
  margin-top:20px;
}

/* =========================
   🔔 INSTRUÇÕES APÓS GERAR
========================= */

.generate-info {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  color: #1e3a8a;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.4;
  margin-bottom: 18px;
}

/* =========================
   CONFIGURAÇÕES DA PRANCHA
========================= */

.board-config {
  background:#f9fafb;
  border:1px solid #e5e7eb;
  border-radius:12px;
  padding:16px;
  margin-bottom:20px;
}

.board-config h3 {
  margin-bottom:12px;
}

.config-field {
  margin-bottom:12px;
}

.apply-config {
  margin-top:10px;
  background:#2563eb;
  color:#fff;
  width:100%;
}

/* =========================
   PRANCHA
========================= */

.board {
  display: grid;
  justify-content: center; /* 🔥 CENTRALIZA NO PDF */
  align-content: start;
  margin: 0 auto;
  width: 100%;
}

/* =========================
   CABEÇALHO DA PRANCHA
========================= */

.board > div:first-child {
  font-size: 36px;       /* 🔥 GRANDE */
  font-weight: 800;
  text-align: center;
  padding: 20px;
  margin-bottom: 20px;
  border-radius: 12px;
  grid-column: 1 / -1;
}

/* =========================
   CÉLULAS
========================= */

.cell {
  position: relative;
  background: #ffffff;
  border-radius: 16px;
  padding: 14px;
  text-align: center;
  cursor: pointer;

  /* 🔥 TAMANHO IDEAL PARA IMPRESSÃO */
  min-height: 210px;

  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* =========================
   IMAGEM
========================= */

.cell img {
  width: 100%;
  max-height: 130px;
  object-fit: contain;
  margin-bottom: 10px;
}

/* =========================
   TEXTO DA CÉLULA (CAA REAL)
========================= */

.cell > div:last-child {
  font-size: 26px;       /* 🔥 MUITO MAIOR */
  font-weight: 700;
  line-height: 1.25;
  word-break: break-word;
}

/* =========================
   BOTÃO REMOVER ❌
========================= */

.cell .remove-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  background: #ef4444;
  color: white;
  border-radius: 50%;
  font-size: 14px;
  font-weight: bold;
  line-height: 22px;
  text-align: center;
  cursor: pointer;
  display: none;
}

.cell:hover .remove-btn {
  display: block;
}

/* =========================
   HISTÓRICO
========================= */

.history {
  margin-top:30px;
}

.history-item {
  background:#f1f5f9;
  padding:10px;
  border-radius:8px;
  margin-bottom:8px;
  font-size:14px;
}

/* =========================
   TOAST
========================= */

.toast {
  position:fixed;
  top:20px;
  right:20px;
  background:#16a34a;
  color:white;
  padding:12px 16px;
  border-radius:10px;
  font-weight:600;
  z-index:9999;
}

/* =========================
   IMPRESSÃO / PDF (A4)
========================= */

@media print {
  body {
    background: white;
    padding: 0;
  }

  .container {
    box-shadow: none;
    border-radius: 0;
    padding: 0;
  }

  .board {
    width: 100%;
    margin: 0 auto;
  }

  .cell {
    page-break-inside: avoid;
  }
}

