/* ========================================
   Judgement Card Game - Styles
   ======================================== */

/* CSS Variables */
:root {
  --bg: #0a1a0a;
  --card: #fff;
  --accent: #ffcc00;
  --accent-hover: #ffd700;
  --table: #2c5f2c;
  --radius: 12px;
  --gap: 1rem;
  --primary: #4caf50;
  --primary-dark: #388e3c;
  --gradient-start: #1a2f1a;
  --gradient-end: #0a1a0a;
}

/* Reset & Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Poppins', Helvetica, Arial, sans-serif;
  background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
  background-attachment: fixed;
  color: #eee;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  min-height: 100vh;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: .5rem;
  text-align: center;
  font-weight: 700;
  background: linear-gradient(135deg, #fff 0%, #a8e6a8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Screen System */
.screen {
  display: none;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 800px;
}

.screen.active {
  display: flex;
}

/* Form Elements */
input, button, select {
  padding: .8rem 1.2rem;
  margin: .3rem;
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: 'Poppins', sans-serif;
}

input, select {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
  width: 100%;
}

select {
  cursor: pointer;
}

select option {
  background: #0f2010;
  color: #e0e0e0;
  padding: 0.8rem;
  font-weight: 500;
}

select option:checked {
  background: linear-gradient(135deg, #2d5f2d 0%, #1e4a1e 100%);
  color: #a8e6a8;
  font-weight: 600;
}

select option:hover {
  background: #1a3d1a;
  color: #fff;
}

select option:checked:hover {
  background: linear-gradient(135deg, #388e3c 0%, #2d5f2d 100%);
  color: #c8f5c8;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

button {
  background: var(--accent);
  color: #000;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 204, 0, 0.4);
}

button:active {
  transform: translateY(0);
}

/* Register Screen Styles */
.register-container {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
  border-radius: 24px;
  padding: 3rem 2.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  max-width: 480px;
  width: 100%;
  animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.register-header {
  text-align: center;
  margin-bottom: 2rem;
}

.game-logo {
  display: inline-block;
  margin-bottom: 1rem;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

.game-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.tagline {
  color: #a8e6a8;
  font-size: 1.1rem;
  font-weight: 400;
  margin-top: 0.5rem;
}

.register-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.input-group label {
  font-weight: 600;
  font-size: 0.9rem;
  color: #a8e6a8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.avatar-grid-container {
  position: relative;
  margin-top: 0.8rem;
  padding-bottom: 50px; /* Space for navigation buttons below */
}

.avatar-grid {
  display: flex;
  gap: 0.8rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.5rem 0;
  scroll-behavior: smooth;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
  scroll-snap-type: x proximity;
}

.avatar-grid::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.avatar-grid-nav {
  position: absolute;
  bottom: 10px;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a8e6a8;
  font-size: 1.2rem;
  font-weight: 300;
  z-index: 10;
  transition: all 0.3s ease;
  opacity: 0.7;
}

.avatar-grid-nav:hover {
  opacity: 1;
  background: rgba(76, 175, 80, 0.15);
  border-color: rgba(76, 175, 80, 0.4);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.2);
}

.avatar-grid-nav.left {
  left: 20px;
}

.avatar-grid-nav.right {
  right: 20px;
}

.avatar-grid-nav.hidden {
  opacity: 0;
  pointer-events: none;
}

.avatar-option {
  min-width: 70px;
  width: 70px;
  height: 70px;
  padding: 0.4rem;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  scroll-snap-align: start;
}

.avatar-option:first-child {
  margin-left: 0;
}

.avatar-option:last-child {
  margin-right: 0;
}

.avatar-option img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  pointer-events: none;
}

.avatar-option:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  background: rgba(76, 175, 80, 0.1);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.avatar-option.selected {
  border-color: var(--primary);
  background: rgba(76, 175, 80, 0.2);
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

.avatar-option.selected:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 204, 0, 0.3);
}

@media (max-width: 480px) {
  .avatar-option {
    min-width: 60px;
    width: 60px;
    height: 60px;
  }
  
  .avatar-grid-nav {
    width: 28px;
    height: 28px;
    font-size: 1rem;
  }
}

.avatar-preview-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin: 1rem 0;
}

.avatar-preview {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--primary);
  box-shadow: 0 4px 20px rgba(76, 175, 80, 0.4);
  transition: all 0.3s ease;
}

