* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --burgundy: #722F37;
  --navy: #1B2838;
  --gold: #FFD700;
  --silver: #C0C0C0;
  --diamond: #B9F2FF;
  --cream: #FFF8DC;
  --wood: #3D2914;
  --wood-light: #5C3D1E;
}

body {
  font-family: 'Crimson Pro', Georgia, serif;
  background: linear-gradient(135deg, var(--navy) 0%, #0D1520 50%, var(--burgundy) 100%);
  min-height: 100vh;
  color: var(--cream);
  overflow-x: hidden;
}

/* Setup Screen */
.setup-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: 
    radial-gradient(circle at 20% 30%, rgba(255, 215, 0, 0.1) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(185, 242, 255, 0.1) 0%, transparent 40%),
    linear-gradient(135deg, var(--navy) 0%, #0D1520 50%, var(--burgundy) 100%);
}

.setup-card {
  background: linear-gradient(145deg, rgba(61, 41, 20, 0.9), rgba(27, 40, 56, 0.95));
  border: 3px solid var(--gold);
  border-radius: 24px;
  padding: 48px;
  text-align: center;
  box-shadow: 
    0 0 60px rgba(255, 215, 0, 0.3),
    inset 0 0 60px rgba(255, 215, 0, 0.05);
  max-width: 500px;
  width: 100%;
}

.game-title {
  font-family: 'Playfair Display', serif;
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 8px;
  cursor: pointer;
  user-select: none;
}

.gold-text {
  background: linear-gradient(135deg, var(--gold), #FFA500, var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
}

.diamond-text {
  background: linear-gradient(135deg, var(--diamond), #fff, var(--diamond));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.dedication {
  color: var(--gold);
  font-size: 1.1rem;
  margin-bottom: 24px;
  opacity: 0.9;
}

.gem-divider {
  font-size: 1.5rem;
  margin: 24px 0;
  letter-spacing: 12px;
  animation: sparkle 2s infinite;
}

.setup-subtitle {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  margin-bottom: 24px;
  color: var(--cream);
}

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

.player-count-btn {
  background: linear-gradient(145deg, var(--burgundy), #4A1A20);
  border: 2px solid var(--gold);
  border-radius: 16px;
  padding: 20px 32px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.player-count-btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(255, 215, 0, 0.4);
  border-color: var(--diamond);
}

.player-count {
  font-family: 'Playfair Display', serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--gold);
}

.player-label {
  font-size: 0.9rem;
  color: var(--cream);
  opacity: 0.8;
}

.token-preview {
  margin-top: 32px;
  display: flex;
  justify-content: center;
  gap: 16px;
}

.preview-token {
  font-size: 2rem;
  animation: float 3s ease-in-out infinite;
}

/* Game Container */
.game-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.game-header {
  background: linear-gradient(180deg, rgba(61, 41, 20, 0.95), rgba(27, 40, 56, 0.9));
  border-bottom: 2px solid var(--gold);
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.header-left {
  display: flex;
  flex-direction: column;
}

.header-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  background: linear-gradient(135deg, var(--gold), #FFA500);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  cursor: pointer;
}

.crypto-badge {
  margin-left: 8px;
  animation: bounce 0.5s infinite;
}

.header-dedication {
  font-size: 0.8rem;
  color: var(--gold);
  opacity: 0.7;
}

.header-center {
  flex: 1;
  display: flex;
  justify-content: center;
}

.current-player-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 215, 0, 0.15);
  padding: 8px 24px;
  border-radius: 30px;
  border: 1px solid var(--gold);
}

.player-token-large {
  font-size: 2rem;
  animation: pulse 1.5s infinite;
}

.player-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  color: var(--cream);
}

.header-right {
  display: flex;
  align-items: center;
}

.round-display {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  color: var(--silver);
}

.round-icon {
  font-size: 1.3rem;
}

/* Market Ticker */
.market-ticker {
  background: linear-gradient(90deg, var(--navy), var(--burgundy), var(--navy));
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 215, 0, 0.3);
  overflow: hidden;
}

