/* PI Monopoly - colours of piboost.fun: near-black green background, acid green accent, gold for prices */
:root {
  --wood-dark: #090b0a;
  --wood: #111412;
  --parchment: #f2f3ee;
  --ink: #090b0a;
  --gold: #4ce580;
  --gold-light: #e5bd55;
  --gold-dim: #21b965;
  --cream: #f2f3ee;
  --muted: #858b82;
  --panel: rgba(17, 20, 18, 0.92);
  --display: Cinzel, Georgia, serif;
  --body: Lora, Georgia, serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

/* shared match: wallet, seat and the name hint */
.wallet-box { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 14px; }
.wallet-info { color: var(--gold-light); font-size: 14px; }
.name-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.name-row input { width: 160px; }
.name-bubble {
  display: inline-block; max-width: 340px; padding: 8px 12px; border-radius: 10px;
  background: var(--gold); color: #090b0a; font-size: 13px; font-weight: 600; position: relative;
}
.turn-note { width: 100%; margin: 4px 0 0; color: var(--gold-light); font-style: italic; }

html, body { min-height: 100%; }

body {
  margin: 0;
  color: var(--cream);
  font-family: var(--body);
  background:
    radial-gradient(ellipse at 80% 16%, rgba(36, 173, 93, 0.12), transparent 31%),
    radial-gradient(ellipse at 10% 85%, rgba(229, 189, 85, 0.035), transparent 24%),
    var(--wood-dark);
}

.app { max-width: 1280px; margin: 0 auto; padding: 22px 16px 40px; }

.top {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 18px;
}
.top h1 {
  margin: 0; font-family: var(--display); font-weight: 700; font-size: 28px; letter-spacing: 3px;
  color: var(--gold-light); text-shadow: 0 2px 0 #000, 0 0 14px rgba(201, 162, 39, 0.35);
}
.top h1 span { color: var(--cream); }

.setup { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 15px; }
select, input {
  width: 110px;
  font: inherit; color: var(--cream);
  background: #0b0f0c; border: 1px solid var(--gold-dim);
  border-radius: 6px; padding: 6px 10px;
}

.names { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -8px 0 16px; color: var(--muted); font-size: 14px; }
.names input.pname { width: 130px; }
.names input.pname[hidden] { display: none; }

.layout { display: grid; grid-template-columns: minmax(0, 800px) minmax(260px, 1fr); gap: 24px; align-items: start; }
.chat-col { grid-column: 1 / -1; }
.chat-log { list-style: none; margin: 0 0 12px; padding: 0; height: 320px; overflow-y: auto; display: grid; gap: 6px; align-content: start; }
.chat-log li { font-size: 14px; line-height: 1.35; word-break: break-word; }
.chat-log b { color: var(--gold-light); }
.chat-form { display: grid; grid-template-columns: minmax(110px, auto) 1fr; gap: 8px; }
.chat-form input, .chat-form select { min-width: 0; width: 100%; }
.chat-form button { grid-column: 1 / -1; }
.chat-note { margin: 8px 0 0; font-size: 12px; opacity: 0.7; }
.summary { margin-top: 18px; padding: 14px 16px; border: 1px solid var(--gold-dim); border-radius: 8px; background: var(--panel); }
.summary h2 { margin: 0 0 6px; font-family: var(--display); font-size: 14px; letter-spacing: 2px; text-transform: uppercase; color: var(--gold-light); }
.standings { width: 100%; border-collapse: collapse; font-size: 14px; }
.standings th, .standings td { padding: 6px 8px; text-align: right; border-bottom: 1px solid rgba(201, 162, 39, 0.2); }
.standings th:nth-child(2), .standings td:nth-child(2) { text-align: left; }
.standings td:last-child { font-weight: 700; color: var(--gold-light); }
@media (min-width: 1400px) {
  /* Desktop: the whole game fits the window, no scrolling. Left: balances, properties, log.
     Centre: the board. Right: the match chat. The board is as large as the height allows. */
  .app { max-width: 1600px; height: 100vh; display: flex; flex-direction: column; overflow: hidden; padding-top: 14px; padding-bottom: 14px; }
  .top { margin-bottom: 10px; }
  /* The three columns sit together in the middle of the window, with small gaps between them. */
  .layout { flex: 1; min-height: 0; grid-template-columns: 270px auto 290px; justify-content: center; column-gap: 18px; align-items: stretch; }
  /* The side panels start level with the top edge of the board frame, not with the layout box. */
  .side, .chat-col { padding-top: 22px; }
  .side { order: -1; min-height: 0; overflow-y: auto; align-content: start; }
  .board-col { min-height: 0; display: flex; flex-direction: column; align-items: center; }
  .board-col .controls { width: 100%; }
  .stage { width: min(100%, calc(100vh - 340px)); aspect-ratio: 1 / 1; flex: 0 0 auto; }
  .stage canvas { height: 100% !important; width: 100% !important; }
  .chat-col { grid-column: auto; min-height: 0; display: flex; flex-direction: column; }
  .chat-col .panel { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .chat-log { height: auto; flex: 1; min-height: 0; }
}
.board-col { min-width: 0; }

.stage { width: 100%; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.55)); }
.stage canvas { display: block; width: 100% !important; height: auto !important; }

.controls { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 16px; }

