:root {
  --card-width: 120px;
  --card-height: 173px;
  --card-radius: var(--radius-2);
  color-scheme: light only;
  
  /* Custom game colors */
  --felt-dark: #1a5c2e;
  --felt-light: #2d8a4e;
  --felt-pattern: linear-gradient(135deg, var(--felt-dark) 0%, var(--felt-light) 50%, var(--felt-dark) 100%);
  --gold-accent: #d4af37;
}

/* Force light mode surfaces */
html {
  --surface-1: var(--gray-0);
  --surface-2: var(--gray-1);
  --surface-3: var(--gray-2);
  --surface-4: var(--gray-3);
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--felt-pattern);
  color: var(--gray-0);
  font-family: var(--font-sans);
  overflow-x: hidden;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes slideInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes glow {
  0%, 100% { box-shadow: 0 0 8px var(--green-5), 0 0 16px var(--green-6); }
  50% { box-shadow: 0 0 12px var(--green-4), 0 0 24px var(--green-5); }
}

@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

@keyframes bounceIn {
  0% { transform: scale(0.3); opacity: 0; }
  50% { transform: scale(1.05); }
  70% { transform: scale(0.9); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes cardDeal {
  from { 
    opacity: 0; 
    transform: translateY(-20px); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0); 
  }
}

/* ===== NEW LOBBY DESIGN ===== */
.lobby {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: var(--size-6);
  color: white;
}

.lobby-hero {
  text-align: center;
  margin-bottom: var(--size-6);
}

.hero-cards {
  font-size: 3rem;
  margin-bottom: var(--size-2);
  display: flex;
  justify-content: center;
  gap: 0;
}

.hero-cards span:first-child {
  transform: rotate(-15deg) translateX(8px);
  display: inline-block;
}

.hero-cards span:last-child {
  transform: rotate(15deg) translateX(-8px);
  display: inline-block;
}

.lobby-hero h1 {
  font-size: var(--font-size-8);
  font-weight: 800;
  margin: 0 0 var(--size-2) 0;
  text-shadow: 2px 3px 0 rgba(0,0,0,0.2);
  letter-spacing: -0.02em;
}

.lobby-hero .tagline {
  font-size: var(--font-size-3);
  opacity: 0.9;
  margin: 0;
  font-weight: 400;
}

.lobby-hero .subtitle {
  font-size: var(--font-size-1);
  opacity: 0.7;
  margin-top: var(--size-2);
  max-width: 400px;
}

.lobby-main {
  width: 100%;
  max-width: 360px;
}

.name-section {
  margin-bottom: var(--size-4);
}

.name-section label {
  display: block;
  font-size: var(--font-size-0);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.7;
  margin-bottom: var(--size-1);
}

.name-section input {
  width: 100%;
  padding: var(--size-3);
  border: none;
  border-radius: var(--radius-2);
  font-size: var(--font-size-2);
  background: rgba(255,255,255,0.15);
  color: white;
  text-align: center;
  font-weight: 500;
}

.name-section input::placeholder {
  color: rgba(255,255,255,0.5);
}

.name-section input:focus {
  outline: none;
  background: rgba(255,255,255,0.25);
}

.play-btn {
  width: 100%;
  padding: var(--size-4);
  font-size: var(--font-size-3);
  font-weight: 700;
  background: white;
  color: var(--felt-dark);
  border: none;
  border-radius: var(--radius-3);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  margin-bottom: var(--size-3);
}

.play-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

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

.secondary-actions {
  display: flex;
  gap: var(--size-2);
}

.secondary-btn {
  flex: 1;
  padding: var(--size-2) var(--size-3);
  font-size: var(--font-size-1);
  font-weight: 500;
  background: rgba(255,255,255,0.1);
  color: white;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-2);
  cursor: pointer;
  transition: background 0.15s;
}

.secondary-btn:hover {
  background: rgba(255,255,255,0.2);
}

.lobby-divider {
  display: flex;
  align-items: center;
  gap: var(--size-3);
  margin: var(--size-5) 0;
  opacity: 0.5;
}

.lobby-divider::before,
.lobby-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: white;
}

.join-section h3 {
  font-size: var(--font-size-1);
  font-weight: 500;
  margin: 0 0 var(--size-2) 0;
  opacity: 0.8;
}

.join-row {
  display: flex;
  gap: var(--size-2);
}

