/* ═══════════════════════════════════════
   RESET & GLOBAL VARIABLES
════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green-board: #00a650;
  --green-dark:  #007a3b;
  --green-light: #e8f5e9;
  --red:         #da291c;
  --red-dark:    #b01f15;
  --gold:        #f6a117;
  --gold-dark:   #d48806;
  --blue:        #1890ff;
  --white:       #ffffff;
  --off-white:   #f8f5f0;
  --black:       #141414;
  --gray:        #595959;
  --border:      3px solid #141414;
  --shadow-hard: 4px 4px 0px rgba(0,0,0,0.9);
  --radius:      12px;
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'Nunito', sans-serif;
  color: var(--black);
  background: #0a160d;
  user-select: none;
}

h1, h2, h3, .round-badge, .lobby-logo, .deed-header-title {
  font-family: 'Titan One', cursive;
  letter-spacing: 0.5px;
}

/* ═══════════════════════════════════════
   BACKGROUND CANVAS (Lobby/Auth)
════════════════════════════════════════ */
#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background: radial-gradient(circle at center, #007a3b 0%, #062b11 100%);
}

/* ═══════════════════════════════════════
   SCREENS
════════════════════════════════════════ */
.screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}
.screen.hidden { display: none !important; }

/* ═══════════════════════════════════════
   RETRO BUTTONS
════════════════════════════════════════ */
button {
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  cursor: pointer;
  border: var(--border);
  border-radius: var(--radius);
  transition: transform 0.08s, box-shadow 0.08s, background 0.15s;
  box-shadow: var(--shadow-hard);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}
