/* ============================================
   CRAZYONOPOLY - Main Styles
   HappyStoner5420 Games!
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Bangers&family=Oswald:wght@400;600;700&family=Roboto:wght@300;400;700&display=swap');

/* ---- CSS Variables ---- */
:root {
  --color-primary: #e74c3c;
  --color-primary-dark: #c0392b;
  --color-secondary: #f39c12;
  --color-secondary-dark: #d68910;
  --color-accent: #9b59b6;
  --color-success: #27ae60;
  --color-danger: #e74c3c;
  --color-dark: #0a0a1a;
  --color-dark2: #111127;
  --color-dark3: #1a1a35;
  --color-gold: #ffd700;
  --color-gold-dark: #c8a400;
  --color-text: #f0f0f0;
  --color-text-dim: #aaa;
  --font-game: 'Bangers', 'Impact', cursive;
  --font-ui: 'Oswald', 'Arial Narrow', sans-serif;
  --font-body: 'Roboto', Arial, sans-serif;
  --shadow-glow: 0 0 20px rgba(231,76,60,0.6);
  --shadow-gold: 0 0 20px rgba(255,215,0,0.6);
  --shadow-card: 0 8px 32px rgba(0,0,0,0.8);
  --border-radius: 12px;
  --transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  font-family: var(--font-body);
  color: var(--color-text);
  user-select: none;
  -webkit-user-select: none;
}

#app {
  width: 100vw;
  height: 100vh;
  position: relative;
  overflow: hidden;
}

/* ---- Screens ---- */
.screen {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  display: none;
  z-index: 10;
}

.screen.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ---- Particle Canvas ---- */
#particle-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 9999;
}

#money-layer {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 9998;
}

/* ============================================
   MAIN MENU
   ============================================ */
#main-menu {
  background: radial-gradient(ellipse at center, #1a0535 0%, #0a0015 60%, #000 100%);
  overflow: hidden;
}

#menu-bg-canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
}

.menu-particles {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 1;
  pointer-events: none;
}

.menu-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
  width: 100%;
  max-width: 600px;
  padding: 20px;
}

/* Logo */
.logo-container {
  text-align: center;
  position: relative;
  padding: 20px 0;
}

.logo-glow {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 500px; height: 200px;
  background: radial-gradient(ellipse, rgba(231,76,60,0.3) 0%, transparent 70%);
  pointer-events: none;
  animation: pulseGlow 2s ease-in-out infinite alternate;
}

@keyframes pulseGlow {
  from { opacity: 0.4; transform: translate(-50%,-50%) scale(1); }
  to   { opacity: 1;   transform: translate(-50%,-50%) scale(1.1); }
}

.game-title {
  font-family: var(--font-game);
  font-size: clamp(52px, 8vw, 90px);
  letter-spacing: 6px;
  background: linear-gradient(135deg, #ffd700 0%, #ff6b00 40%, #e74c3c 70%, #9b59b6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  filter: drop-shadow(0 0 20px rgba(255,215,0,0.8));
  animation: titleBob 3s ease-in-out infinite;
  line-height: 1;
}

@keyframes titleBob {
  0%,100% { transform: translateY(0) rotate(-1deg); }
  50%      { transform: translateY(-8px) rotate(1deg); }
}

.game-subtitle {
  font-family: var(--font-ui);
  font-size: clamp(12px, 2vw, 18px);
  color: #aaa;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-top: 8px;
}

.title-dice {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 10px;
  font-size: 28px;
}

.mini-die {
  animation: dieSpin 4s linear infinite;
  display: inline-block;
}

.mini-die:nth-child(2) {
  animation-duration: 5s;
  animation-direction: reverse;
}

@keyframes dieSpin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Menu Buttons */
.menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 380px;
}

.menu-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 28px;
  font-family: var(--font-ui);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
  overflow: hidden;
  text-align: left;
  width: 100%;
}

.menu-btn::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  transition: left 0.5s;
}

.menu-btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: white;
  box-shadow: 0 4px 20px rgba(231,76,60,0.5);
  border: 1px solid rgba(255,100,100,0.3);
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 30px rgba(231,76,60,0.7);
}

