/* ============================================
   CRAZYONOPOLY - UI & Effects Styles
   HappyStoner5420 Games!
   ============================================ */

/* ============================================
   MONEY ANIMATIONS
   ============================================ */
.money-bill {
  position: fixed;
  pointer-events: none;
  z-index: 9000;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
  will-change: transform, opacity;
}

.money-bill.positive {
  background: linear-gradient(135deg, #1a4d1a, #27ae60);
  color: white;
  border: 1px solid rgba(46,204,113,0.5);
}

.money-bill.negative {
  background: linear-gradient(135deg, #4d1a1a, #c0392b);
  color: white;
  border: 1px solid rgba(231,76,60,0.5);
}

@keyframes moneyFloat {
  0%   { transform: translateY(0) translateX(0) scale(0.5); opacity: 0; }
  15%  { transform: translateY(-20px) translateX(0) scale(1); opacity: 1; }
  70%  { opacity: 1; }
  100% { transform: translateY(-80px) translateX(var(--drift, 20px)) scale(0.8); opacity: 0; }
}

/* ============================================
   PARTICLE EFFECTS
   ============================================ */
.particle {
  position: fixed;
  pointer-events: none;
  border-radius: 50%;
  will-change: transform, opacity;
}

/* ============================================
   TOKEN MOVE TRAIL
   ============================================ */
.move-trail {
  position: absolute;
  width: 10px; height: 10px;
  border-radius: 50%;
  pointer-events: none;
  animation: trailFade 0.5s ease-out forwards;
}

@keyframes trailFade {
  from { transform: scale(1); opacity: 0.7; }
  to   { transform: scale(0); opacity: 0; }
}

/* ============================================
   PROPERTY PURCHASE FLASH
   ============================================ */
.purchase-flash {
  position: absolute;
  border-radius: 6px;
  pointer-events: none;
  animation: purchaseFlash 0.8s ease-out forwards;
}

@keyframes purchaseFlash {
  0%   { opacity: 0; transform: scale(0.5); }
  30%  { opacity: 1; transform: scale(1.3); }
  60%  { opacity: 0.8; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.5); }
}

/* ============================================
   RENT COLLECTION ANIMATION
   ============================================ */
.rent-beam {
  position: fixed;
  height: 3px;
  transform-origin: left center;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(231,76,60,0.8), transparent);
  animation: rentBeam 0.8s ease-in-out;
  z-index: 8999;
}

@keyframes rentBeam {
  0%   { opacity: 0; transform: scaleX(0); }
  50%  { opacity: 1; transform: scaleX(1); }
  100% { opacity: 0; transform: scaleX(1); }
}

/* ============================================
   DICE SHADOW BENEATH
   ============================================ */
.die-shadow {
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 48px; height: 8px;
  background: radial-gradient(ellipse, rgba(0,0,0,0.5), transparent);
  border-radius: 50%;
}

/* ============================================
   CASINO WINNING COINS
   ============================================ */
.casino-coin {
  position: fixed;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffd700, #c8a400);
  border: 2px solid #c8a400;
  pointer-events: none;
  z-index: 9001;
  will-change: transform, opacity;
}

/* ============================================
   SLOT MACHINE WIN EXPLOSION
   ============================================ */
.slot-win-bg {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border-radius: 10px;
  pointer-events: none;
  z-index: 12;
  animation: slotWinBg 0.5s ease-in-out 4;
}

@keyframes slotWinBg {
  0%,100% { background: transparent; }
  50%     { background: rgba(255,215,0,0.15); }
}

/* ============================================
   BUILDING ANIMATION
   ============================================ */
