/* Sidepot — Estates, drawn to the Sidepot Estates Board design. The board is laid out in the
   design's own 920px units: `--u` is one of those units, so every proportion holds at any size. */

.est-wrap { container-type: inline-size; align-self: center; }
.est-wrap--wide { width: min(calc(100vh - 148px), 100%); }
.est-wrap--phone { width: calc(100% - 16px); margin: 10px auto 0; }

.est-frame {
  padding: calc(100cqw * 16 / 952);
  border-radius: calc(100cqw * 12 / 952);
  background: linear-gradient(#32201a, #1d1310);
  box-shadow: 0 34px 76px rgba(0, 0, 0, 0.62), inset 0 0 0 1px rgba(201, 162, 39, 0.5);
}

.est-board {
  --u: calc(100cqw / 920);
  container-type: inline-size;
  display: grid;
  grid-template-columns: 118fr repeat(9, 76fr) 118fr;
  grid-template-rows: 118fr repeat(9, 76fr) 118fr;
  aspect-ratio: 1;
  background: #e9dfc4;
  box-shadow: inset 0 0 0 2px #14110d;
}

/* ---------- spaces ---------- */

.est-space {
  position: relative;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: #f4ecd6;
  box-shadow: inset 0 0 0 1px #14110d;
  font: inherit;
  color: #14110d;
  cursor: pointer;
}
.est-space:hover { background: #fbf4e2; }
.est-space--sel { box-shadow: inset 0 0 0 1px #14110d, inset 0 0 0 calc(var(--u) * 4) #c9a227; }
.est-space--mort .est-space__inner { opacity: 0.5; }
.est-corner { background: #f4ecd6; }

.est-space__inner {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(var(--u) * 76);
  height: calc(var(--u) * 118);
  margin-left: calc(var(--u) * -38);
  margin-top: calc(var(--u) * -59);
  transform: rotate(var(--rot));
  display: flex;
  flex-direction: column;
}
.est-corner__inner {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(var(--u) * 112);
  height: calc(var(--u) * 76);
  margin-left: calc(var(--u) * -56);
  margin-top: calc(var(--u) * -38);
  transform: rotate(var(--rot));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(var(--u) * 5);
  text-align: center;
}

.est-band {
  flex: none;
  height: calc(var(--u) * 26);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(var(--u) * 2);
  box-shadow: inset 0 -1px 0 #14110d, inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
.est-house {
  width: calc(var(--u) * 10);
  height: calc(var(--u) * 10);
  background: #2f7d4f;
  clip-path: polygon(50% 0, 100% 42%, 100% 100%, 0 100%, 0 42%);
  filter: drop-shadow(0 0 1px rgba(20, 17, 13, 0.9));
}
.est-hotel {
  width: calc(var(--u) * 22);
  height: calc(var(--u) * 11);
  background: #a8302a;
  clip-path: polygon(14% 0, 86% 0, 100% 36%, 100% 100%, 0 100%, 0 36%);
  filter: drop-shadow(0 0 1px rgba(20, 17, 13, 0.9));
}

.est-space__body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--u) * 7) calc(var(--u) * 5) calc(var(--u) * 6);
  text-align: center;
}
.est-space__top { display: flex; flex-direction: column; align-items: center; gap: calc(var(--u) * 5); }
.est-name {
  font-family: var(--narrow);
  font-size: calc(var(--u) * 8.5);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1.32;
  color: #14110d;
}
.est-glyph { font-family: var(--serif); line-height: 1; padding-top: calc(var(--u) * 5); }
.est-glyph--rail { font-size: calc(var(--u) * 24); color: #14110d; }
.est-glyph--util { font-size: calc(var(--u) * 21); color: #33487f; }
.est-glyph--fortune { font-size: calc(var(--u) * 30); color: #bb4438; }
.est-glyph--civic { font-size: calc(var(--u) * 22); color: #3b8a66; }
.est-glyph--tax { font-size: calc(var(--u) * 26); color: #8a6f3f; }

.est-price { display: flex; flex-direction: column; align-items: center; gap: calc(var(--u) * 2); }
.est-price__label {
  font-family: var(--narrow);
  font-size: calc(var(--u) * 6.5);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #8a7a60;
}
.est-price__value { font-family: var(--narrow); font-size: calc(var(--u) * 9.5); font-weight: 700; color: #14110d; }
.est-sub { font-family: var(--narrow); font-size: calc(var(--u) * 8.5); font-weight: 600; color: #6b5a44; line-height: 1.3; }
.est-sub--light { font-size: calc(var(--u) * 8); font-weight: 500; color: #8a7a60; }
.est-held { display: flex; flex-direction: column; align-items: center; gap: calc(var(--u) * 2); }
.est-held__text {
  font-family: var(--narrow);
  font-size: calc(var(--u) * 7);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #6b5a44;
}

.est-corner__over, .est-corner__sub {
  font-family: var(--narrow);
  font-size: calc(var(--u) * 8.5);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6b5a44;
}
.est-corner__name { font-family: var(--serif); line-height: 1; letter-spacing: 0.04em; }
.est-arrow { position: absolute; font-size: calc(var(--u) * 24); line-height: 1; }

/* ---------- pieces ---------- */

.est-pieces {
  position: absolute;
  inset: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-content: center;
  justify-content: center;
  gap: calc(var(--u) * 2);
  pointer-events: none;
}
.est-token {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--tok, #e8c578);
  color: #14110d;
  box-shadow: inset 0 0 0 1px rgba(20, 17, 13, 0.85), inset 0 2px 0 rgba(255, 255, 255, 0.45), 0 2px 5px rgba(20, 17, 13, 0.45);
}
.est-token svg { width: 62%; height: 62%; fill: currentColor; }
.est-token--board { width: calc(var(--u) * 30); height: calc(var(--u) * 30); }
.est-token--held { width: calc(var(--u) * 17); height: calc(var(--u) * 17); }
.est-token--turn { box-shadow: inset 0 0 0 1px rgba(20, 17, 13, 0.85), 0 0 0 calc(var(--u) * 2.5) #c9a227, 0 3px 7px rgba(20, 17, 13, 0.5); }
.est-token--jail::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: repeating-linear-gradient(90deg, transparent 0 24%, rgba(20, 17, 13, 0.8) 24% 32%);
}
.est-token--lg { width: 34px; height: 34px; }
.est-token--sm { width: 20px; height: 20px; }

/* ---------- the middle of the board ---------- */

.est-centre {
  grid-area: 2 / 2 / 11 / 11;
  position: relative;
  min-width: 0;
  min-height: 0;
  background: #e9dfc4;
  box-shadow: inset 0 0 0 1px #14110d;
  display: flex;
  align-items: center;
  justify-content: center;
}
.est-hairline { position: absolute; inset: calc(var(--u) * 22); border: 1px solid rgba(20, 17, 13, 0.12); }
.est-centre__stack {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(var(--u) * 13);
  max-width: calc(var(--u) * 420);
}
.est-rule { width: calc(var(--u) * 250); height: 1px; background: #c9a227; }
.est-wordmark { font-family: var(--serif); font-size: calc(var(--u) * 64); line-height: 0.92; letter-spacing: 0.08em; color: #14110d; }
.est-wordmark__sub {
  font-family: var(--narrow);
  font-size: calc(var(--u) * 10.5);
  font-weight: 600;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: #8a6f3f;
}
.est-centre__status { font-size: calc(var(--u) * 14); line-height: 1.45; color: #4a4036; text-align: center; }
.est-centre__status b { color: #8a6f3f; font-weight: 600; }

.est-deck {
  position: absolute;
  width: calc(var(--u) * 206);
  height: calc(var(--u) * 132);
  transform: rotate(-45deg);
  border-radius: calc(var(--u) * 8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(var(--u) * 7);
  box-shadow: 0 10px 22px rgba(20, 17, 13, 0.26), inset 0 0 0 1px #14110d, inset 0 0 0 calc(var(--u) * 4) #fbf5e4, inset 0 0 0 calc(var(--u) * 5) rgba(20, 17, 13, 0.3);
}
.est-deck--fortune { right: calc(var(--u) * 56); top: calc(var(--u) * 88); background: linear-gradient(#fbf5e4, #efe4c9); }
.est-deck--civic { left: calc(var(--u) * 56); bottom: calc(var(--u) * 88); background: linear-gradient(#fbf5e4, #ece8cd); }
.est-deck__glyph { font-family: var(--serif); font-size: calc(var(--u) * 34); line-height: 1; }
.est-deck--civic .est-deck__glyph { font-size: calc(var(--u) * 26); }
.est-deck__name {
  font-family: var(--narrow);
  font-size: calc(var(--u) * 13);
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #14110d;
}
.est-deck__count {
  font-family: var(--narrow);
  font-size: calc(var(--u) * 8.5);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8a7a60;
}

.est-dice { display: flex; gap: calc(var(--u) * 11); }
.est-dice--idle { opacity: 0.4; }
.est-die {
  width: calc(var(--u) * 46);
  height: calc(var(--u) * 46);
  padding: calc(var(--u) * 7);
  border-radius: calc(var(--u) * 8);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  background: linear-gradient(#fdfaf1, #ece2cd);
  box-shadow: 0 calc(var(--u, 1px) * 4) calc(var(--u, 1px) * 10) rgba(20, 17, 13, 0.35), inset 0 0 0 1px rgba(20, 17, 13, 0.28);
}
.est-die i { width: calc(var(--u) * 8); height: calc(var(--u) * 8); border-radius: 50%; background: #14110d; place-self: center; }
.est-die i.off { visibility: hidden; }
.est-die.roll { animation: estRoll 0.5s cubic-bezier(0.2, 0.8, 0.3, 1) both; }
.est-die.roll + .est-die.roll { animation-delay: 0.07s; }
@keyframes estRoll { from { transform: rotate(-150deg) scale(0.45); opacity: 0.2; } to { transform: none; opacity: 1; } }
.d-die-tiny { width: 30px; height: 30px; padding: 5px; border-radius: 6px; }
.d-die-tiny i { width: 5px; height: 5px; }

/* The card that was just turned over. */
.est-card {
  display: flex;
  flex-direction: column;
  gap: calc(var(--u) * 8);
  padding: calc(var(--u) * 16);
  border-radius: calc(var(--u) * 6);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.42), inset 0 0 0 1px #14110d;
  text-align: left;
  animation: estCard 0.34s cubic-bezier(0.22, 0.8, 0.3, 1) both;
}
@keyframes estCard { from { opacity: 0; transform: translateY(6%) rotate(-2deg) scale(0.94); } to { opacity: 1; transform: none; } }
.est-card--centre { width: calc(var(--u) * 250); }
.est-card__head { display: flex; align-items: center; gap: calc(var(--u) * 9); }
.est-card__glyph { font-family: var(--serif); font-size: calc(var(--u) * 19); line-height: 1; }
.est-card__deck {
  flex: 1;
  font-family: var(--narrow);
  font-size: calc(var(--u) * 10);
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #8a7a60;
}
.est-card__who { font-family: var(--narrow); font-size: calc(var(--u) * 10); color: #8a7a60; }
.est-card__title { font-family: var(--narrow); font-size: calc(var(--u) * 15); font-weight: 600; line-height: 1.4; color: #14110d; }
.est-card__body {
  font-family: var(--narrow);
  font-size: calc(var(--u) * 12);
  line-height: 1.55;
  color: #5c5245;
  border-top: 1px solid rgba(20, 17, 13, 0.14);
  padding-top: calc(var(--u) * 9);
}
/* On a phone the board is too small for card type: the card prints in the panel instead. */
.est-card--panel {
  --u: 1px;
  width: 100%;
  gap: 7px;
  padding: 12px 14px;
  background: linear-gradient(#fdfaf1, #f2e9d6);
}
.est-card--panel .est-card__glyph { font-size: 17px; }
.est-card--panel .est-card__deck, .est-card--panel .est-card__who { font-size: 9.5px; }
.est-card--panel .est-card__title { font-size: 13.5px; }
.est-card--panel .est-card__body { font-size: 12px; padding-top: 8px; }

/* Small boards keep the colour, the glyphs and the pieces; the fine print moves to the deed sheet. */
@container (max-width: 620px) {
  .est-name, .est-price, .est-sub, .est-held__text, .est-corner__over, .est-corner__sub,
  .est-wordmark__sub, .est-deck__name, .est-deck__count, .est-centre__status { display: none; }
  .est-space__body { justify-content: center; }
  .est-token--board { width: calc(var(--u) * var(--fit, 46)); height: calc(var(--u) * var(--fit, 46)); }
  .est-token--held { width: calc(var(--u) * 26); height: calc(var(--u) * 26); }
  .est-deck { gap: 0; }
  .est-deck__glyph { font-size: calc(var(--u) * 46); }
  .est-centre__stack { gap: calc(var(--u) * 18); }
}
@container (min-width: 620px) and (max-width: 760px) {
  .est-price__label { display: none; }
}

/* ---------- panel, players, standings ---------- */

.est-panel { padding: 12px 14px 0; display: flex; flex-direction: column; gap: 9px; }
.est-panel--wide { padding: 14px 22px 16px; border-bottom: 1px solid #2c211b; }
.est-status { font-size: 13.5px; line-height: 1.45; color: var(--cream-3); }
.est-status b { color: var(--gold); font-weight: 600; }
.est-time { color: var(--muted); font-variant-numeric: tabular-nums; }
.est-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.est-buttons .act { flex: 1; min-width: 116px; height: 46px; }
.est-buttons .bet { flex: none; height: 34px; padding: 0 12px; }
.est-roll { font-size: 15.5px; }
.est-note { font-size: 12px; line-height: 1.45; color: var(--muted); }
.est-clock { align-self: stretch; }
.est-lot { flex-basis: 100%; padding-left: 9px; border-left: 4px solid; font-size: 13px; color: var(--cream-2); }
.est-bid { width: 92px; height: 34px; font-size: 13px; padding: 0 10px; }
.est-offer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--cream-3);
}
.est-offer span { flex: 1; min-width: 150px; }
.est-offer b { color: var(--cream); font-weight: 600; }
.est-offer .bet { flex: none; height: 30px; padding: 0 11px; }

.est-players { display: flex; flex-direction: column; gap: 8px; padding: 12px 22px; }
.est-players--strip { flex: none; flex-direction: row; overflow-x: auto; padding: 12px 14px 2px; }
.est-player {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 8px 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}
.est-players--strip .est-player { flex: none; border-radius: 999px; }
.est-player--turn { border-color: var(--gold-deep); background: rgba(232, 197, 120, 0.08); }
.est-player--out { opacity: 0.45; }
.est-player__ring { flex: none; padding: 3px; border-radius: 50%; display: flex; background: #3a2b21; }
.est-player__who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.est-player__who b { font-size: 13px; font-weight: 600; color: var(--cream-2); }
.est-player__who span { font-size: 11.5px; color: var(--muted-2); }
.est-players--strip .est-player__who span { white-space: nowrap; }
.est-player__cash { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-variant-numeric: tabular-nums; }
.est-player__cash b { font-size: 13px; font-weight: 600; color: var(--cream); }
.est-player__cash span { font-size: 11px; color: var(--muted-2); }
.est-player .bet { flex: none; height: 28px; padding: 0 10px; }

.est-over { display: flex; flex-direction: column; gap: 7px; }
.est-over__title { font-family: var(--serif); font-size: 20px; color: var(--cream); }
.est-over__why { font-size: 11.5px; color: var(--muted-2); }
.est-place { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--cream-3); }
.est-place--me { color: var(--gold); font-weight: 600; }
.est-place__n { width: 30px; color: var(--muted); }
.est-place__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.est-place__worth { font-variant-numeric: tabular-nums; }
.est-over__again { margin-top: 8px; height: 42px; border-radius: 9px; font-size: 14px; }

/* ---------- the deed sheet and the trade sheet ---------- */

.est-modal .menu-body { gap: 14px; }
.est-deed {
  --u: 1px;
  align-self: center;
  width: min(300px, 100%);
  border-radius: 6px;
  overflow: hidden;
  background: linear-gradient(#fdfaf1, #f2e9d6);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45), inset 0 0 0 1px #14110d;
}
.est-deed__head { padding: 12px 12px 11px; text-align: center; display: flex; flex-direction: column; gap: 3px; box-shadow: inset 0 -1px 0 #14110d; }
.est-deed__kind { font-family: var(--narrow); font-size: 7.5px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; opacity: 0.75; }
.est-deed__name { font-family: var(--narrow); font-size: 13.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; line-height: 1.2; }
.est-deed__set { font-family: var(--narrow); font-size: 7.5px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.75; }
.est-deed__body { padding: 12px 13px 14px; display: flex; flex-direction: column; gap: 5px; color: #14110d; }
.est-deed__row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--narrow);
  font-size: 11px;
  color: #3a332a;
  border-top: 1px solid rgba(20, 17, 13, 0.1);
  padding-top: 4px;
}
.est-deed__row:first-child { border-top: 0; padding-top: 0; font-size: 12px; font-weight: 700; text-transform: uppercase; }
.est-deed__row span:last-child { font-weight: 600; }
.est-deed__row--on { color: #8a3a1f; }
.est-deed__row--on span:last-child { color: #8a3a1f; }
.est-deed__foot {
  border-top: 1px solid #14110d;
  margin-top: 4px;
  padding-top: 7px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-family: var(--narrow);
  font-size: 10px;
  color: #6b5a44;
}
.est-deed__foot > span { display: flex; justify-content: space-between; gap: 10px; }
.est-deed__foot > span span:last-child { font-weight: 700; color: #14110d; }

.est-sheet__status { font-size: 13px; color: var(--cream-2); }
.est-here { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 12px; color: var(--muted); }
.est-here span { margin-right: 6px; }
.est-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.est-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 11px 0 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--cream-3);
  font-size: 12.5px;
  cursor: pointer;
}
.est-chip .est-token { margin-left: 7px; }
.est-chip__band { flex: none; width: 7px; align-self: stretch; margin-right: 4px; }
.est-chip--on { border-color: var(--gold-deep); background: rgba(232, 197, 120, 0.15); color: var(--cream); }
.est-chip[disabled] { opacity: 0.4; cursor: default; }
.est-cash { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted-3); }
.est-cash .input { width: 120px; height: 38px; font-size: 14px; padding: 0 12px; }

/* ---------- layout ---------- */

.d-estates { align-items: stretch; }
.d-estates__main { flex: 1; min-width: 0; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 18px 22px; }
.d-rail--estates { width: 372px; overflow-y: auto; }
@media (max-width: 1299px) { .d-rail--estates { width: 320px; } }
.screen--estates { overflow-y: auto; }
