/* Modal and UI Component Styles */

/* Modal container */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.5) 100%);
  backdrop-filter: blur(8px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1500;
  animation: modalFadeIn 0.3s ease;
}

/* Modal content */
.modal-content {
  background: #ffffff;
  padding: clamp(12px, 4vw, 32px) clamp(10px, 6vw, 48px) clamp(8px, 3vw, 24px) clamp(10px, 6vw, 48px);
  border-radius: 15px;
  text-align: center;
  width: clamp(320px, 60vw, 600px);
  max-width: 98vw;
  min-width: 220px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
  border: 1px solid #e0e0e0;
  animation: modalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow-y: auto;
  max-height: 90vh;
    scrollbar-width: thin;
    scrollbar-color: #b8c5d8 #f1f5f9;
  }

  /* For Webkit browsers */
  .modal-content::-webkit-scrollbar {
    width: 10px;
  }
  .modal-content::-webkit-scrollbar-thumb {
    background: #b8c5d8;
    border-radius: 6px;
  }
  .modal-content::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 6px;
  }
  box-sizing: border-box;
}

@media (max-width: 600px) {
  .modal-content {
    width: 98vw;
    min-width: unset;
    padding: 10px 2vw 8px 2vw;
    border-radius: 10px;
  }
}
}

.modal-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #1e88e5 0%, #1565c0 100%);
  box-shadow: none;
}

.modal-content h2 {
  font-size: 32px;
  font-weight: 700;
  margin: 0 0 12px 0;
  color: #1e293b;
  letter-spacing: -0.5px;
}

.modal-content > p {
  color: #64748b;
  font-size: 15px;
  margin: 0 0 24px 0;
  font-weight: 400;
}

.modal button {
  padding: 10px;
  margin: 10px;
  font-size: 16px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.modal button.buy {
  background-color: #388e3c;
  color: white;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(56, 142, 60, 0.3);
}

.modal button.reject {
  background-color: #d32f2f;
  color: white;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(211, 47, 47, 0.3);
}

.modal h2 {
  margin: 10px 0;
}

/* Property Info Card */
.property-info-card {
  display: none;
  position: absolute;
  width: min(280px, 94vw);
  max-width: 280px;
  z-index: 2500;
  filter: drop-shadow(0 20px 40px rgba(0,0,0,0.25));
  animation: cardSlideIn 0.3s ease-out;
}

.card-content {
  background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 50%, #f0f2f5 100%);
  padding: 0;
  border-radius: 10px;
  width: 100%;
  max-width: 280px;
  display: grid;
  grid-template-rows: 8px 1fr;
  text-align: left;
  box-shadow: 0 15px 50px rgba(0,0,0,0.2), 0 0 0 1px rgba(0,0,0,0.05);
  border: 2px solid rgba(255,255,255,0.8);
  overflow: hidden;
}

.card-content h2 {
  font-size: 15px;
  font-weight: 800;
  margin: 0 0 6px 0;
  color: #1a1a2e;
  text-shadow: 0 1px 2px rgba(0,0,0,0.05);
  padding: 0;
  line-height: 1.2;
}

.card-content p {
  font-size: 13px;
  margin: 6px 0;
  color: #2c3e50;
  padding: 0 16px;
  line-height: 1.5;
}

.card-content p strong {
  color: #1a1a2e;
  font-weight: 700;
}

.color-bar {
  width: 100%;
  height: 8px;
  margin: 0;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15), inset 0 -1px 0 rgba(255,255,255,0.2);
  background: linear-gradient(180deg, rgba(255,255,255,0.2) 0%, rgba(0,0,0,0.1) 100%);
  background-blend-mode: overlay;
}

.card-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 8px 10px 8px 10px;
}

.card-summary {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.title-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

.title-row .pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(26,26,46,0.08);
  color: #1a1a2e;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  background: linear-gradient(135deg, #ffffff 0%, #f6f7fb 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6), 0 1px 2px rgba(0,0,0,0.05);
}

.info-row .label {
  font-weight: 700;
  color: #334155;
  font-size: 10.5px;
}

.info-row .value {
  font-weight: 800;
  color: #0f172a;
  font-size: 11px;
}

.rent-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.rent-panel {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.04);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), 0 6px 18px rgba(0,0,0,0.06);
  padding: 6px 8px 8px 8px;
}

.rent-heading {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.3px;
  color: #475569;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.rent-table { 
  display: flex; 
  flex-direction: column; 
  gap: 3px; 
  margin: 0;
  background: rgba(255,255,255,0.6);
  padding: 6px;
  border-radius: 8px;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.05);
}

