/* ============================================================
   MONOPOLY - STYLESHEET
   Made for phones: one column (board, players, actions) with the move buttons
   pinned to the bottom of the screen. Larger screens show the same column centred.
   ============================================================ */

:root {
  --felt: #0f3d2e;
  --felt-dark: #0a2b20;
  --felt-light: #165440;
  --panel: rgba(8, 30, 23, 0.82);
  --panel-border: rgba(255, 255, 255, 0.1);
  --text: #f4f1e8;
  --muted: #a9bdb3;
  --gold: #f5c542;
  --gold-dark: #c99a1c;
  --red: #e5484d;
  --green: #30a46c;
  --blue: #3b82f6;

  --board-bg: #cfe6d3;
  --tile-bg: #fbf8ef;
  --tile-line: #1d2a24;
  --tile-text: #1d2a24;

  --radius: 14px;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  min-height: 100%;
}

body {
  min-height: 100dvh;
  background: radial-gradient(ellipse at 50% 0%, var(--felt-light) 0%, var(--felt) 45%, var(--felt-dark) 100%) fixed;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Vazirmatn, Tahoma, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.4;
}

button, input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  touch-action: manipulation;
}

[hidden] {
  display: none !important;
}

.app {
  min-height: 100dvh;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.muted { color: var(--muted); }
.small { font-size: 0.82rem; }
.center { text-align: center; }

.row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.row > input {
  flex: 1;
  min-width: 0;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ---------- Panels, buttons, inputs ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}

.panel-title {
  font-weight: 700;
  margin-bottom: 10px;
  display: flex;
  gap: 6px;
  align-items: baseline;
}

.btn {
  border: 0;
  border-radius: 12px;
  padding: 11px 16px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.1);
  transition: transform 0.08s ease, filter 0.15s ease, opacity 0.15s ease;
  min-height: 44px;
}

.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; filter: grayscale(1); cursor: not-allowed; box-shadow: none; }
.btn-lg { padding: 14px 18px; font-size: 1.05rem; }
.btn-sm { padding: 7px 12px; min-height: 36px; font-size: 0.88rem; }

