:root {
  --green: #2f7a45;
  --green-d: #1d4d2c;
  --gold: #d4a017;
  --cream: #f6f1e4;
  --ink: #243028;
  --card: #fffdf8;
  --red: #c44536;
  --sky: #7ec8e3;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Nunito, system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, #d9f0c7 0%, transparent 50%),
    radial-gradient(900px 400px at 100% 0%, #cdefff 0%, transparent 45%),
    var(--cream);
}
h1, h2, h3 { font-family: Fraunces, Georgia, serif; margin: 0 0 .4rem; }
button, input {
  font: inherit;
}
.wrap { max-width: 1180px; margin: 0 auto; padding: 16px; }
.hero {
  display: grid;
  gap: 18px;
  grid-template-columns: 1.1fr .9fr;
  align-items: center;
  margin-bottom: 18px;
}
.badge {
  display: inline-block;
  background: #e8f6dc;
  color: var(--green-d);
  border-radius: 999px;
  padding: .2rem .7rem;
  font-weight: 800;
  font-size: .85rem;
}
.panel {
  background: var(--card);
  border: 1px solid #e4d8b8;
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 10px 30px rgba(36,48,40,.06);
}
label { display: block; font-weight: 700; margin: 10px 0 4px; }
input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d7cba8;
  border-radius: 10px;
  background: #fff;
}
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  appearance: none;
  border: 0;
  border-radius: 12px;
  padding: 11px 16px;
  font-weight: 800;
  cursor: pointer;
  background: var(--green);
  color: #fff;
}
.btn.gold { background: var(--gold); color: #2b2208; }
.btn.ghost { background: #eef5ea; color: var(--green-d); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.muted { color: #5b685e; }
.error { color: var(--red); font-weight: 700; min-height: 1.2em; }
.stats { display: flex; gap: 12px; margin-top: 10px; }
.stat {
  background: #f3faee;
  border-radius: 12px;
  padding: 8px 12px;
  font-weight: 800;
}
.topbar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.code {
  font-weight: 800;
  letter-spacing: .12em;
  background: #fff7d6;
  padding: 6px 10px;
  border-radius: 8px;
}
.layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 14px;
}
.board {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 7px;
  background: linear-gradient(#9fd0a6, #6eaf78);
  padding: 12px;
  border-radius: 16px;
  border: 6px solid #2c5e38;
}
.cell {
  min-height: 74px;
  border-radius: 10px;
  background: #fff;
  padding: 6px;
  position: relative;
  font-size: .72rem;
  font-weight: 800;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: inset 0 0 0 1px #eadfbf;
}
.cell.inicio { background: #ffd3cf; }
.cell.chegada { background: #cfe9ff; }
.cell.carta { background: #fff4c2; }
.cell.pergunta { background: #e8f5e4; }
.cell.preso { background: #ece6f8; }
.cell.desobediente { background: #ffd9b8; }
.cell.fe_fraca { background: #d9f0c8; }
.pawns {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}
.pawn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 14px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.pawn.you { outline: 2px solid var(--gold); }
.side { display: flex; flex-direction: column; gap: 12px; }
.log {
  max-height: 220px;
  overflow: auto;
  font-size: .9rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.log div { background: #f7f3e8; border-radius: 8px; padding: 6px 8px; }
.plist { display: flex; flex-direction: column; gap: 8px; }
.plist .item {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border-radius: 10px;
  background: #f6faF3;
}
.plist .item.turn { outline: 2px solid var(--gold); }
.dice {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  background: #fff;
  border: 2px solid #d7cba8;
  display: grid;
  place-items: center;
  font-size: 2rem;
  font-weight: 800;
  margin: 8px 0;
}
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(20, 35, 24, .55);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 20;
}
.modal {
  width: min(520px, 100%);
  min-height: 120px;
  background: var(--card);
  border-radius: 18px;
  padding: 20px;
  color: var(--ink);
}
.game-card {
  width: min(420px, 100%);
  min-height: 220px;
  color: var(--ink);
  background: linear-gradient(#fffdf4, #fff3c8);
  border: 8px solid #c49212;
  border-radius: 22px;
  padding: 22px 22px 18px;
  box-shadow: 0 18px 50px rgba(0,0,0,.28);
  text-align: center;
}
.game-card .card-kicker {
  letter-spacing: .18em;
  font-weight: 800;
  font-size: .75rem;
  color: #8a6a10;
  margin-bottom: 6px;
}
.game-card h2 {
  color: var(--green-d);
  font-size: 1.7rem;
}
.game-card .who {
  margin: 0 0 12px;
  font-weight: 800;
}
.game-card .card-text {
  font-size: 1.15rem;
  line-height: 1.45;
  margin: 0 0 12px;
  font-weight: 700;
}
.game-card .effect {
  background: #fff;
  border-radius: 12px;
  padding: 8px 10px;
  font-weight: 800;
  color: var(--green-d);
  margin-bottom: 14px;
}
.pawns-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.pawns-pick button {
  border: 1px solid #d7cba8;
  background: #fff;
  border-radius: 12px;
  padding: 8px 10px;
  cursor: pointer;
}
.pawns-pick button.on { outline: 3px solid var(--gold); }
.win { text-align: center; font-size: 1.2rem; }
@media (max-width: 900px) {
  .hero, .layout { grid-template-columns: 1fr; }
  .cell { min-height: 62px; font-size: .64rem; }
}