.btn-secondary {
  background: linear-gradient(135deg, #1e1e4a, #2d2d6b);
  color: #ddd;
  box-shadow: 0 4px 15px rgba(0,0,0,0.5);
  border: 1px solid rgba(100,100,200,0.3);
}

.btn-secondary:hover {
  transform: translateY(-3px) scale(1.02);
  background: linear-gradient(135deg, #2a2a60, #3d3d80);
  color: white;
  box-shadow: 0 8px 25px rgba(50,50,150,0.5);
}

.btn-danger {
  background: linear-gradient(135deg, #4a0a0a, #6b1010);
  color: #ff8080;
  box-shadow: 0 4px 15px rgba(0,0,0,0.5);
  border: 1px solid rgba(200,50,50,0.3);
}

.btn-danger:hover {
  transform: translateY(-3px) scale(1.02);
  background: linear-gradient(135deg, #6b1010, #8b2020);
  color: white;
  box-shadow: 0 8px 25px rgba(150,20,20,0.5);
}

.btn-icon {
  width: 32px; height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.1);
  border-radius: 8px;
  font-size: 16px;
  flex-shrink: 0;
}

.menu-footer {
  font-size: 11px;
  color: rgba(150,150,180,0.6);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 10px;
}

/* ============================================
   PLAYER SETUP
   ============================================ */
#player-setup {
  background: radial-gradient(ellipse at top, #1a1a35 0%, #0a0a15 100%);
}

.setup-container {
  background: rgba(15,15,35,0.95);
  border: 1px solid rgba(100,100,200,0.3);
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 700px;
  box-shadow: var(--shadow-card);
  position: relative;
  z-index: 2;
  max-height: 90vh;
  overflow-y: auto;
}

.screen-title {
  font-family: var(--font-game);
  font-size: 42px;
  letter-spacing: 4px;
  text-align: center;
  background: linear-gradient(135deg, #ffd700, #ff6b00);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 30px;
}

.mode-selector {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 25px;
  flex-wrap: wrap;
}

.mode-btn {
  padding: 10px 24px;
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 1px;
  border: 2px solid rgba(100,100,200,0.4);
  border-radius: 30px;
  background: rgba(30,30,60,0.8);
  color: #aaa;
  cursor: pointer;
  transition: var(--transition);
}

.mode-btn.active,
.mode-btn:hover {
  background: linear-gradient(135deg, #3d1a6e, #5a2d99);
  border-color: #9b59b6;
  color: white;
  box-shadow: 0 0 15px rgba(155,89,182,0.4);
}

#player-slots {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.player-slot {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(20,20,45,0.9);
  border: 1px solid rgba(80,80,160,0.3);
  border-radius: 12px;
  padding: 14px 18px;
  transition: var(--transition);
}

.player-slot.active {
  border-color: rgba(155,89,182,0.6);
  background: rgba(30,20,55,0.9);
}

.player-token-preview {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  border: 3px solid rgba(255,255,255,0.2);
  box-shadow: 0 0 15px rgba(0,0,0,0.5);
}

.player-name-input {
  flex: 1;
  padding: 10px 14px;
  background: rgba(10,10,25,0.8);
  border: 1px solid rgba(100,100,200,0.3);
  border-radius: 8px;
  color: white;
  font-family: var(--font-ui);
  font-size: 16px;
  outline: none;
  transition: var(--transition);
}

.player-name-input:focus {
  border-color: #9b59b6;
  box-shadow: 0 0 10px rgba(155,89,182,0.3);
}

.player-type-select {
  padding: 10px 14px;
  background: rgba(10,10,25,0.8);
  border: 1px solid rgba(100,100,200,0.3);
  border-radius: 8px;
  color: white;
  font-family: var(--font-ui);
  font-size: 14px;
  cursor: pointer;
  outline: none;
}

.player-color-pick {
  display: flex;
  gap: 6px;
}

.color-swatch {
  width: 22px; height: 22px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition);
}

.color-swatch.selected,
.color-swatch:hover {
  border-color: white;
  transform: scale(1.2);
}

.difficulty-section {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.difficulty-section label {
  font-family: var(--font-ui);
  font-size: 15px;
  color: #aaa;
  flex-shrink: 0;
}

.difficulty-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.diff-btn {
  padding: 8px 18px;
  font-family: var(--font-ui);
  font-size: 13px;
  border: 1px solid rgba(100,100,200,0.3);
  border-radius: 20px;
  background: rgba(20,20,45,0.9);
  color: #aaa;
  cursor: pointer;
  transition: var(--transition);
}

.diff-btn.active,
.diff-btn:hover {
  background: linear-gradient(135deg, #1a3a1a, #2a5a2a);
  border-color: #27ae60;
  color: #5dfc8a;
}

.setup-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 10px;
}

/* ============================================
   GAME SCREEN - FULLSCREEN LAYOUT
   ============================================ */
#game-screen {
  display: none;
  flex-direction: column;
  background: #040410;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

#game-screen.active {
  display: flex;
}

/* HUD - Larger and more prominent */
#game-hud {
  width: 100%;
  height: 70px;
  background: linear-gradient(180deg, rgba(10,10,30,0.98), rgba(5,5,20,0.95));
  border-bottom: 2px solid rgba(255,215,0,0.3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
  z-index: 100;
  box-shadow: 0 4px 30px rgba(0,0,0,0.6);
}

#hud-left, #hud-right {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 180px;
}

#hud-right { justify-content: flex-end; }

#hud-center {
  flex: 1;
  display: flex;
  justify-content: center;
}

.hud-btn {
  padding: 10px 20px;
  background: rgba(30,30,70,0.8);
  border: 1px solid rgba(100,100,200,0.3);
  border-radius: 10px;
  color: #bbb;
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: 1px;
}

.hud-btn:hover {
  background: rgba(60,60,120,0.9);
  color: white;
  border-color: rgba(150,150,255,0.5);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(100,100,200,0.3);
}

#turn-display {
  text-align: center;
  background: rgba(20,20,50,0.8);
  padding: 10px 30px;
  border-radius: 12px;
  border: 1px solid rgba(255,215,0,0.3);
}

#current-player-name {
  font-family: var(--font-game);
  font-size: 24px;
  font-weight: 700;
  color: var(--color-gold);
  text-shadow: 0 0 15px rgba(255,215,0,0.5);
  letter-spacing: 3px;
}

#turn-phase {
  font-size: 12px;
  color: #aaa;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 2px;
}

#hud-right {
  display: flex;
  gap: 12px;
  align-items: stretch;
}

#free-parking-display {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  background: linear-gradient(135deg, rgba(60,30,60,0.8), rgba(40,20,40,0.9));
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid rgba(255,215,0,0.4);
  box-shadow: 0 0 20px rgba(255,215,0,0.2);
}

#free-parking-amount {
  font-family: var(--font-game);
  font-size: 22px;
  font-weight: 700;
  color: #ffd700;
  text-shadow: 0 0 15px rgba(255,215,0,0.6);
}

@keyframes freeParkingPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); color: #fff; }
  100% { transform: scale(1); }
}

#bank-display {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  background: rgba(20,40,20,0.6);
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid rgba(46,204,113,0.3);
}

.hud-label {
  font-size: 10px;
  color: #888;
  letter-spacing: 2px;
  text-transform: uppercase;
}

#bank-amount {
  font-family: var(--font-game);
  font-size: 22px;
  font-weight: 700;
  color: #5dfc8a;
  text-shadow: 0 0 10px rgba(93,252,138,0.4);
}

/* Game Main Area - Fullscreen */
#game-main {
  flex: 1;
  display: flex;
  gap: 0;
  overflow: hidden;
  min-height: 0;
  height: calc(100vh - 70px);
}

/* Board Container - Takes most of the screen */
#board-container {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: radial-gradient(ellipse at center, #0a0a20 0%, #040410 100%);
  min-width: 0;
  padding: 20px;
}