.ticker-content {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  padding: 0 16px;
}

.ticker-item {
  font-family: 'Crimson Pro', serif;
  font-size: 1rem;
  font-weight: 500;
  white-space: nowrap;
}

.ticker-divider {
  color: var(--gold);
  opacity: 0.5;
}

.price-up {
  color: #4ADE80;
  font-weight: bold;
}

.price-down {
  color: #EF4444;
  font-weight: bold;
}

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  gap: 20px;
  padding: 20px;
  overflow: hidden;
}

/* Board Section */
.board-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

/* Game Board */
.game-board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  gap: 2px;
  width: 100%;
  max-width: 600px;
  aspect-ratio: 1;
  background: linear-gradient(145deg, var(--wood), var(--wood-light));
  padding: 8px;
  border-radius: 12px;
  border: 4px solid var(--gold);
  box-shadow: 
    0 0 40px rgba(255, 215, 0, 0.2),
    inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.board-tile {
  background: rgba(255, 248, 220, 0.9);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2px;
  position: relative;
  overflow: hidden;
  border: 2px solid transparent;
  transition: all 0.3s ease;
  min-height: 0;
}

.board-tile:hover {
  transform: scale(1.05);
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.tile-color-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: var(--tile-color);
}

.tile-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-top: 4px;
}

.tile-name {
  font-size: 0.5rem;
  font-weight: 600;
  color: #1a1a1a;
  line-height: 1.1;
  max-height: 2.2em;
  overflow: hidden;
}

.tile-cost {
  font-size: 0.6rem;
  margin-top: 2px;
}

.tile-players {
  display: flex;
  gap: 2px;
  position: absolute;
  bottom: 2px;
  font-size: 0.8rem;
}

.player-token {
  animation: bounce 0.5s ease-in-out infinite;
}

/* Board tile positions */
.tile-0 { grid-column: 1; grid-row: 8; }
.tile-1 { grid-column: 2; grid-row: 8; }
.tile-2 { grid-column: 3; grid-row: 8; }
.tile-3 { grid-column: 4; grid-row: 8; }
.tile-4 { grid-column: 5; grid-row: 8; }
.tile-5 { grid-column: 6; grid-row: 8; }
.tile-6 { grid-column: 7; grid-row: 8; }
.tile-7 { grid-column: 8; grid-row: 8; }
.tile-8 { grid-column: 8; grid-row: 7; }
.tile-9 { grid-column: 8; grid-row: 6; }
.tile-10 { grid-column: 8; grid-row: 5; }
.tile-11 { grid-column: 8; grid-row: 4; }
.tile-12 { grid-column: 8; grid-row: 3; }
.tile-13 { grid-column: 8; grid-row: 2; }
.tile-14 { grid-column: 8; grid-row: 1; }
.tile-15 { grid-column: 7; grid-row: 1; }
.tile-16 { grid-column: 6; grid-row: 1; }
.tile-17 { grid-column: 5; grid-row: 1; }
.tile-18 { grid-column: 4; grid-row: 1; }
.tile-19 { grid-column: 3; grid-row: 1; }
.tile-20 { grid-column: 2; grid-row: 1; }
.tile-21 { grid-column: 1; grid-row: 1; }
.tile-22 { grid-column: 1; grid-row: 2; }
.tile-23 { grid-column: 1; grid-row: 3; }
.tile-24 { grid-column: 1; grid-row: 4; }
.tile-25 { grid-column: 1; grid-row: 5; }
.tile-26 { grid-column: 1; grid-row: 6; }
.tile-27 { grid-column: 1; grid-row: 7; }

/* Dice Area */
.dice-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.dice-container {
  display: flex;
  gap: 16px;
}

.die {
  font-size: 3rem;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #FFF8DC, #E6D5B8);
  border: 3px solid var(--gold);
  border-radius: 12px;
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.3),
    inset 0 -2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.1s;
}

