/* ═══════════════════════════════════════════════════════════════════════════
   It's Just Business — Modals Stylesheet
   Property Card, Card Draw, Auction, Trade, Tax Evasion, Jail, Victory
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Modal Overlay ───────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 5000;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  animation: overlayIn 0.18s ease;
}

@keyframes overlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.92) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close {
  position: absolute; top: 14px; right: 14px;
  background: var(--bg-panel); border: 1.5px solid var(--border);
  border-radius: 50%; width: 30px; height: 30px;
  font-size: 14px; cursor: pointer; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition), color var(--transition);
}
.modal-close:hover { background: var(--red); color: #fff; border-color: var(--red); }

/* ── Property Card Modal ─────────────────────────────────────────────────── */
.property-modal { max-width: 340px; padding: 0; overflow: hidden; }

.property-card-header {
  padding: 20px 20px 14px;
  color: #fff;
  text-align: center;
  position: relative;
}
.property-card-group-label {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  opacity: 0.85; margin-bottom: 6px;
}
.property-card-name {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 900;
}

.property-card-body {
  padding: 16px 20px;
}

.prop-rent-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.prop-rent-table td {
  padding: 5px 8px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text);
}
.prop-rent-table td:last-child { text-align: right; font-weight: 600; color: var(--red); }
.prop-rent-table tr.highlight td { background: var(--red-light); font-weight: 700; }

.prop-info-row {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--text-muted);
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid var(--border-soft);
}
.prop-info-row strong { color: var(--text); }

.property-card-actions {
  padding: 14px 20px;
  display: flex; flex-wrap: wrap; gap: 8px;
  border-top: 1px solid var(--border-soft);
}

/* ── Card Draw Modal ─────────────────────────────────────────────────────── */
.card-draw-modal { max-width: 360px; text-align: center; }

.card-draw-type {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted); margin-bottom: 12px;
}
.card-draw-icon { font-size: 52px; margin-bottom: 10px; }
.card-draw-text {
  font-size: 16px; line-height: 1.55; color: var(--text);
  font-weight: 500; margin-bottom: 20px;
}

/* ── Auction Modal ───────────────────────────────────────────────────────── */
.auction-modal { max-width: 400px; }

.auction-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.auction-header h2 { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--text); }

.auction-timer-ring { position: relative; width: 56px; height: 56px; flex-shrink: 0; }
.auction-ring-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--border); stroke-width: 5; }
.ring-fill {
  fill: none; stroke: var(--red); stroke-width: 5;
  stroke-dasharray: 163.36; stroke-dashoffset: 0;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear;
}
#auctionCountdown {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; color: var(--red);
}

.auction-property {
  font-family: var(--font-display); font-size: 20px; font-weight: 700;
  color: var(--text); text-align: center; margin-bottom: 10px;
}

.auction-current-bid {
  text-align: center; font-size: 15px; color: var(--text-muted);
  margin-bottom: 14px;
}
.auction-current-bid strong { font-size: 22px; color: var(--red); }
.auction-bidder { font-size: 12px; color: var(--text-light); display: block; }

.auction-bid-row {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  margin-bottom: 12px;
}

.auction-you-have { text-align: center; font-size: 13px; color: var(--text-muted); }
.auction-you-have strong { color: var(--text); }

/* ── Trade Modal ─────────────────────────────────────────────────────────── */
.trade-modal { max-width: 640px; }

.trade-title {
  font-family: var(--font-display); font-size: 22px; font-weight: 700;
  color: var(--text); margin-bottom: 16px;
}

.trade-panels {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  margin-bottom: 14px;
}

.trade-panel {
  background: var(--bg-panel); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px;
}
.trade-panel h3 { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 10px; }

.trade-cash-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.trade-cash-row label { font-size: 12px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.trade-cash-row input {
  flex: 1; padding: 6px 10px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); background: var(--bg-input); color: var(--text);
  font-size: 14px; font-weight: 600; outline: none;
}
.trade-cash-row input:focus { border-color: var(--red); }

.trade-props { display: flex; flex-wrap: wrap; gap: 5px; min-height: 32px; margin-bottom: 8px; }
.trade-prop-chip {
  padding: 3px 8px; border-radius: 4px; font-size: 11px; font-weight: 600;
  color: #fff; cursor: pointer; transition: opacity 0.15s;
}
.trade-prop-chip:hover { opacity: 0.75; }
.trade-prop-chip.selected { outline: 2px solid var(--text); outline-offset: 2px; }

.trade-jail-row { display: flex; align-items: center; gap: 8px; }
.trade-jail-row label { font-size: 12px; color: var(--text-muted); flex: 1; }
.trade-jail-row input { width: 48px; padding: 4px; text-align: center; border: 1.5px solid var(--border); border-radius: 4px; background: var(--bg-input); color: var(--text); font-size: 13px; outline: none; }

