:root {
  --bg: #f4f7fb;
  --card: #ffffff;
  --ink: #20304a;
  --accent: #2e7cf6;
  --accent-soft: #dbe9ff;
  --good: #21a365;
  --warn: #ffb703;
  --danger: #e63946;
  --shadow: 0 10px 30px rgba(31, 57, 90, 0.12);
  --radius: 22px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: linear-gradient(180deg, #eef5ff 0%, #f7f9fc 60%, #edf3ff 100%);
  color: var(--ink);
}
button, select {
  font: inherit;
}
button {
  border: 0;
  border-radius: 14px;
  padding: 12px 18px;
  cursor: pointer;
  background: #edf3ff;
  color: var(--ink);
  font-weight: 700;
}
button:hover { filter: brightness(0.98); }
button.primary {
  background: var(--accent);
  color: #fff;
}
button.secondary {
  background: #e9eef7;
}
select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #cdd8ea;
  background: #fff;
}
#app {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.screen { width: 100%; max-width: 1280px; }
.hidden { display: none !important; }
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}
.hero { max-width: 760px; margin: 0 auto; text-align: center; }
.hero h1 { font-size: 3rem; margin: 0 0 8px; }
.hero p { font-size: 1.1rem; color: #4c5f7c; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.hero-actions.stacked { flex-direction: column; }
.info-box {
  background: #f5f8ff;
  border-radius: 16px;
  padding: 14px;
  color: #40516c;
}
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin: 24px 0;
}
.game-choice {
  min-height: 160px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  background: linear-gradient(180deg, #f8fbff, #e8f1ff);
}
.game-choice span { font-size: 3rem; }
.large-card { max-width: 1100px; margin: 0 auto; }
.config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}
.assignments {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 18px 0;
}
.assignment-card {
  border: 1px solid #d9e3f0;
  border-radius: 18px;
  padding: 14px;
  background: #fbfdff;
}
.assignment-card h4 { margin: 0 0 12px; }
.checkline { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.game-layout {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
  gap: 18px;
  align-items: start;
}
.board-card { min-height: 78vh; }
#boardArea { min-height: 72vh; }
.side-panel { position: sticky; top: 12px; }
.dice-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
}
.dice {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: #f5f8ff;
  font-size: 1.6rem;
  font-weight: 800;
  border: 2px dashed #c4d5f0;
}
.player-card {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 14px;
  margin-bottom: 8px;
  background: #f8fbff;
  border: 2px solid transparent;
}
.player-card.active { border-color: var(--accent); }
.avatar, .mini-token {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: #d9e6ff;
  border: 3px solid #fff;
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}
.mini-token {
  width: 28px;
  height: 28px;
  border-width: 2px;
}
.history-panel {
  max-height: 220px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.history-item {
  font-size: 0.95rem;
  background: #f7faff;
  border-radius: 12px;
  padding: 10px;
}
.goose-board {
  display: grid;
  grid-template-columns: repeat(6, minmax(90px, 1fr));
  gap: 10px;
}
.goose-cell {
  min-height: 115px;
  border-radius: 18px;
  padding: 10px;
  position: relative;
  background: linear-gradient(180deg, #ffffff, #eff6ff);
  border: 1px solid #d8e5f7;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.goose-cell.special { box-shadow: inset 0 0 0 2px #ffd166; }
.goose-cell.finish { box-shadow: inset 0 0 0 2px #21a365; }
.cell-num { font-size: 0.8rem; color: #5b6b84; font-weight: 700; }
.cell-title { font-size: 0.95rem; font-weight: 700; }
.cell-effect { font-size: 0.8rem; color: #607089; }
.token-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.token-badge {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid white;
  object-fit: cover;
  background: #ddd;
}
.parchis-board {
  display: grid;
  grid-template-columns: repeat(15, minmax(30px, 1fr));
  grid-template-rows: repeat(15, minmax(30px, 1fr));
  gap: 2px;
  max-width: 760px;
  margin: 0 auto;
}
.pb-cell {
  aspect-ratio: 1;
  background: #f2f6fd;
  border-radius: 6px;
  position: relative;
  border: 1px solid #dde7f7;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.pb-home { opacity: 0.9; }
.pb-path.safe { box-shadow: inset 0 0 0 2px #ffc857; }
.pb-lane { opacity: 0.9; }
.pb-goal { background: #fff2c7; }
.pb-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  align-items: center;
  justify-content: center;
}
.pb-token {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid white;
}
.extra-controls { margin: 10px 0; }
.move-list { display: flex; flex-direction: column; gap: 8px; }
.move-btn { text-align: left; }
.winner-card { max-width: 700px; margin: 0 auto; text-align: center; }
.winner-avatar { width: 110px; height: 110px; border-radius: 50%; object-fit: cover; box-shadow: var(--shadow); }
@media (max-width: 980px) {
  .game-layout { grid-template-columns: 1fr; }
  .side-panel { position: static; }
}
@media (max-width: 760px) {
  .goose-board { grid-template-columns: repeat(3, minmax(90px, 1fr)); }
  .hero h1 { font-size: 2.2rem; }
  .parchis-board { grid-template-columns: repeat(15, minmax(18px, 1fr)); }
}