.join-row input {
  flex: 1;
  padding: var(--size-2) var(--size-3);
  border: none;
  border-radius: var(--radius-2);
  font-size: var(--font-size-1);
  background: rgba(255,255,255,0.15);
  color: white;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.join-row input::placeholder {
  color: rgba(255,255,255,0.4);
  text-transform: none;
  letter-spacing: normal;
}

.join-row input:focus {
  outline: none;
  background: rgba(255,255,255,0.25);
}

.join-row button {
  padding: var(--size-2) var(--size-3);
  font-size: var(--font-size-1);
  font-weight: 600;
  background: rgba(255,255,255,0.2);
  color: white;
  border: none;
  border-radius: var(--radius-2);
  cursor: pointer;
  transition: background 0.15s;
}

.join-row button:hover {
  background: rgba(255,255,255,0.3);
}

/* Public games section */
.public-games-section {
  margin-top: var(--size-5);
}

.public-games-section h3 {
  font-size: var(--font-size-1);
  font-weight: 500;
  margin: 0 0 var(--size-2) 0;
  opacity: 0.8;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.public-games-section h3 button {
  background: none;
  border: none;
  color: white;
  opacity: 0.6;
  cursor: pointer;
  font-size: var(--font-size-1);
  padding: var(--size-1);
}

.public-games-section h3 button:hover {
  opacity: 1;
}

.game-list {
  display: flex;
  flex-direction: column;
  gap: var(--size-2);
}

.public-game {
  display: flex;
  align-items: center;
  gap: var(--size-2);
  padding: var(--size-2) var(--size-3);
  background: rgba(255,255,255,0.1);
  border-radius: var(--radius-2);
  cursor: pointer;
  transition: background 0.15s;
}

.public-game:hover {
  background: rgba(255,255,255,0.2);
}

.public-game .game-name {
  flex: 1;
  font-weight: 500;
}

.public-game .game-players {
  font-size: var(--font-size-0);
  opacity: 0.7;
}

.public-game .join-public-btn {
  padding: var(--size-1) var(--size-2);
  font-size: var(--font-size-0);
  font-weight: 600;
  background: white;
  color: var(--felt-dark);
  border: none;
  border-radius: var(--radius-2);
  cursor: pointer;
}

/* Stats pill */
.user-stats {
  display: inline-flex;
  gap: var(--size-3);
  background: rgba(0,0,0,0.2);
  padding: var(--size-1) var(--size-3);
  border-radius: var(--radius-round);
  margin-top: var(--size-4);
  font-size: var(--font-size-0);
}

.user-stats .stat {
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0.8;
}

/* Footer note */
.lobby-footer {
  margin-top: var(--size-6);
  text-align: center;
  font-size: var(--font-size-0);
  opacity: 0.5;
}

.lobby-footer a {
  color: white;
}

/* Options panel */
.options-dropdown {
  margin-top: var(--size-3);
  background: rgba(0,0,0,0.3);
  border-radius: var(--radius-2);
  padding: var(--size-3);
  display: flex;
  flex-direction: column;
  gap: var(--size-2);
}

.options-dropdown label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--font-size-1);
}

.options-dropdown select {
  padding: var(--size-1) var(--size-2);
  border-radius: var(--radius-2);
  border: none;
  background: rgba(255,255,255,0.2);
  color: white;
}

.options-dropdown select option {
  background: var(--gray-8);
  color: white;
}

.options-dropdown input[type="text"] {
  width: 100%;
  padding: var(--size-2);
  border: none;
  border-radius: var(--radius-2);
  background: rgba(255,255,255,0.15);
  color: white;
  font-size: var(--font-size-1);
}

.options-dropdown input[type="text"]::placeholder {
  color: rgba(255,255,255,0.5);
}

.options-dropdown input[type="text"]:focus {
  outline: none;
  background: rgba(255,255,255,0.25);
}

.game-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  padding: var(--size-3);
  gap: var(--size-3);
}

.game-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--size-2) var(--size-3);
  background: linear-gradient(180deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.9) 100%);
  border-radius: var(--radius-3);
  color: var(--gray-9);
  box-shadow: var(--shadow-3);
  backdrop-filter: blur(8px);
}

.trump-indicator {
  display: flex;
  align-items: center;
  gap: var(--size-2);
  font-weight: 600;
}