#board-canvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  box-shadow: 
    0 0 60px rgba(255,215,0,0.15),
    0 20px 60px rgba(0,0,0,0.8);
}

#board-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}

/* Side Panel - Wider and more prominent */
#side-panel {
  width: 320px;
  min-width: 320px;
  max-width: 320px;
  background: linear-gradient(180deg, #0c0c28 0%, #080818 100%);
  border-left: 2px solid rgba(255,215,0,0.2);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 12px;
  gap: 14px;
  z-index: 50;
}

#side-panel::-webkit-scrollbar {
  width: 4px;
}
#side-panel::-webkit-scrollbar-track {
  background: rgba(20,20,50,0.5);
}
#side-panel::-webkit-scrollbar-thumb {
  background: rgba(100,100,200,0.4);
  border-radius: 2px;
}

/* Player Cards in Side Panel - ENLARGED */
#players-panel {
  background: linear-gradient(145deg, rgba(15,15,40,0.95), rgba(10,10,30,0.98));
  border: 1px solid rgba(255,215,0,0.2);
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

#players-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.player-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(25,25,55,0.9), rgba(18,18,40,0.95));
  border: 1px solid rgba(100,100,180,0.25);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.player-card.active-turn {
  border-color: var(--color-gold);
  background: linear-gradient(145deg, rgba(40,35,15,0.95), rgba(30,25,10,0.98));
  box-shadow: 
    0 0 25px rgba(255,215,0,0.25),
    inset 0 0 20px rgba(255,215,0,0.05);
}

.player-card.bankrupt {
  opacity: 0.35;
  filter: grayscale(100%);
}

.player-card-token {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  border: 3px solid rgba(255,255,255,0.25);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.player-card-info {
  flex: 1;
  min-width: 0;
}

.player-card-name {
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 700;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 1px;
  margin-bottom: 2px;
}

.player-card-money {
  font-family: var(--font-game);
  font-size: 20px;
  font-weight: 700;
  color: #5dfc8a;
  text-shadow: 0 0 8px rgba(93,252,138,0.3);
}

.player-card-props {
  font-size: 11px;
  color: #999;
  margin-top: 2px;
}

.active-indicator {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--color-gold);
  box-shadow: 0 0 15px var(--color-gold);
  animation: blink 1s ease-in-out infinite;
}

@keyframes blink {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.2; }
}

/* Dice Area - ENLARGED */
#dice-area {
  background: linear-gradient(145deg, rgba(18,18,45,0.95), rgba(12,12,35,0.98));
  border: 1px solid rgba(255,215,0,0.2);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

#dice-container {
  display: flex;
  gap: 20px;
  justify-content: center;
}

