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

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: white;
  min-height: 100vh;
  padding: 20px;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
}

header {
  text-align: center;
  margin-bottom: 20px;
}

header h1 {
  font-size: 2rem;
  margin-bottom: 4px;
}

header p {
  color: #94a3b8;
  font-size: 0.9rem;
}

/* Main game layout with table seating */
.game-layout {
  display: grid;
  grid-template-columns: 180px 1fr 200px;
  gap: 16px;
  max-width: 1200px;
  margin: 0 auto;
}

.sidebar {
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  padding: 12px;
}

.sidebar h3 {
  font-size: 0.85rem;
  color: #94a3b8;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.left-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.right-sidebar {
  display: flex;
  flex-direction: column;
}

.right-sidebar #log {
  flex: 1;
  max-height: none;
  min-height: 300px;
}

/* Table area - the main playing field */
.table-area {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.table-area #status {
  width: 100%;
  max-width: 500px;
}

/* Table row with left player, center, right player */
.table-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
}

/* Table center (trick area) */
.table-center {
  flex: 1;
  max-width: 400px;
  min-height: 200px;
  background: rgba(30, 60, 40, 0.6);
  border: 3px solid rgba(100, 150, 100, 0.4);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

/* Seat styles - player info cards */
.seat {
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
  padding: 10px 14px;
  text-align: center;
  min-width: 120px;
  transition: all 0.3s ease;
}

.seat.active {
  border: 2px solid #3b82f6;
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
  animation: turnPulse 1.5s ease-in-out infinite;
}

@keyframes turnPulse {
  0%, 100% { box-shadow: 0 0 15px rgba(59, 130, 246, 0.4); }
  50% { box-shadow: 0 0 25px rgba(59, 130, 246, 0.7); }
}

.seat.team-a {
  border-left: 4px solid #f97316;
  border-right: 4px solid #f97316;
}

.seat.team-b {
  border-left: 4px solid #a78bfa;
  border-right: 4px solid #a78bfa;
}

.seat-top {
  margin-bottom: 4px;
}

.seat-bottom {
  margin-top: 4px;
}

.seat-left, .seat-right {
  min-width: 130px;
  max-width: 150px;
}

/* Seat player info */
.seat .player-name {
  font-weight: bold;
  font-size: 0.9rem;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.seat .player-badges {
  display: flex;
  gap: 4px;
  justify-content: center;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.seat .player-stats {
  font-size: 0.75rem;
  color: #94a3b8;
}

.seat .team-badge {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: bold;
}

.seat .team-badge.team-a {
  background: rgba(249, 115, 22, 0.3);
  color: #fb923c;
  border: none;
}

.seat .team-badge.team-b {
  background: rgba(167, 139, 250, 0.3);
  color: #a78bfa;
  border: none;
}

.seat .badge {
  font-size: 0.65rem;
  padding: 2px 5px;
  border-radius: 3px;
}

.seat .dealer-badge {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.seat .bidder-badge {
  background: rgba(245, 158, 11, 0.3);
  color: #fbbf24;
}

/* Hand area */
.hand-area {
  width: 100%;
  max-width: 600px;
  margin-top: 8px;
}

/* Team banks in sidebar */
.team-banks {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Game info in sidebar (bid, trump) */
.game-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.game-info .info-card {
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
  padding: 10px;
  text-align: center;
}

.game-info .progress-card {
  border: 1px solid #3b82f6;
  background: rgba(59, 130, 246, 0.1);
}

.game-info .progress-card .label {
  color: #60a5fa;
}

.game-info .progress-card .value {
  font-size: 1rem;
  font-weight: bold;
  color: #60a5fa;
}

.game-info .progress-card .team-scores {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 4px;
}

.game-info .progress-card .team-a {
  color: #fb923c;
  font-weight: bold;
}

.game-info .progress-card .team-b {
  color: #a78bfa;
  font-weight: bold;
}

/* End Round Early button */
.end-round-btn {
  width: 100%;
  margin-top: 8px;
  padding: 6px 10px;
  background: rgba(34, 197, 94, 0.2);
  border: 1px solid #22c55e;
  color: #22c55e;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.end-round-btn:hover {
  background: rgba(34, 197, 94, 0.3);
}

.end-round-hint {
  margin-top: 4px;
  font-size: 0.7rem;
  color: #94a3b8;
  font-style: italic;
}

.game-info .bid-card {
  border: 1px solid #f59e0b;
  background: rgba(245, 158, 11, 0.1);
}

.game-info .bid-card .label {
  font-size: 0.7rem;
  color: #fbbf24;
  text-transform: uppercase;
}

.game-info .bid-card .value {
  font-size: 1.2rem;
  font-weight: bold;
  color: #fbbf24;
}

.game-info .bid-card .bidder {
  font-size: 0.75rem;
  color: #94a3b8;
}

.game-info .trump-card {
  border: 1px solid #10b981;
  background: rgba(16, 185, 129, 0.1);
}

.game-info .trump-card.hidden {
  border-color: #64748b;
  background: rgba(100, 116, 139, 0.1);
}

.game-info .trump-card .label {
  font-size: 0.7rem;
  color: #10b981;
  text-transform: uppercase;
}

.game-info .trump-card.hidden .label {
  color: #64748b;
}

.game-info .trump-card .suit {
  font-size: 1.5rem;
}

.game-info .trump-card .suit.red {
  color: #ef4444;
}

.game-info .trump-card .detail {
  font-size: 0.7rem;
  color: #94a3b8;
}

.team-bank {
  padding: 10px;
  border-radius: 8px;
  text-align: center;
}

.team-bank.team-a {
  background: rgba(249, 115, 22, 0.15);
  border: 1px solid #f97316;
}

.team-bank.team-b {
  background: rgba(167, 139, 250, 0.15);
  border: 1px solid #a78bfa;
}

.team-bank .bank-label {
  font-size: 0.7rem;
  color: #94a3b8;
  text-transform: uppercase;
}

.team-bank .bank-value {
  font-size: 1.5rem;
  font-weight: bold;
}

.team-bank.team-a .bank-value {
  color: #fb923c;
}

.team-bank.team-b .bank-value {
  color: #a78bfa;
}

/* Round info in table center */
.table-center .round-info {
  width: 100%;
  margin: 0;
  padding: 8px;
  font-size: 0.8rem;
}

.team-scores {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.team-score {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  text-align: center;
}

.team-a-score {
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid #3b82f6;
}

.team-b-score {
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid #f59e0b;
}

.team-name {
  display: block;
  font-size: 0.75rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.team-total {
  display: block;
  font-size: 1.4rem;
  font-weight: bold;
  margin-top: 2px;
}

.team-a-score .team-total {
  color: #60a5fa;
}

.team-b-score .team-total {
  color: #fbbf24;
}

.round-info {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid #10b981;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 12px;
  font-size: 0.85rem;
  text-align: center;
}

.round-info strong {
  display: block;
  margin-bottom: 4px;
  color: #10b981;
}

.round-info span {
  display: block;
  color: #94a3b8;
  font-size: 0.8rem;
}

.round-info.bid-info {
  background: rgba(245, 158, 11, 0.2);
  border-color: #f59e0b;
}

.round-info.bid-info strong {
  color: #fbbf24;
}

.round-info.round-progress {
  background: rgba(59, 130, 246, 0.2);
  border-color: #3b82f6;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.round-info.round-progress strong {
  width: 100%;
  color: #60a5fa;
}

.round-info.round-progress .team-a-pts {
  color: #f97316;
  font-weight: bold;
}

.round-info.round-progress .team-b-pts {
  color: #a78bfa;
  font-weight: bold;
}

.score-item {
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 8px;
  font-size: 0.85rem;
}

.score-item.active {
  border: 2px solid #3b82f6;
  background: rgba(59, 130, 246, 0.1);
}

.score-item.dealing {
  animation: dealPulse 0.3s ease-in-out;
}

@keyframes dealPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); background: rgba(16, 185, 129, 0.2); }
  100% { transform: scale(1); }
}

.score-item.bidder {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
}

.score-item.dealer {
  border-left: 3px solid #10b981;
}

.dealer-badge {
  display: inline-block;
  font-size: 0.7rem;
  padding: 2px 6px;
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  border-radius: 4px;
  margin-left: 4px;
}

.bidder-badge {
  display: inline-block;
  font-size: 0.7rem;
  padding: 2px 6px;
  background: rgba(245, 158, 11, 0.3);
  color: #fbbf24;
  border-radius: 4px;
  margin-left: 4px;
}

.bid-status {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: normal;
}

.score-item.team-a {
  border-left: 4px solid #3b82f6;
  border-right: 4px solid #3b82f6;
  background: rgba(59, 130, 246, 0.1);
}

.score-item.team-b {
  border-left: 4px solid #f59e0b;
  border-right: 4px solid #f59e0b;
  background: rgba(245, 158, 11, 0.1);
}

.score-item.you {
  background: rgba(59, 130, 246, 0.15);
  border-left: 3px solid #3b82f6;
}

.team-label {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 4px;
}

.team-a .team-label {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

.team-b .team-label {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.score-item strong {
  display: block;
  margin-bottom: 4px;
}

.score-item span {
  display: block;
  color: #94a3b8;
  font-size: 0.8rem;
}

/* Legacy - kept for compatibility */
.main-area {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Override old score-item for new seat-based display */
#scores {
  display: none;
}

#status {
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid #3b82f6;
  border-radius: 8px;
  padding: 12px 16px;
  text-align: center;
  font-weight: 500;
  white-space: pre-line;
}

.table {
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  padding: 20px;
  min-height: 200px;
}

.table h3 {
  font-size: 0.9rem;
  color: #94a3b8;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.trump-indicator {
  text-align: center;
  font-size: 1.1rem;
  margin-bottom: 16px;
  padding: 8px;
  background: rgba(245, 158, 11, 0.2);
  border-radius: 8px;
}

.trump-indicator span {
  font-size: 1.5rem;
  font-weight: bold;
}

.trump-indicator span.hidden {
  color: #94a3b8;
}

.trump-indicator.hidden-trump {
  background: rgba(100, 116, 139, 0.2);
  border: 1px dashed #64748b;
}

.trump-indicator em {
  font-size: 0.8rem;
  color: #94a3b8;
}

.trump-revealed-info {
  font-size: 0.75rem;
  color: #22c55e;
  display: block;
  margin-top: 4px;
}

.trick-area {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 100px;
}

/* Cross-pattern trick area for positioned cards */
.trick-area-cross {
  display: grid;
  grid-template-areas:
    ".    top    ."
    "left center right"
    ".    bottom .";
  grid-template-columns: 1fr auto 1fr;
  grid-template-rows: auto auto auto;
  gap: 8px;
  min-height: 150px;
  align-items: center;
  justify-items: center;
}

.trick-slot {
  min-width: 60px;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.trick-slot-top { grid-area: top; }
.trick-slot-left { grid-area: left; }
.trick-slot-center { grid-area: center; display: none; }
.trick-slot-right { grid-area: right; }
.trick-slot-bottom { grid-area: bottom; }

.trick-slot .card.played {
  transform: scale(0.9);
}

.trick-slot .card.last-played {
  border-color: #fbbf24;
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.5);
  animation: lastPlayedPulse 1s ease-in-out infinite;
}

@keyframes lastPlayedPulse {
  0%, 100% { box-shadow: 0 0 12px rgba(251, 191, 36, 0.5); }
  50% { box-shadow: 0 0 20px rgba(251, 191, 36, 0.8); }
}

.played-card-container {
  display: inline-block;
}

.card {
  padding: 12px 16px;
  border-radius: 8px;
  border: 2px solid #e2e8f0;
  background: white;
  color: #1e293b;
  cursor: pointer !important;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 1.1rem;
  font-weight: bold;
  transition: transform 0.2s, box-shadow 0.2s;
  min-width: 60px;
  animation: cardDeal 0.2s ease-out;
}

.card-rank {
  font-size: inherit;
}

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

@keyframes cardDeal {
  0% { 
    opacity: 0; 
    transform: translateY(-20px) scale(0.8);
  }
  100% { 
    opacity: 1; 
    transform: translateY(0) scale(1);
  }
}

.card:hover:not(.played):not(.disabled) {
  transform: translateY(-8px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.card.red {
  color: #dc2626;
}

.card.played {
  cursor: default;
  font-size: 1rem;
}

.card.disabled {
  opacity: 0.5;
  cursor: not-allowed !important;
  pointer-events: none;
}

.card.playable {
  cursor: pointer !important;
  border-color: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
}

.card.playable:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 25px rgba(34, 197, 94, 0.5);
}

.card:not(.disabled):not(.played) {
  cursor: pointer !important;
}

.card.winner {
  border-color: #10b981;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.6);
  transform: scale(1.1);
  animation: pulse 0.5s ease-in-out 2;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 20px rgba(16, 185, 129, 0.6); }
  50% { box-shadow: 0 0 30px rgba(16, 185, 129, 0.9); }
}

.player-label {
  font-size: 0.7rem;
  color: #64748b;
  font-weight: normal;
  margin-bottom: 4px;
}

.played-card-container.last-played {
  animation: lastPlayedPulse 1s ease-in-out infinite;
}

.played-card-container.last-played .card {
  border-color: #fbbf24;
  box-shadow: 0 0 15px rgba(251, 191, 36, 0.5);
}

.played-card-container.last-played .player-label {
  color: #fbbf24;
  font-weight: 600;
}

@keyframes lastPlayedPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

#controls {
  min-height: 60px;
}

.bid-options, .trump-options {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.bid-btn, .trump-btn {
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  background: #3b82f6;
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.bid-btn:hover, .trump-btn:hover {
  background: #2563eb;
  transform: scale(1.05);
}

.bid-btn.pass {
  background: #ef4444;
}

.bid-btn.pass:hover {
  background: #dc2626;
}

.trump-btn {
  font-size: 1.5rem;
  padding: 12px 20px;
  background: #1e293b;
  border: 2px solid #475569;
}

.trump-btn:hover {
  background: #334155;
}

.trump-btn.red {
  color: #dc2626;
}

.trump-instructions {
  text-align: center;
  color: #94a3b8;
  margin-bottom: 12px;
  font-size: 0.95rem;
}

.trump-card-selection {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 400px;
  margin: 0 auto;
}

.trump-select-card {
  font-size: 1.1rem;
  padding: 10px 14px;
  background: #1e293b;
  border: 2px solid #475569;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  transition: all 0.2s;
}

.trump-select-card:hover {
  background: #334155;
  border-color: #3b82f6;
  transform: scale(1.05);
}

.trump-select-card.red {
  color: #dc2626;
}

.trump-card-aside {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid #3b82f6;
  border-radius: 4px;
  margin-left: 6px;
  font-weight: bold;
}

.new-round-btn {
  padding: 14px 28px;
  border-radius: 8px;
  border: none;
  background: #10b981;
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  display: block;
  margin: 0 auto;
}

.new-round-btn:hover {
  background: #059669;
}

.new-game-btn {
  background: #3b82f6;
  margin-top: 16px;
}

.new-game-btn:hover {
  background: #2563eb;
}

.game-end-display {
  text-align: center;
  padding: 20px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(16, 185, 129, 0.2));
  border-radius: 12px;
  margin-bottom: 16px;
}

.game-end-display .winner-trophy {
  font-size: 3rem;
  margin-bottom: 8px;
}

.game-end-display h2 {
  color: #fbbf24;
  margin: 0 0 8px 0;
  font-size: 1.5rem;
}

.game-end-display .winner-players {
  color: #10b981;
  margin: 0 0 12px 0;
  font-size: 1.1rem;
}

.game-end-display .final-score {
  color: #94a3b8;
  margin: 0;
  font-size: 1rem;
}

.show-trump-options {
  text-align: center;
  margin-top: 10px;
  padding: 15px;
  background: rgba(245, 158, 11, 0.1);
  border: 2px solid rgba(245, 158, 11, 0.3);
  border-radius: 12px;
  animation: trumpOptionPulse 2s ease-in-out infinite;
}

@keyframes trumpOptionPulse {
  0%, 100% { box-shadow: 0 0 10px rgba(245, 158, 11, 0.2); }
  50% { box-shadow: 0 0 20px rgba(245, 158, 11, 0.4); }
}

.show-trump-btn {
  padding: 14px 28px;
  border-radius: 8px;
  border: 2px solid #f59e0b;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.3), rgba(245, 158, 11, 0.1));
  color: #fbbf24;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.show-trump-btn:hover {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.5), rgba(245, 158, 11, 0.3));
  transform: scale(1.05);
  box-shadow: 0 5px 20px rgba(245, 158, 11, 0.4);
}

.show-trump-hint {
  font-size: 1rem;
  color: #fbbf24;
  margin-bottom: 12px;
  font-weight: 600;
}

.trump-lead-hint {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 8px;
  padding: 12px 16px;
  margin-top: 10px;
  color: #93c5fd;
  font-size: 0.9rem;
}

.trump-choice-options {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.discard-hint {
  font-size: 0.85rem;
  color: #94a3b8;
  font-style: italic;
}

.hand {
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  padding: 20px;
}

.hand h3 {
  font-size: 0.9rem;
  color: #94a3b8;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

#hand {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.settings-section {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.difficulty-selector {
  margin-top: 8px;
}

.difficulty-selector label {
  display: block;
  font-size: 0.8rem;
  color: #94a3b8;
  margin-bottom: 6px;
}

#difficulty-buttons {
  display: flex;
  gap: 4px;
}

.direction-selector {
  margin-top: 8px;
}

.direction-selector label {
  display: block;
  font-size: 0.8rem;
  color: #94a3b8;
  margin-bottom: 6px;
}

#direction-buttons {
  display: flex;
  gap: 4px;
}

.dir-btn {
  flex: 1;
  padding: 6px 8px;
  border: 1px solid #475569;
  background: rgba(255,255,255,0.05);
  color: #94a3b8;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.2s;
}

.dir-btn:hover {
  background: rgba(255,255,255,0.1);
  color: white;
}

.dir-btn.active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: white;
}

.dir-btn.locked, .diff-btn.locked {
  opacity: 0.5;
  cursor: not-allowed;
}

#target-score-display {
  margin-top: 12px;
  padding: 8px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 6px;
  font-size: 0.85rem;
  color: #fbbf24;
  text-align: center;
}

.sidebar-spacer {
  flex: 1;
}

.exit-game-btn {
  width: 100%;
  margin-top: auto;
  padding: 10px;
  border: 1px solid #ef4444;
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.exit-game-btn:hover {
  background: rgba(239, 68, 68, 0.2);
}

/* Log Drawer - slide-in panel (hidden on desktop) */
.log-drawer-tab {
  display: none;
}

.log-drawer {
  display: none;
}

.log-drawer-header {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 600;
  color: #94a3b8;
}

/* Close tab - positioned on left edge of drawer (same style as open tab) */
.log-drawer-close-tab {
  display: none;
}

.log-drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
}

.log-drawer-content .log-entry {
  font-size: 0.8rem;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
}

.log-drawer-content .log-entry:first-child {
  color: white;
  font-weight: 500;
}

.diff-btn {
  flex: 1;
  padding: 6px 8px;
  border: 1px solid #475569;
  background: rgba(255,255,255,0.05);
  color: #94a3b8;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.diff-btn:hover {
  background: rgba(255,255,255,0.1);
  color: white;
}

.diff-btn.active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: white;
}

.diff-btn.easy.active {
  background: #10b981;
  border-color: #10b981;
}

.diff-btn.hard.active {
  background: #ef4444;
  border-color: #ef4444;
}

#log {
  overflow-y: auto;
}

