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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #e2e8f0;
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.hero {
  text-align: center;
  padding: 40px 20px;
}

.hero h1 {
  font-size: 2.5em;
  background: linear-gradient(135deg, #60a5fa, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 10px;
}

.subtitle {
  color: #94a3b8;
  font-size: 1.1em;
}

.card-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  padding: 20px;
}

.card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 30px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: #60a5fa;
  box-shadow: 0 8px 24px rgba(96, 165, 250, 0.15);
}

.card-icon {
  font-size: 3em;
  margin-bottom: 15px;
}

.card h2 {
  margin-bottom: 10px;
  color: #f1f5f9;
}

.card p {
  color: #94a3b8;
  font-size: 0.9em;
}

/* Forms */
.section {
  max-width: 400px;
  margin: 30px auto;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 30px;
}

.section h2 {
  margin-bottom: 20px;
  color: #f1f5f9;
}

form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

input, select, textarea {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 12px;
  color: #e2e8f0;
  font-size: 1em;
  transition: border-color 0.2s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #60a5fa;
}

button {
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px;
  font-size: 1em;
  cursor: pointer;
  transition: background 0.2s;
}

button:hover {
  background: #2563eb;
}

button.secondary {
  background: #475569;
}

button.secondary:hover {
  background: #64748b;
}

button.danger {
  background: #ef4444;
}

button.danger:hover {
  background: #dc2626;
}

button.success {
  background: #10b981;
}

button.success:hover {
  background: #059669;
}

.hidden {
  display: none !important;
}

.small {
  margin-top: 15px;
  text-align: center;
  color: #94a3b8;
}

.small a {
  color: #60a5fa;
  cursor: pointer;
}

/* Game Layout */
.game-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  grid-template-rows: auto 1fr;
  gap: 15px;
  min-height: 100vh;
  padding: 15px;
}

.game-header {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 15px 20px;
}

.game-header h2 {
  font-size: 1.2em;
  color: #f1f5f9;
}

.player-info {
  display: flex;
  gap: 15px;
  align-items: center;
}

.current-turn {
  background: #3b82f6;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85em;
}

/* Board */
.board-container {
  position: relative;
  overflow: hidden;
}

.board {
  display: grid;
  grid-template-columns: 80px repeat(9, 1fr) 80px;
  grid-template-rows: 80px repeat(9, 1fr) 80px;
  gap: 2px;
  height: 100%;
  min-height: 600px;
}

.board-space {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 4px;
  padding: 2px;
  font-size: 0.65em;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
}

.board-space:hover {
  border-color: #60a5fa;
}

.board-space .space-name {
  font-weight: 600;
  font-size: 0.75em;
  line-height: 1.2;
  max-height: 2.4em;
  overflow: hidden;
}

.board-space .space-price {
  color: #10b981;
  font-size: 0.7em;
  margin-top: 2px;
}

/* Color groups */
.color-strip {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
  border-radius: 4px 4px 0 0;
}