.die.rolling {
  animation: diceRoll 0.1s linear infinite;
}

.roll-button {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  padding: 16px 40px;
  background: linear-gradient(145deg, var(--gold), #FFA500);
  border: 3px solid #B8860B;
  border-radius: 30px;
  color: var(--navy);
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4);
  font-weight: 700;
}

.roll-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(255, 215, 0, 0.6);
}

.roll-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Sidebar */
.sidebar {
  width: 300px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  color: var(--gold);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 215, 0, 0.3);
}

/* Player Cards */
.players-section {
  background: rgba(27, 40, 56, 0.8);
  border: 2px solid rgba(255, 215, 0, 0.3);
  border-radius: 12px;
  padding: 16px;
}

.player-card {
  background: linear-gradient(145deg, rgba(61, 41, 20, 0.6), rgba(27, 40, 56, 0.8));
  border: 2px solid rgba(192, 192, 192, 0.3);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
  transition: all 0.3s ease;
}

.player-card.active {
  border-color: var(--gold);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.player-card.bankrupt {
  opacity: 0.5;
  filter: grayscale(0.7);
}

.player-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.player-token-small {
  font-size: 1.5rem;
}

.bankrupt-badge {
  margin-left: auto;
}

.player-resources {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.resource {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 6px;
  font-size: 0.9rem;
}

.resource-icon {
  font-size: 1.1rem;
}

.shimmer-gold {
  animation: shimmerGold 2s infinite;
}

.shimmer-silver {
  animation: shimmerSilver 2s infinite;
}

.sparkle {
  animation: sparkle 1.5s infinite;
}

.net-worth {
  font-size: 0.85rem;
  color: var(--silver);
  margin-bottom: 4px;
}

.worth-value {
  color: var(--gold);
  font-weight: 600;
}

.property-count {
  font-size: 0.8rem;
  color: rgba(255, 248, 220, 0.6);
}

/* Game Log */
.log-section {
  background: rgba(139, 69, 19, 0.3);
  border: 2px solid rgba(255, 215, 0, 0.2);
  border-radius: 12px;
  padding: 16px;
  flex: 1;
  min-height: 200px;
}

.game-log {
  max-height: 250px;
  overflow-y: auto;
  font-family: 'Crimson Pro', serif;
}

.log-entry {
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 248, 220, 0.1);
  font-size: 0.85rem;
}

.log-time {
  color: rgba(255, 248, 220, 0.5);
  margin-right: 8px;
  font-size: 0.75rem;
}

.log-message {
  color: var(--cream);
}

/* Footer */
.game-footer {
  background: linear-gradient(180deg, rgba(27, 40, 56, 0.9), rgba(61, 41, 20, 0.95));
  border-top: 2px solid rgba(255, 215, 0, 0.3);
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.footer-btn {
  background: rgba(114, 47, 55, 0.6);
  border: 1px solid rgba(255, 215, 0, 0.5);
  color: var(--cream);
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Crimson Pro', serif;
}

.footer-btn:hover {
  background: rgba(114, 47, 55, 0.9);
  border-color: var(--gold);
}

.berrry-link {
  color: var(--diamond);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

.berrry-link:hover {
  color: var(--gold);
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal {
  background: linear-gradient(145deg, var(--wood), var(--navy));
  border: 3px solid var(--gold);
  border-radius: 20px;
  padding: 32px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  box-shadow: 0 0 60px rgba(255, 215, 0, 0.4);
}

.modal-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  color: var(--gold);
  margin-bottom: 24px;
}

.property-card {
  background: rgba(255, 248, 220, 0.95);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 24px;
  color: var(--navy);
}

.property-banner {
  height: 40px;
}

.property-card h3 {
  font-family: 'Playfair Display', serif;
  padding: 16px;
  font-size: 1.3rem;
}

.property-details {
  padding: 0 16px 16px;
  font-size: 1rem;
}

.property-details p {
  margin: 8px 0;
}

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

.buy-btn, .skip-btn, .fortune-btn, .close-btn, .new-game-btn {
  padding: 12px 32px;
  border-radius: 12px;
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid;
}

.buy-btn {
  background: linear-gradient(145deg, var(--gold), #FFA500);
  border-color: #B8860B;
  color: var(--navy);
}

.skip-btn {
  background: transparent;
  border-color: var(--silver);
  color: var(--silver);
}

.fortune-btn, .close-btn, .new-game-btn {
  background: linear-gradient(145deg, var(--burgundy), #4A1A20);
  border-color: var(--gold);
  color: var(--gold);
}

.fortune-card {
  background: linear-gradient(145deg, var(--burgundy), #4A1A20);
  border: 2px solid var(--gold);
  border-radius: 12px;
  padding: 32px;
  margin-bottom: 24px;
}

.fortune-text {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  color: var(--cream);
}

.rules-content {
  text-align: left;
  margin-bottom: 24px;
}

.rules-content p {
  margin: 12px 0;
  font-size: 1rem;
  line-height: 1.5;
}

.gameover-modal {
  background: linear-gradient(145deg, #2D5A27, var(--navy));
}

.winner-title {
  font-size: 2.5rem;
  animation: pulse 1s infinite;
}

.winner-display {
  margin: 24px 0;
}

.winner-token {
  font-size: 4rem;
  display: block;
  margin-bottom: 16px;
  animation: bounce 0.5s infinite;
}

.winner-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  color: var(--cream);
  margin-bottom: 8px;
}

.winner-worth {
  font-size: 1.2rem;
  color: var(--gold);
}

/* Animations */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes sparkle {
  0%, 100% { opacity: 1; filter: brightness(1); }
  50% { opacity: 0.8; filter: brightness(1.5); }
}

@keyframes shimmerGold {
  0%, 100% { filter: brightness(1) drop-shadow(0 0 2px rgba(255, 215, 0, 0.5)); }
  50% { filter: brightness(1.3) drop-shadow(0 0 8px rgba(255, 215, 0, 0.8)); }
}

@keyframes shimmerSilver {
  0%, 100% { filter: brightness(1) drop-shadow(0 0 2px rgba(192, 192, 192, 0.5)); }
  50% { filter: brightness(1.3) drop-shadow(0 0 8px rgba(192, 192, 192, 0.8)); }
}

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

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

@keyframes diceRoll {
  0% { transform: rotate(0deg); }
  25% { transform: rotate(90deg); }
  50% { transform: rotate(180deg); }
  75% { transform: rotate(270deg); }
  100% { transform: rotate(360deg); }
}

/* Mobile Responsive */
@media (max-width: 900px) {
  .main-content {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
  }
  
  .players-section, .log-section {
    flex: 1;
    min-width: 280px;
  }
  
  .game-board {
    max-width: 400px;
  }
}

@media (max-width: 600px) {
  .game-header {
    padding: 8px 12px;
  }
  
  .header-title {
    font-size: 1.2rem;
  }
  
  .current-player-indicator {
    padding: 6px 12px;
  }
  
  .player-token-large {
    font-size: 1.5rem;
  }
  
  .game-board {
    max-width: 320px;
    padding: 4px;
    gap: 1px;
  }
  
  .tile-name {
    font-size: 0.4rem;
  }
  
  .tile-color-bar {
    height: 4px;
  }
  
  .die {
    font-size: 2rem;
    width: 45px;
    height: 45px;
  }
  
  .roll-button {
    font-size: 1rem;
    padding: 12px 24px;
  }
  
  .setup-card {
    padding: 24px;
  }
  
  .game-title {
    font-size: 2rem;
  }
  
  .player-count-btn {
    padding: 16px 24px;
  }
  
  .player-count {
    font-size: 2rem;
  }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(27, 40, 56, 0.5);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--gold);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #FFA500;
}