.log-entry {
  font-size: 0.75rem;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  color: #cbd5e1;
  white-space: pre-line;
}

.log-entry:first-child {
  color: white;
  font-weight: 500;
}

/* Tablet layout */
@media (max-width: 1100px) {
  .game-layout {
    grid-template-columns: 180px 1fr 180px;
  }
  
  .seat {
    padding: 8px 10px;
    min-width: 100px;
  }
  
  .seat .player-name {
    font-size: 0.8rem;
  }
  
  .card {
    padding: 8px 12px;
    font-size: 1rem;
    min-width: 50px;
  }
}

/* Mobile layout */
@media (max-width: 768px) {
  /* Hide header on mobile to save space */
  header {
    display: none;
  }
  
  body {
    padding: 8px;
    padding-bottom: 70px;
  }
  
  .game-layout {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 0;
  }
  
  /* Compact sidebar at top */
  .left-sidebar {
    order: -1;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px;
    background: transparent;
  }
  
  .left-sidebar .team-banks {
    flex-direction: row;
    width: 100%;
    gap: 4px;
  }
  
  .team-bank {
    flex: 1;
    padding: 6px 8px;
  }
  
  .team-bank .bank-label {
    font-size: 0.65rem;
  }
  
  .team-bank .bank-value {
    font-size: 1rem;
  }
  
  /* Compact game info - inline layout */
  .left-sidebar .game-info {
    width: 100%;
    flex-direction: row;
    gap: 4px;
  }
  
  .game-info .info-card {
    flex: 1;
    padding: 4px 6px;
    font-size: 0.7rem;
  }
  
  .game-info .bid-card .value {
    font-size: 1rem;
  }
  
  /* Larger trump suit symbol on mobile */
  .game-info .trump-card .suit {
    font-size: 1.8rem;
  }
  
  .game-info .bid-card .bidder {
    display: none;
  }
  
  /* Log drawer tab - small tab on right edge */
  .log-drawer-tab {
    display: flex;
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 60px;
    background: rgba(59, 130, 246, 0.9);
    border-radius: 8px 0 0 8px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 150;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s, opacity 0.2s;
  }
  
  .log-drawer-tab.hidden {
    transform: translateY(-50%) translateX(100%);
    opacity: 0;
  }
  
  .drawer-tab-icon {
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
  }
  
  /* Log drawer panel - offset from right to leave room for tab */
  .log-drawer {
    display: flex;
    flex-direction: column;
    position: fixed;
    right: 28px;
    top: 0;
    bottom: 0;
    width: 70%;
    max-width: 280px;
    background: rgba(15, 23, 42, 0.97);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 200;
    transform: translateX(calc(100% + 28px));
    transition: transform 0.3s ease;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.4);
  }
  
  .log-drawer.open {
    transform: translateX(0);
  }
  
  /* Close tab - on right edge, same position as open tab */
  .log-drawer-close-tab {
    display: flex;
    position: absolute;
    right: -28px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 60px;
    background: rgba(59, 130, 246, 0.9);
    border-radius: 0 8px 8px 0;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.3);
  }
  
  /* Exit button - back to full width at bottom */
  .exit-game-btn {
    position: fixed;
    bottom: 34px;
    left: 8px;
    right: 8px;
    width: auto;
    z-index: 100;
    padding: 8px;
    font-size: 0.85rem;
  }
  
  .sidebar-spacer {
    display: none;
  }
  
  /* Hide game log on mobile */
  .right-sidebar {
    display: none;
  }
  
  /* Hide page footer on mobile */
  .page-footer {
    display: none;
  }
  
  /* Table area - prioritize this */
  .table-area {
    order: 0;
    padding: 2px;
  }
  
  .table-area #status {
    font-size: 0.8rem;
    padding: 6px 8px;
    margin-bottom: 2px;
  }
  
  /* Seats - smaller on mobile */
  .seat {
    padding: 6px 8px;
    min-width: 80px;
    border-radius: 8px;
  }
  
  .seat .player-name {
    font-size: 0.75rem;
    gap: 4px;
  }
  
  .seat .player-badges {
    gap: 2px;
  }
  
  .seat .team-badge,
  .seat .badge {
    font-size: 0.55rem;
    padding: 1px 4px;
  }
  
  .seat-left, .seat-right {
    min-width: 70px;
    max-width: 90px;
  }
  
  /* Table center - smaller */
  .table-center {
    min-height: 140px;
    padding: 8px;
    border-radius: 12px;
    border-width: 2px;
  }
  
  .table-row {
    gap: 6px;
  }
  
  /* Trick area cards smaller */
  .trick-area-cross {
    gap: 4px;
    padding: 4px;
  }
  
  .trick-slot .card {
    padding: 6px 10px;
    font-size: 0.85rem;
    min-width: 40px;
    border-radius: 6px;
  }
  
  /* Make suit symbols larger on trick cards for visibility */
  .trick-slot .card .card-suit {
    font-size: 1.4rem;
  }
  
  /* Hand area */
  .hand-area {
    margin-top: 4px;
    max-width: 100%;
  }
  
  .hand {
    padding: 10px;
    border-radius: 8px;
  }
  
  .hand h3 {
    font-size: 0.75rem;
    margin-bottom: 8px;
  }
  
  #hand {
    gap: 4px;
    overflow-x: auto;
    flex-wrap: nowrap;
    justify-content: flex-start;
    padding-bottom: 4px;
  }
  
  #hand .card {
    padding: 8px 10px;
    font-size: 0.9rem;
    min-width: 45px;
    flex-shrink: 0;
  }
  
  /* Make suit symbols larger on mobile for better visibility */
  .card-suit {
    font-size: 1.3rem;
  }
  
  /* Larger suits for trump selection cards */
  .trump-select-card .card-suit {
    font-size: 1.2rem;
  }
  
  /* Controls */
  #controls {
    padding: 8px;
  }
  
  #controls button {
    padding: 8px 16px;
    font-size: 0.85rem;
  }
  
  .bid-controls {
    gap: 6px;
  }
  
  .bid-controls input {
    width: 60px;
    padding: 6px;
    font-size: 0.9rem;
  }
  
  .bid-controls button {
    padding: 6px 12px;
    font-size: 0.8rem;
  }
}