.rent-row { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  padding: 5px 7px; 
  border-radius: 6px; 
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%); 
  font-size: 10.5px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.04);
  border: 1px solid rgba(0,0,0,0.04);
  transition: all 0.2s ease;
}

.rent-row:hover {
  background: linear-gradient(135deg, #fff5f0 0%, #ffe8dd 100%);
  transform: translateX(2px);
  box-shadow: 0 3px 6px rgba(0,0,0,0.08);
}

.rent-row .label { 
  color: #2c3e50; 
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.rent-row .value { 
  color: #d35400; 
  font-weight: 800;
  font-size: 11px;
  background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.property-title { 
  font-family: 'Playfair Display', serif; 
  font-size: 20px; 
  margin: 0 0 6px 0; 
}

.house-indicator { 
  display: inline-block; 
  margin-left: 6px; 
  color: #d35400; 
  font-weight: 700; 
}

.card-actions button { 
  padding: 8px 10px; 
  border-radius: 8px; 
  border: none; 
  cursor: pointer; 
}

.card-actions button[disabled] { 
  opacity: 0.6; 
  cursor: default; 
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px 8px;
  background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
  border: 1px solid rgba(0,0,0,0.05);
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
}

.card-actions button {
  flex: 1 1 calc(50% - 2px);
  min-width: 0;
  padding: 6px 8px;
  font-size: 9.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#closeCardBtn {
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
  box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

#closeCardBtn:hover {
  background: linear-gradient(135deg, #c0392b 0%, #e74c3c 100%);
  box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

#buyHouseBtn {
  background: linear-gradient(135deg, #27ae60 0%, #229954 100%) !important;
  box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
  color: white !important;
}

#buyHouseBtn:hover:not([disabled]) {
  background: linear-gradient(135deg, #229954 0%, #27ae60 100%) !important;
  box-shadow: 0 6px 20px rgba(39, 174, 96, 0.4);
}

#sellHouseBtn {
  background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%) !important;
  box-shadow: 0 4px 12px rgba(243, 156, 18, 0.3);
  color: white !important;
}

#sellHouseBtn:hover:not([disabled]) {
  background: linear-gradient(135deg, #e67e22 0%, #f39c12 100%) !important;
  box-shadow: 0 6px 20px rgba(243, 156, 18, 0.4);
}

#sellPropertyBtn {
  background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%) !important;
  box-shadow: 0 4px 12px rgba(52, 73, 94, 0.3);
  color: white !important;
}

#sellPropertyBtn:hover {
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%) !important;
  box-shadow: 0 6px 20px rgba(52, 73, 94, 0.4);
}

/* Special Tile Info Cards */
.special-tile-card {
  background: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  max-width: 500px;
  width: 90%;
  animation: slideUp 0.3s ease-out;
}

.special-tile-header {
  padding: 25px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.special-tile-header .emoji {
  font-size: 48px;
}

.special-tile-header h2 {
  margin: 0;
  color: white;
  font-size: 28px;
  font-weight: 700;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.special-tile-body {
  padding: 24px;
  background: white;
  max-height: 60vh;
  overflow-y: auto;
}

.special-tile-body::-webkit-scrollbar {
  width: 8px;
}

.special-tile-body::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.special-tile-body::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  border-radius: 10px;
}

.special-tile-body::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.special-tile-title {
  display: none;
}

.special-tile-content {
  color: #666;
  font-size: 15px;
  line-height: 1.6;
}

.special-tile-content > p:first-child {
  text-align: center;
  margin: 0 0 16px 0;
}

.special-tile-content .info-section {
  margin: 16px 0;
  padding: 16px;
  border-radius: 12px;
  background: rgba(0,0,0,0.03);
}

.special-tile-content .info-section-title {
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 8px;
  color: #333;
}

.special-tile-content .info-highlight {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 700;
}

.special-tile-content .tip-box {
  margin-top: 16px;
  padding: 14px;
  background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
  border-radius: 12px;
  border-left: 4px solid #f39c12;
  font-size: 14px;
}

.special-tile-close {
  padding: 14px 32px;
  margin-top: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: 2px solid #764ba2;
  border-radius: 25px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(118, 75, 162, 0.3);
  transition: all 0.3s ease;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.special-tile-close:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(118, 75, 162, 0.4);
}

.special-tile-close:active {
  transform: translateY(0);
}

/* Enhanced Game Setup Modal Styling */
#localOptions, #onlineOptions {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
  border-radius: 13px;
  padding: 12px 18px 10px 18px;
  border: 1.5px solid rgba(102, 126, 234, 0.13);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

#localOptions p, #onlineOptions p {
  color: #5a6c8f;
  font-size: 14px;
  font-weight: 600;
}

