/* BALKANOPOLY — the postcards (hover / tap a space) and drawing a Chance or Community Chest card.
   (Split out of the one big base.css in v9.7; files load in the order listed in index.html.) */
/* ----- the postcard (hover a city on desktop, tap it on a phone) ----- */
#tip {
  position: fixed;
  z-index: 90;
  left: 0;
  top: 0;
  width: 580px;
  max-width: calc(100vw - 16px);
  pointer-events: none;
  /* placed with transform (cheap for the browser); fades and lifts in, glides between cities */
  transform: translate3d(var(--x, 0), var(--y, 0), 0);
  opacity: 1;
  transition:
    opacity 0.12s ease-out,
    transform 0.12s ease-out;
  will-change: transform, opacity;
}
#tip.glide {
  transition:
    opacity 0.12s ease-out,
    transform 0.16s cubic-bezier(0.2, 0.7, 0.2, 1);
}
#tip.hidden {
  display: block !important;
  opacity: 0;
  visibility: hidden;
  transform: translate3d(var(--x, 0), calc(var(--y, 0) + 6px), 0);
  transition:
    opacity 0.12s ease-in,
    transform 0.12s ease-in,
    visibility 0s linear 0.12s;
}
#tip.instant {
  transition: none !important;
}
.pc {
  display: flex;
  background: var(--paper);
  border: 1px solid var(--rule);
  box-shadow:
    0 12px 30px rgba(59, 45, 29, 0.45),
    inset 0 0 30px rgba(138, 117, 83, 0.22);
  color: var(--ink);
  min-height: 300px;
  position: relative;
  overflow: hidden;
  font-family: var(--body);
}
.pcf {
  width: 220px;
  flex: none;
  position: relative;
  background: var(--paper2);
  border-right: 1px solid #b59f78;
  overflow: hidden;
}
.pcf > svg,
.pcf > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
/* painted postcard pictures (img/postcards) fill the frame the same way as the drawings */
.pcf > img {
  object-fit: cover;
  object-position: 50% 50%;
}
.pcb {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 12px;
  background: #f6ecd2;
  border: 1px solid #4a3a28;
  box-shadow: 3px 3px 0 rgba(59, 45, 29, 0.35);
  padding: 6px 8px;
  text-align: center;
}
.pcb i {
  display: block;
  font-family: 'IM Fell English', var(--body);
  font-style: italic;
  font-size: 14px;
  line-height: 1;
}
.pcb b {
  display: block;
  font-family: var(--disp);
  font-weight: 400;
  font-size: 26px;
  line-height: 1.05;
  letter-spacing: 0.03em;
  overflow-wrap: anywhere;
}
.pcflag {
  position: absolute;
  left: 12px;
  bottom: 12px;
  line-height: 0;
}
.pcflag .flag {
  width: 34px;
  height: 23px;
  box-shadow:
    0 0 0 1px #4a3a28,
    2px 2px 0 rgba(59, 45, 29, 0.3);
}
.pcr {
  flex: 1;
  min-width: 0;
  padding: 12px 14px 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}