/* Small mobile */
@media (max-width: 480px) {
  body {
    padding: 4px;
  }
  
  .game-layout {
    padding: 0;
    gap: 2px;
  }
  
  .left-sidebar {
    padding: 2px;
    gap: 2px;
  }
  
  .left-sidebar .team-banks {
    gap: 2px;
  }
  
  .team-bank {
    padding: 4px 6px;
  }
  
  .team-bank .bank-label {
    font-size: 0.6rem;
  }
  
  .team-bank .bank-value {
    font-size: 0.9rem;
  }
  
  .left-sidebar .game-info {
    gap: 2px;
  }
  
  .game-info .info-card {
    padding: 3px 5px;
    font-size: 0.65rem;
  }
  
  .seat {
    padding: 3px 5px;
    min-width: 55px;
  }
  
  .seat .player-name {
    font-size: 0.65rem;
  }
  
  .seat .team-badge,
  .seat .badge {
    font-size: 0.5rem;
    padding: 1px 3px;
  }
  
  .seat-left, .seat-right {
    min-width: 50px;
    max-width: 65px;
  }
  
  .table-center {
    min-height: 100px;
    padding: 4px;
  }
  
  .table-area #status {
    font-size: 0.75rem;
    padding: 4px 6px;
  }
  
  .trick-slot .card {
    padding: 3px 6px;
    font-size: 0.7rem;
    min-width: 32px;
  }
  
  /* Larger suits on trick cards for small mobile */
  .trick-slot .card .card-suit {
    font-size: 1.3rem;
  }
  
  #hand .card {
    padding: 5px 7px;
    font-size: 0.75rem;
    min-width: 36px;
  }
  
  /* Even larger suits on small mobile for visibility */
  .card-suit {
    font-size: 1.2rem;
  }
  
  .trump-select-card .card-suit {
    font-size: 1.1rem;
  }
  
  .hand {
    padding: 6px;
  }
  
  .hand h3 {
    font-size: 0.65rem;
    margin-bottom: 4px;
  }
  
  /* Compact controls */
  #controls button {
    padding: 6px 12px;
    font-size: 0.8rem;
  }
  
  .bid-btn, .trump-btn {
    padding: 8px 12px;
    font-size: 0.9rem;
  }
}