#localPlayersList, #roomPlayersList {
  background: white;
  border-radius: 12px;
  padding: 12px;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.06);
}

#localPlayersList li, #roomPlayersList li {
  background: linear-gradient(135deg, #f8f9fe 0%, #ffffff 100%);
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 6px;
  color: #3a4d6c;
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
  transition: all 0.2s ease;
  border-left: 3px solid #667eea;
}

#localPlayersList li:hover, #roomPlayersList li:hover {
  transform: translateX(3px);
  box-shadow: 0 3px 10px rgba(102, 126, 234, 0.2);
}

#joinRoomCode {
  padding: 10px 14px;
  border-radius: 10px;
  border: 2px solid rgba(102, 126, 234, 0.3);
  font-size: 14px;
  font-weight: 600;
  color: #3a4d6c;
  background: white;
  transition: all 0.3s ease;
  outline: none;
  width: 200px;
}

#joinRoomCode:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1), 0 4px 12px rgba(102, 126, 234, 0.2);
}

#joinRoomCode::placeholder {
  color: #b8c5d8;
}

#roomInfo {
  background: linear-gradient(135deg, rgba(102, 234, 175, 0.08) 0%, rgba(102, 126, 234, 0.08) 100%);
  border-radius: 14px;
  padding: 18px;
  border: 2px solid rgba(102, 234, 175, 0.2);
}

#roomCodeDisplay {
  font-family: 'Courier New', monospace;
  background: #e5e7eb;
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 24px;
  letter-spacing: 3px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  display: inline-block;
  min-width: 200px;
  text-align: center;
  margin: 0;
}

/* Chance modal list styles */
.chance-list {
  max-height: 260px;
  overflow-y: auto;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.06);
  padding: 8px;
  background: linear-gradient(180deg,#fff,#fbfbfe);
}

.chance-item { padding: 8px; border-radius: 8px; margin-bottom: 8px; background: rgba(0,0,0,0.03); }
.chance-item-title { font-weight:700; color:var(--board-edge); }
.chance-item-desc { margin-top:4px; }
.chance-item:hover { background: rgba(0,0,0,0.06); }

#chanceModal .modal-content > div:nth-child(2) > div:nth-child(2)::-webkit-scrollbar {
  width: 8px;
}

#chanceModal .modal-content > div:nth-child(2) > div:nth-child(2)::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

#chanceModal .modal-content > div:nth-child(2) > div:nth-child(2)::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  border-radius: 10px;
}

#chanceModal .modal-content > div:nth-child(2) > div:nth-child(2)::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
}

/* Negotiation Modal Styles */
#negotiation-modal input[type="radio"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #fee140;
}

#negotiation-modal button:not(#negotiation-confirm) {
  transition: all 0.3s ease;
}

#negotiation-modal button:not(#negotiation-confirm):hover {
  transform: translateY(-3px) scale(1.02);
  filter: brightness(1.1);
}

#negotiation-modal button:not(#negotiation-confirm):active {
  transform: translateY(0) scale(0.98);
}

#negotiation-confirm {
  transition: all 0.3s ease;
}

#negotiation-confirm:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 6px 20px rgba(254, 225, 64, 0.6);
  filter: brightness(1.1);
}

#negotiation-confirm:active {
  transform: translateY(0) scale(0.98);
}

#trade-request-modal button {
  transition: all 0.3s ease;
}

#trade-request-modal button:hover {
  transform: translateY(-3px) scale(1.05);
  filter: brightness(1.1);
}

#trade-request-modal button:active {
  transform: translateY(0) scale(0.98);
}

/* Scrollbar styling for negotiation lists */
#negotiation-player-list::-webkit-scrollbar,
#negotiation-property-list::-webkit-scrollbar {
  width: 8px;
}

#negotiation-player-list::-webkit-scrollbar-track,
#negotiation-property-list::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

#negotiation-player-list::-webkit-scrollbar-thumb,
#negotiation-property-list::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
  border-radius: 10px;
}

#negotiation-player-list::-webkit-scrollbar-thumb:hover,
#negotiation-property-list::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #fee140 0%, #fa709a 100%);
}