.avatar-preview:hover {
  transform: scale(1.05) rotate(5deg);
  box-shadow: 0 6px 25px rgba(76, 175, 80, 0.6);
}

@keyframes avatarPop {
  0% { transform: scale(0.8) rotate(-10deg); opacity: 0.5; }
  50% { transform: scale(1.1) rotate(5deg); }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.avatar-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: #a8e6a8;
  text-align: center;
}

.primary-btn {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 1rem 2rem;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.primary-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(76, 175, 80, 0.5);
}

.btn-icon {
  font-size: 1.3rem;
  transition: transform 0.3s ease;
}

.primary-btn:hover .btn-icon {
  transform: translateX(5px);
}

.features {
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.feature-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: #ccc;
  flex: 1;
  text-align: center;
}

.feature-icon {
  font-size: 2rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-style: normal;
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .register-container {
    padding: 2rem 1.5rem;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  .game-icon {
    font-size: 3rem;
  }
  
  .features {
    flex-direction: column;
    gap: 0.8rem;
  }
}

/* Footer */
.footer {
  position: static;
  text-align: center;
  padding: 0.8rem 1.5rem;
  margin-top: 1.5rem;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  background: rgba(10, 26, 10, 0.7);
  backdrop-filter: blur(8px);
  border-radius: 20px;
  font-weight: 400;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
  display: none; /* Hidden by default */
  max-width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

/* Only show on register screen */
#register.active ~ .footer {
  display: block;
}

.footer:hover {
  color: rgba(255, 255, 255, 0.8);
  background: rgba(10, 26, 10, 0.85);
}

.footer .heart {
  color: #ff6b6b;
  display: inline-block;
  animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.2); }
  50% { transform: scale(1); }
}

/* ===== LOBBY SCREEN STYLING ===== */
.lobby-container {
  max-width: 500px;
  margin: 0 auto;
  padding: 1rem;
}

.lobby-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.lobby-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.lobby-info-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
  backdrop-filter: blur(15px);
  border: 2px solid rgba(76, 175, 80, 0.3);
  border-radius: 16px;
  padding: 1.2rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.lobby-share-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.lobby-code-display {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 215, 0, 0.08) 100%);
  border: 1px solid rgba(255, 215, 0, 0.4);
  border-radius: 10px;
  padding: 0.6rem 1.2rem;
  flex: 1;
  min-width: 0;
}

.code-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255, 215, 0, 0.8);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.code-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffd700;
  font-family: 'Courier New', monospace;
  letter-spacing: 1.5px;
}

.copy-link-btn {
  padding: 0.7rem 1.5rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.copy-link-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(76, 175, 80, 0.5);
}

.copy-link-btn:active {
  transform: translateY(0);
}

.copy-link-btn.copied {
  background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
}

.players-section {
  margin-bottom: 1.5rem;
}

.section-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 1rem 0;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.lobby-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  width: 100%;
}

.player-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(76, 175, 80, 0.2);
  border-radius: 12px;
  transition: all 0.3s ease;
}

.player-item:hover {
  border-color: var(--primary);
  transform: translateX(5px);
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.2);
}

.player-item img {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  object-fit: cover;
}

.player-item span {
  font-size: 1rem;
  font-weight: 500;
  color: #fff;
  flex: 1;
}

.game-settings {
  margin: 1.5rem 0;
}

.game-settings .input-group {
  margin-bottom: 1.2rem;
}

.game-settings label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--accent);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.game-settings select {
  width: 100%;
  padding: 0.9rem 1rem;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(76, 175, 80, 0.4);
  border-radius: 12px;
  color: #fff;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath fill='%23fff' d='M7 10L2 5h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 3rem;
}