.die {
  width: 80px; height: 80px;
  background: linear-gradient(145deg, #ffffff, #e8e8e8);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    inset -4px -4px 8px rgba(0,0,0,0.15),
    inset 4px 4px 8px rgba(255,255,255,0.9),
    0 8px 25px rgba(0,0,0,0.5);
  position: relative;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.die:hover {
  transform: translateY(-4px) rotateX(10deg) rotateY(-10deg);
  box-shadow:
    inset -4px -4px 8px rgba(0,0,0,0.15),
    inset 4px 4px 8px rgba(255,255,255,0.9),
    0 15px 35px rgba(0,0,0,0.6);
}

.die.rolling {
  animation: diceRoll3D 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes diceRoll3D {
  0%   { transform: rotateX(0deg) rotateY(0deg) scale(1); }
  25%  { transform: rotateX(180deg) rotateY(90deg) scale(1.15); }
  50%  { transform: rotateX(360deg) rotateY(180deg) scale(1); }
  75%  { transform: rotateX(540deg) rotateY(270deg) scale(1.15); }
  100% { transform: rotateX(720deg) rotateY(360deg) scale(1); }
}

.die-face {
  width: 100%; height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-game);
  font-size: 36px;
  color: #1a1a2e;
}

.die-dot {
  position: absolute;
  width: 12px; height: 12px;
  background: radial-gradient(circle at 30% 30%, #444, #111);
  border-radius: 50%;
  box-shadow: inset 0 2px 3px rgba(0,0,0,0.6);
}

#dice-result {
  font-family: var(--font-game);
  font-size: 18px;
  color: #ffd700;
  text-align: center;
  min-height: 24px;
  text-shadow: 0 0 10px rgba(255,215,0,0.4);
}

/* Action Buttons - ENLARGED */
#action-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.action-btn {
  padding: 14px 18px;
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition);
  background: linear-gradient(145deg, #1e1e4a, #2d2d6b);
  color: #ddd;
  border: 1px solid rgba(100,100,200,0.3);
  width: 100%;
  text-align: center;
}

.action-btn:hover:not(:disabled) {
  background: linear-gradient(145deg, #2a2a60, #4040a0);
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(50,50,150,0.5);
}

.action-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.action-btn:active:not(:disabled) {
  transform: translateY(1px);
}

#btn-roll-dice {
  background: linear-gradient(145deg, #ffd700, #c9a000);
  color: #1a1a2e;
  font-family: var(--font-game);
  font-size: 20px;
  padding: 18px;
  box-shadow: 
    0 6px 25px rgba(255,215,0,0.4),
    inset 0 2px 0 rgba(255,255,255,0.4);
  border: none;
  letter-spacing: 2px;
}

#btn-roll-dice:hover:not(:disabled) {
  background: linear-gradient(145deg, #ffec80, #ffd700);
  box-shadow: 
    0 10px 35px rgba(255,215,0,0.6),
    0 0 40px rgba(255,215,0,0.3);
}

#btn-end-turn {
  background: linear-gradient(135deg, #0d4d0d, #145214);
  color: #5dfc8a;
  border-color: rgba(39,174,96,0.3);
}

#btn-end-turn:hover:not(:disabled) {
  background: linear-gradient(135deg, #1a6b1a, #27ae60);
  color: white;
}

#btn-buy-property, #btn-auction {
  background: linear-gradient(135deg, #4a3500, #7a5800);
  color: var(--color-gold);
  border-color: rgba(255,215,0,0.3);
}

#btn-buy-property:hover:not(:disabled),
#btn-auction:hover:not(:disabled) {
  background: linear-gradient(135deg, #7a5800, #c89000);
  color: white;
}

#btn-trade {
  background: linear-gradient(135deg, #003a5c, #005a8c);
  color: #7dd4f8;
  border-color: rgba(100,200,255,0.3);
}

/* Message Log - ENLARGED */
#message-log {
  flex: 1;
  background: linear-gradient(145deg, rgba(12,12,30,0.95), rgba(8,8,22,0.98));
  border: 1px solid rgba(155,89,182,0.25);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 180px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

#log-title {
  font-family: var(--font-game);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #bb8fce;
  padding: 12px 16px;
  background: linear-gradient(90deg, transparent, rgba(155,89,182,0.15), transparent);
  border-bottom: 1px solid rgba(155,89,182,0.25);
  text-align: center;
}

#log-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#log-messages::-webkit-scrollbar { width: 6px; }
#log-messages::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); border-radius: 3px; }
#log-messages::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #9b59b6, #6c3483); border-radius: 3px; }

.log-entry {
  font-size: 13px;
  padding: 10px 14px;
  border-radius: 8px;
  line-height: 1.5;
  animation: logSlideIn 0.3s ease-out;
  border-left: 3px solid #9b59b6;
}

@keyframes logSlideIn {
  from { opacity: 0; transform: translateX(-15px); }
  to   { opacity: 1; transform: translateX(0); }
}

.log-entry.type-move   { color: #7dd4f8; background: rgba(50,150,255,0.1); border-left-color: #3498db; }
.log-entry.type-buy    { color: #ffd700; background: rgba(255,215,0,0.1); border-left-color: #f1c40f; }
.log-entry.type-rent   { color: #ff8080; background: rgba(255,80,80,0.1); border-left-color: #e74c3c; }
.log-entry.type-card   { color: #c39bd3; background: rgba(155,89,182,0.1); border-left-color: #9b59b6; }
.log-entry.type-casino { color: #ff9f43; background: rgba(255,159,67,0.1); border-left-color: #e67e22; }
.log-entry.type-jail   { color: #e74c3c; background: rgba(231,76,60,0.1); border-left-color: #c0392b; }
.log-entry.type-bank   { color: #5dfc8a; background: rgba(93,252,138,0.1); border-left-color: #27ae60; }

/* ============================================
   DEBT & BANKRUPTCY ANIMATIONS
   ============================================ */
@keyframes flashFade {
  from { opacity: 0.5; }
  to { opacity: 0; }
}

@keyframes debtShake {
  0%, 100% { transform: translateX(0); }
  10%, 50%, 90% { transform: translateX(-4px); }
  30%, 70% { transform: translateX(4px); }
}

@keyframes bankruptShake {
  0%, 100% { transform: translateX(0) rotate(0); }
  10% { transform: translateX(-8px) rotate(-1deg); }
  20% { transform: translateX(8px) rotate(1deg); }
  30% { transform: translateX(-6px) rotate(-0.5deg); }
  40% { transform: translateX(6px) rotate(0.5deg); }
  50% { transform: translateX(-4px) rotate(-0.3deg); }
  60% { transform: translateX(4px) rotate(0.3deg); }
  70% { transform: translateX(-2px) rotate(-0.1deg); }
  80% { transform: translateX(2px) rotate(0.1deg); }
  90% { transform: translateX(-1px) rotate(0); }
}

@keyframes debtPulse {
  0%, 100% { box-shadow: 0 0 10px rgba(255,0,0,0.3); }
  50% { box-shadow: 0 0 30px rgba(255,0,0,0.8); }
}

.player-in-debt {
  animation: debtPulse 1s ease-in-out infinite;
  border-color: #ff4444 !important;
}

.mortgage-warning {
  color: #ff8800 !important;
  font-weight: bold;
}

/* ============================================
   OVERLAYS & MODALS
   ============================================ */
.overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(6px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}

.overlay-content {
  background: linear-gradient(135deg, #12122a, #1c1c40);
  border: 1px solid rgba(100,100,200,0.4);
  border-radius: 20px;
  padding: 40px;
  text-align: center;
  max-width: 380px;
  width: 90%;
  box-shadow: var(--shadow-card), 0 0 60px rgba(100,100,200,0.2);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.overlay-content h2 {
  font-family: var(--font-game);
  font-size: 36px;
  letter-spacing: 3px;
  color: var(--color-gold);
}

.overlay-content p {
  font-size: 14px;
  color: #999;
  font-style: italic;
}

/* Notification */
#notification-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notification-box {
  background: linear-gradient(135deg, #12122a, #1c1c40);
  border: 2px solid rgba(155,89,182,0.5);
  border-radius: 16px;
  padding: 30px 36px;
  text-align: center;
  max-width: 440px;
  width: 90%;
  box-shadow: var(--shadow-card), 0 0 40px rgba(155,89,182,0.3);
  animation: notifPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes notifPop {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.notification-title {
  font-family: var(--font-game);
  font-size: 28px;
  letter-spacing: 2px;
  color: var(--color-gold);
  margin-bottom: 10px;
}

.notification-message {
  font-size: 15px;
  color: #ccc;
  line-height: 1.6;
  margin-bottom: 20px;
}

/* ============================================
   HOW TO PLAY
   ============================================ */
#how-to-play {
  background: radial-gradient(ellipse at center, #0e1528 0%, #060a14 100%);
  overflow-y: auto;
}

.help-bg {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.02'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
  z-index: 0;
}

.help-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 720px;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  overflow-y: auto;
  max-height: 100vh;
}

.help-title {
  font-family: var(--font-game);
  font-size: 42px;
  letter-spacing: 4px;
  background: linear-gradient(135deg, #ffd700, #ff6b00);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center;
}

.help-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  width: 100%;
}

@media (max-width: 600px) {
  .help-sections { grid-template-columns: 1fr; }
}

.help-section {
  background: rgba(15,15,35,0.9);
  border: 1px solid rgba(80,80,160,0.3);
  border-radius: 12px;
  padding: 18px;
  transition: var(--transition);
}

.help-section:hover {
  border-color: rgba(155,89,182,0.5);
  background: rgba(20,15,45,0.95);
}

.help-section h3 {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--color-gold);
  margin-bottom: 8px;
}

.help-section p {
  font-size: 13px;
  color: #bbb;
  line-height: 1.6;
}

/* ============================================
   SETTINGS
   ============================================ */
#settings-screen {
  background: radial-gradient(ellipse at center, #0e1528 0%, #060a14 100%);
}

.settings-container {
  background: rgba(12,12,30,0.95);
  border: 1px solid rgba(100,100,200,0.3);
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 560px;
  box-shadow: var(--shadow-card);
  z-index: 1;
}

.settings-title {
  font-family: var(--font-game);
  font-size: 42px;
  letter-spacing: 4px;
  text-align: center;
  background: linear-gradient(135deg, #ffd700, #ff6b00);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 30px;
}

.settings-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 30px;
}

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

.setting-row label {
  font-family: var(--font-ui);
  font-size: 15px;
  color: #bbb;
  min-width: 150px;
}

.setting-row input[type="range"] {
  flex: 1;
  height: 6px;
  -webkit-appearance: none;
  background: rgba(80,80,160,0.3);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.setting-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--color-primary);
  box-shadow: 0 0 10px rgba(231,76,60,0.5);
  cursor: pointer;
}

.setting-row select {
  flex: 1;
  padding: 8px 12px;
  background: rgba(15,15,35,0.9);
  border: 1px solid rgba(100,100,200,0.3);
  border-radius: 8px;
  color: white;
  font-family: var(--font-ui);
  font-size: 14px;
  cursor: pointer;
  outline: none;
}

.setting-row span {
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--color-gold);
  min-width: 45px;
}

.toggle-btn {
  padding: 8px 18px;
  background: linear-gradient(135deg, #1e1e4a, #2d2d6b);
  border: 1px solid rgba(100,100,200,0.3);
  border-radius: 8px;
  color: #ddd;
  font-family: var(--font-ui);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
}

.toggle-btn:hover {
  background: linear-gradient(135deg, #2a2a60, #4040a0);
  color: white;
}

/* ============================================
   CREDITS
   ============================================ */
#credits-screen {
  background: radial-gradient(ellipse at center, #0a0015 0%, #000 100%);
  overflow: hidden;
}

.credits-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 600px;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
}

.credits-scroll {
  width: 100%;
  padding: 100px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 50px;
  animation: creditsScroll 30s linear infinite;
}

@keyframes creditsScroll {
  from { transform: translateY(100vh); }
  to   { transform: translateY(-200%); }
}

.credits-logo h1 {
  font-family: var(--font-game);
  font-size: 56px;
  letter-spacing: 8px;
  background: linear-gradient(135deg, #ffd700, #e74c3c, #9b59b6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center;
}

.credits-logo p {
  font-size: 14px;
  color: #777;
  text-align: center;
  margin-top: 10px;
}

.credits-section {
  text-align: center;
}

.credits-section h2 {
  font-family: var(--font-ui);
  font-size: 14px;
  letter-spacing: 3px;
  color: rgba(155,89,182,0.8);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.credits-section p {
  font-family: var(--font-body);
  font-size: 18px;
  color: #ddd;
}

.credits-big {
  font-family: var(--font-game);
  font-size: 48px !important;
  background: linear-gradient(135deg, #ffd700, #ff6b00);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 3px;
}

.credits-footer {
  font-size: 12px;
  color: #555;
  text-align: center;
}

#btn-back-credits {
  position: fixed;
  bottom: 30px;
  z-index: 10;
}

/* ============================================
   WINNER SCREEN
   ============================================ */
#winner-screen {
  background: radial-gradient(ellipse at center, #1a1000 0%, #0a0800 100%);
  overflow: hidden;
}

#fireworks-canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
}

.winner-container {
  position: relative;
  z-index: 1;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.winner-title {
  font-family: var(--font-game);
  font-size: clamp(60px, 10vw, 100px);
  letter-spacing: 8px;
  background: linear-gradient(135deg, #ffd700, #ff6b00, #e74c3c);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 30px rgba(255,215,0,0.8));
  animation: winnerPulse 1s ease-in-out infinite alternate;
}

@keyframes winnerPulse {
  from { filter: drop-shadow(0 0 20px rgba(255,215,0,0.6)); }
  to   { filter: drop-shadow(0 0 50px rgba(255,215,0,1)); }
}

.winner-player {
  font-family: var(--font-ui);
  font-size: 32px;
  font-weight: 700;
  color: white;
  padding: 16px 40px;
  background: rgba(255,215,0,0.1);
  border: 2px solid rgba(255,215,0,0.4);
  border-radius: 50px;
}

.winner-stats {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.winner-stat {
  background: rgba(15,15,35,0.8);
  border: 1px solid rgba(100,100,200,0.3);
  border-radius: 12px;
  padding: 14px 20px;
  text-align: center;
}

.winner-stat-val {
  font-family: var(--font-game);
  font-size: 28px;
  color: var(--color-gold);
}

.winner-stat-label {
  font-size: 11px;
  color: #888;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.winner-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ============================================
   BANKRUPT SCREEN
   ============================================ */
#bankrupt-screen {
  background: radial-gradient(ellipse at center, #1a0505 0%, #0a0000 100%);
}

.bankrupt-container {
  position: relative;
  z-index: 1;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 40px;
}

.bankrupt-title {
  font-family: var(--font-game);
  font-size: clamp(50px, 8vw, 80px);
  letter-spacing: 6px;
  color: #e74c3c;
  text-shadow: 0 0 30px rgba(231,76,60,0.8);
  animation: bankruptShake 0.5s ease-in-out infinite;
}

@keyframes bankruptShake {
  0%,100% { transform: translateX(0); }
  25%      { transform: translateX(-4px) rotate(-1deg); }
  75%      { transform: translateX(4px) rotate(1deg); }
}

.bankrupt-art {
  width: 200px; height: 200px;
  position: relative;
}

.bankrupt-msg {
  font-size: 18px;
  color: #ccc;
  max-width: 400px;
  line-height: 1.6;
  font-style: italic;
}

/* ============================================
   JAIL SCREEN
   ============================================ */
#jail-screen {
  background: radial-gradient(ellipse at center, #1a0a00 0%, #080400 100%);
}

.jail-container {
  position: relative;
  z-index: 1;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 40px;
}

.jail-title {
  font-family: var(--font-game);
  font-size: clamp(40px, 6vw, 60px);
  letter-spacing: 4px;
  color: #e67e22;
  text-shadow: 0 0 20px rgba(230,126,34,0.6);
}

.jail-flavor {
  font-size: 16px;
  color: #ccc;
  max-width: 400px;
  font-style: italic;
  line-height: 1.6;
}

.jail-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 380px;
}

.jail-turns-left {
  font-family: var(--font-ui);
  font-size: 16px;
  color: #e74c3c;
  font-weight: 700;
}

/* ============================================
   PROPERTY SCREEN
   ============================================ */
#property-screen {
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(8px);
  z-index: 200;
}

.property-container {
  display: flex;
  gap: 30px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  padding: 20px;
  position: relative;
  z-index: 1;
}

.property-card-display {
  box-shadow: var(--shadow-card);
  border-radius: 12px;
  overflow: hidden;
}

.property-actions {
  background: rgba(12,12,30,0.95);
  border: 1px solid rgba(100,100,200,0.3);
  border-radius: 16px;
  padding: 28px;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#property-name-display {
  font-family: var(--font-game);
  font-size: 30px;
  letter-spacing: 2px;
  color: var(--color-gold);
}

.property-price-display {
  font-family: var(--font-ui);
  font-size: 22px;
  font-weight: 700;
  color: #5dfc8a;
}

.property-rent-table {
  font-size: 13px;
  color: #bbb;
  line-height: 1.8;
}

.property-action-btns {
  display: flex;
  gap: 12px;
}

.btn-buy {
  background: linear-gradient(135deg, #1a5200, #27ae60);
  color: white;
  flex: 1;
  border-color: rgba(39,174,96,0.5);
}

.btn-buy:hover:not(:disabled) {
  background: linear-gradient(135deg, #27ae60, #2ecc71);
  box-shadow: 0 4px 20px rgba(39,174,96,0.5);
}

.btn-skip {
  background: linear-gradient(135deg, #4a0a0a, #7a1010);
  color: #ff8080;
  flex: 1;
  border-color: rgba(231,76,60,0.3);
}

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

/* ============================================
   TRADE SCREEN
   ============================================ */
#trade-screen {
  background: rgba(0,0,0,0.9);
  backdrop-filter: blur(8px);
  z-index: 200;
}

.trade-container {
  background: rgba(10,10,25,0.98);
  border: 1px solid rgba(100,100,200,0.4);
  border-radius: 20px;
  padding: 30px;
  width: 100%;
  max-width: 780px;
  max-height: 90vh;
  overflow-y: auto;
  z-index: 1;
}

.trade-container h2 {
  font-family: var(--font-game);
  font-size: 36px;
  letter-spacing: 3px;
  color: var(--color-gold);
  text-align: center;
  margin-bottom: 24px;
}

.trade-layout {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 20px;
  align-items: start;
}

.trade-player {
  background: rgba(15,15,40,0.8);
  border: 1px solid rgba(80,80,160,0.3);
  border-radius: 12px;
  padding: 16px;
}

.trade-player h3 {
  font-family: var(--font-ui);
  font-size: 18px;
  font-weight: 700;
  color: var(--color-gold);
  margin-bottom: 12px;
  text-align: center;
}

.trade-money {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.trade-money label {
  font-size: 13px;
  color: #aaa;
  flex-shrink: 0;
}

.trade-money input {
  flex: 1;
  padding: 6px 10px;
  background: rgba(10,10,25,0.9);
  border: 1px solid rgba(100,100,200,0.3);
  border-radius: 6px;
  color: white;
  font-family: var(--font-ui);
  font-size: 15px;
  width: 100%;
}

.trade-properties {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
}

.trade-prop-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(20,20,45,0.8);
  cursor: pointer;
  transition: var(--transition);
  font-size: 13px;
}

.trade-prop-item:hover,
.trade-prop-item.selected {
  background: rgba(40,40,80,0.9);
  border-left: 3px solid var(--color-gold);
}

.trade-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding-top: 30px;
}

.trade-arrow {
  font-size: 30px;
  color: var(--color-gold);
}

/* ============================================
   AUCTION SCREEN
   ============================================ */
#auction-screen {
  background: rgba(0,0,0,0.9);
  backdrop-filter: blur(8px);
  z-index: 200;
}

.auction-container {
  background: rgba(10,10,25,0.98);
  border: 1px solid rgba(255,215,0,0.3);
  border-radius: 20px;
  padding: 30px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.auction-title {
  font-family: var(--font-game);
  font-size: 38px;
  letter-spacing: 4px;
  color: var(--color-gold);
}

.auction-bids {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 160px;
  overflow-y: auto;
}

.auction-bid-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 14px;
  border-radius: 6px;
  background: rgba(20,20,45,0.8);
  font-family: var(--font-ui);
  font-size: 14px;
}

.bid-amount-control {
  display: flex;
  align-items: center;
  gap: 12px;
}

#bid-minus, #bid-plus {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(30,30,70,0.9);
  border: 1px solid rgba(100,100,200,0.4);
  color: white;
  font-size: 18px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

#bid-minus:hover, #bid-plus:hover {
  background: rgba(60,60,120,0.9);
  border-color: rgba(155,89,182,0.6);
}

#bid-amount {
  width: 80px;
  padding: 8px 12px;
  background: rgba(10,10,25,0.9);
  border: 1px solid rgba(100,100,200,0.3);
  border-radius: 8px;
  color: white;
  font-family: var(--font-ui);
  font-size: 16px;
  text-align: center;
}

#auction-winner-display {
  font-family: var(--font-game);
  font-size: 28px;
  color: var(--color-gold);
  text-align: center;
  padding: 20px;
  animation: winnerPulse 1s ease-in-out infinite alternate;
}

/* ============================================
   CARD SCREEN - AAA PHOTOREALISTIC PREMIUM
   ============================================ */
#card-screen {
  background: radial-gradient(ellipse at center, rgba(30,0,50,0.95) 0%, rgba(0,0,0,0.98) 100%);
  backdrop-filter: blur(12px);
  z-index: 200;
}

.card-bg {
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(ellipse at 20% 20%, rgba(155,89,182,0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(230,126,34,0.1) 0%, transparent 50%);
  animation: cardBgPulse 8s ease-in-out infinite;
}

@keyframes cardBgPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.card-reveal-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
  position: relative;
  z-index: 1;
  perspective: 2000px;
}

.card-reveal-deck {
  position: relative;
  width: 360px; height: 500px;
  transform-style: preserve-3d;
}

/* === PREMIUM CARD FACES === */
.card-face-down,
.card-face-up {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border-radius: 20px;
  backface-visibility: hidden;
  transition: transform 1s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

/* === AAA CARD BACK DESIGN === */
.card-face-down {
  box-shadow: 
    0 25px 60px rgba(0,0,0,0.6),
    0 0 50px rgba(155,89,182,0.4),
    inset 0 0 80px rgba(155,89,182,0.1);
}

.card-back-design {
  width: 100%; height: 100%;
  border-radius: 20px;
  background: 
    repeating-linear-gradient(
      45deg,
      rgba(100,50,150,0.1) 0px,
      rgba(100,50,150,0.1) 2px,
      transparent 2px,
      transparent 10px
    ),
    linear-gradient(180deg, 
      #2d0a4e 0%, 
      #1a0530 30%,
      #0d0218 60%,
      #1a0530 90%,
      #2d0a4e 100%);
  border: 4px solid;
  border-image: linear-gradient(135deg, #9b59b6 0%, #5b2c8a 50%, #9b59b6 100%) 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-game);
  position: relative;
  overflow: hidden;
}

.card-back-design::before {
  content: '';
  position: absolute;
  width: 80%;
  height: 80%;
  border: 3px solid rgba(155,89,182,0.3);
  border-radius: 12px;
  box-shadow: 
    0 0 20px rgba(155,89,182,0.2),
    inset 0 0 30px rgba(155,89,182,0.1);
}

.card-back-design::after {
  content: '?';
  font-size: 180px;
  font-family: var(--font-game);
  background: linear-gradient(180deg, #d7bde2 0%, #9b59b6 50%, #5b2c8a 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 60px rgba(155,89,182,0.8);
  filter: drop-shadow(0 0 20px rgba(155,89,182,0.5));
  animation: mysteryPulse 2s ease-in-out infinite;
}

@keyframes mysteryPulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

/* === AAA CARD FACE UP === */
.card-face-up {
  background: 
    linear-gradient(180deg, 
      rgba(25,25,60,0.95) 0%, 
      rgba(15,15,40,0.98) 50%,
      rgba(10,10,30,0.99) 100%);
  border: 3px solid;
  border-image: linear-gradient(180deg, rgba(255,215,0,0.6) 0%, rgba(155,89,182,0.4) 50%, rgba(255,215,0,0.6) 100%) 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 
    0 30px 70px rgba(0,0,0,0.7),
    0 0 60px rgba(155,89,182,0.3),
    inset 0 1px 0 rgba(255,255,255,0.1),
    inset 0 -1px 0 rgba(0,0,0,0.3);
}

/* === PREMIUM CARD HEADER === */
.card-header {
  padding: 18px 24px;
  font-family: var(--font-game);
  font-size: 22px;
  letter-spacing: 4px;
  text-align: center;
  text-transform: uppercase;
  position: relative;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.card-header::before,
.card-header::after {
  content: '';
  position: absolute;
  left: 10%;
  right: 10%;
  height: 2px;
}

.card-header::before { top: 8px; }
.card-header::after { bottom: 8px; }

.card-header.chaos {
  background: linear-gradient(180deg, 
    rgba(155,89,182,0.5) 0%, 
    rgba(100,50,140,0.4) 50%,
    rgba(155,89,182,0.3) 100%);
  color: #e8d4f0;
  border-bottom: 2px solid rgba(155,89,182,0.6);
  box-shadow: 
    0 4px 20px rgba(155,89,182,0.4),
    inset 0 -10px 30px rgba(155,89,182,0.2);
}

.card-header.chaos::before,
.card-header.chaos::after {
  background: linear-gradient(90deg, transparent, rgba(155,89,182,0.6), transparent);
}

.card-header.chance {
  background: linear-gradient(180deg, 
    rgba(230,126,34,0.5) 0%, 
    rgba(180,90,20,0.4) 50%,
    rgba(230,126,34,0.3) 100%);
  color: #ffecd0;
  border-bottom: 2px solid rgba(230,126,34,0.6);
  box-shadow: 
    0 4px 20px rgba(230,126,34,0.4),
    inset 0 -10px 30px rgba(230,126,34,0.2);
}

.card-header.chance::before,
.card-header.chance::after {
  background: linear-gradient(90deg, transparent, rgba(230,126,34,0.6), transparent);
}

/* === PREMIUM CARD BODY === */
.card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px;
  gap: 20px;
  background: 
    radial-gradient(ellipse at center, rgba(255,255,255,0.02) 0%, transparent 70%);
}

/* === PREMIUM CARD ILLUSTRATION === */
.card-illustration {
  width: 140px; height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-radius: 50%;
  background: 
    radial-gradient(circle at 30% 30%, rgba(255,255,255,0.1) 0%, transparent 50%),
    linear-gradient(180deg, rgba(100,100,200,0.15) 0%, rgba(50,50,100,0.1) 100%);
  box-shadow: 
    0 10px 40px rgba(0,0,0,0.4),
    inset 0 2px 10px rgba(255,255,255,0.1),
    inset 0 -5px 20px rgba(0,0,0,0.3);
  animation: illustrationFloat 4s ease-in-out infinite;
}

@keyframes illustrationFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.card-illustration::before {
  content: '';
  position: absolute;
  width: 160px; height: 160px;
  border-radius: 50%;
  border: 2px solid rgba(255,215,0,0.2);
  animation: illustrationRing 6s linear infinite;
}

@keyframes illustrationRing {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* === PREMIUM CARD TEXT === */
.card-text {
  font-family: var(--font-ui);
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  color: white;
  line-height: 1.6;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
  padding: 0 10px;
  position: relative;
}

.card-text::before {
  content: '"';
  position: absolute;
  left: -15px;
  top: -10px;
  font-size: 40px;
  color: rgba(255,215,0,0.3);
  font-family: serif;
}

.card-text::after {
  content: '"';
  position: absolute;
  right: -15px;
  bottom: -20px;
  font-size: 40px;
  color: rgba(255,215,0,0.3);
  font-family: serif;
}

/* === PREMIUM CARD EFFECT === */
.card-effect {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-gold);
  text-align: center;
  padding: 14px 20px;
  background: 
    linear-gradient(180deg, 
      rgba(255,215,0,0.15) 0%, 
      rgba(255,180,0,0.1) 50%,
      rgba(255,215,0,0.15) 100%);
  border-radius: 12px;
  border: 2px solid rgba(255,215,0,0.3);
  box-shadow: 
    0 4px 20px rgba(255,215,0,0.2),
    inset 0 1px 0 rgba(255,255,255,0.1);
  text-shadow: 0 0 10px rgba(255,215,0,0.5);
  animation: effectGlow 2s ease-in-out infinite alternate;
}

@keyframes effectGlow {
  from { box-shadow: 0 4px 20px rgba(255,215,0,0.2), inset 0 1px 0 rgba(255,255,255,0.1); }
  to { box-shadow: 0 4px 30px rgba(255,215,0,0.4), inset 0 1px 0 rgba(255,255,255,0.1); }
}

/* === PREMIUM FLIP BUTTON === */
.flip-card-btn {
  padding: 18px 50px;
  background: 
    linear-gradient(180deg, 
      #c0392b 0%, 
      #a02020 30%,
      #8b0000 70%,
      #6b0000 100%);
  color: white;
  font-family: var(--font-game);
  font-size: 26px;
  letter-spacing: 4px;
  border: none;
  border-radius: 60px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    0 8px 30px rgba(139,0,0,0.6),
    0 0 40px rgba(231,76,60,0.3),
    inset 0 2px 0 rgba(255,255,255,0.2),
    inset 0 -3px 0 rgba(0,0,0,0.3);
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  position: relative;
  overflow: hidden;
}

.flip-card-btn::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(255,255,255,0.2) 50%,
    transparent 70%
  );
  animation: btnShine 3s ease-in-out infinite;
}

@keyframes btnShine {
  0% { transform: translateX(-100%) rotate(45deg); }
  100% { transform: translateX(100%) rotate(45deg); }
}

.flip-card-btn:hover {
  transform: translateY(-5px) scale(1.08);
  box-shadow: 
    0 15px 50px rgba(139,0,0,0.7),
    0 0 60px rgba(231,76,60,0.5),
    inset 0 2px 0 rgba(255,255,255,0.2),
    inset 0 -3px 0 rgba(0,0,0,0.3);
}

/* === PREMIUM CONFIRM BUTTON === */
.confirm-card-btn {
  padding: 16px 40px;
  background: 
    linear-gradient(180deg, 
      #27ae60 0%, 
      #1e8449 30%,
      #1a5200 70%,
      #144000 100%);
  color: white;
  font-family: var(--font-ui);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 3px;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    0 6px 25px rgba(39,174,96,0.5),
    0 0 30px rgba(39,174,96,0.2),
    inset 0 2px 0 rgba(255,255,255,0.2),
    inset 0 -2px 0 rgba(0,0,0,0.2);
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

.confirm-card-btn:hover {
  background: 
    linear-gradient(180deg, 
      #2ecc71 0%, 
      #27ae60 30%,
      #1e8449 70%,
      #1a5200 100%);
  transform: translateY(-3px) scale(1.05);
  box-shadow: 
    0 10px 35px rgba(39,174,96,0.6),
    0 0 50px rgba(46,204,113,0.3),
    inset 0 2px 0 rgba(255,255,255,0.2),
    inset 0 -2px 0 rgba(0,0,0,0.2);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
  #side-panel {
    width: 220px;
    min-width: 220px;
  }
}

@media (max-width: 700px) {
  #game-main {
    flex-direction: column;
  }

  #side-panel {
    width: 100%;
    min-width: 0;
    height: 200px;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    border-left: none;
    border-top: 1px solid rgba(80,80,160,0.2);
    padding: 8px;
  }

  .help-sections {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   SCROLLBAR GLOBAL
   ============================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: rgba(10,10,25,0.5); }
::-webkit-scrollbar-thumb { background: rgba(100,100,200,0.4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(155,89,182,0.6); }

/* ============================================
   UTILITY CLASSES
   ============================================ */
.hidden { display: none !important; }
.fade-in { animation: fadeIn 0.4s ease; }
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.slide-up { animation: slideUp 0.4s cubic-bezier(0.4,0,0.2,1); }
@keyframes slideUp {
  from { transform: translateY(30px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.bounce { animation: bounce 0.6s cubic-bezier(0.34,1.56,0.64,1); }
@keyframes bounce {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}

.text-gold  { color: var(--color-gold); }
.text-green { color: #5dfc8a; }
.text-red   { color: #ff6b6b; }
.text-dim   { color: #888; }
