/* Cretaceous Hold'em - Styles */

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

:root {
  --bg-dark: #1a1a2e;
  --bg-table: #0d4d2d;
  --bg-card: #16213e;
  --bg-input: #0f3460;
  --accent: #e94560;
  --accent-secondary: #0f3460;
  --amber: #ffb347;
  --text: #eaeaea;
  --text-muted: #a0a0a0;
  --success: #4ade80;
  --danger: #ef4444;
  --spades: #1a1a2e;
  --hearts: #e94560;
  --diamonds: #0f3460;
  --clubs: #4ade80;
}

html, body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-dark);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

#app {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Screens */
.screen {
  display: none;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 1rem;
}

.screen.active {
  display: flex;
}

/* Typography */
h1 {
  font-size: 2rem;
  text-align: center;
  margin-bottom: 0.5rem;
}

h2 {
  font-size: 1.5rem;
  text-align: center;
  margin-bottom: 0.5rem;
}

.subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

/* Buttons */
.btn {
  padding: 0.875rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.1s;
}

.btn:active {
  transform: scale(0.98);
}

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

.btn.primary {
  background: var(--accent);
  color: white;
}

.btn.secondary {
  background: var(--bg-input);
  color: var(--text);
}

.btn.danger {
  background: var(--danger);
  color: white;
}

.btn.accent {
  background: linear-gradient(135deg, var(--amber), #ff6b35);
  color: #1a1a2e;
}

/* Inputs */
input[type="text"] {
  padding: 0.875rem 1rem;
  border: 2px solid var(--bg-input);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text);
  font-size: 1rem;
  width: 100%;
}

input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
}

input[type="text"]::placeholder {
  color: var(--text-muted);
}

/* Join Screen */
#join-screen {
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

.join-form {
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.status {
  text-align: center;
  color: var(--text-muted);
  min-height: 1.5rem;
}

/* Lobby Screen */
#lobby-screen {
  align-items: center;
  padding-top: 3rem;
}

#room-code-display {
  font-family: monospace;
  font-size: 1.75rem;
  letter-spacing: 0.25em;
  color: var(--amber);
}

.player-list {
  width: 100%;
  max-width: 400px;
  margin: 1.5rem 0;
}

.lobby-player {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.player-number {
  width: 1.5rem;
  height: 1.5rem;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 600;
}

.dealer-tag {
  margin-left: auto;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  background: var(--amber);
  color: #1a1a2e;
  border-radius: 4px;
}

.hint {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 1rem;
}

/* Game Screen */
#game-screen {
  background: var(--bg-table);
  position: relative;
}

#community-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.pot-display {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

.pot-label {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.chip-icon {
  font-size: 1.5rem;
}

#community-cards {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* Cards */
.card-row {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.card {
  width: 70px;
  height: 100px;
  background: white;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  font-weight: 600;
}

.card.small {
  width: 40px;
  height: 56px;
  font-size: 0.75rem;
}

.card.face-down {
  background: linear-gradient(135deg, #2d5a27, #1a3518);
  border: 2px solid #4ade80;
}

.card-back {
  font-size: 1.5rem;
}

.card.small .card-back {
  font-size: 1rem;
}

.card-rank {
  font-size: 0.7rem;
  text-align: center;
  color: #333;
  line-height: 1.2;
}

.card-suit {
  font-size: 1.25rem;
}

.card.spades .card-suit { color: #1a1a2e; }
.card.hearts .card-suit { color: #e94560; }
.card.diamonds .card-suit { color: #0f3460; }
.card.clubs .card-suit { color: #4ade80; }

/* Other Players */
#other-players {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.5rem;
}

.other-player {
  background: rgba(0,0,0,0.3);
  border-radius: 8px;
  padding: 0.5rem;
  min-width: 100px;
  text-align: center;
}

.other-player.active {
  border: 2px solid var(--amber);
}

.other-player.folded {
  opacity: 0.5;
}

.player-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
}

.player-name {
  font-weight: 600;
  font-size: 0.875rem;
}

.player-chips {
  font-size: 0.75rem;
  color: var(--amber);
}

.player-status {
  font-size: 0.625rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.player-bet {
  font-size: 0.75rem;
  color: var(--success);
}

.player-cards {
  display: flex;
  gap: 0.25rem;
  justify-content: center;
}

.dealer-badge {
  font-size: 0.75rem;
}

/* Your Area */
#your-area {
  padding: 1rem;
  background: rgba(0,0,0,0.3);
  border-radius: 12px 12px 0 0;
}

#your-cards {
  margin-bottom: 0.5rem;
}

#your-info {
  display: flex;
  justify-content: center;
  gap: 1rem;
  font-size: 0.875rem;
}

#your-name {
  font-weight: 600;
}

#your-chips {
  color: var(--amber);
}

/* Actions */
#actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem;
  justify-content: center;
  background: var(--bg-dark);
}

#actions.hidden {
  display: none;
}

#actions .btn {
  flex: 1;
  min-width: 80px;
  max-width: 150px;
  padding: 0.75rem 0.5rem;
  font-size: 0.875rem;
}

/* Game Status */
#game-status {
  text-align: center;
  padding: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

#game-status.your-turn {
  color: var(--amber);
  font-weight: 600;
}

/* Showdown Screen */
#showdown-screen {
  align-items: center;
  padding-top: 2rem;
  background: var(--bg-table);
}

#showdown-title {
  margin-bottom: 1.5rem;
  color: var(--amber);
}

#showdown-results {
  width: 100%;
  max-width: 400px;
  margin-bottom: 2rem;
}

.showdown-player {
  background: rgba(0,0,0,0.3);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 0.75rem;
  text-align: center;
}

.showdown-player.winner {
  border: 2px solid var(--amber);
  background: rgba(255,179,71,0.1);
}

.showdown-player-name {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.showdown-cards {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.mini-card {
  padding: 0.25rem 0.5rem;
  background: white;
  border-radius: 4px;
  font-size: 0.75rem;
  color: #333;
}

.mini-card.spades { border-bottom: 2px solid #1a1a2e; }
.mini-card.hearts { border-bottom: 2px solid #e94560; }
.mini-card.diamonds { border-bottom: 2px solid #0f3460; }
.mini-card.clubs { border-bottom: 2px solid #4ade80; }

.showdown-hand {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.showdown-pot {
  margin-top: 0.5rem;
  font-size: 1.25rem;
  color: var(--amber);
  font-weight: 600;
}

/* Responsive */
@media (min-width: 768px) {
  .card {
    width: 90px;
    height: 130px;
  }
  
  .card-rank {
    font-size: 0.9rem;
  }
  
  .card-suit {
    font-size: 1.5rem;
  }
  
  #other-players {
    gap: 1.5rem;
  }
  
  .other-player {
    min-width: 140px;
  }
}