.game-settings select:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(76, 175, 80, 0.6);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.game-settings select:focus {
  outline: none;
  border-color: rgba(76, 175, 80, 0.8);
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

.game-settings select option {
  background: rgba(45, 95, 45, 0.98);
  padding: 0.8rem;
  font-size: 1rem;
  color: #fff;
  font-weight: 500;
}

.game-settings select option:hover {
  background: rgba(76, 175, 80, 0.3);
}

.game-settings select option:checked {
  background: rgba(76, 175, 80, 0.5);
  font-weight: 600;
}

/* Lobby custom dropdowns */
.lobby-dropdown {
  width: 100% !important;
}

.lobby-dropdown .dropdown-selected {
  padding: 0.9rem 1rem;
  padding-right: 3rem;
}

.lobby-dropdown .dropdown-arrow {
  right: 1rem;
}

.helper-text {
  display: block;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85rem;
  margin-top: 0.5rem;
  font-style: italic;
}

.start-game-btn {
  width: 100%;
  background: linear-gradient(135deg, #ffd700 0%, #ffb900 100%);
  color: #000;
  padding: 1rem 2rem;
  font-size: 1.2rem;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 6px 25px rgba(255, 215, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  margin-top: 2rem;
}

.start-game-btn:hover {
  background: linear-gradient(135deg, #ffed4e 0%, #ffd700 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(255, 215, 0, 0.6);
}

.start-game-btn:active {
  transform: translateY(0);
}

.start-game-btn .btn-icon {
  font-size: 1.3rem;
}

/* Legacy lobby selects */
#lobbyList, #hostSelect {
  margin-top: 1rem;
  width: 100%;
  max-width: 400px;
}

/* ===== GAME SCREEN LAYOUT ===== */
#game {
  display: none;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem;
  min-height: 100vh;
  position: relative;
}

#game.active {
  display: flex;
}

/* Top Bar with Scorecard, Round Info, and User Info */
#gameTopBar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: transparent;
  z-index: 1000;
  gap: 1rem;
}

#gameTopBar #roundInfo {
  flex: 1;
  text-align: center;
  font-size: 1rem;
  margin: 0;
  padding: 0.5rem 1rem;
  background: rgba(76, 175, 80, 0.2);
  border-radius: 10px;
  border: 1px solid rgba(76, 175, 80, 0.3);
}

/* Game Content Area (below top bar) */
.game-content {
  width: 100%;
  padding-top: 5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
}

/* Scoreboard - Below Round Info */
#scoreboard {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
  backdrop-filter: blur(20px);
  border-radius: 16px;
  border: 2px solid rgba(76, 175, 80, 0.3);
  padding: 1rem;
  max-width: 600px;
  width: 90%;
  overflow-x: auto;
  margin: 0.5rem auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* Round Info */
#roundInfo {
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  margin: 0.5rem auto;
  padding: 0.6rem 1rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  max-width: 600px;
  min-height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  -webkit-text-fill-color: #fff;
  background-clip: border-box;
  -webkit-background-clip: border-box;
}

/* Deal Button */
#dealBtn {
  position: absolute;
  top: calc(5rem + 1.5rem + 1.5rem + 3rem + 24vmin);
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 0.8rem 2rem;
  background: linear-gradient(135deg, #ffd700 0%, #ffb900 100%);
  color: #000;
  font-size: 1.1rem;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 10;
  animation: dealButtonPop 0.4s ease-out;
}

@keyframes dealButtonPop {
  from {
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0;
  }
  to {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

#dealBtn:hover {
  transform: translate(-50%, -50%) translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 215, 0, 0.6);
}

#dealBtn:active {
  transform: translate(-50%, -50%) translateY(0);
}

/* Game Table */
#table {
  position: relative;
  width: 60vmin;
  height: 60vmin;
  max-width: 400px;
  max-height: 400px;
  background: radial-gradient(circle at center, #2c5f2c 0%, #1e4520 100%);
  border-radius: 50%;
  margin: 3rem auto;
  box-shadow: 
    0 0 0 8px rgba(76, 175, 80, 0.15),
    0 0 0 12px rgba(76, 175, 80, 0.08),
    0 10px 40px rgba(0, 0, 0, 0.5),
    inset 0 0 60px rgba(0, 0, 0, 0.3);
  border: 3px solid rgba(76, 175, 80, 0.2);
}