.trump-indicator > span:first-child {
  background: var(--gold-accent);
  color: var(--gray-9);
  padding: var(--size-1) var(--size-2);
  border-radius: var(--radius-2);
  font-size: var(--font-size-0);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.trump-card-wrapper {
  display: flex;
  align-items: center;
}

.trump-card {
  transform: scale(0.65);
  transform-origin: left center;
  margin: -15px 0 -15px var(--size-1);
}

@media (max-width: 500px) {
  .trump-card {
    transform: scale(0.55);
    margin: -18px 0 -18px 4px;
  }
}

.players-area {
  display: flex;
  justify-content: center;
  gap: var(--size-3);
  flex-wrap: wrap;
}

.player-info {
  background: linear-gradient(180deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.85) 100%);
  padding: var(--size-2) var(--size-3);
  border-radius: var(--radius-3);
  text-align: center;
  color: var(--gray-9);
  min-width: 100px;
  box-shadow: var(--shadow-2);
  transition: transform 0.2s, box-shadow 0.2s;
  border: 2px solid transparent;
}

.player-info:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-3);
}

.player-info.attacker {
  border-color: var(--red-5);
  background: linear-gradient(180deg, rgba(255,235,235,0.95) 0%, rgba(255,220,220,0.9) 100%);
}

.player-info.defender {
  border-color: var(--blue-5);
  background: linear-gradient(180deg, rgba(235,245,255,0.95) 0%, rgba(220,235,255,0.9) 100%);
}

.player-info.is-out {
  opacity: 0.6;
  filter: grayscale(50%);
}

.player-info .player-name {
  font-weight: 600;
  margin-bottom: var(--size-1);
}

.player-info .card-count {
  font-size: var(--font-size-0);
  color: var(--gray-6);
}

.player-info .role-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--font-size-0);
  padding: 2px 8px;
  border-radius: var(--radius-round);
  margin-top: var(--size-1);
}

.player-info.attacker .role-badge {
  background: var(--red-2);
  color: var(--red-9);
}

.player-info.defender .role-badge {
  background: var(--blue-2);
  color: var(--blue-9);
}

.table-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--size-4);
  min-height: 180px;
  position: relative;
}

.table-area::before {
  content: '';
  position: absolute;
  width: 90%;
  max-width: 500px;
  height: 80%;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.1) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.table-cards {
  display: flex;
  gap: var(--size-2);
  flex-wrap: wrap;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.attack-pair {
  position: relative;
  width: calc(var(--card-width) + 25px);
  height: calc(var(--card-height) + 40px);
}

.attack-pair .attack-card {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  transition: transform 0.2s;
}

.attack-pair .attack-card[data-clickable="true"] {
  cursor: pointer;
}

.attack-pair .attack-card[data-clickable="true"]:hover {
  transform: scale(1.05);
  z-index: 3;
}

.attack-pair .attack-card.selected {
  transform: scale(1.08);
  box-shadow: 0 0 0 3px var(--blue-5), 0 8px 16px rgba(0,0,0,0.2);
  z-index: 3;
}

.attack-pair .defense-card {
  position: absolute;
  top: 30px;
  left: 16px;
  z-index: 2;
}

.table-empty-text {
  color: rgba(255,255,255,0.5);
  font-size: var(--font-size-1);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.hand-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--size-3);
  padding: var(--size-3) var(--size-2);
  padding-bottom: env(safe-area-inset-bottom, var(--size-4));
  background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.2) 100%);
  border-radius: var(--radius-4) var(--radius-4) 0 0;
  margin-top: auto;
}

.hand {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 0 var(--size-2);
}

/* Fan cards on mobile for better fit */
@media (max-width: 500px) {
  :root {
    --card-width: 65px;
    --card-height: 94px;
  }
  
  playing-card .card-content {
    padding: 3px;
  }
  
  playing-card .card-corner {
    font-size: 10px;
  }
  
  playing-card .card-center {
    font-size: 22px;
  }
  
  .hand {
    gap: 0;
    max-width: 100%;
    padding: 0 8px;
  }
  
  .hand playing-card {
    margin-left: -18px;
    flex-shrink: 0;
  }
  
  .hand playing-card:first-child {
    margin-left: 0;
  }
  
  .hand playing-card:hover,
  .hand playing-card.selected,
  .hand playing-card.playable:hover {
    z-index: 10;
  }
  
  .game-info {
    flex-wrap: wrap;
    gap: var(--size-2);
  }
  
  .players-area {
    gap: var(--size-2);
  }
  
  .player-info {
    min-width: 80px;
    padding: var(--size-1) var(--size-2);
    font-size: var(--font-size-0);
  }
  
  .actions {
    flex-direction: column;
    width: 100%;
    max-width: 300px;
  }
  
  .actions button {
    width: 100%;
  }
}

/* Very small screens */
@media (max-width: 360px) {
  :root {
    --card-width: 55px;
    --card-height: 79px;
  }
  
  .hand playing-card {
    margin-left: -22px;
  }
  
  playing-card .card-corner {
    font-size: 9px;
  }
  
  playing-card .card-center {
    font-size: 18px;
  }
}

