/* BALKANOPOLY — the game screen: shell and side panels, pop-up windows, the debt box, My properties, the journal, +1 minute.
   (Split out of the one big base.css in v9.7; files load in the order listed in index.html.) */
/* ----- game shell ----- */
#game {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#topbar {
  height: 48px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border-bottom: 1px solid var(--rule);
  background: var(--paper2);
  box-shadow:
    0 2px 0 var(--paper),
    0 3px 0 var(--rule);
  z-index: 30;
}
#topbar .brand {
  font-family: var(--disp);
  font-size: 20px;
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  gap: 8px;
}
#topbar .brand svg {
  width: 26px;
  height: 26px;
}
#topbar .sp {
  flex: 1;
}
.pill {
  border: 1px solid var(--rule);
  background: var(--paper3);
  padding: 4px 10px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--ink);
}
button.pill {
  cursor: pointer;
}
.pill.live {
  color: var(--good);
}
.pill.warn {
  color: #9a6a1d;
}
.pill.bad {
  color: var(--bad);
}
#stage {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 16px;
  padding: 12px 14px 12px 10px;
  align-items: stretch;
  justify-content: center;
}
#sidebar {
  width: clamp(340px, 29vw, 440px);
  flex: none;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 6px 8px 6px 6px;
  scrollbar-width: thin;
}
.panel {
  padding: 12px 14px;
}
.panel h4 {
  margin: 0 0 8px;
  font-size: 17px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.timer {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 30px;
  color: var(--ink);
}
.timer.urgent {
  color: var(--bad);
  animation: pulse 1s infinite;
}
@keyframes pulse {
  50% {
    opacity: 0.55;
  }
}
.turnhead {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.turnhead .who {
  flex: 1;
  min-width: 0;
}
.turnhead .who b {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 19px;
}
.turnhead .who small {
  color: var(--muted);
  font-style: italic;
  font-size: 15px;
}
.hint {
  color: var(--muted);
  font-size: 15px;
  font-style: italic;
  margin: 8px 0;
  line-height: 1.35;
}
.actions {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}
.alert {
  padding: 9px 12px;
  margin: 8px 0;
  font-size: 15px;
  line-height: 1.35;
  border: 1px solid;
}
.alert.debt {
  background: #f1d6c8;
  border-color: var(--bad);
}
/* v9.3: the debt box — what you could raise, step by step */
.dpanel .dsub {
  font-size: 14px;
  color: var(--muted);
}
.dmeter {
  height: 8px;
  margin: 9px 0 3px;
  background: rgba(168, 57, 42, 0.15);
  border: 1px solid var(--bad);
  border-radius: 999px;
  overflow: hidden;
}
.dmeter i {
  display: block;
  height: 100%;
  background: var(--good);
}
.dmeta {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}
.dpanel .dmeta b,
.dpanel .dshort b {
  display: inline;
  margin: 0;
  color: var(--ink);
}
.dsteps {
  display: grid;
  gap: 5px;
}
.dstep {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  margin-top: 5px;
  padding: 7px 9px;
  background: var(--paper3, #f7efdf);
  border: 1px solid var(--rule, #c9b48f);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.dsteps .dstep {
  margin-top: 0;
}
.dstep:hover {
  border-color: var(--ink);
}
.dstep .dnum {
  flex: none;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  font: 700 12px/1 var(--mono);
  font-style: normal;
}
.dstep.trade .dnum {
  border: 0;
  font-size: 16px;
}
.dstep .dtxt {
  flex: 1;
  min-width: 0;
}
.dstep .dtxt b {
  margin: 0;
  font-size: 15px;
}
.dstep .dtxt small {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
  font-style: italic;
}
.dstep .dval {
  flex: none;
  text-align: right;
  font: 700 14px/1.2 var(--mono);
}
.dstep .dval em {
  display: block;
  font: italic 600 12px var(--body);
  color: var(--good);
}
.dstep.covers {
  border: 2px solid var(--good);
  background: #e6ecd9;
}
.dstep.extra {
  opacity: 0.55;
}
.dshort {
  margin: 7px 0 0;
  font-size: 14px;
  color: var(--bad);
}
.dnote {
  margin-top: 7px;
  font-size: 12.5px;
  color: var(--muted);
}
.alert.offer {
  background: #dfe6d8;
  border-color: #4f6f8f;
}
.alert b {
  display: block;
  margin-bottom: 3px;
}
.prow {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 6px;
  border-bottom: 1px dashed var(--light);
  cursor: pointer;
}
.prow:last-child {
  border-bottom: 0;
}
.prow .meta {
  flex: 1;
  min-width: 0;
}
.prow .meta b {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 17px;
}
.prow .meta small {
  color: var(--muted);
  font-size: 14px;
  font-style: italic;
}
.prow .cash {
  font-weight: 700;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}
.prow.cur {
  background: #ead6ac;
}
.prow.hl {
  box-shadow: inset 0 0 0 2px var(--accent);
}
.prow:hover {
  background: #efe1bf;
}
.prow.out {
  opacity: 0.4;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  background: var(--good);
  margin-right: 4px;
}
.dot.off {
  background: var(--bad);
}
.flag {
  width: 24px;
  height: 16px;
  box-shadow: 0 0 0 1px var(--ink);
  flex: none;
  display: inline-block;
  vertical-align: middle;
}
.flag.lg {
  width: 44px;
  height: 29px;
}
input[type='range'] {
  width: 100%;
  accent-color: var(--accent);
}
.setrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
}
.setrow span {
  min-width: 64px;
  font-size: 15px;
  color: var(--muted);
  font-style: italic;
}
.jc {
  display: inline-block;
  border: 1px solid var(--gold);
  color: #7a5a1d;
  background: #f3e2b0;
  padding: 0 5px;
  font-size: 12px;
  font-weight: 700;
  margin-left: 4px;
}

/* ----- pop-up windows ----- */
#modalRoot {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
}
.ov {
  position: fixed;
  inset: 0;
  background: rgba(59, 45, 29, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  pointer-events: auto;
  animation: fadein 0.15s;
}
.ov.top {
  z-index: 3;
}
@keyframes fadein {
  from {
    opacity: 0;
  }
}
.noanim,
.noanim .modal {
  animation: none !important;
}
.modal {
  width: min(560px, 100%);
  max-height: calc(100dvh - 28px);
  overflow: auto;
  background: var(--paper);
  border: 1px solid var(--rule);
  box-shadow:
    0 0 0 5px var(--paper),
    0 0 0 6px var(--rule),
    0 24px 60px rgba(59, 45, 29, 0.5);
  padding: 18px 20px;
  animation: pop 0.18s;
  color: var(--ink);
}
.modal.wide {
  width: min(780px, 100%);
}
@keyframes pop {
  from {
    transform: translateY(12px) scale(0.97);
    opacity: 0;
  }
}
.modal h3 {
  margin: 0 0 4px;
  font-family: var(--disp);
  font-weight: 400;
  font-size: 26px;
  letter-spacing: 0.03em;
}
.modal .sub {
  color: var(--muted);
  font-size: 15px;
  font-style: italic;
  margin-bottom: 12px;
}
.xbtn {
  float: right;
  background: var(--paper3);
  border: 1px solid var(--rule);
  width: 34px;
  height: 34px;
  font-size: 16px;
  color: var(--ink);
}
.tag {
  padding: 1px 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--paper3);
  border: 1px solid var(--ink);
}
.bidrow {
  display: flex;
  gap: 8px;
  margin: 10px 0;
  flex-wrap: wrap;
}
.bigmoney {
  font-size: 40px;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.tcols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.tcol {
  background: var(--paper2);
  border: 1px solid var(--rule);
  padding: 10px;
  min-width: 0;
}
.tcol h5 {
  margin: 0 0 6px;
  font-family: var(--disp);
  font-weight: 400;
  font-size: 17px;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.pchips {
  display: grid;
  gap: 5px;
  max-height: 200px;
  overflow: auto;
  margin: 6px 0;
}
.pchip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  background: var(--paper3);
  border: 1px solid var(--light);
  font-size: 16px;
  cursor: pointer;
  text-align: left;
  color: var(--ink);
}
.pchip.on {
  background: #f3dcc8;
  border: 2px solid var(--accent);
}
.pchip.dis {
  opacity: 0.4;
  cursor: not-allowed;
}
.pchip small {
  margin-left: auto;
  color: var(--muted);
  font-style: italic;
}
.hist {
  max-height: 160px;
  overflow: auto;
  display: grid;
  gap: 5px;
  margin: 8px 0;
}
.hist div {
  background: var(--paper3);
  border: 1px solid var(--light);
  padding: 7px 9px;
  font-size: 15px;
  line-height: 1.35;
}
.preview {
  background: var(--paper3);
  border: 1px dashed var(--rule);
  padding: 10px;
  font-size: 16px;
  margin: 10px 0;
  line-height: 1.45;
}
#toast {
  position: fixed;
  left: 50%;
  bottom: 90px;
  transform: translateX(-50%);
  z-index: 130;
  background: var(--ink);
  color: var(--paper3);
  border: 1px solid var(--ink);
  box-shadow:
    0 0 0 3px var(--paper),
    0 10px 30px rgba(59, 45, 29, 0.5);
  padding: 9px 16px;
  font-size: 16px;
  max-width: 92vw;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
#toast.show {
  opacity: 1;
}
.banner {
  position: fixed;
  top: 48px;
  left: 0;
  right: 0;
  z-index: 60;
  background: var(--accent);
  color: var(--paper3);
  text-align: center;
  padding: 6px;
  font-size: 15px;
}
.stand {
  display: grid;
  gap: 6px;
  margin: 12px 0;
}
.stand div {
  display: flex;
  gap: 10px;
  align-items: center;
  background: var(--paper3);
  border: 1px solid var(--light);
  padding: 7px 10px;
  font-size: 17px;
}
.stand div span:last-child {
  margin-left: auto;
  font-weight: 700;
}
.awards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0;
}
.award {
  background: var(--paper3);
  border: 1px solid var(--light);
  padding: 8px 11px;
  font-size: 14px;
  line-height: 1.35;
  min-width: 0;
}
.award b {
  display: block;
  font-family: var(--disp);
  font-weight: 400;
  font-size: 15px;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 2px;
}
.award span {
  font-weight: 700;
  font-size: 16px;
}
.chart {
  position: relative;
  margin: 6px 0 4px;
}
.chart svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
  font-family: var(--body);
}
.chart .tipbox {
  position: absolute;
  pointer-events: none;
  background: var(--paper3);
  border: 1px solid var(--ink);
  padding: 7px 9px;
  font-size: 14px;
  line-height: 1.45;
  white-space: nowrap;
  transform: translate(-50%, -105%);
  z-index: 2;
  box-shadow: 3px 3px 0 rgba(59, 45, 29, 0.3);
}
.chart .tipbox i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 15px;
  margin: 4px 0 8px;
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.legend i {
  width: 16px;
  height: 3px;
  display: inline-block;
}
details.tbl summary {
  cursor: pointer;
  font-size: 14px;
  font-style: italic;
  color: var(--muted);
}
details.tbl table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-top: 6px;
}
details.tbl td,
details.tbl th {
  padding: 3px 6px;
  text-align: right;
  border-bottom: 1px solid var(--light);
}
details.tbl th:first-child,
details.tbl td:first-child {
  text-align: left;
}