.seat {
  position: absolute;
  width: 70px;
  height: 95px;
  text-align: center;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Mini card badge showing what player played */
.seat .mini-card {
  position: absolute;
  width: 32px;
  height: 46px;
  background: white;
  border-radius: 4px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: bold;
  border: 1px solid rgba(0, 0, 0, 0.2);
  z-index: 10;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease-out;
}

.seat .mini-card.show {
  display: flex;
  opacity: 1;
}

@keyframes miniCardPopIn {
  0% {
    transform: scale(0.8);
  }
  100% {
    transform: scale(1);
  }
}

.seat .mini-card .mini-rank {
  font-size: 0.7rem;
  line-height: 1;
  margin-bottom: 2px;
}

.seat .mini-card .mini-suit {
  font-size: 1rem;
  line-height: 1;
}

.seat .mini-card.spades,
.seat .mini-card.clubs {
  color: #1a1a1a;
}

.seat .mini-card.hearts,
.seat .mini-card.diamonds {
  color: #e63946;
}

.seat img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(76, 175, 80, 0.4);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  transition: all 0.3s ease;
}

.seat.active-turn img {
  border: 3px solid #ffd700;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.8), 0 0 40px rgba(255, 215, 0, 0.4);
  animation: activePulse 2s ease-in-out infinite;
}

@keyframes activePulse {
  0%, 100% {
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.8), 0 0 40px rgba(255, 215, 0, 0.4);
  }
  50% {
    box-shadow: 0 0 30px rgba(255, 215, 0, 1), 0 0 60px rgba(255, 215, 0, 0.6);
  }
}

.seat.active-turn .name {
  color: #ffd700;
  font-weight: 700;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.6), 0 1px 2px rgba(0, 0, 0, 0.8);
}

.seat img:hover {
  transform: scale(1.1);
  border-color: var(--primary);
}

.seat .name {
  margin-top: .4rem;
  font-size: .85rem;
  font-weight: 500;
  color: #e0e0e0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Player Hand */
.hand {
  display: flex;
  gap: .4rem;
  flex-wrap: nowrap;
  justify-content: flex-start;
  margin: 1.5rem auto;
  overflow-x: auto;
  overflow-y: visible;
  padding: .5rem;
  width: 100%;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

.hand::-webkit-scrollbar {
  height: 8px;
}

.hand::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.hand::-webkit-scrollbar-thumb {
  background: rgba(76, 175, 80, 0.5);
  border-radius: 10px;
}

.hand::-webkit-scrollbar-thumb:hover {
  background: rgba(76, 175, 80, 0.7);
}

/* Playing Cards */
.card {
  width: 90px;
  height: 130px;
  background: linear-gradient(135deg, #ffffff 0%, #f5f5f5 100%);
  color: #000;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .3), 0 2px 4px rgba(0, 0, 0, .2);
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  padding: .5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 2px solid rgba(0, 0, 0, 0.1);
}

.card:hover:not([style*="opacity: 0.4"]) {
  transform: translateY(-8px) scale(1.05);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .4), 0 4px 8px rgba(0, 0, 0, .3);
}

.card .card-corner {
  position: absolute;
  font-size: 1rem;
  line-height: 1;
  font-weight: bold;
}

.card .card-corner.top-left {
  top: .4rem;
  left: .5rem;
}

.card .card-corner.top-right {
  top: .4rem;
  right: .5rem;
}

.card .card-corner.bottom-left {
  bottom: .4rem;
  left: .5rem;
  transform: rotate(180deg);
}

.card .card-corner.bottom-right {
  bottom: .4rem;
  right: .5rem;
  transform: rotate(180deg);
}

.card .card-center {
  font-size: 2.5rem;
  font-weight: bold;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Card Suit Colors */
.card.spades, .card.clubs {
  color: #1a1a1a;
}

.card.hearts, .card.diamonds {
  color: #e63946;
}

/* Trick Display (Center of Table) */
.trick {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0;
}

.trick .card {
  box-shadow: 0 6px 16px rgba(0, 0, 0, .5), 0 3px 6px rgba(0, 0, 0, .3);
  transform: scale(1.15);
  margin-left: -40px;
}

.trick .card:first-child {
  margin-left: 0;
}

/* Center Message (modern coachmark style) */
#centerMsg {
  background: rgba(102, 126, 234, 0.95);
  backdrop-filter: blur(10px);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  text-align: center;
  display: none;
  letter-spacing: 0.3px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  margin: 1.5rem auto;
  max-width: 500px;
  width: 90%;
}

#centerMsg.show {
  display: block;
}

/* Messages */
#msg {
  color: var(--accent);
  margin-top: .5rem;
}