.pctop {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.pcmeta {
  flex: 1;
  min-width: 0;
}
.pcmeta small {
  display: block;
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--muted);
  text-transform: uppercase;
}
.pcmeta i {
  display: block;
  font-size: 15px;
  line-height: 1.2;
}
.pm {
  width: 56px;
  height: 56px;
  flex: none;
  border: 1.5px solid var(--muted);
  border-radius: 50%;
  display: grid;
  place-items: center;
  text-align: center;
  font-size: 8.5px;
  line-height: 1.15;
  color: var(--muted);
  transform: rotate(-14deg);
  overflow: hidden;
  padding: 4px;
}
.stamp {
  width: 64px;
  height: 72px;
  flex: none;
  padding: 6px 4px;
  background: var(--sc, #6b5539);
  color: #f6ecd2;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  outline: 3px dotted #f6ecd2;
  outline-offset: -3px;
  box-shadow: 0 0 0 1px #8a7553;
}
.stamp small {
  font-size: 9px;
  letter-spacing: 0.12em;
}
.stamp b {
  font-family: var(--disp);
  font-weight: 400;
  font-size: 22px;
  line-height: 1;
}
.ownst {
  align-self: flex-start;
  transform: rotate(-3deg);
  border: 2px solid var(--oc);
  color: var(--oc);
  font-family: var(--disp);
  font-size: 17px;
  letter-spacing: 0.04em;
  padding: 0 10px;
  border-radius: 3px;
  filter: brightness(0.85);
}
.lad h6 {
  margin: 0 0 5px;
  font-family: var(--disp);
  font-weight: 400;
  font-size: 15px;
  letter-spacing: 0.06em;
  border-bottom: 1px solid #b59f78;
}
.lad7 {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
}
.lad4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 3px;
}
.lad3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
}
.lc {
  text-align: center;
  padding: 4px 2px;
  border: 1px solid var(--light);
  min-width: 0;
}
.lc span {
  display: block;
  font-size: 11px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lc b {
  display: block;
  font-size: 14px;
  line-height: 1.2;
  white-space: nowrap;
}
.lc.on {
  background: var(--oc);
  border-color: var(--oc);
  color: #f6ecd2;
}
.costs {
  margin-top: auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  font-size: 13px;
}
.costs div {
  border-top: 1px dashed #b59f78;
  padding-top: 4px;
}
.costs i {
  display: block;
  color: var(--muted);
}
.costs b {
  font-size: 17px;
}
.mstamp {
  position: absolute;
  right: 22px;
  bottom: 70px;
  transform: rotate(-16deg);
  border: 3px double var(--bad);
  color: var(--bad);
  font-family: var(--disp);
  font-size: 24px;
  padding: 0 10px;
  opacity: 0.85;
  background: #f6ecd2aa;
}
.pc.plain {
  min-height: 0;
}
.pcplain {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 18px;
}
.pcico {
  width: 48px;
  height: 48px;
  flex: none;
}
.pcico svg {
  width: 100%;
  height: 100%;
}
.pcplain b {
  font-family: var(--disp);
  font-weight: 400;
  font-size: 24px;
}
.pcplain p {
  margin: 4px 0 0;
  font-size: 16px;
  line-height: 1.4;
}
.modal .pc {
  box-shadow: none;
}
@media (max-width: 620px) {
  .pc {
    flex-direction: column;
    min-height: 0;
  }
  .pcf {
    width: auto;
    height: 170px;
    border-right: 0;
    border-bottom: 1px solid #b59f78;
    background: repeating-linear-gradient(0deg, #0000 0 11px, rgba(201, 180, 140, 0.35) 11px 12px), var(--paper2);
  }
  .pcf > svg,
  .pcf > img {
    right: auto;
    width: 134px;
    border-right: 1px solid #b59f78;
  }
  .pcb {
    left: 146px;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
  }
  .pcflag {
    left: auto;
    right: 10px;
    top: 10px;
    bottom: auto;
  }
  .lad7 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ----- drawing a Telegram / an Envelope ----- */
.cardfly {
  position: fixed;
  z-index: 120;
  pointer-events: none;
  perspective: 1200px;
}
.cf3 {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transform: rotateY(180deg);
}
.cface {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow: 0 18px 40px rgba(59, 45, 29, 0.55);
  border: 1px solid var(--rule);
  overflow: hidden;
  color: var(--ink);
  font-family: var(--body);
}
.cface.back {
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.cface.back.tele {
  background: var(--accent);
  color: var(--paper3);
  outline: 2px solid var(--paper3);
  outline-offset: -10px;
}
.cface.back.tele b {
  font-family: var(--disp);
  font-weight: 400;
  font-size: 84px;
  line-height: 0.9;
}
.cface.back span {
  font-family: var(--disp);
  font-size: 24px;
  letter-spacing: 0.1em;
}
.cface.back.letter {
  background: #ead9b2;
}
.cface.back.letter .seal {
  position: static;
  transform: none;
  width: 76px;
  height: 76px;
}
.cface.front {
  display: flex;
  flex-direction: column;
}
.seal {
  position: absolute;
  left: 50%;
  top: 26%;
  transform: translateX(-50%);
  width: 60px;
  height: 60px;
  z-index: 2;
  border-radius: 46% 54% 50% 50%/52% 48% 52% 48%;
  background: #a8261b;
  border: 2px solid #6e170f;
  box-shadow:
    inset 0 0 0 7px #a8261b,
    inset 0 0 0 9px #e8a296;
}
.seal::after {
  content: '★';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #e8a296;
  font-size: 22px;
}
/* v9.9 card faces: a postage stamp (the sender's country flag, perforated edge), a round postmark, a result stamp */
.pstamp {
  flex: none;
  padding: 3px;
  background: #fbf4e2;
  outline: 1.5px dashed #8a7553;
  outline-offset: -2px;
  transform: rotate(4deg);
  box-shadow: 1px 1px 0 rgba(59, 45, 29, 0.25);
}
.pstamp > span {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  width: 40px;
  height: 46px;
  padding: 3px 3px 2px;
  box-sizing: border-box;
  border: 1px solid var(--ink);
  background: #efe4c6;
}
.pstamp > span > .flag {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  box-shadow: 0 0 0 0.5px var(--ink);
}
.pstamp > span > b {
  font: 700 9px/1 var(--mono);
  color: var(--ink);
  white-space: nowrap;
}
.postmark {
  flex: none;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 2px solid rgba(59, 45, 29, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font: 700 7.5px/1.3 var(--mono);
  color: rgba(59, 45, 29, 0.7);
  transform: rotate(-14deg);
  margin-right: -20px;
  position: relative;
  z-index: 1;
}
.cres {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
.cres .cstamp {
  border: 2.5px solid currentColor;
  padding: 3px 7px;
  font: 700 12px/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transform: rotate(-6deg);
  white-space: nowrap;
  opacity: 0;
}
.cres b {
  font: 600 28px/1 var(--body);
  white-space: nowrap;
}
.cres.good {
  color: var(--good);
}
.cres.bad {
  color: var(--bad);
}
.cres.keep {
  color: var(--accent);
}
.cres.go {
  color: #2f4a5a;
}
/* the stamp thumps down once the card has been read (typed out / opened) */
.cardfly.done .cstamp {
  opacity: 0.88;
  animation: thump 0.32s cubic-bezier(0.3, 1.6, 0.5, 1);
}
@keyframes thump {
  from {
    opacity: 0;
    transform: rotate(-6deg) scale(1.9);
  }
}
.hand2 {
  font-family: 'Caveat', 'IM Fell English', var(--body);
  font-weight: 500;
  color: #2f3e6b;
}

/* Telegram: a post office form, typed out */
.tform {
  background: #f4f1e4;
  border-color: #2f4a5a !important;
  color: #2f4a5a;
  padding: 10px 14px 10px;
  gap: 6px;
}
.tf-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tf-head > div {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.tf-head small {
  font: 700 9px/1 var(--mono);
  letter-spacing: 0.28em;
}
.tf-head > div > b {
  font: 400 26px/1 var(--disp);
}
.tf-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.4fr 0.7fr 0.7fr;
  border: 1px solid #2f4a5a;
}
.tf-grid span {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 2px 6px;
  font: 400 13px/1.1 var(--type);
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
}
.tf-grid span + span {
  border-left: 1px solid #2f4a5a;
}
.tf-grid i {
  font: 700 8px/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #2f4a5a;
  font-style: normal;
}
.tf-to {
  display: flex;
  gap: 14px;
  font: 400 11px/1.2 var(--mono);
  white-space: nowrap;
  overflow: hidden;
}
.tf-to em {
  font: 400 13px var(--type);
  color: var(--ink);
}
.tf-msg {
  margin: 0;
  flex: 1;
  font: 400 15.5px/23px var(--type);
  color: var(--ink);
  background-image: repeating-linear-gradient(transparent 0 22px, rgba(47, 74, 90, 0.3) 22px 23px);
  overflow: hidden;
}
.tf-msg.long {
  font-size: 13.5px;
  line-height: 20px;
  background-image: repeating-linear-gradient(transparent 0 19px, rgba(47, 74, 90, 0.3) 19px 20px);
}
.tf-msg.typing::after {
  content: '';
  display: inline-block;
  width: 0.55em;
  height: 1em;
  margin-left: 1px;
  vertical-align: -0.15em;
  background: var(--ink);
}
.tf-foot {
  display: flex;
  align-items: center;
  font: italic 13px var(--body);
}
.tf-foot em {
  font: 400 13px var(--type);
}

/* Envelope (official letter): fees, fines, the border */
.eoff {
  background: #fdfaf0;
  padding: 10px 18px 10px;
  gap: 6px;
}
.eo-head {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 3px double var(--ink);
  padding-bottom: 6px;
}
.eo-crest {
  width: 28px;
  height: 33px;
  flex: none;
}
.eo-head > div {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.eo-head > div > b {
  font: 400 19px/1 var(--disp);
}
.eo-head small {
  font: 700 9px/1 var(--mono);
  letter-spacing: 0.18em;
  color: var(--muted);
}
.eo-ref {
  display: flex;
  justify-content: space-between;
  font: 400 11px var(--mono);
  color: var(--muted);
}
.eo-body {
  margin: 0;
  flex: 1;
  font: 400 15px/1.4 var(--type);
}
.eo-foot {
  display: flex;
  align-items: center;
}
.eo-seal {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2.5px solid rgba(90, 61, 138, 0.75);
  box-shadow: inset 0 0 0 3px rgba(90, 61, 138, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font: 700 7px/1.3 var(--mono);
  color: rgba(90, 61, 138, 0.85);
  transform: rotate(14deg);
}

/* Envelope (airmail): money and good news */
.eair {
  padding: 8px;
  background: repeating-linear-gradient(-45deg, #b8322a 0 12px, #fbf4e2 12px 19px, #1f4e8c 19px 31px, #fbf4e2 31px 38px);
}
.ea-in {
  flex: 1;
  background: #fbf4e2;
  padding: 8px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ea-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.ea-from {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.ea-from .hand2 {
  font-size: 19px;
  line-height: 1;
  color: var(--ink);
}
.parav {
  align-self: flex-start;
  background: #1f4e8c;
  color: #fbf4e2;
  padding: 3px 7px;
  font: 700 9px/1 var(--mono);
  letter-spacing: 0.16em;
}
.ea-st {
  display: flex;
  align-items: center;
}
.ea-to {
  align-self: center;
  font-size: 22px;
  line-height: 1;
}
.ea-note {
  margin-top: auto;
  background: #f3e6c8;
  border: 1px solid var(--light);
  box-shadow: 2px 2px 0 rgba(59, 45, 29, 0.18);
  padding: 7px 12px;
  transform: rotate(-1deg);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ea-note p {
  margin: 0;
  font: 400 16px/1.25 var(--body);
}

/* Envelope (postcard): cards that send you somewhere: the painting of the place on one side */
.epost {
  flex-direction: row !important;
  background: #fbf4e2;
  padding: 9px;
  gap: 10px;
}
.ep-pic {
  position: relative;
  width: 165px;
  flex: none;
  border: 1px solid var(--ink);
  overflow: hidden;
  background: var(--paper2);
}
.ep-pic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ep-pic span {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 6px;
  background: rgba(251, 244, 226, 0.92);
  border: 1px solid var(--ink);
  padding: 3px 6px;
  font: 400 13px/1.1 var(--disp);
  text-align: center;
}
.ep-side {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.ep-top {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}
.ep-side p {
  margin: 0;
  font-size: 19px;
  line-height: 1.12;
}
.ep-sign {
  align-self: flex-end;
  font-size: 17px;
  font-weight: 700;
}
.ep-foot {
  margin-top: auto;
  display: flex;
}
.ep-foot .cres {
  margin-left: 0;
}

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .tcols {
    grid-template-columns: 1fr;
  }
  .wrap {
    padding: 16px 14px 30px;
  }
}
@media (max-width: 520px) {
  .award {
    padding: 7px 9px;
    font-size: 13px;
  }
  .award span {
    font-size: 15px;
  }
  .awards {
    grid-template-columns: 1fr 1fr;
  }
}

/* postcards for corners, card spaces and taxes */
.pc.special {
  min-height: 260px;
}
.pc.special .sptxt {
  margin: 4px 0 0;
  font-size: 17px;
  line-height: 1.45;
}
@media (max-width: 620px) {
  .pc.special {
    min-height: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  #tip,
  #tip.glide,
  #tip.hidden {
    transition: none;
  }
  .lplane {
    animation: none;
  }
  .cardfly.done .cstamp {
    animation: none;
  }
}

/* a postcard inside a window (click on a space, auction) gets the same width as the hover card,
   so all seven rent prices fit side by side */
.modal:has(.pc) {
  width: min(620px, 100%);
}
/* the auction always shows the card (it used to be folded away and closed at every bid) */
.aucard {
  margin-top: 10px;
}
/* seven rent prices side by side: a touch smaller so even "€2,000" never touches its neighbour */
.lad7 .lc {
  padding: 4px 1px;
}
.lad7 .lc b {
  font-size: 13px;
  letter-spacing: -0.02em;
}