.board-space.brown .color-strip { background: #8B4513; }
.board-space.lightblue .color-strip { background: #87CEEB; }
.board-space.pink .color-strip { background: #FF69B4; }
.board-space.orange .color-strip { background: #FF8C00; }
.board-space.red .color-strip { background: #DC143C; }
.board-space.yellow .color-strip { background: #FFD700; }
.board-space.green .color-strip { background: #228B22; }
.board-space.darkblue .color-strip { background: #191970; }
.board-space.railroad .color-strip { background: #666; }
.board-space.utility .color-strip { background: #9370DB; }

/* Player tokens on board */
.player-tokens {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 2px;
}

.player-token {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 0.5em;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
}

/* Sidebar */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.panel {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 15px;
}

.panel h3 {
  font-size: 0.9em;
  color: #94a3b8;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.player-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.player-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background: #0f172a;
  border-radius: 8px;
  font-size: 0.9em;
}

.player-card.active-turn {
  border: 2px solid #3b82f6;
}

.player-card .name {
  font-weight: 600;
}

.player-card .cash {
  color: #10b981;
  font-weight: 600;
}

.player-card .roi {
  color: #f59e0b;
  font-size: 0.85em;
}

/* Entry interface */
.entry-panel {
  background: #1e293b;
  border: 1px solid #3b82f6;
  border-radius: 12px;
  padding: 20px;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 500px;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.entry-panel h3 {
  margin-bottom: 15px;
  font-size: 1.1em;
  color: #f1f5f9;
}

.entry-description {
  background: #0f172a;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 15px;
  font-size: 0.95em;
  border-left: 3px solid #3b82f6;
}

.entry-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.entry-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.entry-help {
  background: #0f172a;
  padding: 12px;
  border-radius: 8px;
  font-size: 0.85em;
  color: #94a3b8;
  margin-bottom: 10px;
}

.error-message {
  background: #451a1a;
  border: 1px solid #ef4444;
  color: #fca5a5;
  padding: 10px;
  border-radius: 8px;
  font-size: 0.9em;
  margin-bottom: 10px;
}

.success-message {
  background: #064e3b;
  border: 1px solid #10b981;
  color: #6ee7b7;
  padding: 10px;
  border-radius: 8px;
  font-size: 0.9em;
  margin-bottom: 10px;
}

.transition-message {
  background: #1e3a5f;
  border: 1px solid #60a5fa;
  color: #93c5fd;
  padding: 15px;
  border-radius: 12px;
  font-size: 1em;
  margin-bottom: 15px;
  text-align: center;
}

/* Financial statements */
.financial-panel {
  max-height: 400px;
  overflow-y: auto;
}

.financial-panel table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85em;
}

.financial-panel th, .financial-panel td {
  padding: 6px 8px;
  text-align: left;
  border-bottom: 1px solid #334155;
}

.financial-panel th {
  color: #94a3b8;
  font-weight: 500;
}

.financial-panel .total-row {
  font-weight: 700;
  border-top: 2px solid #475569;
}

.accounting-eq {
  text-align: center;
  padding: 10px;
  background: #0f172a;
  border-radius: 8px;
  font-family: monospace;
  font-size: 0.9em;
  margin-top: 10px;
  color: #60a5fa;
}

/* Chat */
.chat-box {
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chat-message {
  padding: 8px 10px;
  background: #0f172a;
  border-radius: 8px;
  font-size: 0.85em;
}

.chat-message .chat-author {
  font-weight: 600;
  color: #60a5fa;
  margin-right: 5px;
}

.chat-message.coach .chat-author {
  color: #f59e0b;
}

.chat-message.help-request {
  border-left: 3px solid #f59e0b;
}

.chat-input {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.chat-input input {
  flex: 1;
  padding: 8px;
  font-size: 0.85em;
}

.chat-input button {
  padding: 8px 12px;
  font-size: 0.85em;
}

/* ROI Dashboard */
.roi-dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.roi-card {
  background: #0f172a;
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}

.roi-card .roi-name {
  font-weight: 600;
  font-size: 0.9em;
}

.roi-card .roi-value {
  font-size: 1.5em;
  font-weight: 700;
  color: #10b981;
  margin-top: 5px;
}

.roi-card .roi-value.negative {
  color: #ef4444;
}

.roi-card.rank-1 { border: 2px solid #f59e0b; }
.roi-card.rank-2 { border: 2px solid #94a3b8; }
.roi-card.rank-3 { border: 2px solid #8B4513; }

/* Dice */
.dice-area {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

.dice {
  width: 50px;
  height: 50px;
  background: white;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5em;
  font-weight: bold;
  color: #0f172a;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Coach dashboard */
.coach-dashboard {
  display: grid;
  gap: 20px;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 15px;
}

.game-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 20px;
}

.game-card h3 {
  margin-bottom: 10px;
}

.game-card .player-count {
  color: #94a3b8;
  font-size: 0.9em;
}

.game-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

/* Overlay */
.overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 999;
}

/* Responsive */
@media (max-width: 768px) {
  .game-layout {
    grid-template-columns: 1fr;
  }
  .board {
    grid-template-columns: 60px repeat(9, 1fr) 60px;
    grid-template-rows: 60px repeat(9, 1fr) 60px;
    min-height: auto;
  }
  .board-space {
    font-size: 0.5em;
  }
  .board-space .space-name {
    font-size: 0.65em;
  }
}