/* Scoreboard Table Styles */
#scoreboard table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  color: #fff;
  font-size: 0.9rem;
}

#scoreboard th, #scoreboard td {
  padding: 0.7rem 0.8rem;
  text-align: center;
  border-bottom: 1px solid rgba(76, 175, 80, 0.2);
}

#scoreboard th {
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.3) 0%, rgba(76, 175, 80, 0.15) 100%);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.95);
  border-bottom: 2px solid rgba(76, 175, 80, 0.4);
}

#scoreboard th:first-child {
  border-top-left-radius: 8px;
}

#scoreboard th:last-child {
  border-top-right-radius: 8px;
}

#scoreboard tr:hover {
  background: rgba(76, 175, 80, 0.1);
}

.dealer-indicator {
  color: var(--accent);
  font-weight: bold;
  text-shadow: 0 0 10px var(--accent);
}

.active-turn {
  background: linear-gradient(90deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 215, 0, 0.1) 100%) !important;
  border-left: 3px solid rgba(255, 215, 0, 0.8);
}

/* Bidding UI */
#biddingUI {
  position: absolute;
  top: calc(5rem + 1.5rem + 1.5rem + 3rem + 24vmin);
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
  backdrop-filter: blur(20px);
  border: 2px solid rgba(76, 175, 80, 0.4);
  border-radius: 16px;
  padding: 1.5rem;
  max-width: 280px;
  width: 90%;
  display: none;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  /* Vertical column layout */
  flex-direction: column;
  gap: 1rem;
  align-items: stretch;
  z-index: 100;
}

#biddingUI.active {
  display: flex;
  animation: slideInFromTop 0.5s ease-out;
}

#biddingUI #biddingPrompt {
  text-align: center;
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

/* Bidding controls row - dropdown and button side by side */
#biddingUI > div {
  display: flex;
  gap: 0.75rem;
  align-items: stretch;
  justify-content: center;
}

/* Custom Dropdown Styling */
.custom-dropdown {
  position: relative;
  width: 120px;
  cursor: pointer;
  user-select: none;
}

.dropdown-selected {
  padding: 0.8rem 1rem;
  font-size: 1.1rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(76, 175, 80, 0.4);
  border-radius: 12px;
  color: #fff;
  text-align: center;
  transition: all 0.3s ease;
}

.custom-dropdown:hover .dropdown-selected {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(76, 175, 80, 0.6);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.dropdown-arrow {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.7rem;
  color: #fff;
  transition: transform 0.3s ease;
  pointer-events: none;
}

.custom-dropdown.open .dropdown-arrow {
  transform: translateY(-50%) rotate(180deg);
}

.dropdown-options {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  background: rgba(45, 95, 45, 0.98);
  backdrop-filter: blur(15px);
  border: 2px solid rgba(76, 175, 80, 0.5);
  border-radius: 12px;
  max-height: 250px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  display: none;
  animation: dropdownSlideIn 0.3s ease-out;
}

.custom-dropdown.open .dropdown-options {
  display: block;
}

.dropdown-options::-webkit-scrollbar {
  width: 6px;
}

.dropdown-options::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
}

.dropdown-options::-webkit-scrollbar-thumb {
  background: rgba(76, 175, 80, 0.6);
  border-radius: 10px;
}

.dropdown-options::-webkit-scrollbar-thumb:hover {
  background: rgba(76, 175, 80, 0.8);
}

.dropdown-option {
  padding: 0.8rem 1rem;
  color: #fff;
  font-size: 1rem;
  font-weight: 500;
  text-align: center;
  transition: all 0.2s ease;
  cursor: pointer;
}

.dropdown-option:hover:not(.disabled) {
  background: rgba(76, 175, 80, 0.3);
}

