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

:root {
  --bg-dark: #1a1a2e;
  --bg-medium: #16213e;
  --bg-light: #0f3460;
  --accent: #e94560;
  --accent-glow: #ff6b6b;
  --text: #eee;
  --text-dim: #aaa;
  --gold: #ffd700;
  --green: #4ade80;
  --red: #ef4444;
  --card-bg: #fff;
  --card-red: #dc2626;
  --card-black: #1f2937;
}

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

.screen {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1rem;
}

.hidden {
  display: none !important;
}

/* Character Select */
.select-header {
  text-align: center;
  margin-bottom: 2rem;
}

.select-header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--accent), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.select-header p {
  color: var(--text-dim);
  font-size: 1.1rem;
}

.character-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  max-width: 1000px;
  width: 100%;
}

.character-option {
  background: var(--bg-medium);
  border: 2px solid transparent;
  border-radius: 16px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.character-option:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(233, 69, 96, 0.2);
}

.char-portrait img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent);
  margin-bottom: 1rem;
}

.char-info h3 {
  font-size: 1.4rem;
  margin-bottom: 0.3rem;
}

.char-archetype {
  color: var(--accent);
  font-size: 0.9rem;
  text-transform: capitalize;
  margin-bottom: 0.5rem;
}

.char-personality {
  color: var(--text-dim);
  font-size: 0.85rem;
  line-height: 1.4;
}

/* Game Screen */
#game-screen {
  justify-content: space-between;
  padding: 1rem;
  max-width: 800px;
  margin: 0 auto;
}

/* Character Area */
.character-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}

.character-image-wrapper {
  width: 100%;
  max-width: 512px;
  aspect-ratio: 2 / 1;
  background: var(--bg-medium);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.character-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.character-info {
  text-align: center;
}

.character-info h2 {
  font-size: 1.5rem;
}

.character-state {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin: 0.2rem 0;
}

.character-dialogue {
  font-style: italic;
  color: var(--gold);
  font-size: 1rem;
  min-height: 1.5em;
  margin-top: 0.3rem;
}

.character-chips-area {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 1.1rem;
}

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

/* Pot */
.pot-area {
  text-align: center;
  padding: 0.8rem;
}

.pot-label {
  font-size: 0.8rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.pot-amount {
  font-size: 2rem;
  font-weight: bold;
  color: var(--gold);
}

/* Progression */
.progression-area {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}

.progression-track {
  width: 100%;
  height: 8px;
  background: var(--bg-medium);
  border-radius: 4px;
  overflow: hidden;
}

.progression-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--accent));
  border-radius: 4px;
  transition: width 0.5s ease;
  width: 0%;
}

.progression-label {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.3rem;
}

/* Cards */
.card-row {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  min-height: 80px;
  align-items: center;
}

.card {
  width: 60px;
  height: 84px;
  background: var(--card-bg);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  user-select: none;
}

.card-red { color: var(--card-red); }
.card-black { color: var(--card-black); }

.card-rank {
  font-size: 1.2rem;
  line-height: 1;
}

.card-suit {
  font-size: 1.4rem;
  line-height: 1;
}

.community-cards {
  margin: 0.5rem 0;
}

/* Player Area */
.player-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.player-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.player-chips-area {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 1.1rem;
}

/* Actions */
.player-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
  padding: 1rem 0;
}

.action-btn {
  padding: 0.7rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 80px;
}

.action-btn:hover {
  transform: translateY(-2px);
}

.action-btn:active {
  transform: translateY(0);
}

.btn-fold {
  background: #6b7280;
  color: white;
}

.btn-check {
  background: #3b82f6;
  color: white;
}

.btn-call {
  background: #10b981;
  color: white;
}

.btn-raise {
  background: #f59e0b;
  color: white;
}

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

.btn-new-hand {
  background: linear-gradient(135deg, var(--accent), #ff6b6b);
  color: white;
  font-size: 1.1rem;
  padding: 0.8rem 2rem;
  margin: 0.5rem auto;
  display: block;
}

.raise-group {
  display: flex;
  gap: 0.3rem;
  align-items: center;
}

.raise-input {
  width: 70px;
  padding: 0.7rem;
  border: 2px solid var(--bg-light);
  border-radius: 8px;
  background: var(--bg-medium);
  color: var(--text);
  font-size: 1rem;
  text-align: center;
}

.raise-input:focus {
  outline: none;
  border-color: var(--accent);
}

/* Game Log */
.game-log {
  width: 100%;
  max-height: 150px;
  overflow-y: auto;
  background: var(--bg-medium);
  border-radius: 8px;
  padding: 0.8rem;
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.log-entry {
  padding: 0.2rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.log-action { color: var(--text-dim); }
.log-result { color: var(--gold); font-weight: 600; }
.log-system { color: var(--accent); font-style: italic; }
.log-dialogue { color: var(--green); }

/* Mobile */
@media (max-width: 640px) {
  .select-header h1 {
    font-size: 1.8rem;
  }

  .character-grid {
    grid-template-columns: 1fr;
  }

  .card {
    width: 50px;
    height: 70px;
    font-size: 0.9rem;
  }

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

  .action-btn {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    min-width: 70px;
  }

  .pot-amount {
    font-size: 1.5rem;
  }
}