/* Help Icon (? next to title) */
.help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  font-size: 0.85rem;
  font-weight: bold;
  color: #94a3b8;
  background: rgba(255,255,255,0.1);
  border: 1px solid #64748b;
  border-radius: 50%;
  cursor: pointer;
  margin-left: 8px;
  vertical-align: middle;
  transition: all 0.2s;
}

.help-icon:hover {
  background: rgba(59, 130, 246, 0.3);
  border-color: #3b82f6;
  color: white;
}

/* Rules Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.8);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-content {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border-radius: 16px;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  border: 1px solid rgba(255,255,255,0.1);
}

.rules-modal, .settings-modal {
  padding: 24px;
}

.rules-modal h2, .settings-modal h2 {
  margin: 0 0 20px 0;
  color: #f8fafc;
  font-size: 1.5rem;
  text-align: center;
}

.name-edit-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.name-edit-row label {
  font-size: 0.85rem;
  color: #94a3b8;
}

.name-edit-input {
  padding: 10px 12px;
  border: 1px solid #475569;
  background: rgba(255,255,255,0.05);
  color: white;
  border-radius: 6px;
  font-size: 1rem;
}

.name-edit-input:focus {
  outline: none;
  border-color: #3b82f6;
}

/* Settings Modal Styles */
.settings-modal {
  max-width: 480px;
}