.dropdown-option.selected {
  background: rgba(76, 175, 80, 0.5);
  font-weight: 600;
}

.dropdown-option.disabled {
  color: rgba(255, 255, 255, 0.4);
  text-decoration: line-through;
  cursor: not-allowed;
  background: rgba(100, 100, 100, 0.2);
}

@keyframes dropdownSlideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#biddingUI button {
  width: 140px;
}

@keyframes slideInFromTop {
  from {
    transform: translate(-50%, -60%);
    opacity: 0;
  }
  to {
    transform: translate(-50%, -50%);
    opacity: 1;
  }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

#biddingPrompt {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  margin: 0;
  letter-spacing: 0.3px;
  flex: 1;
  min-width: 0;
}

#bidSelect {
  flex: 0 0 70px;
  padding: 0.8rem 1rem;
  font-size: 1.1rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(76, 175, 80, 0.4);
  border-radius: 12px;
  color: #fff;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23fff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  padding-right: 2rem;
  overflow: hidden;
}

#bidSelect::-webkit-scrollbar {
  display: none;
}

#bidSelect {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

#bidSelect:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(76, 175, 80, 0.6);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

#bidSelect:focus {
  outline: none;
  border-color: rgba(76, 175, 80, 0.8);
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

#bidSelect option {
  background-color: #2d5f2d !important;
  background: #2d5f2d !important;
  color: #ffffff !important;
  padding: 0.8rem;
  font-weight: 500;
  font-size: 1rem;
}

#bidSelect option:checked,
#bidSelect option:checked:hover {
  background-color: #4caf50 !important;
  background: #4caf50 !important;
  color: #fff !important;
  font-weight: 600;
}

#bidSelect option:hover {
  background-color: #3d7f3d !important;
  background: #3d7f3d !important;
}

#bidSelect option:disabled {
  background-color: #666666 !important;
  background: #666666 !important;
  color: rgba(255, 255, 255, 0.4) !important;
  text-decoration: line-through;
}

#bidSelect option {
  background: #1a1a1a;
  padding: 0.8rem;
  font-size: 1.1rem;
}

#biddingUI button {
  padding: 0.7rem 1.8rem;
  font-size: 0.95rem;
  font-weight: 700;
  background: linear-gradient(135deg, #ffd700 0%, #ffb900 100%);
  color: #000;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
  white-space: nowrap;
}

#biddingUI button:hover {
  background: linear-gradient(135deg, #ffed4e 0%, #ffd700 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 215, 0, 0.5);
}

#biddingUI button:active {
  transform: translateY(0);
}

/* User Info (Top Right) */
#userInfo {
  position: relative;
  background: #222;
  padding: 0.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .5);
  cursor: pointer;
  width: 50px;
  height: 50px;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

#userInfo:hover {
  box-shadow: 0 4px 16px rgba(76, 175, 80, 0.4);
  transform: scale(1.05);
}

/* Hide on register screen */
#register.active ~ #userInfo {
  display: none !important;
}

#userInfo img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

#userInfo .userName {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  background: #222;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-weight: bold;
  color: var(--accent);
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .5);
  z-index: 1001;
}

#userInfo:hover .userName {
  display: block;
}

/* User Dropdown Menu */
#userMenu {
  position: fixed;
  top: 4.5rem; /* Below the userInfo button */
  right: 1rem;
  background: #222;
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .6);
  display: none;
  flex-direction: column;
  min-width: 150px;
  overflow: hidden;
  z-index: 1001;
}

#userMenu.show {
  display: flex;
}

#userMenu button {
  background: #333;
  color: #eee;
  border: none;
  padding: .8rem 1rem;
  text-align: left;
  cursor: pointer;
  border-radius: 0;
  margin: 0;
  transition: background .2s;
}

#userMenu button:hover {
  background: #444;
  transform: none;
}

/* ===================== Scorecard ===================== */
#scorecardBtn {
  position: relative;
  background: #222;
  border: none;
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  transition: all 0.3s ease;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.5rem;
}

#scorecardBtn .scorecard-label {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0.5rem;
  background: #222;
  padding: 0.5rem 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: bold;
  color: var(--accent);
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  z-index: 1001;
}