/* computer players */
.bottag {
  font: italic 600 11px/1 var(--body);
  letter-spacing: 0.04em;
  color: var(--muted);
  border: 1px solid var(--rule);
  padding: 1px 4px;
  vertical-align: 2px;
}
.pl.addbot {
  background: var(--paper3);
}

/* journal links: tap a city to see its postcard, "view trade" to open that trade */
.jl {
  cursor: pointer;
  text-decoration: underline dotted;
  text-underline-offset: 2px;
}
.jl:hover {
  color: var(--wax, #a8392a);
}
.jtr {
  font: inherit;
  font-size: 0.85em;
  padding: 0 6px;
  margin-left: 2px;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  border-radius: 3px;
  cursor: pointer;
}

/* debt: how much more you still need, always in sight */
.debtbar {
  position: fixed;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 85;
  max-width: calc(100vw - 32px);
  padding: 6px 14px;
  background: #f6e1d6;
  border: 2px solid var(--bad, #a8392a);
  color: var(--ink);
  font-family: var(--body);
  font-size: 15px;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(59, 45, 29, 0.3);
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.debtbar small {
  color: var(--muted);
}
@media (max-width: 760px) {
  .debtbar {
    top: auto;
    bottom: calc(100% - 100dvh + 8px);
    font-size: 13px;
  }
}

/* "+1 minute" for a player who is low on time or lost connection (shown to everyone else) */
.addtime {
  position: fixed;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 86;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 32px);
  padding: 5px 6px 5px 14px;
  background: #fbf0d4;
  border: 2px solid #b8862f;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(59, 45, 29, 0.3);
  font-family: var(--body);
  font-size: 15px;
  color: var(--ink);
  animation: pop 0.18s;
}
.addtime .btn {
  white-space: nowrap;
}
@media (max-width: 760px) {
  .addtime {
    top: auto;
    bottom: calc(100% - 100dvh + 8px);
    font-size: 13px;
  }
}

/* Border Control, Customs Check and the three taxes: the label sits at the bottom so it doesn't hide the people */
@media (min-width: 621px) {
  .pc.lowlab .pcb {
    top: auto;
    bottom: 12px;
  }
}

/* ---- My properties: summary, filter tabs, one row per country with city chips ---- */
.asum {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 8px;
}
.asum b {
  color: var(--ink);
}
.atabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.atabs button {
  padding: 3px 10px;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  font: 14px var(--body);
  border-radius: 999px;
  cursor: pointer;
}
.atabs button.on {
  background: #6b5539;
  color: #f6ecd2;
  border-color: #6b5539;
}
.arow {
  border-top: 1px dashed var(--light);
  padding: 7px 0 6px;
}
.ahead {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--disp);
  font-size: 15px;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 5px;
}
.ahead span {
  margin-left: auto;
  font-family: var(--body);
  letter-spacing: 0;
}
.achips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.achip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 92px;
  padding: 5px 9px 5px 10px;
  border: 1px solid var(--rule);
  border-left: 5px solid var(--gc);
  background: var(--paper);
  color: var(--ink);
  border-radius: 4px;
  cursor: pointer;
  text-align: left;
  font: inherit;
}
.achip:hover {
  filter: brightness(1.04);
}
.achip b {
  font-size: 16px;
}
.achip .hd {
  font-size: 10px;
  letter-spacing: 1px;
  color: #3f7a4a;
}
.achip small {
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
}
.achip.mort {
  opacity: 0.65;
  background: repeating-linear-gradient(45deg, transparent 0 6px, rgba(168, 57, 42, 0.08) 6px 12px), var(--paper);
}