/* buttons: gold-trimmed plates */
.neon {
  font: 700 14px var(--display); letter-spacing: 1px; text-transform: uppercase;
  color: #090b0a;
  background: linear-gradient(180deg, #6cf09a, var(--gold) 55%, var(--gold-dim));
  border: 1px solid var(--gold-dim); border-radius: 6px;
  padding: 11px 22px; cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 3px 8px rgba(0, 0, 0, 0.45);
  transition: transform 0.15s, filter 0.2s, opacity 0.2s;
}
.neon:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.08); }
.neon.ghost {
  color: var(--cream);
  background: linear-gradient(180deg, #171c18, #0c100d);
  border: 1px solid var(--gold);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 3px 8px rgba(0, 0, 0, 0.45);
}
.neon:disabled { opacity: 0.4; cursor: not-allowed; }
.neon:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 3px; }

.status {
  min-height: 1.4em; margin: 14px 0 0; text-align: center;
  color: var(--gold-light); font-style: italic; font-size: 15px;
}

.side { display: grid; gap: 16px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--gold-dim);
  border-radius: 8px;
  padding: 16px 18px;
  box-shadow: inset 0 0 0 3px rgba(26, 15, 7, 0.9), inset 0 0 0 4px rgba(201, 162, 39, 0.25), 0 10px 26px rgba(0, 0, 0, 0.45);
}
.panel h2 {
  margin: 0 0 12px; font-family: var(--display); font-size: 14px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase; color: var(--gold-light);
  border-bottom: 1px solid rgba(201, 162, 39, 0.35); padding-bottom: 8px;
}

.players { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.players li {
  display: grid; grid-template-columns: 14px 1fr auto; gap: 2px 10px; align-items: center;
  padding: 9px 12px; border-radius: 6px;
  border: 1px solid rgba(201, 162, 39, 0.18); background: rgba(0, 0, 0, 0.18);
  transition: border-color 0.2s, background 0.2s;
}
.players li.active { border-color: var(--gold-light); background: rgba(201, 162, 39, 0.14); }
.players li.out { opacity: 0.4; text-decoration: line-through; }
.players .dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--c);
  border: 2px solid var(--gold-light);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}
.players .nm { font-weight: 600; font-family: var(--body); }
.players .bal { font-family: var(--display); font-weight: 700; color: var(--gold-light); font-variant-numeric: tabular-nums; }
.players small { grid-column: 2 / 4; color: var(--muted); font-size: 13px; }

.burn { margin: 14px 0 0; color: var(--muted); font-size: 15px; }
/* title deed: the card shown when a property is clicked */
.deed-modal[hidden] { display: none; }
.deed-modal {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center; padding: 16px;
  background: rgba(10, 6, 2, 0.7);
}
.deed {
  width: min(330px, 100%); background: #f7f0dc; color: #1c1408;
  border: 2px solid #1c1408; border-radius: 8px; overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6); font-family: var(--body);
}
.deed-head {
  padding: 22px 14px 14px; text-align: center; color: #fff;
  font-family: var(--display); font-weight: 700; letter-spacing: 1px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.deed-head .deed-name { display: block; font-size: 20px; text-transform: uppercase; }
.deed-head .deed-sub { display: block; font-size: 11px; letter-spacing: 2px; margin-top: 4px; opacity: 0.9; }
.deed-body { padding: 12px 18px 16px; }
.deed-rents { width: 100%; border-collapse: collapse; font-size: 14px; }
.deed-rents td { padding: 4px 0; border-bottom: 1px dotted rgba(28, 20, 8, 0.35); }
.deed-rents td + td { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.deed-rents tr.main td { font-weight: 700; font-size: 15px; }
.deed-note { margin: 10px 0 0; font-size: 13px; line-height: 1.5; color: #3a2b12; }
.deed-note b { color: #1c1408; }
.deed-owner { margin: 10px 0 0; font-size: 13px; color: #5c4212; text-align: center; font-style: italic; }
.deed-close { margin-top: 14px; width: 100%; }
.prop-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.prop-actions .neon { padding: 6px 10px; font-size: 12px; }
#props li { display: block; }
.burn b { color: var(--gold-light); }

.log {
  list-style: none; margin: 0; padding: 0; max-height: 360px; overflow-y: auto;
  display: grid; gap: 6px; font-size: 14px; color: #e6d7b8;
}
.log li {
  padding: 7px 10px; border-radius: 4px;
  border-left: 3px solid var(--gold); background: rgba(0, 0, 0, 0.2);
}

/* card reveal: parchment card with gold trim over a dimmed board */
.card-modal[hidden] { display: none; }
.card-modal {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center; padding: 16px;
  background: rgba(10, 6, 2, 0.7);
  backdrop-filter: blur(3px);
}
.card-face {
  width: min(360px, 100%); padding: 28px 26px 22px; text-align: center;
  color: var(--ink, #2b1d0e);
  background: #f3e7c9;
  border: 3px solid var(--gold);
  border-radius: 10px;
  box-shadow: inset 0 0 0 4px #f3e7c9, inset 0 0 0 5px var(--gold-dim), 0 20px 50px rgba(0, 0, 0, 0.6);
}
.card-kind {
  margin: 0 0 14px; font-family: var(--display); font-weight: 700;
  font-size: 15px; letter-spacing: 2px; text-transform: uppercase; color: #5c4212;
}
.card-text { margin: 0 0 22px; font-size: 18px; line-height: 1.45; color: #2b1d0e; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
}