#scorecardBtn:hover .scorecard-label {
  display: block;
}

/* Hide on register screen */
#register.active ~ #scorecardBtn {
  display: none !important;
}

#scorecardBtn:hover {
  box-shadow: 0 4px 16px rgba(76, 175, 80, 0.4);
  transform: scale(1.05);
}

#scorecardOverlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  z-index: 2000;
  justify-content: center;
  align-items: center;
}

#scorecardOverlay.show {
  display: flex;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Hide top bar elements when scorecard is open */
#scorecardOverlay.show ~ #game #gameTopBar {
  opacity: 0;
  pointer-events: none;
}

#scorecardModal {
  background: linear-gradient(135deg, rgba(30, 30, 30, 0.95) 0%, rgba(20, 20, 20, 0.98) 100%);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  border: 2px solid rgba(76, 175, 80, 0.4);
  padding: 3rem;
  max-width: 1200px;
  width: 90%;
  max-height: 90%;
  overflow-y: auto;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(76, 175, 80, 0.2);
  position: relative;
  animation: modalSlideIn 0.4s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-40px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

#scorecardModal h2 {
  margin: 0 0 2.5rem 0;
  color: #fff;
  font-size: 2.5rem;
  text-align: center;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-shadow: 0 2px 10px rgba(76, 175, 80, 0.3);
}

#scorecardModal .close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 45px;
  height: 45px;
  font-size: 1.8rem;
  font-weight: 300;
  cursor: pointer;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  padding: 0;
  backdrop-filter: blur(10px);
}

#scorecardModal .close-btn:hover {
  background: rgba(244, 67, 54, 0.8);
  color: white;
  border-color: #f44336;
  transform: scale(1.1) rotate(90deg);
  box-shadow: 0 4px 20px rgba(244, 67, 54, 0.5);
}

#scorecardContent table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 1rem;
  font-size: 1.15rem;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  border: 2px solid rgba(76, 175, 80, 0.4);
}

#scorecardContent th,
#scorecardContent td {
  border: none;
  border-right: 1px solid rgba(76, 175, 80, 0.15);
  border-bottom: 1px solid rgba(76, 175, 80, 0.15);
  padding: 1.4rem 1.8rem;
  text-align: center;
}

#scorecardContent th:last-child,
#scorecardContent td:last-child {
  border-right: none;
}

#scorecardContent th {
  background: linear-gradient(135deg, rgba(56, 142, 60, 0.8) 0%, rgba(46, 125, 50, 0.8) 100%);
  color: #fff;
  font-weight: 700;
  font-size: 1.25rem;
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 1.6rem;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

#scorecardContent td {
  background: rgba(30, 30, 30, 0.6);
  line-height: 1.9;
  color: rgba(255, 255, 255, 0.95);
  font-size: 1.1rem;
  transition: all 0.3s ease;
  font-weight: 500;
  backdrop-filter: blur(5px);
}

/* First column (ROUND) styling */
#scorecardContent td:first-child {
  background: rgba(50, 50, 50, 0.9);
  font-weight: 700;
  color: #fff;
  border-right: 2px solid rgba(76, 175, 80, 0.3);
  font-size: 1.1rem;
  letter-spacing: 0.5px;
}

#scorecardContent tbody tr:hover td {
  background: rgba(76, 175, 80, 0.2);
  transform: translateX(2px);
  box-shadow: inset 0 0 20px rgba(76, 175, 80, 0.1);
}

#scorecardContent tbody tr:hover td:first-child {
  background: rgba(76, 175, 80, 0.25);
}

/* Total Score Row Highlight */
#scorecardContent tr:last-child td {
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.4) 0%, rgba(56, 142, 60, 0.4) 100%);
  font-weight: 700;
  font-size: 1.3rem;
  border-top: 2px solid rgba(76, 175, 80, 0.6);
  border-bottom: none;
  color: #fff !important;
  text-shadow: 0 2px 8px rgba(76, 175, 80, 0.5);
  padding: 1.5rem;
}