.settings-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.settings-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.settings-section:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
}

.settings-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.settings-icon {
  font-size: 1.4rem;
  line-height: 1;
  margin-top: 2px;
}

.settings-title {
  flex: 1;
}

.settings-title h3 {
  font-size: 1rem;
  color: #f1f5f9;
  margin: 0 0 4px 0;
  font-weight: 600;
}

.settings-desc {
  font-size: 0.8rem;
  color: #64748b;
  margin: 0;
}

.settings-btn-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.settings-opt-btn {
  padding: 10px 18px;
  background: rgba(255,255,255,0.03);
  border: 1px solid #475569;
  color: #94a3b8;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 90px;
}

.settings-opt-btn .opt-label {
  font-weight: 500;
}

.settings-opt-btn .opt-hint {
  font-size: 0.7rem;
  opacity: 0.7;
}

.settings-opt-btn:hover {
  background: rgba(255,255,255,0.08);
  border-color: #64748b;
  color: white;
  transform: translateY(-1px);
}

.settings-opt-btn.active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: white;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.settings-opt-btn.easy.active { 
  background: #10b981; 
  border-color: #10b981; 
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}
.settings-opt-btn.medium.active { 
  background: #f59e0b; 
  border-color: #f59e0b; 
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}
.settings-opt-btn.hard.active { 
  background: #ef4444; 
  border-color: #ef4444; 
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.names-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.name-edit-row label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.seat-indicator {
  font-size: 0.6rem;
}

.seat-indicator.partner {
  color: #3b82f6;
}

.seat-indicator.opponent {
  color: #f59e0b;
}

.name-edit-input {
  background: rgba(0,0,0,0.3);
  border: 1px solid #475569;
  transition: all 0.2s;
}

.name-edit-input:hover {
  border-color: #64748b;
}

.name-edit-input::placeholder {
  color: #4b5563;
  font-style: italic;
}

.settings-buttons {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.save-settings-btn {
  flex: 1;
  padding: 14px 20px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: none;
  color: white;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.save-settings-btn:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

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

.reset-settings-btn {
  padding: 14px 20px;
  background: transparent;
  border: 1px solid #475569;
  color: #94a3b8;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.2s;
}

.reset-settings-btn:hover {
  border-color: #ef4444;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

/* Toast Notification */
.toast-notification {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  padding: 14px 28px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 500;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast-notification.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast-icon {
  font-size: 1.1rem;
}

.mode-btn.settings-btn {
  background: rgba(100, 116, 139, 0.2);
  border-color: #475569;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.8rem;
  cursor: pointer;
  padding: 4px 10px;
  line-height: 1;
}

.modal-close:hover {
  color: white;
}

.rules-content {
  color: #cbd5e1;
}

.rule-section {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.rule-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.rule-section h3 {
  color: #f8fafc;
  font-size: 1rem;
  margin: 0 0 8px 0;
}

.rule-section p {
  margin: 0 0 8px 0;
  line-height: 1.5;
}

.rule-section ol, .rule-section ul {
  margin: 0;
  padding-left: 20px;
}

.rule-section li {
  margin-bottom: 6px;
  line-height: 1.4;
}

.card-ranks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
}

.card-ranks span {
  background: rgba(255,255,255,0.1);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.85rem;
}

.hint {
  font-size: 0.8rem;
  color: #94a3b8;
  font-style: italic;
}

.scoring-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 0.85rem;
}

.scoring-table th, .scoring-table td {
  padding: 8px 12px;
  text-align: left;
  border: 1px solid rgba(255,255,255,0.1);
}

.scoring-table th {
  background: rgba(255,255,255,0.05);
  color: #f8fafc;
}

.scoring-table td {
  color: #cbd5e1;
}

.credits-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
}

.credits-section h3 {
  color: #94a3b8;
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.credits-section p {
  margin: 4px 0;
}

.guide-link-section {
  text-align: center;
  padding: 16px;
  background: rgba(59, 130, 246, 0.1);
  border-radius: 8px;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.full-guide-link {
  display: inline-block;
  color: #60a5fa;
  font-size: 1.1rem;
  font-weight: 600;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 6px;
  transition: all 0.2s;
}

.full-guide-link:hover {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}

/* Lobby Styles */
.lobby-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lobby-container {
  background: rgba(255,255,255,0.05);
  border-radius: 16px;
  padding: 40px;
  max-width: 500px;
  width: 90%;
  text-align: center;
}

.lobby-footer {
  position: absolute;
  bottom: 16px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.8rem;
  color: #64748b;
  opacity: 0.7;
}

.lobby-container h1 {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.lobby-container .subtitle {
  color: #94a3b8;
  margin-bottom: 32px;
}

.mode-buttons {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.mode-btn {
  padding: 20px 32px;
  border-radius: 12px;
  border: 2px solid #475569;
  background: rgba(255,255,255,0.05);
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.mode-btn:hover {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.1);
  transform: translateY(-2px);
}

.mode-btn.primary {
  background: #3b82f6;
  border-color: #3b82f6;
}

.mode-btn.primary:hover {
  background: #2563eb;
}

.mode-btn .mode-icon {
  font-size: 1.5rem;
  margin-right: 12px;
}

.mode-btn .mode-desc {
  display: block;
  font-size: 0.8rem;
  color: #94a3b8;
  font-weight: normal;
  margin-top: 4px;
}

.name-input-section {
  margin-bottom: 20px;
}

.name-input-section label {
  display: block;
  font-size: 0.9rem;
  color: #94a3b8;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.input-hint {
  display: block;
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 6px;
}

.name-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 8px;
  border: 2px solid #475569;
  background: rgba(255,255,255,0.05);
  color: white;
  font-size: 1.2rem;
  text-align: center;
}

.name-input:focus {
  outline: none;
  border-color: #3b82f6;
}

.name-input::placeholder {
  color: #64748b;
}

.multiplayer-options {
  display: none;
}

.multiplayer-options.active {
  display: block;
}

.mp-section {
  margin-bottom: 24px;
}

.mp-section h3 {
  color: #94a3b8;
  font-size: 0.9rem;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.room-code-display {
  background: rgba(16, 185, 129, 0.2);
  border: 2px solid #10b981;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}

.room-code-display .code {
  font-size: 2.5rem;
  font-weight: bold;
  letter-spacing: 8px;
  color: #10b981;
  font-family: monospace;
}

.room-code-display .hint {
  font-size: 0.85rem;
  color: #94a3b8;
  margin-top: 8px;
}

.copy-link-btn {
  margin-top: 12px;
  padding: 10px 20px;
  border-radius: 8px;
  border: 1px solid #10b981;
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.copy-link-btn:hover {
  background: rgba(16, 185, 129, 0.4);
  transform: scale(1.02);
}

.join-input-group {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.join-input {
  flex: 1;
  padding: 14px 16px;
  border-radius: 8px;
  border: 2px solid #475569;
  background: rgba(255,255,255,0.05);
  color: white;
  font-size: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 4px;
  text-align: center;
  font-family: monospace;
}

.join-input:focus {
  outline: none;
  border-color: #3b82f6;
}

.join-input::placeholder {
  color: #64748b;
  letter-spacing: 2px;
}

.join-btn {
  padding: 14px 24px;
  border-radius: 8px;
  border: none;
  background: #3b82f6;
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.join-btn:hover {
  background: #2563eb;
}

.join-btn:disabled {
  background: #475569;
  cursor: not-allowed;
}

.back-btn {
  padding: 10px 20px;
  border-radius: 8px;
  border: 1px solid #475569;
  background: transparent;
  color: #94a3b8;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.back-btn:hover {
  border-color: #64748b;
  color: white;
}

.waiting-room {
  display: none;
}

.waiting-room.active {
  display: block;
}

.players-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.player-slot {
  background: rgba(255,255,255,0.05);
  border: 2px solid #475569;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.player-slot.occupied {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.1);
}

.player-slot.you {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.1);
}

.player-slot .player-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.player-slot .player-name {
  font-weight: 600;
  margin-bottom: 4px;
}

.player-slot .player-status {
  font-size: 0.8rem;
  color: #94a3b8;
}

.player-slot .player-team {
  font-size: 0.7rem;
  margin-top: 4px;
}

.player-slot.swap-selected {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.2);
  animation: pulse-swap 1s infinite;
}

@keyframes pulse-swap {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(245, 158, 11, 0); }
}

.swap-btn {
  margin-top: 8px;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid #475569;
  background: rgba(255, 255, 255, 0.05);
  color: #94a3b8;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.swap-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border-color: #64748b;
}

.swap-btn.confirm {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.swap-btn.confirm:hover {
  background: rgba(16, 185, 129, 0.4);
}

.swap-btn.cancel {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.swap-btn.cancel:hover {
  background: rgba(239, 68, 68, 0.4);
}

.player-slot.occupied .player-status {
  color: #10b981;
}

.start-game-btn {
  padding: 16px 32px;
  border-radius: 12px;
  border: none;
  background: #10b981;
  color: white;
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
}

.start-game-btn:hover:not(:disabled) {
  background: #059669;
  transform: translateY(-2px);
}

.start-game-btn:disabled {
  background: #475569;
  cursor: not-allowed;
}

.error-message {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid #ef4444;
  color: #fca5a5;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s linear infinite;
  margin-right: 8px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.page-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  font-size: 0.75rem;
  color: #64748b;
  background: rgba(15, 23, 42, 0.9);
  border-top: 1px solid rgba(255,255,255,0.05);
  z-index: 100;
  pointer-events: none;
}

.footer-credit {
  opacity: 0.7;
}

.version-indicator {
  opacity: 0.5;
}
