:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #eef3f8;
  --paper: #ffffff;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-strong: #f8fafc;
  --text: #172033;
  --muted: #64748b;
  --brand: #2563eb;
  --brand-2: #14b8a6;
  --danger: #ef4444;
  --line: #dbe4ef;
  --line-strong: #cbd5e1;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.11);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.08), transparent 32rem),
    radial-gradient(circle at 85% 8%, rgba(20, 184, 166, 0.14), transparent 28rem),
    var(--bg);
  color: var(--text);
}

button, input { font: inherit; }

button {
  border: 0;
  border-radius: 0.9rem;
  padding: 0.85rem 1rem;
  background: linear-gradient(135deg, var(--brand), #60a5fa);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

button:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(37, 99, 235, 0.22); }
button:disabled { cursor: not-allowed; opacity: 0.45; }

input {
  width: 100%;
  margin-top: 0.4rem;
  border: 1px solid var(--line-strong);
  border-radius: 0.8rem;
  padding: 0.8rem 0.9rem;
  background: #fff;
  color: var(--text);
  outline: none;
}

input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14); }
label { color: var(--muted); font-size: 0.9rem; }

.app-shell { width: min(1760px, calc(100% - 2rem)); margin: 0 auto; padding: 1.5rem 0; }

.hero {
  display: grid;
  grid-template-columns: 1fr minmax(230px, 320px);
  gap: 1rem;
  align-items: stretch;
  margin-bottom: 1rem;
}

.eyebrow { color: var(--brand); font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(2.4rem, 5vw, 5.3rem); line-height: 0.92; }
.hero-copy { max-width: 66ch; color: var(--muted); font-size: 1.08rem; }

.hero-card, .panel, .board-wrap {
  border: 1px solid var(--line);
  border-radius: 1.5rem;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero-card { padding: 1.2rem; display: grid; gap: 0.4rem; align-content: center; }
.hero-card span { font-size: 3rem; }
.hero-card small { color: var(--muted); }

.layout { display: grid; grid-template-columns: 300px minmax(980px, 1fr) 320px; gap: 1rem; align-items: start; }
.panel { padding: 1rem; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 1rem; }
h2, h3 { margin: 0; }
.hint { color: var(--muted); font-size: 0.9rem; line-height: 1.45; }
.room-grid, .button-row, .dice-box { display: grid; gap: 0.75rem; }
.secondary-btn { background: linear-gradient(135deg, var(--brand-2), #5eead4); color: #07302d; }
.ghost-btn { background: #fff; color: var(--text); border: 1px solid var(--line-strong); }

.board-wrap { padding: 1rem; overflow: auto; }
.board {
  display: grid;
  grid-template-columns: repeat(11, minmax(82px, 1fr));
  grid-template-rows: repeat(11, minmax(82px, 1fr));
  min-width: 960px;
  aspect-ratio: 1 / 1;
  gap: 0.38rem;
  padding: 0.6rem;
  border-radius: 1.1rem;
  background: #dce6f1;
}

.cell {
  --category-color: var(--brand);
  --category-tint: #f8fafc;
  position: relative;
  overflow: hidden;
  display: flex;
  min-height: 82px;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid color-mix(in srgb, var(--category-color) 38%, var(--line));
  border-radius: 0.8rem;
  padding: 0.48rem;
  background: linear-gradient(180deg, var(--category-tint), #fff 68%);
  box-shadow: 0 5px 14px rgba(15, 23, 42, 0.08);
}

.cell.center {
  grid-column: 2 / 11;
  grid-row: 2 / 11;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  text-align: center;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(248, 250, 252, 0.9)),
    repeating-linear-gradient(45deg, rgba(37, 99, 235, 0.06) 0 12px, rgba(20, 184, 166, 0.07) 12px 24px);
  border: 1px solid var(--line-strong);
}

.center-card {
  max-width: 620px;
  padding: 1.4rem;
  border: 1px solid var(--line);
  border-radius: 1.4rem;
  background: rgba(255, 255, 255, 0.86);
}

.center-card p { margin-bottom: 0; color: var(--muted); }
.center-icon { display: block; font-size: 3.2rem; margin-bottom: 0.5rem; }
.category-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.55rem; max-width: 720px; }
.category-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid color-mix(in srgb, var(--legend-color) 45%, var(--line));
  border-left: 0.45rem solid var(--legend-color);
  border-radius: 999px;
  padding: 0.38rem 0.65rem;
  background: #fff;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 800;
}

.cell-color {
  display: grid;
  place-items: center;
  min-height: 1.35rem;
  margin: -0.48rem -0.48rem 0.32rem;
  background: var(--category-color);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 900;
}
.cell-name { font-size: 0.78rem; line-height: 1.08; color: #0f172a; }
.cell-category { color: var(--category-color); font-size: 0.62rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.04em; }
.cell-price { color: var(--muted); font-size: 0.68rem; line-height: 1.15; }
.cell--corner .cell-name { font-size: 0.88rem; }
.cell--chance .cell-color, .cell--tax .cell-color { color: #0f172a; }
.tokens { display: flex; flex-wrap: wrap; gap: 0.18rem; min-height: 1.1rem; }
.token { width: 1rem; height: 1rem; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.92); box-shadow: 0 2px 8px rgba(15, 23, 42, 0.35); }
.owner-dot { position: absolute; right: 0.4rem; top: 1.72rem; width: 0.85rem; height: 0.85rem; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 5px rgba(15, 23, 42, 0.3); }
.house-count { position: absolute; left: 0.4rem; bottom: 0.32rem; color: var(--category-color); font-weight: 900; font-size: 0.72rem; }

.turn-badge { border-radius: 999px; padding: 0.35rem 0.65rem; background: rgba(37, 99, 235, 0.1); color: var(--brand); font-size: 0.8rem; font-weight: 800; }
.dice { display: grid; place-items: center; min-height: 4.8rem; border-radius: 1rem; background: var(--panel-strong); border: 1px solid var(--line); font-size: 2.4rem; font-weight: 900; }
.players-section, .log-section { margin-top: 1rem; }
.players-list, .game-log { display: grid; gap: 0.55rem; max-height: 420px; overflow: auto; padding-right: 0.25rem; }
.player-card { border: 1px solid var(--line); border-radius: 1rem; padding: 0.75rem; background: #fff; }
.player-card.active { border-color: var(--brand); box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.28); }
.player-top { display: flex; justify-content: space-between; gap: 0.5rem; align-items: center; }
.player-chip { display: inline-flex; gap: 0.4rem; align-items: center; font-weight: 800; }
.player-card small { color: var(--muted); }
.log-item { color: var(--muted); border-left: 3px solid var(--brand-2); padding-left: 0.6rem; font-size: 0.9rem; }

@media (max-width: 1500px) {
  .layout { grid-template-columns: 1fr; }
  .board { max-width: 1120px; margin: 0 auto; }
  .hero { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .app-shell { width: min(100% - 0.75rem, 1760px); padding: 0.75rem 0; }
  .board-wrap { padding: 0.45rem; }
  .board { grid-template-columns: repeat(11, 72px); grid-template-rows: repeat(11, 72px); min-width: 840px; gap: 0.25rem; }
  .cell { min-height: 72px; padding: 0.35rem; border-radius: 0.62rem; }
  .cell-color { margin: -0.35rem -0.35rem 0.22rem; min-height: 1.1rem; }
  .cell-name { font-size: 0.68rem; }
  .cell-category, .cell-price { font-size: 0.56rem; }
}