.actions {
  display: flex;
  gap: var(--size-2);
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

.actions button {
  padding: var(--size-2) var(--size-4);
  background: linear-gradient(180deg, var(--gray-6) 0%, var(--gray-8) 100%);
  color: white;
  border: none;
  border-radius: var(--radius-2);
  cursor: pointer;
  font-weight: 600;
  font-size: var(--font-size-1);
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  min-width: 80px;
}

.actions button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.25);
}

.actions button:active {
  transform: translateY(0);
}

.actions button#attackBtn {
  background: linear-gradient(180deg, var(--red-6) 0%, var(--red-8) 100%);
}

.actions button.pickup {
  background: linear-gradient(180deg, var(--orange-6) 0%, var(--orange-8) 100%);
}

.actions button.pass {
  background: linear-gradient(180deg, var(--blue-6) 0%, var(--blue-8) 100%);
}

.actions .hint {
  font-size: var(--font-size-0);
  color: rgba(255,255,255,0.7);
  margin: 0;
  text-align: center;
  max-width: 200px;
}

/* Old text-based card styles removed in favor of image-based cards */

.waiting-room {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  gap: var(--size-4);
  padding: var(--size-4);
}

.waiting-room h2 {
  margin: 0;
  font-size: var(--font-size-5);
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.game-code-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--size-2);
}

.game-code-label {
  font-size: var(--font-size-0);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.8;
}

.game-code {
  font-size: var(--font-size-6);
  font-family: var(--font-mono);
  background: linear-gradient(180deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.9) 100%);
  padding: var(--size-3) var(--size-5);
  border-radius: var(--radius-3);
  color: var(--gray-9);
  box-shadow: var(--shadow-4);
  letter-spacing: 0.1em;
  user-select: all;
  cursor: pointer;
  transition: transform 0.15s;
}

.game-code:hover {
  transform: scale(1.02);
}

.player-list {
  display: flex;
  flex-direction: column;
  gap: var(--size-2);
  align-items: center;
}

.player-list p {
  margin: 0;
  font-size: var(--font-size-1);
  opacity: 0.9;
}



.bot-controls {
  display: flex;
  gap: var(--size-2);
  flex-wrap: wrap;
  justify-content: center;
}

.add-bot-btn {
  padding: var(--size-2) var(--size-3);
  background: linear-gradient(180deg, var(--gray-6) 0%, var(--gray-8) 100%);
  color: white;
  border: none;
  border-radius: var(--radius-2);
  cursor: pointer;
  font-size: var(--font-size-1);
  font-weight: 500;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.add-bot-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.25);
}

.add-bot-btn[data-strategy="aggressive"] {
  background: linear-gradient(180deg, var(--red-6) 0%, var(--red-8) 100%);
}

.add-bot-btn[data-strategy="defensive"] {
  background: linear-gradient(180deg, var(--blue-6) 0%, var(--blue-8) 100%);
}

#startBtn {
  padding: var(--size-3) var(--size-6);
  background: linear-gradient(180deg, var(--green-5) 0%, var(--green-7) 100%);
  color: white;
  border: none;
  border-radius: var(--radius-3);
  cursor: pointer;
  font-size: var(--font-size-3);
  font-weight: 600;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

#startBtn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 6px 12px rgba(0,0,0,0.25);
}

.error-toast {
  position: fixed;
  bottom: var(--size-6);
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(180deg, var(--red-6) 0%, var(--red-8) 100%);
  color: white;
  padding: var(--size-2) var(--size-4);
  border-radius: var(--radius-3);
  box-shadow: var(--shadow-4);
  animation: toastIn 0.3s var(--ease-out-3);
  z-index: 1000;
  font-weight: 500;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(20px) scale(0.9); }
  to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

.game-over {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--size-4);
  z-index: 100;
  animation: fadeIn 0.4s var(--ease-2);
}

.game-over h2 {
  font-size: var(--font-size-8);
  margin: 0;
  animation: bounceIn 0.6s var(--ease-out-3);
}

.game-over p {
  font-size: var(--font-size-4);
  margin: 0;
  animation: fadeIn 0.5s var(--ease-2) 0.3s backwards;
}

.game-over .loser-text {
  font-size: var(--font-size-3);
  color: var(--red-4);
  animation: pulse 1s ease-in-out infinite;
}