/* ---- v8.4.2: build / sell bar under a city in My properties ---- */
.acell {
  display: flex;
  flex-direction: column;
  min-width: 150px;
}
.acell .achip {
  width: 100%;
}
.achip.hasbld {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.abld {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--rule);
  border-top: 1px dashed var(--light);
  border-left: 5px solid var(--gc);
  border-radius: 0 0 4px 4px;
  background: var(--paper3);
}
.abtn {
  flex: 1;
  min-height: 38px;
  padding: 4px 6px;
  border: 0;
  background: transparent;
  font: 700 13px var(--mono);
  color: var(--bad);
  white-space: nowrap;
}
.abtn.plus {
  color: var(--good);
}
.abtn:not(:disabled):hover {
  background: var(--paper2);
}
.abtn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.alv {
  display: grid;
  place-items: center;
  padding: 0 6px;
  font: 12px var(--mono);
  color: #5c4830;
  border-left: 1px dashed var(--light);
  border-right: 1px dashed var(--light);
}
@media (max-width: 700px), (pointer: coarse) {
  .abtn {
    min-height: 44px;
  }
}

/* v8.4.3: the Mortgage / Redeem line under each property in My properties */
.abtn.amort {
  color: var(--accent);
  font-weight: 700;
}
.abtn.amort.plus {
  color: var(--good);
}
.abld.amrow {
  border-radius: 0 0 4px 4px;
}
.abld:has(+ .amrow) {
  border-radius: 0;
}

/* v9.5.1: at the start of a game the player rows slide from join order into playing order */
.prow.shuf {
  animation: prowShuf 0.9s cubic-bezier(0.3, 0.9, 0.3, 1) both;
  animation-delay: calc(0.35s + var(--i) * 0.06s);
  position: relative;
  z-index: 1;
}
@keyframes prowShuf {
  from {
    transform: translateY(calc(var(--d) * 100%));
  }
}
@media (prefers-reduced-motion: reduce) {
  .prow.shuf {
    animation: none;
  }
}
