:root {
  --blue: #336699;
  --blue2: #aac2da;
  --ink: #172235;
  --page: #eef4fb;
  --card: #fff;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background:
    url("pics/bottomBack.gif"),
    linear-gradient(180deg, #fff 0%, var(--page) 100%);
}
.site-header {
  background: var(--blue);
  color: #fff;
  border-bottom: 4px solid var(--blue2);
}
.brand {
  width: min(1100px, calc(100% - 24px));
  margin: 0 auto;
  padding: 14px 0;
  display: flex;
  gap: 14px;
  align-items: center;
}
.logo {
  background: #fff;
  color: var(--blue);
  border: 3px solid var(--blue2);
  border-radius: 10px;
  font-weight: 800;
  padding: 8px 10px;
}
h1 { margin: 0; font-size: clamp(1.8rem, 4vw, 2.7rem); }
.site-header p { margin: 2px 0 0; color: #e9f2fb; }
.layout {
  width: min(1100px, calc(100% - 24px));
  margin: 18px auto 36px;
  display: grid;
  gap: 18px;
}
.game-card, .instructions {
  background: rgba(255,255,255,.96);
  border: 2px solid #c8d6e7;
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(30,55,90,.12);
}
.game-card { padding: 14px; }
.status-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}
.status {
  flex: 1;
  min-height: 34px;
  border: 1px solid #b8c7d8;
  border-radius: 999px;
  background: rgba(255,255,255,.95);
  padding: 8px 14px;
  text-align: center;
  font-weight: 700;
}
.score-pill {
  min-width: 120px;
  text-align: center;
  color: #fff;
  background: var(--blue);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 800;
}
.setup-panel {
  max-width: 860px;
  margin: 18px auto;
  padding: 18px;
  background: rgba(255,255,255,.96);
  border: 2px solid #111;
  border-radius: 12px;
}
.intro {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}
.intro-img {
  width: 100px;
  height: 100px;
  image-rendering: auto;
}
.setup-line, .player-row, .controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 10px;
  align-items: center;
}
.player-rows {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}
.player-row {
  background: #fff;
  border: 1px solid #d6e1ee;
  border-radius: 10px;
  padding: 8px;
}
label { font-weight: 700; }
input, select, button {
  font: inherit;
  min-height: 34px;
  border-radius: 8px;
  border: 1px solid #91a8c2;
  padding: 6px 9px;
}
button {
  cursor: pointer;
  background: linear-gradient(#fff, #e6edf5);
  font-weight: 800;
}
button:hover:not(:disabled) { transform: translateY(-1px); }
button:disabled { opacity: .48; cursor: not-allowed; }
.primary {
  color: #fff;
  background: linear-gradient(#477bb2, #285887);
  border-color: #1d456d;
}
.hidden { display: none !important; }
.game-panel { display: grid; gap: 12px; justify-items: center; }
.canvas-shell { width: min(100%, 980px); margin: 0 auto; }
canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 900 / 620;
  border: 3px solid #111;
  background: #ceffce;
  box-shadow: 0 4px 14px rgba(0,0,0,.18);
  touch-action: none;
}
.controls { margin-top: 4px; }
.check {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 7px 10px;
  border: 1px solid #b8c7d8;
  border-radius: 999px;
  background: rgba(255,255,255,.95);
}
.instructions { padding: 18px 22px; line-height: 1.5; }
.instructions h2 { margin-top: 0; color: #244d76; }
@media (max-width: 760px) {
  .layout, .brand { width: min(100% - 12px, 1100px); }
  .game-card { padding: 8px; }
  .status-row { align-items: stretch; gap: 8px; }
  .status { font-size: .86rem; padding: 7px 10px; }
  .score-pill { min-width: 82px; padding: 7px 8px; }
  .intro { flex-direction: column; text-align: center; }
  .player-row input { max-width: 130px; }
  button { min-height: 42px; }
  .canvas-shell { width: 100%; overflow-x: visible; }
  canvas { min-width: 0; }
  .instructions { padding: 14px; }
}


/* v1.1 management controls */
.controls button {
  white-space: nowrap;
}


/* v1.2 in-page choice dialogs */
.choice-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(12, 20, 36, .55);
}
.choice-overlay.hidden { display: none !important; }
.choice-dialog {
  width: min(760px, 96vw);
  max-height: min(760px, 92vh);
  overflow: auto;
  background: #fff;
  color: var(--ink);
  border: 2px solid #111;
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(0,0,0,.35);
  padding: 18px;
}
.choice-dialog h3 {
  margin: 0 0 6px;
  font-size: 1.35rem;
}
.choice-subtitle {
  margin: 0 0 12px;
  color: #445;
}
.choice-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}
.choice-card {
  width: 100%;
  min-height: 78px;
  text-align: left;
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: start;
  border-radius: 12px;
  padding: 10px;
  background: linear-gradient(#fff, #eef4fb);
}
.choice-card:hover {
  transform: translateY(-1px);
}
.choice-card-swatch {
  width: 16px;
  height: 42px;
  border: 1px solid #111;
  border-radius: 4px;
}
.choice-card-title {
  display: block;
  font-weight: 800;
  margin-bottom: 3px;
}
.choice-card-detail {
  display: block;
  font-size: .9rem;
  color: #37445c;
  line-height: 1.25;
}
.choice-form {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}
.choice-form.hidden { display: none !important; }
.choice-form label {
  display: grid;
  gap: 5px;
}
.choice-form input {
  width: 100%;
}
.choice-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}
@media (max-width: 760px) {
  .choice-dialog {
    padding: 14px;
  }
  .choice-list {
    grid-template-columns: 1fr;
  }
}