#scorecardContent tr:last-child td:first-child {
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.5) 0%, rgba(56, 142, 60, 0.5) 100%);
  border-right: 2px solid rgba(76, 175, 80, 0.6);
  font-size: 1.2rem;
  letter-spacing: 1px;
}

/* Total Score - override positive/negative colors for last row */
#scorecardContent tr:last-child td.score-positive {
  color: #fff !important;
  text-shadow: 0 0 15px rgba(102, 187, 106, 0.8);
}

#scorecardContent tr:last-child td.score-negative {
  color: #fff !important;
  text-shadow: 0 0 15px rgba(239, 83, 80, 0.8);
}

/* Points styling */
#scorecardContent .score-positive {
  color: #66bb6a;
  font-weight: 700;
  text-shadow: 0 0 10px rgba(102, 187, 106, 0.5);
}

#scorecardContent .score-negative {
  color: #ef5350;
  font-weight: 700;
  text-shadow: 0 0 10px rgba(239, 83, 80, 0.5);
}
/* ===== MOBILE RESPONSIVENESS ===== */
@media (max-width: 768px) {
  /* Scoreboard - Make smaller on mobile */
  #scoreboard {
    max-width: 280px;
    font-size: 0.75rem;
  }
  
  #scoreboard table {
    font-size: 0.75rem;
  }
  
  #scoreboard th, #scoreboard td {
    padding: 0.3rem 0.2rem;
  }
  
  #scoreboard th {
    font-size: 0.65rem;
    padding: 0.4rem 0.2rem;
    letter-spacing: 0.3px;
  }
  
  /* Center Message */
  #centerMsg {
    font-size: 0.9rem;
    padding: 0.8rem 1rem;
  }
  
  /* Round Info */
  #roundInfo {
    font-size: 1rem;
    padding: 0.5rem;
  }
  
  /* Table */
  #table {
    width: 75vmin;
    height: 75vmin;
    margin: 2rem auto;
  }
  
  /* Deal Button - Adjust for mobile table position */
  #dealBtn {
    top: calc(5rem + 1.5rem + 1.5rem + 3rem + 40vmin);
  }
  
  /* Bidding UI - Adjust for mobile table position */
  #biddingUI {
    top: calc(5rem + 1.5rem + 1.5rem + 2rem + 45vmin);
  }
  
  #biddingUI #biddingPrompt {
    text-align: center;
  }
  
  #biddingUI select {
    width: 100%;
  }
  
  #biddingUI button {
    width: 100%;
  }
  
  /* Custom dropdown - Make wider on mobile to match button */
  .custom-dropdown {
    width: 100%;
    flex: 1;
  }
  
  #biddingUI > div {
    width: 100%;
  }
  
  #biddingUI button {
    flex: 1;
  }
  
  /* Mini cards - Make smaller on mobile */
  .seat .mini-card {
    width: 26px;
    height: 38px;
  }
  
  .seat .mini-card .mini-rank {
    font-size: 0.6rem;
  }
  
  .seat .mini-card .mini-suit {
    font-size: 0.85rem;
  }
  
  /* Cards */
  .hand {
    justify-content: flex-start;
    padding: 0.5rem;
    margin: 1rem auto;
  }
  
  .card {
    width: 70px;
    height: 100px;
  }
  
  .card .card-corner {
    font-size: 0.9rem;
  }
  
  .card .card-center {
    font-size: 2rem;
  }
  
  /* Messages */
  #msg {
    font-size: 0.9rem;
    text-align: center;
  }
}

@media (max-width: 480px) {
  #scoreboard {
    max-width: 220px;
  }
  
  #scoreboard table {
    font-size: 0.7rem;
  }
  
  #scoreboard th, #scoreboard td {
    padding: 0.25rem 0.15rem;
  }
  
  #scoreboard th {
    font-size: 0.6rem;
    padding: 0.35rem 0.15rem;
    letter-spacing: 0.2px;
  }
  
  #centerMsg {
    font-size: 0.85rem;
    padding: 0.7rem 0.8rem;
  }
  
  .card {
    width: 60px;
    height: 85px;
  }
  
  .card .card-corner {
    font-size: 0.8rem;
  }
  
  .card .card-center {
    font-size: 1.8rem;
  }
}