.trade-target-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
}
.trade-target-row label { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.trade-target-row select {
  flex: 1; padding: 7px 10px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-input); color: var(--text); font-size: 13px; outline: none;
}

.trade-actions { display: flex; gap: 8px; justify-content: flex-end; }

.trade-incoming {
  background: var(--red-light); border: 1.5px solid var(--red);
  border-radius: var(--radius-sm); padding: 14px; margin-top: 16px;
}
#tradeIncomingText { font-size: 14px; color: var(--text); margin-bottom: 12px; }
.trade-incoming-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ── Tax Modal ───────────────────────────────────────────────────────────── */
.tax-modal { max-width: 360px; text-align: center; }
.tax-icon { font-size: 52px; margin-bottom: 10px; }
.tax-modal h2 { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
#taxAmount { font-size: 18px; font-weight: 700; color: var(--red); margin-bottom: 8px; }
.tax-odds { font-size: 13px; color: var(--text-muted); margin-bottom: 18px; line-height: 1.5; }
.tax-actions { display: flex; gap: 10px; }

/* ── Jail Modal ──────────────────────────────────────────────────────────── */
.jail-modal { max-width: 360px; text-align: center; }
.jail-icon { font-size: 52px; margin-bottom: 8px; }
.jail-modal h2 { font-family: var(--font-display); font-size: 22px; font-weight: 700; margin-bottom: 8px; }
#jailTurnsText { font-size: 14px; color: var(--text-muted); margin-bottom: 18px; }
.jail-actions { display: flex; flex-direction: column; gap: 8px; }

/* ── Victory Modal ───────────────────────────────────────────────────────── */
.victory-modal {
  max-width: 420px; text-align: center;
  background: linear-gradient(135deg, var(--red) 0%, #4a0000 100%);
  border: none; color: #fff; overflow: hidden;
}
.confetti-canvas { position: absolute; inset: 0; pointer-events: none; }
.victory-token { font-size: 72px; margin-bottom: 10px; position: relative; animation: victoryBounce 1s ease infinite alternate; }
@keyframes victoryBounce {
  from { transform: translateY(0) scale(1); }
  to   { transform: translateY(-12px) scale(1.05); }
}
.victory-title {
  font-family: var(--font-display); font-size: 32px; font-weight: 900;
  color: rgba(255,255,255,0.5); margin-bottom: 4px; letter-spacing: 0.02em;
}
.victory-winner {
  font-family: var(--font-display); font-size: 26px; font-weight: 700;
  color: #fff; margin-bottom: 8px;
}
.victory-sub { font-size: 14px; color: rgba(255,255,255,0.7); margin-bottom: 24px; }
.victory-modal .btn-primary {
  background: #fff; color: var(--red); border-color: #fff;
  font-size: 15px;
}
.victory-modal .btn-primary:hover { background: rgba(255,255,255,0.9); }

/* ── Confetti particles (JS-generated) ──────────────────────────────────── */
.confetti-piece {
  position: absolute;
  width: 8px; height: 8px;
  border-radius: 2px;
  animation: confettiFall 3s ease-out forwards;
}
@keyframes confettiFall {
  0%   { opacity: 1; transform: translateY(-20px) rotate(0deg); }
  100% { opacity: 0; transform: translateY(400px) rotate(720deg); }
}

/* ── Toast Notifications ─────────────────────────────────────────────────── */
.toast-container {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
  z-index: 9000; display: flex; flex-direction: column; gap: 8px;
  pointer-events: none; align-items: center;
}

.toast {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-md);
  animation: toastIn 0.2s ease, toastOut 0.3s ease 2.7s forwards;
  white-space: nowrap;
}
.toast.toast-good { border-color: var(--red); background: var(--red-light); color: var(--red); }
.toast.toast-bad  { border-color: #7f1d1d; background: #1c0a0a; color: #f87171; }

@keyframes toastIn  { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateY(-8px); } }

/* ── Mobile Slide-Up Bottom Sheet Experience ────────────────────────────── */
@media (max-width: 680px) {
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
  
  .modal {
    border-radius: 22px 22px 0 0;
    max-height: 85vh;
    padding: 20px 16px 28px;
    animation: sheetSlideUp 0.28s cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: 0 -10px 32px rgba(0,0,0,0.45);
    border-bottom: none;
  }
  
  @keyframes sheetSlideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
  }
  
  .modal::before {
    content: '';
    display: block;
    width: 40px;
    height: 4.5px;
    background: var(--border);
    border-radius: 3px;
    margin: -8px auto 14px;
    opacity: 0.75;
  }
  
  .property-modal {
    max-width: 100%;
    border-radius: 22px 22px 0 0;
  }
  
  .trade-panels {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .auction-header h2 { font-size: 18px; }
  .auction-property { font-size: 17px; }
  .auction-current-bid strong { font-size: 20px; }
  
  .auction-bid-row .btn {
    padding: 8px 12px;
    font-size: 12px;
  }
}
