/* HOODOPOLY — the 40-tile board, side panels and in-match modals. */

.table {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(290px, 370px);
  gap: clamp(12px, 1.6vw, 24px);
  padding: clamp(10px, 1.6vw, 22px);
  max-width: 1560px; margin: 0 auto;
  align-items: start;
}
.table__board { display: grid; place-items: center; min-width: 0; }

/* ─────────── board grid ─────────── */

.board {
  width: min(100%, 84vh, 940px);
  aspect-ratio: 1;
  display: grid;
  /* corners are wider, like a real board */
  grid-template-columns: 1.45fr repeat(9, 1fr) 1.45fr;
  grid-template-rows: 1.45fr repeat(9, 1fr) 1.45fr;
  gap: 2px;
  padding: 8px;
  background: linear-gradient(145deg, #1b4437, #0f2a21);
  border: 2px solid var(--brass);
  border-radius: 3px;
  box-shadow: 0 40px 90px rgba(0,0,0,.6), inset 0 0 70px rgba(0,0,0,.45);
  position: relative;
}

.board__center {
  grid-column: 2 / 11; grid-row: 2 / 11;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: clamp(8px, 1.4vw, 22px) clamp(8px, 1.4vw, 20px);
  gap: 8px; min-width: 0; overflow: hidden;
}
.board__logo { text-align: center; }
.board__logo-h {
  display: block;
  font-family: "Bodoni Moda", Didot, serif; font-weight: 700;
  font-size: clamp(20px, 3.6vw, 48px); letter-spacing: .04em;
  color: var(--felt); transform: rotate(-4deg);
  text-shadow: 0 2px 0 rgba(0,0,0,.35);
}
.board__logo-sub {
  display: block; margin-top: 4px;
  font-size: clamp(8px, .9vw, 11px); letter-spacing: .22em; text-transform: uppercase;
  color: var(--brass); transform: rotate(-4deg);
}
.tape--center { width: 100%; height: 26px; border-radius: 2px; }
.tape--center .tape__item { font-size: 10.5px; }
.tape--center::before { background: linear-gradient(90deg, #143529, transparent); }
.tape--center::after { background: linear-gradient(270deg, #143529, transparent); }

/* drawn card */
.card-slot {
  width: min(100%, 340px); text-align: center;
  padding: 10px 14px; border-radius: 2px;
  background: linear-gradient(180deg, #fbf6ea, var(--felt));
  color: var(--ink);
  box-shadow: 0 10px 26px rgba(0,0,0,.45);
  animation: cardIn .35s var(--ease);
}
@keyframes cardIn { from { opacity: 0; transform: translateY(-8px) rotate(-2deg); } }
.card-slot__deck { display: block; font-size: 9.5px; letter-spacing: .22em; color: var(--brass-dim); }
.card-slot__text { display: block; font-size: 12.5px; margin-top: 3px; }

/* dice */
.dice-zone { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.dice { display: flex; gap: 8px; }
.die {
  width: clamp(34px, 4.4vw, 52px); height: clamp(34px, 4.4vw, 52px);
  display: grid; place-items: center;
  background: linear-gradient(160deg, #fdfaf2, #ddd3bd);
  color: var(--ink); border-radius: 8px;
  font-size: clamp(18px, 2.6vw, 28px); font-weight: 600;
  box-shadow: 0 5px 0 #b3a88f, 0 12px 22px rgba(0,0,0,.45);
}
.die.is-rolling { animation: dieRoll .5s var(--ease); }
@keyframes dieRoll {
  0% { transform: rotate(0) scale(1); }
  30% { transform: rotate(-20deg) scale(1.16); }
  60% { transform: rotate(14deg) scale(1.06); }
  100% { transform: rotate(0) scale(1); }
}
.dice-actions { display: flex; gap: 8px; align-items: center; }
.btn--roll { padding: 10px 24px; }
.dice-hint {
  margin: 0; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
  color: rgba(242,234,216,.5); text-align: center;
}

/* ─────────── tiles ─────────── */

.tile {
  position: relative;
  background: linear-gradient(180deg, #fbf6ea, var(--felt));
  color: var(--ink);
  display: flex; overflow: visible;
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
  transition: transform .14s var(--ease), box-shadow .14s var(--ease);
  min-width: 0; min-height: 0;
}
.tile:hover, .tile:focus-visible { transform: scale(1.04); z-index: 20; box-shadow: 0 8px 20px rgba(0,0,0,.5); outline: none; }
.tile:focus-visible { box-shadow: 0 0 0 2px var(--brass), 0 8px 20px rgba(0,0,0,.5); }
.tile.is-here { box-shadow: 0 0 0 2px var(--brass), 0 8px 22px rgba(201,162,39,.45); z-index: 10; }
.tile.is-target { animation: targetPulse 1.2s ease-in-out infinite; z-index: 12; }
@keyframes targetPulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(201,162,39,.5); }
  50% { box-shadow: 0 0 0 5px rgba(201,162,39,.18); }
}
.tile.is-mortgaged { filter: grayscale(.75) brightness(.9); }
.tile.is-mortgaged::before {
  content: "MORTGAGED";
  position: absolute; inset: auto 0 40% 0; z-index: 6;
  font-size: 6px; letter-spacing: .1em; text-align: center;
  color: var(--down); transform: rotate(-12deg);
}

/* the colour bar sits on the inner edge, so it always faces the centre */
.tile__bar { background: var(--c); flex: none; position: relative; }
.tile--bottom { flex-direction: column; }
.tile--bottom .tile__bar { height: 18%; order: -1; }
.tile--top { flex-direction: column-reverse; }
.tile--top .tile__bar { height: 18%; }
.tile--left { flex-direction: row-reverse; }
.tile--left .tile__bar { width: 18%; }
.tile--right { flex-direction: row; }
.tile--right .tile__bar { width: 18%; }

.tile__body {
  flex: 1; min-width: 0; min-height: 0;
  padding: 3px 2px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; text-align: center; overflow: hidden;
}
.tile__ticker {
  font-family: Anton, "Arial Narrow", sans-serif;
  font-size: clamp(6px, .82vw, 11px); letter-spacing: .02em; line-height: 1;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tile__name {
  font-size: clamp(4.5px, .58vw, 8px); line-height: 1.05;
  color: rgba(22,19,15,.62);
  max-width: 100%; overflow: hidden;
}
.tile__price { font-size: clamp(5px, .62vw, 8.5px); font-weight: 600; }
.tile__glyph { font-size: clamp(9px, 1.3vw, 18px); line-height: 1; }
.tile__note { font-size: clamp(4.5px, .55vw, 7.5px); color: rgba(22,19,15,.55); }
.tile__body--special .tile__name {
  font-family: Anton, sans-serif; font-size: clamp(6px, .85vw, 12px);
  color: var(--ink); letter-spacing: .02em;
}

/* corners get more room */
.tile--corner .tile__glyph { font-size: clamp(14px, 2vw, 28px); }
.tile--corner .tile__name { font-size: clamp(7px, 1vw, 14px); }
.tile--go { background: linear-gradient(150deg, #d8cba8, var(--felt)); }
.tile--jail { background: linear-gradient(150deg, #e6bdb6, var(--felt)); }
.tile--go-to-jail { background: linear-gradient(150deg, #e0b0a8, var(--felt)); }
.tile--free-parking { background: linear-gradient(150deg, #c9cfc4, var(--felt)); }
.tile--chance, .tile--community-chest { background: linear-gradient(150deg, #e8dcc0, var(--felt)); }

/* ownership flag */
.tile__flag {
  position: absolute; top: 0; right: 0; width: 7px; height: 7px; z-index: 5;
  transition: background .2s;
}
.tile--left .tile__flag, .tile--top .tile__flag { top: auto; bottom: 0; }

/* houses and hotels */
.tile__pips {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center; gap: 2px;
}
.pip {
  width: clamp(3px, .42vw, 6px); height: clamp(3px, .42vw, 6px);
  background: #2f8f52; border: .5px solid rgba(0,0,0,.4); border-radius: 1px;
}
.pip--hotel {
  width: clamp(7px, .9vw, 13px); height: clamp(4px, .5vw, 7px);
  background: #c2382b; border-radius: 1px;
}

/* player tokens */
.tile__tokens {
  position: absolute; inset: auto 1px 1px auto; z-index: 8;
  display: flex; flex-wrap: wrap-reverse; gap: 1px; justify-content: flex-end;
  max-width: 82%;
}
.token {
  width: clamp(9px, 1.15vw, 16px); height: clamp(9px, 1.15vw, 16px);
  border-radius: 50%; display: grid; place-items: center;
  font-size: clamp(5px, .68vw, 9px);
  background: var(--c, var(--brass));
  border: 1px solid rgba(0,0,0,.4);
  box-shadow: 0 1px 3px rgba(0,0,0,.5);
}

/* hover card */
.tile__tip {
  position: absolute; z-index: 40; left: 50%; bottom: 105%;
  transform: translateX(-50%) scale(.96);
  width: max-content; max-width: 210px;
  padding: 8px 10px; font-size: 10.5px; line-height: 1.45;
  background: var(--ink); color: var(--felt);
  border-left: 3px solid var(--c);
  box-shadow: 0 12px 30px rgba(0,0,0,.55);
  opacity: 0; pointer-events: none; transition: .15s var(--ease);
}
.tile:hover .tile__tip, .tile:focus-visible .tile__tip { opacity: 1; transform: translateX(-50%) scale(1); }
.tile--top .tile__tip { bottom: auto; top: 105%; }
.tile--left .tile__tip { left: 105%; bottom: auto; top: 50%; transform: translateY(-50%) scale(.96); }
.tile--left:hover .tile__tip { transform: translateY(-50%) scale(1); }
.tile--right .tile__tip { left: auto; right: 105%; bottom: auto; top: 50%; transform: translateY(-50%) scale(.96); }
.tile--right:hover .tile__tip { transform: translateY(-50%) scale(1); }
.tile__tip b { color: var(--brass); }

/* ─────────── side panels ─────────── */

.table__side { display: grid; gap: 10px; min-width: 0; }
.panel {
  background: rgba(0,0,0,.28);
  border: 1px solid rgba(242,234,216,.14);
  border-radius: 3px;
  padding: 11px 12px;
}
.panel__title {
  font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase;
  color: rgba(242,234,216,.5); margin-bottom: 8px;
}

.pcard {
  display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; align-items: center;
  padding: 8px 9px; border-radius: 2px; margin-bottom: 5px;
  background: rgba(242,234,216,.05);
  border-left: 3px solid var(--c, var(--brass));
  transition: .2s var(--ease);
}
.pcard:last-child { margin-bottom: 0; }
.pcard.is-turn { background: rgba(201,162,39,.16); box-shadow: 0 0 0 1px rgba(201,162,39,.4); }
.pcard.is-out { opacity: .4; filter: grayscale(1); }
.pcard__ava {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font-size: 14px; background: rgba(0,0,0,.35); border: 1px solid rgba(242,234,216,.2);
}
.pcard__name { font-size: 12.5px; font-weight: 500; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pcard__name .tag {
  font-size: 8px; letter-spacing: .08em; padding: 1px 3px;
  border: 1px solid currentColor; color: rgba(242,234,216,.45);
}
.pcard__name .tag--jail { color: #f0a79e; }
.pcard__sets { display: flex; gap: 2px; margin-top: 3px; flex-wrap: wrap; }
.pcard__set { width: 12px; height: 5px; border-radius: 1px; background: var(--c); }
.pcard__meta { font-size: 9.5px; color: rgba(242,234,216,.45); margin-top: 2px; }
.pcard__money { text-align: right; }
.pcard__cash { font-size: 14px; font-weight: 600; color: var(--brass); }
.pcard__nw { font-size: 9px; color: rgba(242,234,216,.45); }

/* portfolio / manage */
.manage-list { display: grid; gap: 4px; max-height: 26vh; overflow-y: auto; }
.mrow {
  display: grid; grid-template-columns: 4px 1fr auto; gap: 7px; align-items: center;
  padding: 5px 7px; background: rgba(242,234,216,.05); border-radius: 2px;
  font-size: 11.5px;
}
.mrow__bar { align-self: stretch; background: var(--c); border-radius: 1px; }
.mrow__t { font-weight: 500; }
.mrow__sub { font-size: 9px; color: rgba(242,234,216,.45); }
.mrow__acts { display: flex; gap: 3px; }
.mini {
  font-family: inherit; font-size: 9.5px; padding: 3px 6px; cursor: pointer;
  background: transparent; color: var(--felt); border-radius: 2px;
  border: 1px solid rgba(242,234,216,.3);
}
.mini:hover:not(:disabled) { background: rgba(242,234,216,.12); }
.mini:disabled { opacity: .3; cursor: not-allowed; }
.mini--build { border-color: #2f8f52; color: #8fe0b0; }
.mini--sell { border-color: var(--down); color: #f0a79e; }
.btn--wide { width: 100%; margin-top: 7px; }
.empty--sm { padding: 12px 8px; font-size: 11px; }

.logfeed {
  list-style: none; margin: 0; padding: 0; max-height: 26vh; overflow-y: auto;
  font-size: 11.5px; display: flex; flex-direction: column-reverse;
}
.logfeed li { padding: 4px 0; border-bottom: 1px solid rgba(242,234,216,.07); color: rgba(242,234,216,.72); }
.logfeed li.k-roll { color: var(--felt); }
.logfeed li.k-rent { color: #f0a79e; }
.logfeed li.k-buy { color: #7ed6a8; }
.logfeed li.k-build { color: #8fe0b0; }
.logfeed li.k-go { color: var(--brass); }
.logfeed li.k-jail { color: #f0a79e; }
.logfeed li.k-card { color: #e6d08a; }
.logfeed li.k-auction { color: #b9c7ff; }
.logfeed li.k-trade { color: #d9b3ff; }
.logfeed li.k-bust { color: var(--down); font-weight: 600; }
.logfeed li.k-end { color: var(--brass); font-weight: 600; }
.logfeed li.k-mortgage { color: #cbb68a; }
.logfeed li.k-system, .logfeed li.k-timeout, .logfeed li.k-info { color: rgba(242,234,216,.38); font-size: 10.5px; }

.turnbar { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.turnbar__label { font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: rgba(242,234,216,.45); }
.turnbar__who { font-family: Anton, sans-serif; font-size: 15px; letter-spacing: .03em; }
.turnbar__round { font-size: 11px; color: rgba(242,234,216,.5); }
.turnbar__timer { font-size: 11.5px; color: var(--brass); }
.turnbar.is-you .turnbar__who { color: var(--brass); }
.fair { font-size: 10px; color: rgba(242,234,216,.45); }
.fair .mono { color: rgba(242,234,216,.7); }

/* ─────────── modals ─────────── */

.modal {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center; padding: 16px;
  background: rgba(6,18,14,.75); backdrop-filter: blur(3px);
  animation: screenIn .2s var(--ease);
}
.modal__card {
  width: min(430px, 100%);
  background: linear-gradient(180deg, #fbf6ea, var(--felt));
  color: var(--ink);
  border-radius: 3px; overflow: hidden;
  box-shadow: var(--paper-shadow);
  position: relative;
}
.modal__card--wide { width: min(640px, 100%); }
.modal__stripe {
  background: var(--c, var(--brass)); color: #fff;
  padding: 7px 14px; font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase;
}
.modal__stripe--auction { background: #2B4C7E; }
.modal__stripe--trade { background: #6B4C9A; }
.modal__stripe--jail { background: #C2382B; }
.modal__name { font-size: 30px; padding: 14px 18px 0; line-height: 1; }
.modal__units { padding: 5px 18px 0; font-size: 12px; color: rgba(22,19,15,.6); }
.modal__rows { padding: 12px 18px 4px; }
.modal__row {
  display: flex; justify-content: space-between; gap: 12px; padding: 5px 0;
  font-size: 12.5px; border-bottom: 1px solid rgba(22,19,15,.1);
}
.modal__row b { font-size: 14px; }
.modal__row--calc { border-bottom: 0; font-size: 11px; color: rgba(22,19,15,.5); display: block; padding-top: 7px; }
.modal__actions { display: flex; gap: 9px; padding: 12px 18px 16px; }
.modal__actions .btn { flex: 1; }
.modal__timer { height: 3px; background: rgba(22,19,15,.12); }
.modal__timer div { height: 100%; background: var(--brass); width: 100%; }

/* auction */
.auction-state { padding: 12px 18px 0; }
.auction-state__bid { display: flex; align-items: baseline; gap: 9px; }
.auction-state__bid b { font-size: 26px; }
.auction-state__bid .muted { color: rgba(22,19,15,.5); font-size: 11px; }
.auction-state__bid .mono { font-size: 11px; color: rgba(22,19,15,.6); }
.auction-bidders { display: flex; gap: 5px; margin-top: 9px; flex-wrap: wrap; }
.abidder {
  font-size: 10.5px; padding: 3px 7px; border-radius: 2px;
  border: 1px solid rgba(22,19,15,.25); color: rgba(22,19,15,.7);
}
.abidder.is-turn { border-color: var(--brass-dim); background: rgba(201,162,39,.2); font-weight: 600; }
.abidder.is-out { opacity: .35; text-decoration: line-through; }
.auction-controls { display: flex; gap: 7px; padding: 12px 18px 14px; }
.auction-controls .input { flex: 1; }
.input--sm { padding: 8px 10px; font-size: 13px; background: rgba(22,19,15,.06); color: var(--ink); border-color: rgba(22,19,15,.25); }
.input--sm:focus { border-color: var(--brass-dim); }

/* trade */
.trade-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 14px 18px 0; }
.trade-h { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: rgba(22,19,15,.55); margin-bottom: 6px; }
.trade-list { display: grid; gap: 3px; max-height: 210px; overflow-y: auto; }
.trade-item {
  display: flex; align-items: center; gap: 6px; padding: 4px 6px;
  font-size: 11.5px; border: 1px solid rgba(22,19,15,.15); border-radius: 2px; cursor: pointer;
}
.trade-item input { accent-color: var(--brass-dim); }
.trade-item.is-on { background: rgba(201,162,39,.2); border-color: var(--brass-dim); }
.trade-item i { width: 4px; height: 14px; background: var(--c); border-radius: 1px; }
.trade-partner {
  display: grid; grid-template-columns: auto 1fr auto 110px; gap: 8px;
  align-items: center; padding: 12px 18px 0; font-size: 11.5px;
}
.trade-partner .muted { color: rgba(22,19,15,.55); }

/* ─────────── responsive ─────────── */

@media (max-width: 1180px) {
  .table { grid-template-columns: 1fr; }
  .board { width: min(100%, 94vw, 760px); }
  .table__side { grid-template-columns: 1fr 1fr; display: grid; }
  .panel--log { grid-column: 1 / -1; }
  .logfeed, .manage-list { max-height: 200px; }
}
@media (max-width: 760px) {
  .table__side { grid-template-columns: 1fr; }
  .board { padding: 5px; gap: 1px; }
  .board__logo-h { font-size: 19px; }
  .tape--center, .tile__name, .tile__price { display: none; }
  .turnbar { display: none; }
  .trade-grid { grid-template-columns: 1fr; }
  .trade-partner { grid-template-columns: 1fr 1fr; }
}