button:active:not(:disabled) {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0px rgba(0,0,0,0.9);
}
button:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary { background: var(--red); color: #fff; padding: 0.75rem 1.6rem; font-size: 1rem; }
.btn-primary:hover:not(:disabled) { background: var(--red-dark); }

.btn-green { background: var(--green-board); color: #fff; padding: 0.75rem 1.6rem; font-size: 1rem; }
.btn-green:hover:not(:disabled) { background: var(--green-dark); }

.btn-blue { background: var(--blue); color: #fff; padding: 0.75rem 1.6rem; font-size: 1rem; }
.btn-blue:hover:not(:disabled) { background: #096dd9; }

.btn-danger { background: #cf1322; color: #fff; padding: 0.75rem 1.4rem; font-size: 1rem; }
.btn-danger:hover:not(:disabled) { background: #a8071a; }

.btn-bid { background: var(--gold); color: #000; padding: 0.6rem 1.1rem; font-size: 1rem; }
.btn-bid:hover:not(:disabled) { background: var(--gold-dark); }

.btn-icon { background: #fff; border: 2px solid var(--black); color: var(--black); padding: 0.4rem 0.9rem; font-size: 0.9rem; box-shadow: 2px 2px 0 rgba(0,0,0,0.7); }

.icon-btn { background: rgba(255,255,255,0.15); border: 2px solid rgba(255,255,255,0.6); color: #fff; padding: 0.4rem 1rem; font-size: 0.9rem; box-shadow: none; }
.icon-btn:hover { background: rgba(255,255,255,0.3); }

/* ═══════════════════════════════════════
   AUTH SCREEN
════════════════════════════════════════ */
.auth-box {
  background: var(--white);
  border: var(--border);
  border-radius: 18px;
  box-shadow: 8px 8px 0 rgba(0,0,0,0.9);
  padding: 2.5rem 2.5rem 2rem;
  width: 410px;
  max-width: calc(100vw - 2rem);
  text-align: center;
  position: relative;
  z-index: 1;
}

.auth-logo { margin-bottom: 1.5rem; }
.auth-logo .dice-icon { font-size: 2.8rem; display: block; margin-bottom: 0.3rem; }
.auth-logo h1 { font-size: 2.3rem; color: var(--black); letter-spacing: 1px; }
.auth-logo h1 .red { color: var(--red); }
.auth-logo .subtitle { color: var(--gray); font-size: 0.9rem; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; margin-top: 0.2rem; }

.tabs { display: flex; border: var(--border); border-radius: 10px; overflow: hidden; margin-bottom: 1.5rem; }
.tab  { flex: 1; padding: 0.75rem; background: var(--off-white); color: var(--gray); border: none; font-size: 1rem; font-weight: 800; cursor: pointer; box-shadow: none; transition: all 0.15s; }
.tab.active { background: var(--red); color: #fff; }

#auth-form { display: flex; flex-direction: column; gap: 1rem; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-icon { position: absolute; left: 1rem; font-size: 1.1rem; pointer-events: none; }
.input-wrap input {
  width: 100%;
  padding: 0.85rem 1rem 0.85rem 2.8rem;
  border: var(--border);
  border-radius: 10px;
  font-size: 1rem;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  background: var(--off-white);
  outline: none;
}
.input-wrap input:focus { border-color: var(--red); box-shadow: 3px 3px 0 var(--red); }
#auth-submit-btn { width: 100%; padding: 0.9rem; font-size: 1.1rem; background: var(--red); color: #fff; }

.error-msg { color: var(--red); font-size: 0.9rem; font-weight: 800; margin-top: 0.75rem; min-height: 1.2em; }

/* ═══════════════════════════════════════
   LOBBY SCREEN
════════════════════════════════════════ */
#lobby-screen {
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  overflow-y: auto;
}

.lobby-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 2.5rem;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(12px);
  border-bottom: 3px solid rgba(255,255,255,0.2);
  position: sticky;
  top: 0;
  z-index: 20;
}
.lobby-logo { font-size: 1.6rem; color: #fff; text-shadow: 2px 2px 0 rgba(0,0,0,0.6); }
.lobby-logo span { color: var(--gold); }
.user-info { display: flex; align-items: center; gap: 1rem; }
.user-badge { display: flex; align-items: center; gap: 0.5rem; background: rgba(255,255,255,0.15); border: 2px solid rgba(255,255,255,0.4); border-radius: 999px; padding: 0.4rem 1.2rem; color: #fff; font-weight: 800; font-size: 1rem; }

.lobby-body {
  padding: 2.5rem 2rem;
  max-width: 920px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
}

.lobby-actions-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.8rem; }

.lobby-card {
  background: var(--white);
  border: var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-hard);
  padding: 1.8rem;
}
.lobby-card .card-icon { font-size: 2.2rem; margin-bottom: 0.4rem; }
.lobby-card h3 { font-size: 1.2rem; margin-bottom: 1rem; color: var(--black); }
.lobby-card input {
  width: 100%;
  padding: 0.85rem 1rem;
  border: var(--border);
  border-radius: 10px;
  font-size: 1rem;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  margin-bottom: 1rem;
  background: var(--off-white);
  outline: none;
}
.lobby-card input:focus { border-color: var(--red); box-shadow: 2px 2px 0 var(--red); }
.lobby-card button { width: 100%; padding: 0.85rem; font-size: 1.05rem; }

.room-list-card { padding: 1.8rem; }
.room-list-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.2rem; }
.room-list-header h3 { font-size: 1.2rem; }
.empty-msg { color: var(--gray); text-align: center; padding: 2.5rem; font-weight: 700; font-size: 1.05rem; }

.room-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.2rem;
  border: 2.5px solid var(--black);
  border-radius: 12px;
  background: var(--off-white);
  margin-bottom: 0.75rem;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.8);
}
.room-card-info { flex: 1; }
.room-card-name { font-weight: 900; font-size: 1.05rem; color: var(--black); }
.room-card-meta { color: var(--gray); font-size: 0.85rem; margin-top: 3px; font-weight: 700; }
.room-card-join { background: var(--green-board); color: #fff; border: 2.5px solid var(--black); border-radius: 8px; padding: 0.55rem 1.3rem; font-weight: 900; cursor: pointer; font-size: 0.95rem; box-shadow: 2px 2px 0 rgba(0,0,0,0.8); white-space: nowrap; }
.room-card-join:hover { background: var(--green-dark); }

.room-player-dots { display: flex; gap: 5px; }
.room-dot { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid #000; }
.room-dot.filled { background: var(--green-board); }
.room-dot.empty  { background: #d9d9d9; }

/* ═══════════════════════════════════════
   WAITING ROOM
════════════════════════════════════════ */
.waiting-box {
  background: var(--white);
  border: var(--border);
  border-radius: 18px;
  box-shadow: 8px 8px 0 rgba(0,0,0,0.85);
  padding: 2.5rem;
  width: 520px;
  max-width: calc(100vw - 2rem);
  position: relative;
  z-index: 1;
}
.waiting-header { text-align: center; margin-bottom: 1.5rem; }
.waiting-header h2 { font-size: 1.9rem; color: var(--red); }
.room-id-row { display: flex; align-items: center; justify-content: center; gap: 0.5rem; margin-top: 0.5rem; }
.room-id-label { font-weight: 800; color: var(--gray); }
code { background: var(--off-white); border: 2px solid var(--black); border-radius: 6px; padding: 0.25rem 0.7rem; font-size: 0.95rem; font-weight: 800; letter-spacing: 1px; }
#copy-id-btn { background: none; border: none; box-shadow: none; font-size: 1.2rem; padding: 0.2rem; cursor: pointer; }
#copy-id-btn:active { transform: scale(0.85); }

#waiting-players { display: flex; flex-direction: column; gap: 0.7rem; margin-bottom: 1rem; }
.waiting-player-slot {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.85rem 1.1rem;
  border: 2px solid var(--black);
  border-radius: 10px;
  background: var(--off-white);
  font-weight: 800;
}
.player-dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #000; flex-shrink: 0; }
.empty-slot { color: var(--gray); font-style: italic; font-weight: 700; }
.slot-host-badge { margin-left: auto; background: var(--gold); color: #000; border: 1.5px solid #000; border-radius: 999px; padding: 0.15rem 0.6rem; font-size: 0.75rem; font-weight: 900; }
.slot-bot-badge  { margin-left: auto; background: #3498db; color: #fff; border: 1.5px solid #000; border-radius: 999px; padding: 0.15rem 0.6rem; font-size: 0.75rem; font-weight: 900; }

.hint { color: var(--gray); font-size: 0.95rem; font-weight: 700; text-align: center; margin-bottom: 1.4rem; }
.waiting-actions { display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; }

/* ═══════════════════════════════════════
   GAME SCREEN
════════════════════════════════════════ */
#game-screen { display: none; background: #0a160d; }
#game-screen:not(.hidden) { display: block; }
#game-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

/* Sidebar: Round & Players */
#sidebar {
  position: absolute;
  top: 1.2rem;
  left: 1.2rem;
  width: 250px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.sidebar-top-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.round-badge {
  flex: 1;
  background: var(--white);
  border: var(--border);
  border-radius: 12px;
  padding: 0.55rem 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  color: var(--red);
  font-size: 1rem;
  box-shadow: var(--shadow-hard);
  white-space: nowrap;
}
.game-leave-btn {
  padding: 0.55rem 0.85rem;
  font-size: 0.9rem;
  border-radius: 12px;
  background: #cf1322;
  color: #fff;
  white-space: nowrap;
}
.player-card {
  background: rgba(255,255,255,0.96);
  border: var(--border);
  border-radius: 12px;
  padding: 0.8rem 1rem;
  box-shadow: var(--shadow-hard);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.player-card.active-turn {
  transform: translateX(12px) scale(1.02);
  border-color: var(--gold);
  box-shadow: 5px 5px 0px var(--gold);
  background: #fffdf5;
}
.player-card.bankrupt { opacity: 0.35; filter: grayscale(1); }
.pc-header { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.4rem; }
.pc-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #000; flex-shrink: 0; }
.pc-name { font-weight: 900; font-size: 1rem; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-money { color: var(--green-board); font-size: 1.15rem; font-weight: 900; font-family: 'Titan One', sans-serif; }
.pc-props { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 0.5rem; min-height: 14px; }
.pc-prop-dot { width: 14px; height: 14px; border-radius: 3px; border: 1.5px solid #000; }

/* Action Log (Top Right) */
#action-log {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  width: 290px;
  max-height: 220px;
  background: rgba(10, 22, 13, 0.85);
  backdrop-filter: blur(8px);
  border: 2px solid rgba(255,255,255,0.25);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  z-index: 20;
  color: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.action-log-header {
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  padding-bottom: 0.3rem;
}
#action-log-feed {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  overflow-y: auto;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.35;
}
.log-entry {
  padding: 0.25rem 0.4rem;
  border-radius: 4px;
  background: rgba(255,255,255,0.06);
  border-left: 3px solid var(--gold);
  animation: slideInLog 0.25s ease-out;
}
.log-entry.money   { border-left-color: var(--green-board); }
.log-entry.danger  { border-left-color: var(--red); }
.log-entry.special { border-left-color: var(--blue); }

@keyframes slideInLog {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Sleek In-Bar Roll Result Badge */
.roll-result-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--off-white);
  border: 2px solid var(--black);
  border-radius: 10px;
  padding: 0.35rem 0.85rem;
  font-size: 0.95rem;
  box-shadow: 2px 2px 0 #000;
  animation: popInBounce 0.25s ease-out;
}
.roll-result-badge.hidden { display: none !important; }
.roll-result-badge span { color: var(--gray); font-weight: 800; }
.roll-result-badge strong {
  font-family: 'Titan One', sans-serif;
  color: var(--green-board);
  font-size: 1.15rem;
}

@keyframes popInBounce {
  0%   { opacity: 0; transform: scale(0.4) rotate(-5deg); }
  70%  { opacity: 1; transform: scale(1.08) rotate(2deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}
@keyframes pulseDouble {
  from { transform: scale(1); }
  to   { transform: scale(1.1); }
}

/* Bottom Action Bar */
#action-bar {
  position: absolute;
  bottom: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  background: rgba(255,255,255,0.98);
  border: var(--border);
  border-radius: 16px;
  padding: 0.55rem 1.6rem;
  box-shadow: 4px 4px 0px rgba(0,0,0,0.9);
  white-space: nowrap;
}
.turn-status-group {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.turn-avatar-badge {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--off-white);
  border: 2.5px solid var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 2px 2px 0 #000;
}
.turn-text-info {
  display: flex;
  flex-direction: column;
}
.turn-label {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--gray);
  text-transform: uppercase;
}
.turn-text-info strong {
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--black);
}

.timer-wrapper {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--off-white);
  border: 2px solid var(--black);
  border-radius: 10px;
  padding: 0.35rem 0.8rem;
}
.timer-clock-icon { font-size: 1.1rem; }
.timer {
  font-family: 'Titan One', cursive;
  font-size: 1.4rem;
  color: var(--red);
  min-width: 2.5rem;
  text-align: center;
}
.timer.urgent { animation: shake 0.4s infinite; }

.action-buttons-group {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.roll-btn {
  background: var(--gold);
  color: #000;
  padding: 0.75rem 1.8rem;
  font-size: 1.1rem;
  box-shadow: 3px 3px 0 #000;
}
.roll-btn:hover:not(:disabled) { background: var(--gold-dark); }
.end-btn {
  background: var(--green-board);
  color: #fff;
  padding: 0.75rem 1.6rem;
  font-size: 1.05rem;
  box-shadow: 3px 3px 0 #000;
}
.trade-btn:hover:not(:disabled) { background: #0056b3; }
.trade-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ═══════════════════════════════════════
   POPUPS & DEED CARDS
════════════════════════════════════════ */
.popup {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(5px);
}
.popup.hidden { display: none !important; }

.popup-inner {
  background: var(--white);
  border: var(--border);
  border-radius: 18px;
  padding: 2.2rem;
  min-width: 360px;
  max-width: 480px;
  text-align: center;
  box-shadow: 8px 8px 0px #000;
  animation: popInModal 0.25s ease-out;
}

@keyframes popInModal {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}

.popup-inner h3 { font-size: 1.6rem; margin-bottom: 0.8rem; color: var(--black); }
.color-bar {
  height: 48px;
  border: 2.5px solid #000;
  border-radius: 8px;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.deed-header-title {
  color: #ffffff;
  font-size: 1.05rem;
  letter-spacing: 2px;
  text-shadow: 1px 1px 0 #000;
}

.prop-details { display: flex; gap: 1rem; justify-content: center; margin: 1rem 0; }
.prop-stat {
  background: var(--off-white);
  border: 2px solid #000;
  border-radius: 10px;
  padding: 0.6rem 1.4rem;
  text-align: center;
}
.prop-stat span { display: block; font-size: 0.8rem; color: var(--gray); font-weight: 800; text-transform: uppercase; }
.prop-stat strong { display: block; font-size: 1.3rem; font-weight: 900; color: var(--green-board); font-family: 'Titan One', sans-serif; }

.upgrade-info-badge {
  background: var(--off-white);
  border: 2px solid var(--black);
  border-radius: 8px;
  padding: 0.35rem 0.8rem;
  font-weight: 800;
  color: var(--black);
  display: inline-block;
  margin-bottom: 0.8rem;
}

.trade-btn {
  padding: 0.75rem 1.4rem;
  font-size: 1rem;
}
.bid-actions { gap: 0.6rem; }

.auction-card {
  border-color: var(--gold);
  box-shadow: 8px 8px 0px var(--gold);
}
.auction-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}
.auction-gavel { font-size: 2.4rem; animation: pulse 0.8s infinite alternate; }
.auction-property-preview {
  background: var(--off-white);
  border: 2px solid var(--black);
  border-radius: 12px;
  padding: 0.8rem;
  margin: 0.6rem 0;
}
.auction-property-preview .color-bar {
  height: 18px;
  margin-bottom: 0.4rem;
}
.auction-prop-highlight { font-size: 1.4rem; font-weight: 900; color: var(--black); margin-bottom: 0.2rem; }
.auction-base-stat { font-size: 0.9rem; font-weight: 700; color: var(--gray); }
.auction-base-stat strong { color: var(--green-board); }

.big-timer { font-family: 'Titan One', cursive; font-size: 2.8rem; color: var(--red); margin: 0.3rem 0; text-shadow: 2px 2px 0 #000; }
.big-timer.urgent { animation: shake 0.4s infinite; }

.auction-bids-box {
  background: var(--off-white);
  border: 2px solid #000;
  border-radius: 10px;
  padding: 0.6rem;
  max-height: 140px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.8rem;
}
.no-bids-hint {
  color: var(--gray);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.4rem;
}
.auction-bid-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.6rem;
  background: #fff;
  border: 1.5px solid #000;
  border-radius: 6px;
  font-size: 0.95rem;
}
.auction-bid-row.top-bid {
  background: #fffbe6;
  border-color: var(--gold);
  box-shadow: 2px 2px 0 var(--gold);
}
.bidder-info {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.bidder-name {
  font-weight: 800;
  color: var(--black);
}
.top-bid-tag {
  background: var(--gold);
  color: #000;
  font-size: 0.65rem;
  font-weight: 900;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  border: 1px solid #000;
  margin-left: 0.2rem;
}
.bid-amount {
  color: var(--green-board);
  font-weight: 900;
  font-family: 'Titan One', sans-serif;
  font-size: 1.05rem;
}
#auction-my-bid { color: var(--black); font-size: 1.05rem; font-weight: 800; margin-top: 0.8rem; }
#auction-my-bid strong { color: var(--green-board); font-family: 'Titan One', sans-serif; font-size: 1.2rem; }

/* Trade */
.trade-card {
  max-width: 520px;
}
#trade-modal select {
  width: 100%;
  padding: 0.8rem;
  border: var(--border);
  border-radius: 10px;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  margin: 0.5rem 0 1rem;
  background: var(--off-white);
  outline: none;
}
.trade-split-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  margin-bottom: 1rem;
}
.trade-side-box {
  background: var(--off-white);
  border: 2px solid var(--black);
  border-radius: 10px;
  padding: 0.6rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.trade-side-box label {
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--black);
  margin-bottom: 0.4rem;
  display: block;
}
#trade-my-props, #trade-their-props {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 0.6rem;
  min-height: 48px;
  align-content: flex-start;
}
.trade-prop-chip { padding: 4px 10px; font-size: 0.8rem; font-weight: 800; cursor: pointer; border: 2px solid #000; color: #fff; text-shadow: 1px 1px 0 #000; opacity: 0.65; transition: all 0.1s; border-radius: 6px; box-shadow: 2px 2px 0 #000; }
.trade-prop-chip.selected { opacity: 1; transform: translateY(-2px); border-color: #fff; box-shadow: 2px 2px 0 #fff; }

.trade-cash-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: auto;
  padding-top: 0.4rem;
  border-top: 1px dashed #ccc;
  font-size: 0.85rem;
  font-weight: 800;
}
.trade-cash-input {
  width: 80px;
  padding: 0.3rem 0.5rem;
  border: 2px solid var(--black);
  border-radius: 6px;
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 0.95rem;
  outline: none;
  background: #fff;
  color: var(--green-board);
}

/* Card Flip & Draw Animation */
.card-modal-inner {
  background: transparent;
  border: none;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  perspective: 1200px;
}
.card-draw-container {
  width: 320px;
  height: 240px;
  margin-bottom: 1.2rem;
  perspective: 1000px;
}
.card-flip {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.card-flip.draw-shake {
  animation: cardDeckShake 0.6s ease-in-out;
}
.card-flip.flipped {
  transform: rotateY(180deg) translateY(-8px);
}

.card-face {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 1.5rem;
  box-shadow: 8px 8px 0px rgba(0,0,0,0.85);
  border: 3.5px solid var(--black);
}

/* Card Back (Deck State) */
.card-back {
  background: linear-gradient(135deg, #ff6b35, #d84315);
  color: #fff;
}
.card-popup-chance .card-back {
  background: linear-gradient(135deg, #ff6b35 0%, #c43800 100%);
  border-color: #f6a117;
  box-shadow: 8px 8px 0px #f6a117;
}
.card-popup-community .card-back {
  background: linear-gradient(135deg, #00838f 0%, #004d40 100%);
  border-color: #26c6da;
  box-shadow: 8px 8px 0px #26c6da;
}

.card-deck-icon {
  font-size: 3.5rem;
  margin-bottom: 0.3rem;
  animation: pulse 0.7s infinite alternate;
}
.card-deck-title {
  font-family: 'Titan One', sans-serif;
  font-size: 2rem;
  letter-spacing: 2px;
  text-shadow: 2px 2px 0 #000;
}
.card-deck-sub {
  font-size: 0.85rem;
  font-weight: 800;
  opacity: 0.85;
  margin-top: 0.2rem;
}

/* Card Front (Revealed Fate) */
.card-front {
  background: #ffffff;
  transform: rotateY(180deg);
  border: 3.5px solid var(--black);
  text-align: center;
}
.card-front-badge {
  font-family: 'Titan One', sans-serif;
  font-size: 0.85rem;
  letter-spacing: 1px;
  color: #fff;
  background: var(--red);
  padding: 0.2rem 0.8rem;
  border-radius: 999px;
  border: 1.5px solid #000;
  margin-bottom: 0.5rem;
}
.card-popup-chance .card-front-badge { background: #ff5722; }
.card-popup-community .card-front-badge { background: #00838f; }

.card-front h3 {
  font-family: 'Titan One', sans-serif;
  font-size: 1.35rem;
  margin-bottom: 0.4rem;
  color: var(--black);
}
.card-desc-box {
  background: var(--off-white);
  border: 2px solid var(--black);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  margin-bottom: 0.6rem;
  width: 100%;
}
.card-desc-box p {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--black);
  line-height: 1.35;
}
.card-reward-tag {
  font-family: 'Titan One', sans-serif;
  font-size: 1.3rem;
  color: var(--green-board);
}
.card-reward-tag.danger { color: var(--red); }

.card-reveal-btn {
  margin-top: 1rem;
  font-size: 1.15rem;
  padding: 0.85rem 2.4rem;
  box-shadow: 4px 4px 0 #000;
  cursor: pointer;
  z-index: 10;
  transition: transform 0.1s;
}
.card-reveal-btn:hover {
  transform: translateY(-2px);
}

@keyframes cardDeckShake {
  0%, 100% { transform: scale(1) rotate(0deg); }
  20% { transform: scale(1.05) rotate(-4deg); }
  40% { transform: scale(1.08) rotate(4deg); }
  60% { transform: scale(1.08) rotate(-3deg); }
  80% { transform: scale(1.05) rotate(3deg); }
}

/* ═══════════════════════════════════════
   DEED INSPECTOR (Under Live Activity)
════════════════════════════════════════ */
.deed-inspector-container {
  position: absolute;
  top: 17.5rem;
  right: 1.2rem;
  width: 290px;
  max-height: calc(100vh - 20rem);
  background: rgba(255, 255, 255, 0.96);
  border: var(--border);
  border-radius: 14px;
  padding: 0.75rem;
  z-index: 20;
  box-shadow: 4px 4px 0px rgba(0,0,0,0.85);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.deed-inspector-header {
  font-family: 'Titan One', sans-serif;
  font-size: 0.95rem;
  color: var(--black);
  margin-bottom: 0.5rem;
  padding-bottom: 0.3rem;
  border-bottom: 2px solid var(--black);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.deed-empty-hint {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gray);
  text-align: center;
  padding: 1.5rem 0.5rem;
  line-height: 1.4;
}

/* Deed Card Content */
.deed-card-view {
  background: var(--white);
  border: 2px solid var(--black);
  border-radius: 8px;
  padding: 0.6rem;
}
.deed-banner {
  border: 2px solid var(--black);
  border-radius: 6px;
  padding: 0.4rem;
  text-align: center;
  color: #fff;
  font-family: 'Titan One', sans-serif;
  font-size: 1.05rem;
  letter-spacing: 1px;
  text-shadow: 1px 1px 0 #000;
  margin-bottom: 0.5rem;
}
.deed-owner-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  padding: 0.3rem 0.5rem;
  background: var(--off-white);
  border-radius: 6px;
  border: 1px solid #ddd;
}
.deed-rent-table {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}
.deed-rent-row {
  display: flex;
  justify-content: space-between;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
}
.deed-rent-row.highlight {
  background: #fff8e1;
  border: 1.5px solid var(--gold);
  font-weight: 900;
}
.deed-rent-val {
  color: var(--green-board);
  font-family: 'Titan One', sans-serif;
}
.deed-footer {
  border-top: 1px dashed #bbb;
  padding-top: 0.4rem;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--gray);
  display: flex;
  justify-content: space-between;
}

/* ═══════════════════════════════════════
   DEBT RESOLUTION / INSOLVENCY MODAL
════════════════════════════════════════ */
.debt-modal-inner {
  max-width: 500px;
  border-color: var(--red);
}
.debt-warning-icon {
  font-size: 3rem;
  margin-bottom: 0.2rem;
  animation: pulse 0.6s infinite alternate;
}
.debt-modal-inner h3 {
  color: var(--red);
  font-size: 1.6rem;
  margin-bottom: 0.3rem;
}
.debt-reason {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--black);
  margin-bottom: 1rem;
}
.debt-status-card {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.6rem;
  background: var(--off-white);
  border: 2px solid var(--black);
  border-radius: 12px;
  padding: 0.75rem;
  margin-bottom: 1rem;
}
.debt-stat span {
  display: block;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--gray);
  text-transform: uppercase;
}
.debt-stat strong {
  display: block;
  font-size: 1.25rem;
  font-family: 'Titan One', sans-serif;
}
.text-danger { color: var(--red) !important; }
.text-success { color: var(--green-board) !important; }

.debt-action-hint {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--gray);
  margin-bottom: 1rem;
  line-height: 1.35;
}
.debt-liquidation-panel {
  background: var(--off-white);
  border: 2px solid var(--black);
  border-radius: 12px;
  padding: 0.8rem;
  margin-bottom: 1.2rem;
  max-height: 180px;
  overflow-y: auto;
}
.debt-section-title {
  font-weight: 900;
  font-size: 0.85rem;
  color: var(--black);
  margin-bottom: 0.5rem;
  text-align: left;
}
.debt-assets-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.debt-asset-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border: 1.5px solid #000;
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  font-size: 0.85rem;
  font-weight: 800;
}
.debt-asset-name {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.debt-asset-btns {
  display: flex;
  gap: 0.4rem;
}
.btn-asset-sell {
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 900;
  border-radius: 6px;
  border: 1.5px solid #000;
  background: #f6a117;
  color: #000;
  cursor: pointer;
  box-shadow: 1px 1px 0 #000;
}
.btn-asset-sell:hover { background: #e69107; }

.debt-actions {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
}

/* Scrollbars */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.3); border-radius: 4px; }
