/* Blackjack Dealer Styles */

/* ===== Screen Content ===== */
.screen-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1.5rem;
  padding-top: calc(env(safe-area-inset-top) + 2rem);
  padding-bottom: calc(env(safe-area-inset-bottom) + 2rem);
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

.center-content {
  justify-content: center;
}

/* ===== Typography Extension ===== */
.title {
  font-size: 3rem;
}

.section-title {
  font-size: 1rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

/* ===== Form Elements ===== */
.form-section {
  width: 100%;
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

#player-inputs {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.player-input {
  width: 100%;
  padding: 1rem;
  border: none;
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text);
  font-size: 1rem;
  outline: none;
}

.player-input:focus {
  box-shadow: 0 0 0 2px var(--primary);
}

/* ===== Button Extensions ===== */
.btn-primary {
  width: 100%;
}

.btn-secondary:disabled {
  border-color: var(--text-muted);
}

/* ===== Room Code ===== */
.room-code-section {
  text-align: center;
  margin-bottom: 2rem;
  position: relative;
}

.room-label {
  display: block;
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.room-code {
  font-family: 'Playfair Display', serif;
  font-size: 3rem;
  color: var(--gold);
  letter-spacing: 0.2em;
  cursor: pointer;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: background 0.2s;
}

.room-code:hover {
  background: var(--bg-card);
}

.room-code-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--felt-dark);
  border-radius: 8px;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.room-code-menu.hidden {
  display: none;
}

.menu-btn {
  padding: 0.75rem 1.5rem;
  background: var(--bg-card);
  border: none;
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}

.menu-btn:hover {
  background: var(--primary);
}

/* ===== Player Status List ===== */
.player-status-section {
  width: 100%;
  margin-bottom: 1.5rem;
}

#player-status-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.player-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: var(--bg-card);
  border-radius: 8px;
  border-left: 4px solid var(--text-muted);
}

.player-status.connected {
  border-left-color: var(--success);
}

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

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

.player-status.connected .status {
  color: var(--success);
}

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

/* ===== Game Layout ===== */
.game-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: var(--felt-dark);
}

.room-code-small {
  font-family: monospace;
  font-size: 1rem;
  color: var(--gold);
  letter-spacing: 0.1em;
}

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

/* ===== Dealer Area ===== */
.dealer-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 2px solid var(--gold);
}

.dealer-label {
  font-size: 0.75rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-bottom: 0.5rem;
}

.dealer-cards {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.dealer-total {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
}

/* ===== Card Extensions ===== */
.card {
  width: 50px;
  height: 70px;
  font-size: 1.25rem;
}

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

.card.face-down::after {
  content: "";
  position: absolute;
  inset: 4px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
}

/* ===== Players Area ===== */
.players-area {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  padding: 1rem;
  overflow-y: auto;
}

.player-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

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

.player-cards .card {
  width: 40px;
  height: 56px;
  font-size: 1rem;
}

.player-cards .card .suit {
  font-size: 0.75rem;
}

.player-total {
  font-size: 1.25rem;
  font-weight: bold;
  color: var(--gold);
}

/* ===== Turn Indicator ===== */
.turn-indicator {
  text-align: center;
  padding: 1rem;
  font-size: 1.25rem;
  color: var(--gold);
  background: var(--felt-dark);
}

/* ===== Dealer Actions ===== */
.dealer-actions {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  padding-bottom: calc(env(safe-area-inset-bottom) + 1rem);
  background: var(--felt-dark);
}

.dealer-actions .btn {
  flex: 1;
}

/* ===== Game Log ===== */
.game-log {
  max-height: 100px;
  overflow-y: auto;
  padding: 0.5rem 1rem;
  background: rgba(0, 0, 0, 0.3);
}

.log-entry {
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 0.25rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* ===== Results ===== */
.results-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: var(--bg-card);
  border-radius: 8px;
}

.result-row.win {
  border-left: 4px solid var(--success);
}

.result-row.lose {
  border-left: 4px solid var(--primary);
}

.result-row.push {
  border-left: 4px solid var(--text-muted);
}

.result-row.blackjack {
  border-left: 4px solid var(--gold);
  background: rgba(251, 191, 36, 0.1);
}

/* ===== Testing Badge ===== */
.testing-badge {
  position: fixed;
  top: 10px;
  right: 10px;
  background: var(--gold);
  color: var(--felt-dark);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}
