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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #1a1a2e;
  color: #eee;
  min-height: 100vh;
  overflow-x: hidden;
}

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

.screen { display: none; }
.screen.active { display: block; }

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #16213e;
  border-bottom: 1px solid #0f3460;
}

/* Auth */
#auth-screen .container {
  padding-top: 80px;
  text-align: center;
}

h1 { font-size: 2rem; margin-bottom: 8px; }
.subtitle { color: #8892b0; margin-bottom: 32px; }

#auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  background: #16213e;
  border-radius: 8px;
  overflow: hidden;
}

.tab {
  flex: 1;
  padding: 12px;
  border: none;
  background: transparent;
  color: #8892b0;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.tab.active {
  background: #0f3460;
  color: #e94560;
}

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

input {
  padding: 12px 16px;
  border: 1px solid #0f3460;
  background: #16213e;
  color: #eee;
  border-radius: 8px;
  font-size: 1rem;
  width: 100%;
  outline: none;
}

input:focus { border-color: #e94560; }

button {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  background: #e94560;
  color: white;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 600;
}

button:hover { background: #d63851; }
button.secondary { background: #0f3460; color: #8892b0; }
button.secondary:hover { background: #1a4a8a; }
button.primary { width: 100%; max-width: 300px; margin: 0 auto; display: block; }

.error { color: #e94560; font-size: 0.85rem; margin-top: 4px; }

/* Lobby */
.actions {
  display: flex;
  gap: 8px;
  margin: 20px 0;
}

.actions input { flex: 1; }
.actions button { white-space: nowrap; }

.divider {
  text-align: center;
  color: #8892b0;
  margin: 16px 0;
  position: relative;
}

.divider::before, .divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 42%;
  height: 1px;
  background: #0f3460;
}

.divider::before { left: 0; }
.divider::after { right: 0; }

/* Dialog */
.dialog {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.dialog.active { display: flex; }

.dialog-content {
  background: #1a1a2e;
  border: 1px solid #0f3460;
  border-radius: 12px;
  padding: 24px;
  width: 90%;
  max-width: 400px;
}

.dialog-content label {
  display: block;
  margin: 12px 0;
  font-size: 0.9rem;
  color: #8892b0;
}

.dialog-content input { margin-top: 4px; }

.dialog-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  justify-content: flex-end;
}

/* Seat grid */
#seat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 16px 0;
}

.seat-option {
  padding: 16px;
  text-align: center;
  border: 1px solid #0f3460;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.seat-option:hover { border-color: #e94560; }
.seat-option.taken { opacity: 0.4; cursor: not-allowed; border-color: #333; }
.seat-option.selected { border-color: #e94560; background: #16213e; }

/* Game Table */
.table {
  position: relative;
  padding: 20px;
  min-height: 400px;
}

.community {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 20px;
  min-height: 80px;
}

.card {
  width: 54px;
  height: 78px;
  background: white;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.card.red { color: #e94560; }
.card.black { color: #222; }
.card.face-down { background: #e94560; color: white; font-size: 1.4rem; }

.seats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 20px 0;
}

.seat {
  width: 80px;
  text-align: center;
  padding: 8px;
  border: 2px solid #0f3460;
  border-radius: 8px;
  background: #16213e;
}

.seat.active { border-color: #e94560; }
.seat.current-turn { border-color: #4ecca3; box-shadow: 0 0 12px rgba(78, 204, 163, 0.4); }
.seat.folded { opacity: 0.4; }
.seat h4 { font-size: 0.7rem; margin-bottom: 4px; }
.seat .chips { color: #4ecca3; font-size: 0.8rem; }
.seat .hand-card { display: inline-block; width: 22px; height: 30px; background: white; border-radius: 3px; font-size: 0.5rem; line-height: 30px; text-align: center; margin: 1px; }

.my-hand {
  text-align: center;
  margin: 12px 0;
}

.my-hand .card {
  display: inline-block;
  margin: 0 4px;
}

.pot {
  color: #4ecca3;
  font-size: 1.2rem;
  font-weight: bold;
}

.action-bar {
  text-align: center;
  padding: 16px;
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.action-bar button { min-width: 70px; }

.action-bar input {
  width: 80px;
  text-align: center;
}

.game-info {
  text-align: center;
  color: #8892b0;
  padding: 8px;
  font-size: 0.85rem;
}

/* Showdown */
#showdown-results .result {
  display: flex;
  justify-content: space-between;
  padding: 12px;
  border-bottom: 1px solid #0f3460;
}

#showdown-results .result.winner { background: #16213e; color: #4ecca3; font-weight: bold; }

/* Status bar */
.status-bar {
  text-align: center;
  padding: 8px;
  color: #8892b0;
  font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 480px) {
  .container { padding: 16px; }
  .card { width: 44px; height: 64px; font-size: 0.8rem; }
  .seat { width: 64px; }
  .seat .hand-card { width: 18px; height: 24px; font-size: 0.4rem; line-height: 24px; }
}