/* v1.3: keep destructive/new-game controls separate */
.secondary-controls {
  margin-top: -4px;
}
.secondary-controls #newGame {
  border-color: #c48a8a;
}


/* v1.4 richer management / event dialogs */
.property-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: .92rem;
}
.property-table th,
.property-table td {
  border-bottom: 1px solid #dbe5f0;
  padding: 7px 6px;
  text-align: left;
  vertical-align: top;
}
.property-table th {
  background: #eef4fb;
  color: #244d76;
}
.choice-wide {
  grid-column: 1 / -1;
}
.event-card {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 14px;
  align-items: center;
  margin: 8px 0;
}
.event-card img {
  max-width: 105px;
  max-height: 105px;
  object-fit: contain;
}
.event-card-title {
  font-weight: 800;
  font-size: 1.05rem;
}
.event-card-detail {
  line-height: 1.35;
  color: #37445c;
  margin-top: 5px;
}
.auction-bids {
  display: grid;
  gap: 8px;
}
.auction-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  border: 1px solid #d6e1ee;
  border-radius: 10px;
  padding: 8px;
}
.auction-row input {
  width: 100px;
}
@media (max-width: 760px) {
  .event-card {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .property-table {
    font-size: .84rem;
  }
  .property-table th:nth-child(3),
  .property-table td:nth-child(3),
  .property-table th:nth-child(4),
  .property-table td:nth-child(4) {
    display: none;
  }
}

/* v1.5 enhanced auction, trade package, and debt screens */
.choice-card.selected { outline: 3px solid #2a74b8; background: linear-gradient(#eef8ff, #d8ebff); }
.multi-select-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.auction-current { border: 2px solid #2a74b8; background: #eef8ff; }
.auction-pass { opacity: .55; }
.debt-log { background: #fff7e6; border: 1px solid #d9b66f; border-radius: 10px; padding: 10px 12px; margin: 8px 0; line-height: 1.35; }

/* v1.6 manual debt and polished event/property cards */
.choice-card.danger { border-color: #b73333; background: linear-gradient(#fff5f5, #ffe1e1); }
.choice-card.good { border-color: #3c8b45; background: linear-gradient(#f4fff5, #e2f6e5); }
.debt-meter {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  background: #f7fbff;
  border: 1px solid #bfd3ea;
  border-radius: 10px;
  margin-bottom: 10px;
}
.debt-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 10px;
}
.event-card {
  background: linear-gradient(#fff, #f5f8fc);
  border-radius: 12px;
  border: 1px solid #d8e2ee;
  padding: 10px;
}

/* v1.7 polish */
.status, .score-pill {
  box-shadow: 0 1px 3px rgba(0,0,0,.12);
}
.choice-subtitle {
  white-space: pre-line;
}

/* v1.11 mobile fit + debt dialog fix */
@media (max-width: 760px) {
  .canvas-shell {
    width: min(100%, calc(100vw - 20px));
    overflow: visible;
  }
  canvas {
    width: 100% !important;
    min-width: 0 !important;
    max-width: calc(100vw - 20px);
  }
  .controls {
    gap: 6px;
  }
  .controls button {
    font-size: .9rem;
    padding: 6px 7px;
  }
}
.debt-actions-list {
  margin: 10px 0;
}

/* v1.15 computer player setup */
.player-row select[id^="ptype"] {
  min-width: 104px;
}

/* v1.17 computer pacing dialogs */
.computer-event-note {
  margin-top: 10px;
  font-size: .9rem;
  color: #555;
  text-align: center;
  font-style: italic;
}
.computer-event-card {
  border-color: #b7cce3;
  background: linear-gradient(#ffffff, #eef6ff);
}

/* v1.19 dialog pacing */
.computer-event-note {
  opacity: .86;
}


/* v1.23 JGames standardization */
body{
  position:relative;
}
.jgames-home-badge{
  position:fixed;
  top:12px;
  right:12px;
  z-index:10000;
  width:44px;
  height:44px;
  display:grid;
  place-items:center;
  border-radius:14px;
  background:#fff;
  border:1px solid rgba(11,46,131,.18);
  box-shadow:0 8px 22px rgba(11,46,131,.18);
  transition:transform .12s ease, box-shadow .12s ease;
}
.jgames-home-badge img{
  width:32px;
  height:32px;
  display:block;
}
.jgames-home-badge:hover{
  transform:translateY(-1px);
  box-shadow:0 12px 28px rgba(11,46,131,.22);
}
.brand{
  padding-right:60px;
}
.logo{
  min-width:96px;
  min-height:96px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:10px;
}
.logo img{
  display:block;
  max-width:72px;
  max-height:72px;
  width:auto;
  height:auto;
}
.footer{
  width:min(1100px, calc(100% - 24px));
  margin:0 auto 36px;
  padding:18px 18px 24px;
  background:rgba(255,255,255,.96);
  border:2px solid #c8d6e7;
  border-radius:14px;
  box-shadow:0 12px 30px rgba(30,55,90,.12);
  text-align:center;
  font:14px/1.45 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;
}
.footer nav{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:8px 14px;
  margin-bottom:12px;
  font-weight:700;
}
.footer a{
  color:#0B2E83;
  text-decoration:none;
}
.footer a:hover{
  color:#D80D16;
  text-decoration:underline;
}
.footer p{
  margin:6px 0 0;
  color:#34445c;
}
.instructions p{
  margin-bottom:.95rem;
}
@media(max-width:760px){
  .jgames-home-badge{
    width:40px;
    height:40px;
    border-radius:13px;
  }
  .jgames-home-badge img{
    width:29px;
    height:29px;
  }
  .brand{
    padding-right:52px;
  }
  .logo{
    min-width:72px;
    min-height:72px;
    padding:8px;
  }
  .logo img{
    max-width:54px;
    max-height:54px;
  }
  .footer{
    width:min(100% - 12px, 1100px);
    padding:14px 12px 18px;
    margin-bottom:24px;
  }
}

