* { box-sizing: border-box; }
html, body {
  margin: 0; min-height: 100%; background: #14171f; color: #eef1f6;
  font-family: 'Segoe UI', system-ui, sans-serif;
}
h1 { margin: 0 0 4px; }
button { font-family: inherit; cursor: pointer; }
.hidden { display: none !important; }

/* ---------- Setup screen ---------- */
.screen { min-height: 100vh; }
#setup-screen { display: flex; align-items: center; justify-content: center; padding: 30px; }
.setup-card {
  background: #1e2230; border-radius: 16px; padding: 32px 40px; max-width: 560px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.setup-card h1 { font-size: 30px; color: #ffcc00; text-shadow: 2px 2px 0 #d4361c; }
.sub { color: #9aa3b8; margin-bottom: 20px; }
.player-row { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.player-row input[type=text] {
  flex: 1; padding: 10px 12px; border-radius: 8px; border: 1px solid #3a4058;
  background: #12151f; color: #eef1f6; font-size: 14px;
}
.player-row select {
  padding: 10px; border-radius: 8px; border: 1px solid #3a4058; background: #12151f; color: #eef1f6;
}
.player-row .swatch { width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; border: 2px solid #fff3; }
.btn {
  border: none; border-radius: 10px; padding: 12px 20px; font-size: 15px; font-weight: 600;
  color: #12151f; background: #ffcc00; margin-top: 14px;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary { background: #ffcc00; }
.btn-outline { background: transparent; border: 1px solid #4a5170; color: #eef1f6; }
.btn-danger { background: #e8392f; color: #fff; }
.btn-small { padding: 6px 12px; font-size: 12px; margin: 3px; }

/* ---------- Game layout ---------- */
.layout { display: flex; align-items: flex-start; justify-content: center; padding: 16px; }
.board {
  display: grid; grid-template-columns: repeat(11, 74px); grid-template-rows: repeat(11, 74px);
  gap: 2px; background: #05060a;
}
.space {
  background: #1e2230; border-radius: 3px; font-size: 9px; padding: 3px; position: relative;
  display: flex; flex-direction: column; overflow: hidden; color: #cfd6e8;
}
.space .bar { height: 8px; margin: -3px -3px 3px; }
.space .name { font-weight: 600; line-height: 1.1; }
.space .price { margin-top: auto; color: #8b93a8; }
.space.corner { align-items: center; justify-content: center; text-align: center; font-size: 11px; }
.space .tokens { position: absolute; bottom: 2px; right: 2px; display: flex; gap: 1px; flex-wrap: wrap; max-width: 60px; }
.token-dot {
  width: 12px; height: 12px; border-radius: 50%; border: 1px solid #0008;
  display: flex; align-items: center; justify-content: center; font-size: 8px; font-weight: 700; color: #fff;
}
.space .owner-mark { position: absolute; top: 2px; right: 2px; width: 8px; height: 8px; border-radius: 50%; }
.space .houses { position: absolute; top: 12px; left: 2px; display: flex; gap: 1px; }
.house-icon { width: 6px; height: 6px; background: #2ecc40; border-radius: 1px; }
.hotel-icon { width: 10px; height: 8px; background: #e8392f; border-radius: 1px; }
.space.mortgaged { opacity: 0.45; }

.center-panel {
  grid-row: 2 / 11; grid-column: 2 / 11; background: #262b3c; border-radius: 8px;
  padding: 14px; display: flex; flex-direction: column; gap: 10px; overflow: hidden;
}
.center-top { display: flex; gap: 14px; flex: 1; min-height: 0; }
.players-list { width: 220px; overflow-y: auto; }
.player-card {
  background: #1e2230; border-radius: 8px; padding: 8px 10px; margin-bottom: 6px; font-size: 12px;
  border-left: 4px solid transparent;
}
.player-card.active { border-left-color: #ffcc00; background: #2c3348; }
.player-card.bankrupt { opacity: 0.4; text-decoration: line-through; }
.player-card .pname { font-weight: 700; display: flex; align-items: center; gap: 6px; }
.player-card .pmoney { color: #7be08a; font-weight: 700; }

.mid-panel { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.dice-row { display: flex; align-items: center; gap: 10px; }
.die { width: 40px; height: 40px; background: #fff; color: #12151f; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; }
.turn-banner { font-size: 15px; font-weight: 700; }
.turn-sub { font-size: 12px; color: #9aa3b8; }
.action-row { display: flex; gap: 8px; flex-wrap: wrap; }
.log-box { flex: 1; overflow-y: auto; background: #12151f; border-radius: 6px; padding: 8px; font-size: 11.5px; color: #b7bfd4; min-height: 0; }
.log-box div { margin-bottom: 3px; }

.props-panel { width: 240px; overflow-y: auto; font-size: 11px; }
.prop-row { background: #1e2230; border-radius: 6px; padding: 6px 8px; margin-bottom: 5px; }
.prop-row .pn { font-weight: 700; }
.prop-row .pactions { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }

/* ---------- Modals ---------- */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal-card { background: #1e2230; border-radius: 14px; padding: 26px 30px; max-width: 380px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,0.6); }
.card-title { font-size: 18px; font-weight: 700; color: #ffcc00; margin-bottom: 10px; }
.card-text { font-size: 14px; color: #d7dcea; margin-bottom: 6px; }