.btn-primary {
  background: linear-gradient(180deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: #2a1d00;
  box-shadow: 0 4px 14px rgba(245, 197, 66, 0.35);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.btn-danger {
  background: rgba(229, 72, 77, 0.18);
  border: 1px solid rgba(229, 72, 77, 0.55);
  color: #ffd0d1;
}

.btn-green {
  background: linear-gradient(180deg, #3fbf7f 0%, #24885a 100%);
  color: #fff;
}

.btn-link {
  background: none;
  border: 0;
  color: var(--muted);
  text-decoration: underline;
  min-height: 36px;
  padding: 6px 10px;
  font-weight: 600;
}

input[type="text"], input[type="number"] {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 11px 14px;
  min-height: 44px;
  outline: none;
}

input:focus { border-color: var(--gold); }

.icon-btn {
  border: 0;
  background: rgba(255, 255, 255, 0.08);
  width: 40px;
  height: 40px;
  border-radius: 12px;
  font-size: 1.1rem;
  display: grid;
  place-items: center;
  flex: none;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 16px;
}

.chip {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.82rem;
}

/* ============================================================
   LANDING
   ============================================================ */
.landing, .lobby {
  max-width: 520px;
  margin: 0 auto;
  padding: 20px 16px calc(28px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hero {
  text-align: center;
  padding: 18px 0 6px;
}

.hero-logo {
  font-size: 2.2rem;
  display: flex;
  justify-content: center;
  gap: 10px;
  align-items: center;
}

.hero-hat {
  font-size: 3.2rem;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.5));
}

.hero-die {
  color: var(--gold);
  font-size: 2.4rem;
}

.hero-title {
  font-size: 2.6rem;
  letter-spacing: 0.12em;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 3px 0 #b3261e, 0 8px 20px rgba(0, 0, 0, 0.5);
}

.hero-tagline {
  color: var(--muted);
  margin-top: 4px;
}

.lead { line-height: 1.5; }

.account {
  display: flex;
  gap: 12px;
  align-items: center;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  background: var(--gold);
  color: #2a1d00;
  flex: none;
}

.account-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.account-name {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.mode-card {
  text-align: start;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mode-card.active {
  border-color: var(--gold);
  background: rgba(245, 197, 66, 0.1);
}

.mode-badge {
  font-size: 0.75rem;
  color: var(--gold);
  font-weight: 700;
}

.mode-name {
  font-size: 1.1rem;
  font-weight: 800;
}

.mode-desc {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.35;
}

.rules summary {
  font-weight: 700;
  cursor: pointer;
}

.rules ul, .menu-rules ul {
  margin: 10px 0 0;
  padding-inline-start: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #dfe8e3;
  font-size: 0.92rem;
}

/* ============================================================
   LOBBY
   ============================================================ */
.lobby-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.room-code {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  color: var(--gold);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
}

.segmented button {
  border: 0;
  background: none;
  border-radius: 9px;
  padding: 9px;
  font-weight: 700;
  color: var(--muted);
}

.segmented button.active {
  background: var(--gold);
  color: #2a1d00;
}

.segmented.readonly button { cursor: default; }

#lobbyModeNote { margin-top: 8px; }

.lobby-players {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.lobby-player {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 8px 10px;
}

.lobby-player.empty {
  border: 1px dashed rgba(255, 255, 255, 0.15);
  background: none;
  color: var(--muted);
  justify-content: center;
  min-height: 48px;
}

.token-badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  border: 3px solid var(--c, #999);
  font-size: 1.15rem;
  flex: none;
}

.lobby-player .name {
  flex: 1;
  font-weight: 700;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  white-space: nowrap;
}

.tag-host { background: rgba(245, 197, 66, 0.2); color: var(--gold); }
.tag-you { background: rgba(59, 130, 246, 0.25); color: #bcd4ff; }

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  flex: none;
}

.dot.off { background: #777; }

.standings {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.standings li {
  display: flex;
  gap: 10px;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  padding: 8px 10px;
  border-radius: 10px;
}

.standings .place {
  font-weight: 900;
  width: 26px;
  text-align: center;
}

.standings .name { flex: 1; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.standings .worth { font-weight: 800; color: var(--gold); }

/* ============================================================
   GAME TABLE
   ============================================================ */
#gameView.active {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  max-width: 520px;
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  padding-top: max(8px, env(safe-area-inset-top, 0px));
}

.topbar-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.15;
}

.topbar-room {
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--gold);
}

.table {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 6px;
  flex: 1;
}

.board-wrap {
  display: flex;
  justify-content: center;
}

/* ---------- The board: an 11 x 11 grid with wider corners ---------- */
/* The board always runs left to right (GO bottom right); only the words inside follow the page language */
.board {
  direction: ltr;
  /* As wide as the phone, but short enough to leave room for players and buttons below */
  --size: max(280px, min(calc(100vw - 12px), 508px, calc(100dvh - 300px)));
  width: var(--size);
  height: var(--size);
  position: relative;
  display: grid;
  grid-template-columns: 1.55fr repeat(9, 1fr) 1.55fr;
  grid-template-rows: 1.55fr repeat(9, 1fr) 1.55fr;
  background: var(--board-bg);
  border: 2px solid var(--tile-line);
  border-radius: 6px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55);
  container-type: inline-size;
  color: var(--tile-text);
  user-select: none;
  -webkit-user-select: none;
}

.tile {
  position: relative;
  background: var(--tile-bg);
  border: 0.5px solid var(--tile-line);
  display: flex;
  overflow: hidden;
  cursor: pointer;
  text-align: center;
}

.tile-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3cqw;
  padding: 0.3cqw;
  min-width: 0;
}

.tile-name {
  font-size: 1.8cqw;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  hyphens: auto;
  -webkit-hyphens: auto;
  max-width: 100%;
}

.tile-price {
  font-size: 1.7cqw;
  font-weight: 600;
  opacity: 0.8;
}

.tile-icon {
  font-size: 3.4cqw;
  line-height: 1;
}

/* Colour bar sits on the edge that faces the middle of the board */
.tile-bar {
  flex: none;
  background: var(--g, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35cqw;
  border-color: var(--tile-line);
  border-style: solid;
  border-width: 0;
}

.side-bottom { flex-direction: column; }
.side-top { flex-direction: column-reverse; }
.side-left { flex-direction: row-reverse; }
.side-right { flex-direction: row; }

.side-bottom .tile-bar, .side-top .tile-bar { height: 22%; }
.side-left .tile-bar, .side-right .tile-bar { width: 22%; flex-direction: column; }
.side-bottom .tile-bar { border-bottom-width: 0.5px; }
.side-top .tile-bar { border-top-width: 0.5px; }
.side-left .tile-bar { border-left-width: 0.5px; }
.side-right .tile-bar { border-right-width: 0.5px; }

.house {
  width: 1.4cqw;
  height: 1.4cqw;
  background: #1f9d55;
  border: 0.5px solid #0b3d22;
  border-radius: 1px;
}

.hotel {
  width: 3cqw;
  height: 1.6cqw;
  background: #d62828;
  border: 0.5px solid #5c0d0d;
  border-radius: 1px;
}

.side-left .hotel, .side-right .hotel { width: 1.6cqw; height: 3cqw; }

/* Owner marker: a strip in the owner's colour on the outer edge */
.tile.owned::after {
  content: '';
  position: absolute;
  background: var(--owner);
  pointer-events: none;
}

.side-bottom.owned::after { left: 0; right: 0; bottom: 0; height: 9%; }
.side-top.owned::after { left: 0; right: 0; top: 0; height: 9%; }
.side-left.owned::after { top: 0; bottom: 0; left: 0; width: 9%; }
.side-right.owned::after { top: 0; bottom: 0; right: 0; width: 9%; }

.tile.mortgaged .tile-body {
  background: repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.08) 0 4px, transparent 4px 8px);
  opacity: 0.55;
}

.tile.mortgaged .tile-price::before { content: 'MORTGAGED '; }

.tile.highlight {
  box-shadow: inset 0 0 0 0.6cqw var(--gold);
  animation: pulse 1.2s ease-in-out infinite;
  z-index: 1;
}

@keyframes pulse {
  50% { box-shadow: inset 0 0 0 0.3cqw var(--gold); }
}

.corner {
  flex-direction: column;
  justify-content: center;
}

.corner .tile-icon { font-size: 5.5cqw; }
.corner .tile-name { font-size: 1.9cqw; }

.tile.go .tile-name { font-size: 4cqw; color: #b3261e; }

.jail-cell {
  position: absolute;
  top: 0;
  right: 0;
  width: 64%;
  height: 64%;
  background: #f7a35c;
  border-left: 0.5px solid var(--tile-line);
  border-bottom: 0.5px solid var(--tile-line);
  display: grid;
  place-items: center;
  font-size: 1.8cqw;
  font-weight: 800;
}

.jail-visit {
  position: absolute;
  left: 3%;
  bottom: 3%;
  font-size: 1.4cqw;
  font-weight: 700;
  text-align: left;
}

/* ---------- Board centre: dice, whose turn, latest events ---------- */
.board-center {
  grid-row: 2 / 11;
  grid-column: 2 / 11;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2cqw;
  padding: 3cqw;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.center-brand {
  font-weight: 900;
  font-size: 5.6cqw;
  letter-spacing: 0.1em;
  color: #fff;
  background: #b3261e;
  padding: 0.6cqw 3cqw;
  border-radius: 1cqw;
  box-shadow: 0 1cqw 0 #7a1712;
}

.dice {
  display: flex;
  gap: 2.5cqw;
}

.die {
  width: 9cqw;
  height: 9cqw;
  background: #fff;
  border-radius: 1.8cqw;
  box-shadow: 0 0.8cqw 1.6cqw rgba(0, 0, 0, 0.35), inset 0 -0.5cqw 0 rgba(0, 0, 0, 0.12);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: 1.2cqw;
}

.die.rolling { animation: shake 0.5s ease-in-out; }

@keyframes shake {
  20% { transform: rotate(-18deg) translateY(-1cqw); }
  45% { transform: rotate(14deg) translateY(0.5cqw); }
  70% { transform: rotate(-8deg); }
}

.pip {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #1d2a24;
  transform: scale(0.72);
}

.center-turn {
  font-weight: 800;
  font-size: 3.1cqw;
  text-align: center;
  display: flex;
  gap: 1.2cqw;
  align-items: center;
}

.ticker {
  list-style: none;
  width: 100%;
  max-width: 60cqw;
  display: flex;
  flex-direction: column;
  gap: 0.8cqw;
  font-size: 2.35cqw;
  text-align: center;
  line-height: 1.25;
}

.ticker li {
  background: rgba(255, 255, 255, 0.65);
  border-radius: 1.2cqw;
  padding: 0.8cqw 1.6cqw;
  animation: tickIn 0.3s ease-out;
}

.ticker li:not(:first-child) { opacity: 0.6; }

@keyframes tickIn {
  from { transform: translateY(-1.5cqw); opacity: 0; }
}

/* ---------- Tokens ---------- */
.tokens {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.token {
  position: absolute;
  left: 0;
  top: 0;
  width: 5.4cqw;
  height: 5.4cqw;
  margin: -2.7cqw 0 0 -2.7cqw;
  border-radius: 50%;
  background: #fff;
  border: 0.55cqw solid var(--c);
  display: grid;
  place-items: center;
  font-size: 3.1cqw;
  box-shadow: 0 0.6cqw 1.2cqw rgba(0, 0, 0, 0.45);
  transition: transform 0.16s ease-out;
  z-index: 3;
}

.token.active {
  z-index: 4;
  box-shadow: 0 0 0 0.6cqw rgba(245, 197, 66, 0.85), 0 0.6cqw 1.2cqw rgba(0, 0, 0, 0.45);
}

.token.hop { transition: transform 0.13s cubic-bezier(0.3, 1.6, 0.6, 1); }
.token.jump { transition: transform 0.5s ease-in-out; }
.token.out { display: none; }

/* ---------- Side: players, actions, navigation ---------- */
.side {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.dock {
  position: sticky;
  bottom: 0;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 0 calc(6px + var(--safe-bottom));
  background: linear-gradient(180deg, rgba(10, 43, 32, 0) 0%, var(--felt-dark) 22%);
  z-index: 5;
}

.dock > * { flex-shrink: 0; }

.players {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 4px;
  scrollbar-width: none;
}

.players::-webkit-scrollbar { display: none; }

.player {
  position: relative;
  flex: 0 0 auto;
  min-width: 108px;
  background: var(--panel);
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 7px 9px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.player.turn { border-color: var(--gold); }
.player.bankrupt { opacity: 0.4; }

.player .token-badge {
  width: 30px;
  height: 30px;
  font-size: 0.95rem;
  border-width: 2.5px;
}

.player-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}

.player-name {
  font-weight: 700;
  font-size: 0.85rem;
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-cash {
  font-weight: 800;
  color: var(--gold);
  font-size: 0.95rem;
}

.player-flags {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
}

.cash-pop {
  position: absolute;
  inset-inline-end: 6px;
  top: -6px;
  font-weight: 900;
  font-size: 0.85rem;
  animation: pop 1.6s ease-out forwards;
  pointer-events: none;
}

.cash-pop.up { color: #4ade80; }
.cash-pop.down { color: #ff7b7f; }

@keyframes pop {
  from { transform: translateY(6px); opacity: 0; }
  15% { transform: translateY(0); opacity: 1; }
  to { transform: translateY(-16px); opacity: 0; }
}

.action-panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}

.action-panel.my-move {
  border-color: rgba(245, 197, 66, 0.6);
  box-shadow: 0 0 0 1px rgba(245, 197, 66, 0.25), var(--shadow);
}

.timer {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
}

.timer-bar {
  height: 100%;
  background: var(--gold);
  transform-origin: left;
}

.timer.urgent .timer-bar { background: var(--red); }

.action-text {
  font-size: 0.95rem;
  line-height: 1.4;
}

.action-text b { color: var(--gold); }

.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.action-buttons .btn { flex: 1 1 auto; }

.bid-row {
  display: flex;
  gap: 6px;
  width: 100%;
}

.bid-row .btn { flex: 1; padding-left: 6px; padding-right: 6px; }

.bottom-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.action-buttons .btn-lg { flex-basis: 100%; min-height: 54px; font-size: 1.15rem; }

.nav-btn {
  border: 1px solid var(--panel-border);
  background: var(--panel);
  border-radius: 12px;
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 1.15rem;
  min-height: 52px;
}

.nav-btn span { font-size: 0.75rem; font-weight: 700; color: var(--muted); }
.nav-btn:disabled { opacity: 0.4; }

.log {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.86rem;
}

.log li {
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

/* ============================================================
   SHEETS (slide up from the bottom) & MODALS
   ============================================================ */
.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 20;
}

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  max-height: 86dvh;
  overflow-y: auto;
  background: #10342a;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  border: 1px solid var(--panel-border);
  padding: 8px 16px calc(18px + var(--safe-bottom));
  z-index: 21;
  transform: translateY(105%);
  transition: transform 0.25s ease;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
}

.sheet.open { transform: translateY(0); }

.sheet-grip {
  width: 44px;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.25);
  margin: 0 auto 10px;
}

.sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.sheet-head h2 { font-size: 1.15rem; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.45);
}

/* ---------- Title deed ---------- */
.deed {
  background: #fffdf6;
  color: #1d2a24;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid #1d2a24;
  max-width: 340px;
  margin: 0 auto;
}

.deed-head {
  background: var(--g, #ddd);
  color: var(--gt, #1d2a24);
  text-align: center;
  padding: 10px;
  border-bottom: 2px solid #1d2a24;
}

.deed-head small {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  font-weight: 700;
}

.deed-head strong {
  font-size: 1.15rem;
  text-transform: uppercase;
}

.deed-icon { font-size: 2rem; }

.deed table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.deed td {
  padding: 4px 14px;
}

.deed td:last-child { text-align: right; font-weight: 700; }
.deed tr.current td { background: rgba(245, 197, 66, 0.35); }

.deed-foot {
  border-top: 1px solid rgba(0, 0, 0, 0.15);
  padding: 8px 14px 12px;
  font-size: 0.82rem;
  text-align: center;
}

.deed-status {
  text-align: center;
  margin: 12px 0;
}

.deed-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  max-width: 340px;
  margin: 0 auto;
}

/* ---------- Asset list ---------- */
.asset-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.stat {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 8px;
  text-align: center;
}

.stat b { display: block; color: var(--gold); font-size: 1.05rem; }
.stat span { font-size: 0.72rem; color: var(--muted); }

.asset-group {
  margin-bottom: 10px;
}

.asset-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 7px 8px;
  margin-bottom: 6px;
}

.swatch {
  width: 12px;
  align-self: stretch;
  border-radius: 4px;
  background: var(--g);
  flex: none;
}

.asset-name {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  text-align: start;
}

.asset-name b {
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-name span { font-size: 0.75rem; color: var(--muted); }

.asset-btns {
  display: flex;
  gap: 4px;
}

.mini-btn {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  min-width: 38px;
  height: 36px;
  padding: 0 7px;
  font-size: 0.8rem;
  font-weight: 700;
}

.mini-btn:disabled { opacity: 0.3; }

.empty-note {
  text-align: center;
  color: var(--muted);
  padding: 20px 0;
}

/* ---------- Trade ---------- */
.partner-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 12px;
  padding-bottom: 4px;
}

.partner {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
  padding: 4px 12px 4px 4px;
  font-weight: 700;
  font-size: 0.85rem;
}

.partner .token-badge { width: 28px; height: 28px; font-size: 0.9rem; border-width: 2px; }
.partner.active { border-color: var(--gold); background: rgba(245, 197, 66, 0.12); }

.trade-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.trade-col {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.trade-col h3 { font-size: 0.85rem; color: var(--muted); }

.trade-col input { width: 100%; }

.prop-chips {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.prop-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  text-align: start;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 5px 7px;
  font-size: 0.78rem;
  font-weight: 600;
  min-height: 34px;
}

.prop-chip .swatch { width: 8px; align-self: stretch; }
.prop-chip.on { border-color: var(--gold); background: rgba(245, 197, 66, 0.15); }
.prop-chip.static { cursor: default; }

.stepper {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
}

.offer-cols { margin-bottom: 14px; }

/* ---------- Chance / Community Chest card ---------- */
.game-card {
  width: min(300px, 86vw);
  border-radius: 16px;
  padding: 22px 20px;
  text-align: center;
  color: #2a1d00;
  background: #ffb347;
  border: 4px solid #fff;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  animation: cardIn 0.35s cubic-bezier(0.2, 1.4, 0.5, 1);
}

.game-card.chest { background: #ffe680; }

@keyframes cardIn {
  from { transform: scale(0.6) rotate(-8deg); opacity: 0; }
}

.game-card-title {
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.game-card-icon { font-size: 3rem; margin: 6px 0; }
.game-card-text { font-size: 1.05rem; font-weight: 600; margin-bottom: 10px; }
.game-card .muted { color: rgba(42, 29, 0, 0.7); }

.result-panel {
  width: min(420px, 100%);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.result-trophy { font-size: 3rem; }

/* ---------- Toast & connection banner ---------- */
.toast {
  position: fixed;
  left: 50%;
  top: max(14px, env(safe-area-inset-top, 0px));
  transform: translate(-50%, -150%);
  background: #fff;
  color: #1d2a24;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 40;
  max-width: calc(100vw - 32px);
  transition: transform 0.25s ease;
  text-align: center;
}

.toast.show { transform: translate(-50%, 0); }

.conn-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--red);
  color: #fff;
  text-align: center;
  font-weight: 700;
  padding: 8px calc(8px + var(--safe-bottom));
  z-index: 50;
}

/* ============================================================
   LARGER SCREENS: the game is designed for phones, so tablets and computers
   show the same phone column in the middle of the screen
   ============================================================ */
@media (min-width: 560px) {
  .sheet { border-radius: 20px 20px 0 0; }
  .table { padding-top: 4px; }
}

/* ============================================================
   PERSIAN (RTL)
   ============================================================ */
[dir="rtl"] .tile-body,
[dir="rtl"] .board-center,
[dir="rtl"] .jail-cell,
[dir="rtl"] .jail-visit {
  direction: rtl;
}

/* Letter spacing breaks the joined Persian script */
[dir="rtl"] .tile-name,
[dir="rtl"] .hero-title,
[dir="rtl"] .center-brand,
[dir="rtl"] .game-card-title,
[dir="rtl"] .deed-head small {
  letter-spacing: 0;
}

[dir="rtl"] .jail-visit { text-align: right; left: auto; right: 40%; }
[dir="rtl"] .tile.go .tile-name { font-size: 2.8cqw; }

.lang-row {
  display: flex;
  justify-content: flex-end;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