.game-over button {
  padding: var(--size-3) var(--size-6);
  background: linear-gradient(180deg, var(--blue-6) 0%, var(--blue-8) 100%);
  color: white;
  border: none;
  border-radius: var(--radius-3);
  cursor: pointer;
  font-size: var(--font-size-2);
  font-weight: 600;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  animation: fadeIn 0.5s var(--ease-2) 0.5s backwards;
}

.game-over button:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 6px 12px rgba(0,0,0,0.35);
}

.deck-area {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--size-1);
}

.deck-stack {
  position: relative;
  width: var(--card-width);
  height: var(--card-height);
}

/* Create stacked deck effect */
.deck-stack playing-card {
  position: absolute;
  top: 0;
  left: 0;
}

.deck-stack::before,
.deck-stack::after {
  content: '';
  position: absolute;
  width: var(--card-width);
  height: var(--card-height);
  background: linear-gradient(135deg, var(--blue-8) 0%, var(--blue-9) 100%);
  border-radius: var(--card-radius);
  border: 1px solid var(--blue-9);
}

.deck-stack::before {
  top: -3px;
  left: -2px;
  opacity: 0.7;
}

.deck-stack::after {
  top: -6px;
  left: -4px;
  opacity: 0.4;
}

.deck-count {
  background: rgba(255,255,255,0.9);
  color: var(--gray-8);
  padding: var(--size-1) var(--size-2);
  border-radius: var(--radius-round);
  font-size: var(--font-size-0);
  font-weight: 600;
  box-shadow: var(--shadow-2);
}

.deck-empty {
  font-size: var(--font-size-0);
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hidden-cards {
  display: flex;
  align-items: center;
  padding: var(--size-2) var(--size-3);
  background: rgba(255,255,255,0.2);
  border-radius: var(--radius-2);
  color: rgba(255,255,255,0.8);
  font-size: var(--font-size-0);
  margin-left: var(--size-2);
}

.hand-options {
  display: flex;
  justify-content: center;
  gap: var(--size-3);
  margin-bottom: var(--size-2);
}

.trump-sort-toggle {
  display: flex;
  align-items: center;
  gap: var(--size-1);
  color: rgba(255,255,255,0.7);
  font-size: var(--font-size-0);
  cursor: pointer;
  user-select: none;
}

.trump-sort-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--orange-6);
}

/* Image-based playing cards using Sofu pack (large in hand, smaller on table) */
/* Base logical size used for layout math (table / trump / deck) */
:root {
  --card-width: 70px;
  --card-height: 102px;
}

.hand {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding: 0 var(--size-2);
}

/* Large, high-res cards in hand with strong overlap */
.hand playing-card {
  display: inline-block;
  width: calc(var(--card-width) * 1.6);
  height: calc(var(--card-height) * 1.6);
  margin-left: -55px;
  position: relative;
  z-index: 1;
}

.hand playing-card:first-child {
  margin-left: 0;
}

/* Bring hovered / selected card to front */
.hand playing-card:hover,
.hand playing-card.selected {
  z-index: 5;
}

.card-image {
  width: 100%;
  height: 100%;
  border-radius: var(--card-radius);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  box-shadow: 0 10px 25px rgba(0,0,0,0.45);
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s, filter 0.15s;
}

/* Hand interactions */
.hand playing-card.selected .card-image {
  transform: translateY(-14px);
  box-shadow: 0 14px 36px rgba(0,0,0,0.6);
}

.hand playing-card.playable .card-image::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 0 2px rgba(34,197,94,0.9) inset;
}

.hand playing-card.dimmed .card-image {
  opacity: 1;
  filter: none;
}

/* Table cards: medium size, non-overlapping */
.table-area .attack-card .card-image,
.table-area .defense-card .card-image {
  width: var(--card-width);
  height: var(--card-height);
  box-shadow: 0 4px 10px rgba(0,0,0,0.35);
}

/* Trump & deck: slightly smaller */
.trump-card .card-image,
.deck-stack playing-card .card-image {
  width: calc(var(--card-width) * 0.8);
  height: calc(var(--card-height) * 0.8);
  box-shadow: 0 3px 8px rgba(0,0,0,0.35);
}

@media (max-width: 600px) {
  :root {
    --card-width: 60px;
    --card-height: 88px;
  }

  .hand playing-card {
    width: calc(var(--card-width) * 1.4);
    height: calc(var(--card-height) * 1.4);
    margin-left: -40px;
  }
}

@media (max-width: 380px) {
  :root {
    --card-width: 55px;
    --card-height: 80px;
  }

  .hand playing-card {
    margin-left: -32px;
  }
}