@keyframes houseBuild {
  0%   { transform: translateY(20px) scale(0); opacity: 0; }
  60%  { transform: translateY(-5px) scale(1.2); opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes hotelBuild {
  0%   { transform: translateY(30px) scale(0) rotate(-10deg); opacity: 0; }
  60%  { transform: translateY(-8px) scale(1.3) rotate(3deg); opacity: 1; }
  100% { transform: translateY(0) scale(1) rotate(0deg); opacity: 1; }
}

/* ============================================
   SCREEN TRANSITIONS
   ============================================ */
.screen-enter {
  animation: screenEnter 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes screenEnter {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.screen-exit {
  animation: screenExit 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes screenExit {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(1.05);
  }
}

/* ============================================
   FLOATING TEXT ALERTS
   ============================================ */
.float-alert {
  position: fixed;
  pointer-events: none;
  z-index: 9500;
  font-family: var(--font-game);
  letter-spacing: 2px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.8);
  animation: floatAlert 2.5s cubic-bezier(0.4,0,0.2,1) forwards;
}

@keyframes floatAlert {
  0%   { transform: translateY(0) scale(0.5); opacity: 0; }
  15%  { transform: translateY(-10px) scale(1.2); opacity: 1; }
  60%  { transform: translateY(-40px) scale(1); opacity: 1; }
  100% { transform: translateY(-80px) scale(0.8); opacity: 0; }
}

/* ============================================
   FIREWORKS (Winner Screen)
   ============================================ */
#fireworks-canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* ============================================
   LOADING SPINNER
   ============================================ */
.spinner {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 4px solid rgba(100,100,200,0.2);
  border-top-color: var(--color-primary);
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================
   PROPERTY GRID (side panel property list)
   ============================================ */
.owned-properties-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.owned-prop-dot {
  width: 16px; height: 16px;
  border-radius: 3px;
  border: 1px solid rgba(0,0,0,0.3);
  cursor: help;
  transition: transform 0.2s;
  position: relative;
}

.owned-prop-dot:hover {
  transform: scale(1.5);
  z-index: 10;
}

.owned-prop-dot.mortgaged {
  opacity: 0.4;
  filter: grayscale(100%);
}

.owned-prop-dot.has-house::after {
  content: '';
  position: absolute;
  bottom: 1px;
  left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 5px solid rgba(255,255,255,0.8);
}

.owned-prop-dot.has-hotel {
  box-shadow: 0 0 5px rgba(231,76,60,0.8);
}

/* ============================================
   TOOLTIP POPOVER
   ============================================ */
.tooltip-popover {
  position: fixed;
  background: rgba(8,8,25,0.97);
  border: 1px solid rgba(155,89,182,0.4);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 12px;
  color: #ccc;
  line-height: 1.6;
  z-index: 10000;
  pointer-events: none;
  max-width: 220px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.8);
  animation: tooltipFadeIn 0.15s ease;
}

/* ============================================
   MORTGAGE OVERLAY ON PROPERTY CARD
   ============================================ */
.mortgage-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  pointer-events: none;
}

.mortgage-stamp {
  font-family: var(--font-game);
  font-size: 28px;
  letter-spacing: 3px;
  color: rgba(231,76,60,0.9);
  border: 3px solid rgba(231,76,60,0.7);
  padding: 4px 14px;
  transform: rotate(-20deg);
  text-shadow: 0 0 10px rgba(231,76,60,0.5);
}

/* ============================================
   AUCTION COUNTDOWN
   ============================================ */
.auction-timer {
  font-family: var(--font-game);
  font-size: 48px;
  color: var(--color-gold);
  text-shadow: 0 0 20px rgba(255,215,0,0.8);
  animation: timerPulse 1s ease-in-out infinite;
}

@keyframes timerPulse {
  0%,100% { transform: scale(1); }
  50%      { transform: scale(1.1); }
}

.auction-timer.urgent {
  color: #e74c3c;
  animation: timerUrgent 0.5s ease-in-out infinite;
}

@keyframes timerUrgent {
  0%,100% { transform: scale(1); color: #e74c3c; }
  50%      { transform: scale(1.15); color: #ff6b6b; }
}

/* ============================================
   JAIL BARS
   ============================================ */
.jail-bars-svg {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  opacity: 0.15;
}

/* ============================================
   TURN INDICATOR ARROWS
   ============================================ */
.turn-arrow {
  position: fixed;
  pointer-events: none;
  z-index: 9000;
  animation: turnArrow 1s ease-in-out 3 forwards;
}

@keyframes turnArrow {
  0%,100% { transform: translateX(0); opacity: 0.8; }
  50%      { transform: translateX(8px); opacity: 1; }
}

/* ============================================
   CASINO LIGHTS BORDER
   ============================================ */
.casino-lights-border {
  position: absolute;
  top: 0; left: 0;
  right: 0; bottom: 0;
  border-radius: 20px;
  pointer-events: none;
  overflow: hidden;
}

.casino-light-dot {
  position: absolute;
  width: 8px; height: 8px;
  border-radius: 50%;
  animation: casinoDot 1s linear infinite;
}

@keyframes casinoDot {
  0%,100% { opacity: 0.3; transform: scale(0.7); }
  50%      { opacity: 1; transform: scale(1); }
}

/* ============================================
   RESPONSIVE PANEL ADJUSTMENTS
   ============================================ */
@media (max-height: 600px) {
  .slot-machine-body {
    padding: 12px;
  }
  .slot-container {
    gap: 12px;
  }
  .paytable {
    display: none;
  }
}

/* ============================================
   DICE ROLL RESULT TEXT
   ============================================ */
.roll-result-big {
  font-family: var(--font-game);
  font-size: 56px;
  letter-spacing: 4px;
  background: linear-gradient(135deg, #ffd700, #ff6b00);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 15px rgba(255,150,0,0.6));
  animation: rollResultPop 0.5s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes rollResultPop {
  from { transform: scale(0) rotate(-10deg); opacity: 0; }
  to   { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* ============================================
   PROPERTY GROUP LABELS
   ============================================ */
.group-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-family: var(--font-ui);
  font-weight: 600;
  letter-spacing: 1px;
}

/* ============================================
   MENU BACKGROUND ANIMATIONS
   ============================================ */
.menu-float-die {
  position: absolute;
  font-size: 24px;
  pointer-events: none;
  opacity: 0.08;
  animation: menuFloatDie linear infinite;
}

@keyframes menuFloatDie {
  from {
    transform: translateY(100vh) rotate(0deg);
    opacity: 0;
  }
  10% { opacity: 0.08; }
  90% { opacity: 0.08; }
  to {
    transform: translateY(-10vh) rotate(720deg);
    opacity: 0;
  }
}

/* ============================================
   PROGRESS BAR (loading/turn timer)
   ============================================ */
.progress-bar-wrap {
  width: 100%;
  height: 6px;
  background: rgba(30,30,70,0.6);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
  transition: width 0.3s ease;
  box-shadow: 0 0 6px rgba(231,76,60,0.5);
}

/* ============================================
   MORTGAGE / UNMORTGAGE PANEL
   ============================================ */
.mortgage-panel {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(8,8,25,0.97);
  border: 1px solid rgba(155,89,182,0.4);
  border-radius: 16px;
  padding: 20px;
  max-width: 500px;
  width: 90%;
  z-index: 400;
  box-shadow: var(--shadow-card);
  animation: slideUp 0.3s ease;
}

.mortgage-panel h3 {
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--color-gold);
  margin-bottom: 12px;
  text-transform: uppercase;
}

.mortgage-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
}

.mortgage-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(20,20,45,0.8);
  border-radius: 8px;
  font-size: 13px;
}

.mortgage-mini-card {
  width: 34px;
  height: 48px;
  border-radius: 3px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.mortgage-item-info {
  flex: 1;
  min-width: 0;
}

.mortgage-item-name {
  font-family: var(--font-ui);
  font-weight: 600;
  color: white;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mortgage-item-status {
  font-size: 10px;
  font-family: var(--font-ui);
  letter-spacing: 1px;
  margin-top: 2px;
}
.mortgage-item-status.mortgaged {
  color: #e74c3c;
}
.mortgage-item-status.active {
  color: #5dfc8a;
}

.mortgage-item-value {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 12px;
  color: #e74c3c;
  white-space: nowrap;
}
.mortgage-item-value.gain {
  color: #5dfc8a;
}

.mortgage-item-btn {
  padding: 5px 14px;
  background: linear-gradient(135deg, #4a0a0a, #7a1010);
  border: 1px solid rgba(231,76,60,0.3);
  border-radius: 6px;
  color: #ff8080;
  font-size: 12px;
  font-family: var(--font-ui);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.mortgage-item-btn:hover {
  background: linear-gradient(135deg, #7a1010, #c0392b);
  color: white;
}

.mortgage-item-btn.unmortgage {
  background: linear-gradient(135deg, #1a4d1a, #27ae60);
  border-color: rgba(39,174,96,0.3);
  color: #5dfc8a;
}

.mortgage-item-btn.unmortgage:hover {
  background: linear-gradient(135deg, #27ae60, #2ecc71);
  color: white;
}

/* ============================================
   BUILD PANEL
   ============================================ */
.build-panel {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(8,8,25,0.97);
  border: 1px solid rgba(39,174,96,0.4);
  border-radius: 16px;
  padding: 20px;
  max-width: 540px;
  width: 90%;
  z-index: 400;
  box-shadow: var(--shadow-card);
  animation: slideUp 0.3s ease;
}

.build-panel h3 {
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #5dfc8a;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.build-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
}

.build-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(20,20,45,0.8);
  border-radius: 8px;
}

.build-item-color {
  width: 12px; height: 32px;
  border-radius: 3px;
  flex-shrink: 0;
}

.build-item-info {
  flex: 1;
}

.build-item-name {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  color: white;
}

.build-item-status {
  font-size: 11px;
  color: #888;
}

.build-item-btns {
  display: flex;
  gap: 6px;
}

.build-house-btn, .sell-house-btn {
  padding: 5px 12px;
  font-size: 12px;
  font-family: var(--font-ui);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
  font-weight: 600;
}

.build-house-btn {
  background: linear-gradient(135deg, #1a5200, #27ae60);
  color: white;
}

.build-house-btn:hover { background: linear-gradient(135deg, #27ae60, #2ecc71); }

.sell-house-btn {
  background: linear-gradient(135deg, #4a0a0a, #7a1010);
  color: #ff8080;
}

.sell-house-btn:hover { background: linear-gradient(135deg, #7a1010, #c0392b); color: white; }

.close-panel-btn {
  position: absolute;
  top: 10px; right: 14px;
  background: none;
  border: none;
  color: #e74c3c;
  font-size: 20px;
  cursor: pointer;
  transition: var(--transition);
  width: 28px; height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.close-panel-btn:hover {
  color: #fff;
  background: #e74c3c;
}
