.screen {
  min-height: 100vh;
  min-height: 100dvh;
}

/* Join Screen - Medieval Welcome */
.join-container {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background:
    radial-gradient(ellipse at top, rgba(107, 45, 91, 0.3) 0%, transparent 50%),
    radial-gradient(ellipse at bottom, rgba(212, 175, 55, 0.1) 0%, transparent 50%),
    linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 50%, var(--bg-tertiary) 100%);
}

.join-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--gold-light);
  letter-spacing: 0.2em;
  margin-bottom: 0.5rem;
  font-family: 'MedievalSharp', serif;
  text-shadow:
    0 0 20px rgba(212, 175, 55, 0.5),
    2px 2px 0 var(--gold-dark);
}

.join-subtitle {
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-family: 'Cinzel', serif;
}

.join-form {
  width: 100%;
  max-width: 300px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.join-form .input {
  text-align: center;
}

.code-input {
  text-align: center;
  font-size: 2rem;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  font-family: 'MedievalSharp', serif;
}

.code-input::placeholder {
  letter-spacing: 0.1em;
  font-size: 1.2rem;
}

.btn-full {
  width: 100%;
  padding: 1rem;
}

.error-text {
  color: var(--crimson);
  margin-top: 1rem;
  text-align: center;
  font-family: 'Cinzel', serif;
}

/* Lobby Screen */
.lobby-container {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
  background:
    radial-gradient(ellipse at center, rgba(107, 45, 91, 0.2) 0%, transparent 60%),
    linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 50%, var(--bg-tertiary) 100%);
}

.lobby-container h2 {
  font-family: 'MedievalSharp', serif;
  color: var(--gold-light);
  text-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

.room-info {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 2rem;
  font-family: 'Cinzel', serif;
}

.room-info span {
  color: var(--gold-light);
  font-weight: bold;
  font-size: 1.3rem;
  font-family: 'MedievalSharp', serif;
}

.lobby-players {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2rem;
  width: 100%;
  max-width: 300px;
}

.lobby-player-item {
  padding: 1rem;
  background: linear-gradient(145deg, rgba(107, 45, 91, 0.4) 0%, rgba(45, 27, 61, 0.6) 100%);
  border-radius: 8px;
  border: 2px solid rgba(212, 175, 55, 0.3);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Cinzel', serif;
}

.lobby-player-item.me {
  border: 2px solid var(--gold);
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
}

.lobby-player-item .badge {
  font-size: 0.7rem;
  padding: 4px 8px;
  border-radius: 4px;
  margin-left: auto;
  font-family: 'Cinzel', serif;
  font-weight: 700;
  text-transform: uppercase;
}

.lobby-player-item .badge.host {
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 100%);
  color: #1a0a0a;
  border: 1px solid var(--gold-dark);
}

.lobby-player-item .badge.ai {
  background: var(--royal-purple);
  border: 1px solid var(--royal-purple-light);
}

.host-controls {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  max-width: 300px;
  margin-bottom: 1rem;
}

.waiting-message {
  color: var(--text-muted);
  font-style: italic;
  font-family: 'Cinzel', serif;
}

/* Game Screen */
#game-screen {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: env(safe-area-inset-bottom);
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 50%, var(--bg-tertiary) 100%);
}

.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: linear-gradient(180deg, rgba(45, 27, 61, 0.9) 0%, rgba(26, 10, 26, 0.8) 100%);
  border-bottom: 2px solid var(--gold);
  position: sticky;
  top: 0;
  z-index: 100;
}

.turn-status {
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  background: rgba(107, 45, 91, 0.5);
  border: 1px solid var(--border-gold);
  font-family: 'Cinzel', serif;
}

.turn-status.my-turn {
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 100%);
  color: #1a0a0a;
  border: 2px solid var(--gold-dark);
  animation: royalPulse 2s infinite;
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
}

@keyframes royalPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(212, 175, 55, 0.5); }
  50% { box-shadow: 0 0 30px rgba(212, 175, 55, 0.8); }
}

.points-display {
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--gold-light);
  font-family: 'MedievalSharp', serif;
  text-shadow: 0 0 8px rgba(212, 175, 55, 0.4);
}

/* Inline Market (always visible at top) */
.inline-market {
  padding: 0.6rem 0.5rem;
  background: linear-gradient(180deg, rgba(26, 10, 26, 0.6) 0%, rgba(45, 27, 61, 0.4) 100%);
  border-bottom: 1px solid rgba(212, 175, 55, 0.3);
}

.inline-market-tiers {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.inline-tier-row {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.inline-tier-label {
  width: 18px;
  font-size: 0.65rem;
  font-weight: bold;
  color: var(--gold);
  font-family: 'MedievalSharp', serif;
  text-align: center;
}

.inline-tier-cards {
  display: flex;
  gap: 0.35rem;
  flex: 1;
  justify-content: center;
}

.inline-card {
  width: 90px;
  height: 115px;
  background:
    radial-gradient(ellipse at 25% 15%, rgba(212, 175, 55, 0.08) 0%, transparent 50%),
    linear-gradient(160deg, rgba(55, 35, 60, 0.95) 0%, rgba(30, 18, 38, 1) 100%);
  border-radius: 7px;
  border: 2px solid var(--border-gold);
  position: relative;
  flex-shrink: 1;
  min-width: 70px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: all 0.15s;
  overflow: hidden;
}

/* Tier 3 - Gold Background */
.inline-tier-row:nth-child(1) .inline-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(241, 196, 15, 0.15) 0%, rgba(212, 175, 55, 0.1) 50%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

/* Tier 2 - Blue Background */
.inline-tier-row:nth-child(2) .inline-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(52, 152, 219, 0.12) 0%, rgba(41, 128, 185, 0.08) 50%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

/* Tier 1 - Green Background */
.inline-tier-row:nth-child(3) .inline-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(46, 204, 113, 0.2) 0%, rgba(39, 174, 96, 0.15) 50%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

/* Tier 3 - Royalty Portrait */
.inline-tier-row:nth-child(1) .inline-card::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 85px;
  height: 105px;
  background:
    radial-gradient(ellipse 12px 8px at 43% 18%, rgba(241, 196, 15, 1) 0%, transparent 70%),
    radial-gradient(ellipse 8px 6px at 44% 19%, rgba(255, 215, 0, 1) 0%, transparent 60%),
    radial-gradient(ellipse 12px 8px at 57% 18%, rgba(241, 196, 15, 1) 0%, transparent 70%),
    radial-gradient(ellipse 8px 6px at 56% 19%, rgba(255, 215, 0, 1) 0%, transparent 60%),
    radial-gradient(ellipse 10px 7px at 38% 16%, rgba(241, 196, 15, 1) 0%, transparent 70%),
    radial-gradient(ellipse 10px 7px at 62% 16%, rgba(241, 196, 15, 1) 0%, transparent 70%),
    radial-gradient(circle 5px at 43% 19%, rgba(220, 20, 60, 1) 0%, transparent 70%),
    radial-gradient(circle 3px at 43% 19%, rgba(139, 0, 0, 1) 0%, transparent 60%),
    radial-gradient(circle 5px at 57% 19%, rgba(220, 20, 60, 1) 0%, transparent 70%),
    radial-gradient(circle 3px at 57% 19%, rgba(139, 0, 0, 1) 0%, transparent 60%),
    radial-gradient(circle 4px at 50% 17%, rgba(220, 20, 60, 1) 0%, transparent 70%),
    radial-gradient(circle 4px at 38% 17%, rgba(255, 215, 0, 1) 0%, transparent 70%),
    radial-gradient(circle 4px at 62% 17%, rgba(255, 215, 0, 1) 0%, transparent 70%),
    radial-gradient(circle 3px at 35% 18%, rgba(255, 215, 0, 1) 0%, transparent 70%),
    radial-gradient(ellipse 32px 20px at 50% 25%, rgba(101, 67, 33, 0.5) 0%, transparent 65%),
    radial-gradient(ellipse 20px 18px at 38% 27%, rgba(101, 67, 33, 0.6) 0%, transparent 70%),
    radial-gradient(ellipse 20px 18px at 62% 27%, rgba(101, 67, 33, 0.6) 0%, transparent 70%),
    radial-gradient(ellipse 28px 16px at 50% 28%, rgba(101, 67, 33, 0.5) 0%, transparent 70%),
    radial-gradient(ellipse 18px 15px at 50% 24%, rgba(139, 90, 43, 0.4) 0%, transparent 70%),
    radial-gradient(circle 7px at 36% 28%, rgba(255, 223, 0, 1) 0%, transparent 70%),
    radial-gradient(circle 5px at 36% 29%, rgba(184, 134, 11, 1) 0%, transparent 60%),
    radial-gradient(circle 7px at 64% 28%, rgba(255, 223, 0, 1) 0%, transparent 70%),
    radial-gradient(circle 5px at 64% 29%, rgba(184, 134, 11, 1) 0%, transparent 60%),
    radial-gradient(ellipse 22px 26px at 50% 41%, rgba(210, 180, 140, 1) 0%, transparent 75%),
    radial-gradient(ellipse 20px 24px at 50% 42%, rgba(222, 184, 135, 1) 0%, transparent 70%),
    radial-gradient(ellipse 18px 16px at 50% 33%, rgba(245, 222, 179, 1) 0%, transparent 70%),
    radial-gradient(ellipse 16px 12px at 50% 32%, rgba(255, 239, 213, 1) 0%, transparent 65%),
    radial-gradient(ellipse 14px 10px at 48% 38%, rgba(205, 133, 63, 0.3) 0%, transparent 70%),
    radial-gradient(ellipse 14px 10px at 52% 38%, rgba(205, 133, 63, 0.3) 0%, transparent 70%),
    radial-gradient(ellipse 8px 4px at 42% 36%, rgba(101, 67, 33, 0.6) 0%, transparent 70%),
    radial-gradient(ellipse 8px 4px at 58% 36%, rgba(101, 67, 33, 0.6) 0%, transparent 70%),
    radial-gradient(circle 4px at 43% 39%, rgba(70, 50, 30, 1) 0%, rgba(70, 50, 30, 0.5) 30%, transparent 60%),
    radial-gradient(circle 2px at 44% 38%, rgba(255, 255, 255, 0.9) 0%, transparent 50%),
    radial-gradient(circle 4px at 57% 39%, rgba(70, 50, 30, 1) 0%, rgba(70, 50, 30, 0.5) 30%, transparent 60%),
    radial-gradient(circle 2px at 58% 38%, rgba(255, 255, 255, 0.9) 0%, transparent 50%),
    radial-gradient(ellipse 8px 12px at 50% 44%, rgba(210, 180, 140, 1) 0%, transparent 70%),
    radial-gradient(ellipse 6px 10px at 50% 45%, rgba(188, 143, 143, 1) 0%, transparent 70%),
    radial-gradient(circle 2px at 49% 44%, rgba(139, 69, 19, 0.8) 0%, transparent 60%),
    radial-gradient(circle 2px at 51% 44%, rgba(139, 69, 19, 0.8) 0%, transparent 60%),
    radial-gradient(circle 2px at 50% 46%, rgba(139, 69, 19, 0.6) 0%, transparent 60%),
    radial-gradient(ellipse 10px 5px at 50% 49%, rgba(139, 69, 19, 0.7) 0%, transparent 70%),
    radial-gradient(ellipse 8px 4px at 50% 49%, rgba(160, 82, 45, 0.8) 0%, transparent 70%),
    radial-gradient(ellipse 6px 3px at 50% 50%, rgba(205, 92, 92, 0.6) 0%, transparent 70%),
    radial-gradient(ellipse 16px 10px at 50% 54%, rgba(205, 133, 63, 1) 0%, transparent 70%),
    radial-gradient(ellipse 14px 8px at 50% 55%, rgba(210, 180, 140, 1) 0%, transparent 70%),
    radial-gradient(ellipse 20px 14px at 50% 60%, rgba(160, 82, 45, 1) 0%, transparent 75%),
    radial-gradient(ellipse 18px 12px at 50% 61%, rgba(139, 69, 19, 1) 0%, transparent 70%),
    radial-gradient(circle 8px at 50% 58%, rgba(220, 20, 60, 1) 0%, transparent 70%),
    radial-gradient(circle 6px at 50% 58%, rgba(139, 0, 0, 1) 0%, transparent 65%),
    radial-gradient(circle 3px at 50% 58%, rgba(255, 215, 0, 1) 0%, transparent 60%),
    radial-gradient(circle 5px at 44% 60%, rgba(255, 215, 0, 0.8) 0%, transparent 70%),
    radial-gradient(circle 5px at 56% 60%, rgba(255, 215, 0, 0.8) 0%, transparent 70%),
    radial-gradient(circle 4px at 50% 62%, rgba(220, 20, 60, 0.8) 0%, transparent 70%),
    radial-gradient(circle 4px at 38% 61%, rgba(255, 215, 0, 0.7) 0%, transparent 70%),
    radial-gradient(circle 4px at 62% 61%, rgba(255, 215, 0, 0.7) 0%, transparent 70%),
    radial-gradient(ellipse 34px 16px at 50% 65%, rgba(255, 255, 255, 1) 0%, rgba(240, 240, 240, 0.8) 60%, transparent 85%),
    radial-gradient(circle 3px at 42% 65%, rgba(0, 0, 0, 0.8) 0%, transparent 60%),
    radial-gradient(circle 3px at 46% 66%, rgba(0, 0, 0, 0.8) 0%, transparent 60%),
    radial-gradient(circle 3px at 50% 67%, rgba(0, 0, 0, 0.8) 0%, transparent 60%),
    radial-gradient(circle 3px at 54% 66%, rgba(0, 0, 0, 0.8) 0%, transparent 60%),
    radial-gradient(circle 3px at 58% 65%, rgba(0, 0, 0, 0.8) 0%, transparent 60%),
    radial-gradient(circle 2px at 44% 64%, rgba(0, 0, 0, 0.6) 0%, transparent 50%),
    radial-gradient(circle 2px at 56% 64%, rgba(0, 0, 0, 0.6) 0%, transparent 50%),
    radial-gradient(ellipse 36px 22px at 50% 75%, rgba(128, 0, 128, 1) 0%, rgba(75, 0, 130, 0.9) 60%, transparent 85%),
    radial-gradient(ellipse 32px 18px at 50% 76%, rgba(138, 43, 226, 0.8) 0%, transparent 80%),
    radial-gradient(ellipse 28px 14px at 50% 77%, rgba(147, 112, 219, 0.6) 0%, transparent 75%),
    radial-gradient(ellipse 24px 10px at 50% 78%, rgba(186, 85, 211, 0.4) 0%, transparent 70%),
    radial-gradient(ellipse 20px 8px at 50% 79%, rgba(218, 112, 214, 0.3) 0%, transparent 65%),
    radial-gradient(ellipse 14px 6px at 40% 73%, rgba(255, 215, 0, 0.9) 0%, transparent 70%),
    radial-gradient(ellipse 12px 5px at 41% 74%, rgba(218, 165, 32, 0.8) 0%, transparent 65%),
    radial-gradient(ellipse 14px 6px at 60% 73%, rgba(255, 215, 0, 0.9) 0%, transparent 70%),
    radial-gradient(ellipse 12px 5px at 59% 74%, rgba(218, 165, 32, 0.8) 0%, transparent 65%),
    radial-gradient(ellipse 10px 5px at 35% 76%, rgba(255, 215, 0, 0.7) 0%, transparent 70%),
    radial-gradient(ellipse 10px 5px at 65% 76%, rgba(255, 215, 0, 0.7) 0%, transparent 70%),
    radial-gradient(ellipse 8px 4px at 32% 78%, rgba(255, 215, 0, 0.6) 0%, transparent 70%),
    radial-gradient(ellipse 8px 4px at 68% 78%, rgba(255, 215, 0, 0.6) 0%, transparent 70%),
    radial-gradient(circle 8px at 50% 82%, rgba(220, 20, 60, 1) 0%, transparent 70%),
    radial-gradient(circle 5px at 50% 82%, rgba(255, 215, 0, 1) 0%, transparent 60%);
  pointer-events: none;
  z-index: 1;
  opacity: 0.6;
}

/* Tier 2 - Knight Portrait */
.inline-tier-row:nth-child(2) .inline-card::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 85px;
  height: 105px;
  background:
    radial-gradient(ellipse 16px 10px at 50% 18%, rgba(220, 20, 60, 1) 0%, transparent 70%),
    radial-gradient(ellipse 12px 7px at 50% 19%, rgba(139, 0, 0, 0.8) 0%, transparent 65%),
    radial-gradient(ellipse 30px 16px at 50% 23%, rgba(169, 169, 169, 1) 0%, transparent 75%),
    radial-gradient(ellipse 28px 14px at 50% 24%, rgba(192, 192, 192, 1) 0%, transparent 70%),
    radial-gradient(ellipse 24px 12px at 50% 25%, rgba(211, 211, 211, 0.9) 0%, transparent 70%),
    radial-gradient(ellipse 18px 14px at 36% 27%, rgba(169, 169, 169, 1) 0%, transparent 75%),
    radial-gradient(ellipse 18px 14px at 64% 27%, rgba(169, 169, 169, 1) 0%, transparent 75%),
    radial-gradient(ellipse 16px 12px at 36% 28%, rgba(105, 105, 105, 1) 0%, transparent 70%),
    radial-gradient(ellipse 16px 12px at 64% 28%, rgba(105, 105, 105, 1) 0%, transparent 70%),
    radial-gradient(ellipse 20px 18px at 50% 37%, rgba(80, 80, 80, 1) 0%, transparent 75%),
    radial-gradient(ellipse 18px 16px at 50% 38%, rgba(60, 60, 60, 1) 0%, transparent 70%),
    radial-gradient(ellipse 14px 10px at 50% 38%, rgba(40, 40, 40, 0.9) 0%, transparent 65%),
    radial-gradient(ellipse 18px 14px at 50% 42%, rgba(210, 180, 140, 1) 0%, transparent 75%),
    radial-gradient(ellipse 16px 12px at 50% 43%, rgba(222, 184, 135, 1) 0%, transparent 70%),
    radial-gradient(circle 5px at 43% 42%, rgba(41, 128, 185, 1) 0%, rgba(52, 152, 219, 0.8) 40%, transparent 70%),
    radial-gradient(circle 4px at 43% 42%, rgba(135, 206, 250, 1) 0%, transparent 60%),
    radial-gradient(circle 3px at 44% 41%, rgba(173, 216, 230, 1) 0%, transparent 50%),
    radial-gradient(circle 2px at 44% 41%, rgba(240, 248, 255, 1) 0%, transparent 40%),
    radial-gradient(circle 1px at 43.5% 41.5%, rgba(255, 255, 255, 1) 0%, transparent 30%),
    radial-gradient(circle 5px at 57% 42%, rgba(41, 128, 185, 1) 0%, rgba(52, 152, 219, 0.8) 40%, transparent 70%),
    radial-gradient(circle 4px at 57% 42%, rgba(135, 206, 250, 1) 0%, transparent 60%),
    radial-gradient(circle 3px at 56% 41%, rgba(173, 216, 230, 1) 0%, transparent 50%),
    radial-gradient(circle 2px at 56% 41%, rgba(240, 248, 255, 1) 0%, transparent 40%),
    radial-gradient(circle 1px at 56.5% 41.5%, rgba(255, 255, 255, 1) 0%, transparent 30%),
    radial-gradient(ellipse 8px 12px at 50% 46%, rgba(210, 180, 140, 1) 0%, transparent 70%),
    radial-gradient(ellipse 6px 10px at 50% 47%, rgba(188, 143, 143, 1) 0%, transparent 70%),
    radial-gradient(ellipse 14px 8px at 50% 51%, rgba(205, 133, 63, 1) 0%, transparent 70%),
    radial-gradient(ellipse 12px 6px at 50% 52%, rgba(210, 180, 140, 1) 0%, transparent 70%),
    radial-gradient(ellipse 20px 12px at 50% 57%, rgba(169, 169, 169, 1) 0%, transparent 75%),
    radial-gradient(ellipse 18px 10px at 50% 58%, rgba(192, 192, 192, 1) 0%, transparent 70%),
    radial-gradient(ellipse 16px 8px at 50% 59%, rgba(105, 105, 105, 0.9) 0%, transparent 70%),
    radial-gradient(ellipse 30px 18px at 50% 66%, rgba(105, 105, 105, 1) 0%, transparent 80%),
    radial-gradient(ellipse 28px 16px at 50% 67%, rgba(119, 136, 153, 1) 0%, transparent 75%),
    radial-gradient(ellipse 26px 14px at 50% 68%, rgba(169, 169, 169, 0.9) 0%, transparent 70%),
    radial-gradient(ellipse 24px 12px at 50% 69%, rgba(192, 192, 192, 0.8) 0%, transparent 70%),
    radial-gradient(ellipse 22px 10px at 50% 70%, rgba(211, 211, 211, 0.7) 0%, transparent 65%),
    radial-gradient(ellipse 18px 14px at 38% 67%, rgba(128, 128, 128, 1) 0%, transparent 75%),
    radial-gradient(ellipse 18px 14px at 62% 67%, rgba(128, 128, 128, 1) 0%, transparent 75%),
    radial-gradient(circle 4px at 40% 64%, rgba(169, 169, 169, 1) 0%, transparent 70%),
    radial-gradient(circle 4px at 45% 66%, rgba(169, 169, 169, 1) 0%, transparent 70%),
    radial-gradient(circle 4px at 50% 67%, rgba(169, 169, 169, 1) 0%, transparent 70%),
    radial-gradient(circle 4px at 55% 66%, rgba(169, 169, 169, 1) 0%, transparent 70%),
    radial-gradient(circle 4px at 60% 64%, rgba(169, 169, 169, 1) 0%, transparent 70%),
    radial-gradient(circle 3px at 42% 70%, rgba(169, 169, 169, 1) 0%, transparent 70%),
    radial-gradient(circle 3px at 58% 70%, rgba(169, 169, 169, 1) 0%, transparent 70%),
    radial-gradient(ellipse 16px 10px at 50% 78%, rgba(139, 69, 19, 1) 0%, transparent 75%),
    radial-gradient(ellipse 14px 8px at 50% 79%, rgba(160, 82, 45, 1) 0%, transparent 70%),
    radial-gradient(circle 6px at 50% 78%, rgba(218, 165, 32, 1) 0%, transparent 65%);
  pointer-events: none;
  z-index: 1;
  opacity: 0.55;
}

/* Tier 1 - Merchant Portrait */
.inline-tier-row:nth-child(3) .inline-card::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 85px;
  height: 105px;
  background:
    radial-gradient(ellipse 32px 20px at 50% 24%, rgba(101, 67, 33, 0.5) 0%, transparent 65%),
    radial-gradient(ellipse 20px 18px at 38% 26%, rgba(101, 67, 33, 0.6) 0%, transparent 70%),
    radial-gradient(ellipse 20px 18px at 62% 26%, rgba(101, 67, 33, 0.6) 0%, transparent 70%),
    radial-gradient(ellipse 28px 16px at 50% 27%, rgba(139, 90, 43, 0.5) 0%, transparent 70%),
    radial-gradient(ellipse 7px 10px at 34% 40%, rgba(210, 180, 140, 0.3) 0%, transparent 70%),
    radial-gradient(ellipse 6px 8px at 34% 41%, rgba(222, 184, 135, 0.4) 0%, transparent 65%),
    radial-gradient(ellipse 7px 10px at 66% 40%, rgba(210, 180, 140, 0.3) 0%, transparent 70%),
    radial-gradient(ellipse 6px 8px at 66% 41%, rgba(222, 184, 135, 0.4) 0%, transparent 65%),
    radial-gradient(ellipse 24px 28px at 50% 43%, rgba(210, 180, 140, 1) 0%, transparent 75%),
    radial-gradient(ellipse 22px 26px at 50% 44%, rgba(222, 184, 135, 1) 0%, transparent 70%),
    radial-gradient(ellipse 20px 24px at 50% 45%, rgba(245, 222, 179, 0.9) 0%, transparent 70%),
    radial-gradient(ellipse 18px 16px at 50% 36%, rgba(245, 222, 179, 1) 0%, transparent 70%),
    radial-gradient(ellipse 16px 12px at 50% 35%, rgba(255, 239, 213, 1) 0%, transparent 65%),
    radial-gradient(ellipse 8px 4px at 42% 38%, rgba(101, 67, 33, 0.6) 0%, transparent 70%),
    radial-gradient(ellipse 8px 4px at 58% 38%, rgba(101, 67, 33, 0.6) 0%, transparent 70%),
    radial-gradient(circle 4px at 43% 41%, rgba(70, 50, 30, 1) 0%, rgba(70, 50, 30, 0.5) 30%, transparent 60%),
    radial-gradient(circle 2px at 44% 40%, rgba(255, 255, 255, 0.9) 0%, transparent 50%),
    radial-gradient(circle 4px at 57% 41%, rgba(70, 50, 30, 1) 0%, rgba(70, 50, 30, 0.5) 30%, transparent 60%),
    radial-gradient(circle 2px at 58% 40%, rgba(255, 255, 255, 0.9) 0%, transparent 50%),
    radial-gradient(ellipse 8px 12px at 50% 46%, rgba(210, 180, 140, 1) 0%, transparent 70%),
    radial-gradient(ellipse 6px 10px at 50% 47%, rgba(188, 143, 143, 1) 0%, transparent 70%),
    radial-gradient(circle 2px at 49% 46%, rgba(139, 69, 19, 0.8) 0%, transparent 60%),
    radial-gradient(circle 2px at 51% 46%, rgba(139, 69, 19, 0.8) 0%, transparent 60%),
    radial-gradient(circle 2px at 50% 48%, rgba(139, 69, 19, 0.6) 0%, transparent 60%),
    radial-gradient(ellipse 10px 5px at 50% 52%, rgba(139, 69, 19, 0.7) 0%, transparent 70%),
    radial-gradient(ellipse 8px 4px at 50% 52%, rgba(160, 82, 45, 0.8) 0%, transparent 70%),
    radial-gradient(ellipse 6px 3px at 50% 53%, rgba(205, 92, 92, 0.6) 0%, transparent 70%),
    radial-gradient(ellipse 16px 10px at 50% 57%, rgba(205, 133, 63, 1) 0%, transparent 70%),
    radial-gradient(ellipse 14px 8px at 50% 58%, rgba(210, 180, 140, 1) 0%, transparent 70%),
    radial-gradient(ellipse 20px 14px at 50% 63%, rgba(160, 82, 45, 1) 0%, transparent 75%),
    radial-gradient(ellipse 18px 12px at 50% 64%, rgba(139, 69, 19, 1) 0%, transparent 70%),
    radial-gradient(ellipse 24px 14px at 50% 69%, rgba(139, 69, 19, 1) 0%, transparent 75%),
    radial-gradient(ellipse 22px 12px at 50% 70%, rgba(160, 82, 45, 1) 0%, transparent 70%),
    radial-gradient(ellipse 20px 10px at 50% 71%, rgba(101, 67, 33, 0.9) 0%, transparent 70%),
    radial-gradient(ellipse 28px 16px at 50% 76%, rgba(101, 67, 33, 1) 0%, transparent 80%),
    radial-gradient(ellipse 26px 14px at 50% 77%, rgba(139, 69, 19, 1) 0%, transparent 75%),
    radial-gradient(ellipse 24px 12px at 50% 78%, rgba(160, 82, 45, 0.9) 0%, transparent 70%),
    radial-gradient(ellipse 14px 10px at 38% 77%, rgba(46, 204, 113, 0.4) 0%, transparent 70%),
    radial-gradient(ellipse 14px 10px at 62% 77%, rgba(46, 204, 113, 0.4) 0%, transparent 70%),
    radial-gradient(circle 6px at 50% 82%, rgba(139, 69, 19, 1) 0%, transparent 70%),
    radial-gradient(circle 4px at 50% 82%, rgba(218, 165, 32, 1) 0%, transparent 65%);
  pointer-events: none;
  z-index: 1;
  opacity: 0.5;
}

.inline-card.affordable {
  border-color: #2ecc71;
  box-shadow: 0 0 10px rgba(46, 204, 113, 0.5), 0 2px 6px rgba(0, 0, 0, 0.3);
}

.inline-card:active {
  transform: scale(0.95);
}

.inline-card.empty {
  background: rgba(30, 20, 40, 0.3);
  border-style: dashed;
  border-color: rgba(212, 175, 55, 0.2);
}

.inline-card .points {
  position: absolute;
  top: 5px;
  left: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.85rem;
  color: var(--gold-light);
  text-shadow: 0 0 6px rgba(212, 175, 55, 0.5), 1px 1px 2px rgba(0, 0, 0, 0.8);
  z-index: 1;
}

.inline-card .points.zero {
  display: none;
}

.inline-card .bonus {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(212, 175, 55, 0.5);
  z-index: 1;
}

/* Unique gem shapes for inline card bonus */
.inline-card .bonus.gem-diamond {
  border-radius: 4px;
  transform: rotate(45deg);
}
.inline-card .bonus.gem-sapphire {
  border-radius: 50% / 40%;
}
.inline-card .bonus.gem-emerald {
  clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
  border: none;
}
.inline-card .bonus.gem-ruby {
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
}
.inline-card .bonus.gem-onyx {
  clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
  border: none;
}

.inline-card .cost {
  position: absolute;
  bottom: 5px;
  left: 5px;
  right: 5px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  z-index: 1;
}

.inline-card .cost-item {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: bold;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  box-shadow:
    inset 0 -2px 4px rgba(0, 0, 0, 0.3),
    inset 0 2px 4px rgba(255, 255, 255, 0.2);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5);
}

/* Distinct gem shapes for cost items */
.cost-item.gem-diamond {
  border-radius: 3px;
  transform: rotate(45deg);
  border-color: rgba(200, 200, 200, 0.6);
}
.cost-item.gem-diamond .gem-count {
  display: inline-block;
  transform: rotate(-45deg);
}

.cost-item.gem-sapphire {
  border-radius: 50% / 35%;
  border-color: rgba(100, 149, 237, 0.6);
}

.cost-item.gem-emerald {
  clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
  border: none;
}

.cost-item.gem-ruby {
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  border-color: rgba(255, 100, 100, 0.5);
}

.cost-item.gem-onyx {
  clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
  border: none;
}

.cost-item.gem-gold {
  border-radius: 50%;
  border-color: rgba(255, 215, 0, 0.6);
}

/* Combined Resources (gems + bonuses in one row) */
.combined-resources {
  padding: 0.75rem 0.5rem;
  background: linear-gradient(180deg, rgba(45, 27, 61, 0.3) 0%, rgba(26, 10, 26, 0.4) 100%);
}

.resource-circles {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  max-width: 280px;
  margin: 0 auto;
}

.resource-circle {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.5rem;
  border: 2px solid var(--gold);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  position: relative;
}

.resource-circle.empty {
  opacity: 0.35;
  filter: grayscale(40%);
}

.resource-circle .total {
  font-size: 1.6rem;
  font-weight: bold;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Gem count indicator (bottom-left) */
/* Gem indicator - diamond shape showing held gem tokens */
.resource-circle .gem-indicator {
  position: absolute;
  bottom: -8px;
  left: -8px;
  width: 20px;
  height: 20px;
  border-radius: 3px;
  background: linear-gradient(135deg, rgba(60, 60, 70, 0.95) 0%, rgba(40, 40, 50, 0.95) 100%);
  border: 1.5px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: bold;
  color: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  transform: rotate(45deg);
  z-index: 5;
}

.resource-circle .gem-indicator span {
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Card count indicator (top-left) */
.resource-circle .card-indicator {
  position: absolute;
  top: -6px;
  left: -6px;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: linear-gradient(135deg, rgba(107, 45, 91, 0.95) 0%, rgba(70, 30, 60, 0.95) 100%);
  border: 1.5px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: bold;
  color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* Gold gem special styling */
.resource-circle.gold-gem {
  border-color: #f1c40f;
}

.resource-circle.gold-gem .gem-indicator {
  border-color: #f1c40f;
}

/* Clickable gem circles for selection */
.resource-circle.clickable {
  cursor: pointer;
  transition: all 0.15s ease;
}

.resource-circle.clickable:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 15px rgba(212, 175, 55, 0.3);
}

.resource-circle.clickable:active {
  transform: scale(0.95);
}

/* Selected state for gem circles */
.resource-circle.selected {
  border-color: #f1c40f;
  box-shadow: 0 0 0 3px rgba(241, 196, 15, 0.5), 0 4px 12px rgba(0, 0, 0, 0.4);
  opacity: 1 !important;
  filter: none !important;
}

/* Yellow selection badge - diamond shape */
.resource-circle .selection-badge {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 26px;
  height: 26px;
  border-radius: 4px;
  background: linear-gradient(135deg, #f1c40f 0%, #d4af37 100%);
  border: 2px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: bold;
  color: #1a0a0a;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  z-index: 10;
  transform: rotate(45deg);
}

.resource-circle .selection-badge span {
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Bank count indicator (shows available gems) */
.resource-circle .bank-count {
  position: absolute;
  bottom: -8px;
  right: -8px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(60, 60, 70, 0.95) 0%, rgba(40, 40, 50, 0.95) 100%);
  border: 1.5px solid rgba(212, 175, 55, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: bold;
  color: rgba(255, 255, 255, 0.7);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* Reserved Section - Compact */
.reserved-section.compact {
  padding: 0.5rem;
  margin-bottom: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.reserved-section.compact h3 {
  font-size: 0.75rem;
  margin-bottom: 0.35rem;
}

.reserved-section.compact .reserved-cards {
  gap: 0.5rem;
  justify-content: center;
}

/* Smaller reserved cards */
.reserved-card-small {
  width: 60px;
  height: 75px;
  background:
    radial-gradient(ellipse at 25% 15%, rgba(212, 175, 55, 0.08) 0%, transparent 50%),
    linear-gradient(160deg, rgba(55, 35, 60, 0.95) 0%, rgba(30, 18, 38, 1) 100%);
  border-radius: 5px;
  border: 2px solid var(--border-gold);
  position: relative;
  flex-shrink: 0;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.reserved-card-small.affordable {
  border-color: #2ecc71;
  box-shadow: 0 0 8px rgba(46, 204, 113, 0.4);
}

.reserved-card-small.empty {
  border: 2px dashed rgba(212, 175, 55, 0.25);
  background: rgba(30, 20, 40, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.6rem;
  font-family: 'Cinzel', serif;
  cursor: default;
}

.reserved-card-small .points {
  position: absolute;
  top: 2px;
  left: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.55rem;
  color: var(--gold-light);
  text-shadow: 0 0 4px rgba(212, 175, 55, 0.5), 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.reserved-card-small .points.zero {
  display: none;
}

.reserved-card-small .bonus {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid rgba(212, 175, 55, 0.5);
}

/* Unique gem shapes for reserved card bonus */
.reserved-card-small .bonus.gem-diamond {
  border-radius: 3px;
  transform: rotate(45deg);
}
.reserved-card-small .bonus.gem-sapphire {
  border-radius: 50% / 40%;
}
.reserved-card-small .bonus.gem-emerald {
  clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
  border: none;
}
.reserved-card-small .bonus.gem-ruby {
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
}
.reserved-card-small .bonus.gem-onyx {
  clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
  border: none;
}

.reserved-card-small .cost {
  position: absolute;
  bottom: 2px;
  left: 2px;
  right: 2px;
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
}

.reserved-card-small .cost-item {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.5rem;
  font-weight: bold;
  border: 1px solid rgba(212, 175, 55, 0.3);
}

/* Reserved Section */
.reserved-section {
  padding: 0 1rem;
  margin-bottom: 1rem;
}

.reserved-section h3 {
  font-size: 0.85rem;
  color: var(--gold);
  text-transform: uppercase;

/* Tier 1 - Merchant/Common Folk Portrait (Mobile - Green Background) */
.tier-row:nth-child(3) .market-card-small::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    linear-gradient(135deg, rgba(46, 204, 113, 0.1) 0%, rgba(39, 174, 96, 0.06) 50%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

.tier-row:nth-child(3) .market-card-small::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 54px;
  background:
    /* Hair/Head */
    radial-gradient(ellipse 16px 11px at 50% 22%, rgba(101, 67, 33, 0.25) 0%, transparent 65%),
    radial-gradient(ellipse 13px 9px at 50% 20%, rgba(139, 69, 19, 0.2) 0%, transparent 70%),
    /* Face */
    radial-gradient(ellipse 15px 19px at 50% 38%, rgba(210, 180, 140, 0.18) 0%, transparent 70%),
    /* Neck */
    radial-gradient(ellipse 11px 9px at 50% 52%, rgba(210, 180, 140, 0.15) 0%, transparent 65%),
    /* Tunic/Shirt */
    radial-gradient(ellipse 23px 17px at 50% 70%, rgba(46, 204, 113, 0.2) 0%, transparent 70%),
    /* Arms/Shoulders */
    radial-gradient(ellipse 27px 15px at 50% 68%, rgba(39, 174, 96, 0.15) 0%, transparent 70%),
    /* Eyes */
    radial-gradient(circle 1.2px at 42% 35%, rgba(60, 40, 20, 0.3) 0%, transparent 70%),
    radial-gradient(circle 1.2px at 58% 35%, rgba(60, 40, 20, 0.3) 0%, transparent 70%),
    /* Nose */
    radial-gradient(ellipse 2.5px 3.5px at 50% 42%, rgba(180, 150, 120, 0.12) 0%, transparent 70%),
    /* Belt/Details */
    radial-gradient(ellipse 18px 5px at 50% 62%, rgba(101, 67, 33, 0.15) 0%, transparent 70%);
  opacity: 0.5;
  z-index: 0;
  pointer-events: none;
}

/* Tier 2 - Noble/Knight Portrait (Mobile - Blue Background) */
.tier-row:nth-child(2) .market-card-small::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    linear-gradient(135deg, rgba(52, 152, 219, 0.12) 0%, rgba(41, 128, 185, 0.08) 50%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

.tier-row:nth-child(2) .market-card-small::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 58px;
  background:
    /* Helmet/Crown Top */
    radial-gradient(ellipse 14px 8px at 50% 16%, rgba(192, 192, 192, 0.25) 0%, transparent 70%),
    radial-gradient(ellipse 11px 6px at 50% 15%, rgba(212, 175, 55, 0.2) 0%, transparent 65%),
    /* Helmet Visor Area */
    radial-gradient(ellipse 16px 11px at 50% 28%, rgba(169, 169, 169, 0.2) 0%, transparent 70%),
    /* Face/Neck Opening */
    radial-gradient(ellipse 13px 15px at 50% 38%, rgba(210, 180, 140, 0.15) 0%, transparent 70%),
    /* Gorget (neck armor) */
    radial-gradient(ellipse 17px 7px at 50% 48%, rgba(192, 192, 192, 0.18) 0%, transparent 65%),
    /* Chest Armor/Breastplate */
    radial-gradient(ellipse 25px 19px at 50% 70%, rgba(52, 152, 219, 0.22) 0%, transparent 70%),
    radial-gradient(ellipse 23px 17px at 50% 68%, rgba(169, 169, 169, 0.15) 0%, transparent 70%),
    /* Shoulder Guards */
    radial-gradient(ellipse 29px 13px at 50% 58%, rgba(192, 192, 192, 0.12) 0%, transparent 70%),
    /* Eyes */
    radial-gradient(circle 1.5px at 43% 36%, rgba(52, 152, 219, 0.35) 0%, transparent 70%),
    radial-gradient(circle 1.5px at 57% 36%, rgba(52, 152, 219, 0.35) 0%, transparent 70%),
    /* Armor Details/Rivets */
    radial-gradient(circle 1.2px at 50% 62%, rgba(212, 175, 55, 0.15) 0%, transparent 70%),
    radial-gradient(circle 1px at 40% 70%, rgba(192, 192, 192, 0.15) 0%, transparent 70%),
    radial-gradient(circle 1px at 60% 70%, rgba(192, 192, 192, 0.15) 0%, transparent 70%);
  opacity: 0.55;
  z-index: 0;
  pointer-events: none;
}

/* Tier 3 - Royalty Portrait (Mobile - Gold Background) */
.tier-row:nth-child(1) .market-card-small::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    linear-gradient(135deg, rgba(241, 196, 15, 0.15) 0%, rgba(212, 175, 55, 0.1) 50%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

.tier-row:nth-child(1) .market-card-small::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 52px;
  height: 62px;
  background:
    /* Crown Top */
    radial-gradient(ellipse 18px 10px at 50% 13%, rgba(241, 196, 15, 0.28) 0%, transparent 70%),
    radial-gradient(ellipse 16px 7px at 50% 12%, rgba(255, 215, 0, 0.22) 0%, transparent 65%),
    /* Crown Jewels */
    radial-gradient(circle 2px at 38% 10%, rgba(231, 76, 60, 0.45) 0%, transparent 70%),
    radial-gradient(circle 2px at 50% 8%, rgba(46, 204, 113, 0.4) 0%, transparent 70%),
    radial-gradient(circle 2px at 62% 10%, rgba(52, 152, 219, 0.45) 0%, transparent 70%),
    radial-gradient(circle 1.2px at 44% 11%, rgba(138, 43, 226, 0.35) 0%, transparent 70%),
    radial-gradient(circle 1.2px at 56% 11%, rgba(138, 43, 226, 0.35) 0%, transparent 70%),
    /* Hair */
    radial-gradient(ellipse 19px 15px at 50% 25%, rgba(139, 69, 19, 0.2) 0%, transparent 70%),
    radial-gradient(ellipse 17px 12px at 45% 24%, rgba(101, 67, 33, 0.18) 0%, transparent 70%),
    radial-gradient(ellipse 17px 12px at 55% 24%, rgba(101, 67, 33, 0.18) 0%, transparent 70%),
    /* Face */
    radial-gradient(ellipse 17px 22px at 50% 42%, rgba(210, 180, 140, 0.2) 0%, transparent 70%),
    /* Neck */
    radial-gradient(ellipse 12px 11px at 50% 56%, rgba(210, 180, 140, 0.16) 0%, transparent 65%),
    /* Royal Necklace */
    radial-gradient(ellipse 19px 6px at 50% 58%, rgba(241, 196, 15, 0.25) 0%, transparent 70%),
    radial-gradient(circle 1.5px at 50% 58%, rgba(46, 204, 113, 0.4) 0%, transparent 70%),
    /* Royal Robe */
    radial-gradient(ellipse 29px 23px at 50% 78%, rgba(107, 45, 91, 0.25) 0%, transparent 70%),
    radial-gradient(ellipse 26px 20px at 50% 76%, rgba(138, 43, 226, 0.18) 0%, transparent 70%),
    /* Shoulders/Ermine Trim */
    radial-gradient(ellipse 31px 17px at 50% 68%, rgba(255, 255, 255, 0.12) 0%, transparent 70%),
    /* Eyes */
    radial-gradient(circle 1.5px at 43% 40%, rgba(60, 40, 20, 0.35) 0%, transparent 70%),
    radial-gradient(circle 1.5px at 57% 40%, rgba(60, 40, 20, 0.35) 0%, transparent 70%),
    /* Nose */
    radial-gradient(ellipse 3px 5px at 50% 46%, rgba(180, 150, 120, 0.15) 0%, transparent 70%),
    /* Golden Details on Robe */
    radial-gradient(circle 1.2px at 50% 70%, rgba(241, 196, 15, 0.2) 0%, transparent 70%),
    radial-gradient(circle 1px at 42% 74%, rgba(212, 175, 55, 0.18) 0%, transparent 70%),
    radial-gradient(circle 1px at 58% 74%, rgba(212, 175, 55, 0.18) 0%, transparent 70%);
  opacity: 0.6;
  z-index: 0;
  pointer-events: none;
}
  letter-spacing: 0.15em;
  margin-bottom: 0.5rem;
  font-family: 'Cinzel', serif;
}

.reserved-section h3 span {
  color: var(--text-muted);
}

.reserved-cards {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.reserved-card {
  min-width: 100px;
  height: 130px;
  background: linear-gradient(145deg, rgba(244, 228, 188, 0.1) 0%, rgba(30, 20, 40, 0.9) 100%);
  border-radius: 8px;
  padding: 0.5rem;
  position: relative;
  flex-shrink: 0;
  border: 2px solid var(--border-gold);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.reserved-card.empty {
  border: 2px dashed rgba(212, 175, 55, 0.3);
  background: rgba(30, 20, 40, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-family: 'Cinzel', serif;
}

/* Action Buttons - Medieval Emblems */
.actions-section {
  display: flex;
  padding: 1rem;
  background: linear-gradient(180deg, rgba(26, 10, 26, 0.8) 0%, rgba(45, 27, 61, 0.9) 100%);
  border-top: 2px solid var(--gold);
  margin-top: auto;
  position: sticky;
  bottom: 0;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  background: linear-gradient(145deg, rgba(107, 45, 91, 0.5) 0%, rgba(45, 27, 61, 0.7) 100%);
  border: 2px solid var(--border-gold);
  border-radius: 8px;
  color: var(--text-light);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Cinzel', serif;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.action-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(30%);
}

.action-btn:not(:disabled):active {
  transform: scale(0.95);
  background: linear-gradient(145deg, rgba(212, 175, 55, 0.3) 0%, rgba(107, 45, 91, 0.6) 100%);
  border-color: var(--gold);
  box-shadow:
    inset 0 0 15px rgba(212, 175, 55, 0.2),
    0 0 15px rgba(212, 175, 55, 0.3);
}

.action-icon {
  font-size: 1.5rem;
}

/* End Turn Button - Full width */
.end-turn-btn {
  width: 100%;
  flex-direction: row;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  justify-content: center;
  background: linear-gradient(145deg, rgba(46, 204, 113, 0.4) 0%, rgba(39, 174, 96, 0.5) 100%);
  border-color: #2ecc71;
}

.end-turn-btn:not(:disabled):hover {
  background: linear-gradient(145deg, rgba(46, 204, 113, 0.5) 0%, rgba(39, 174, 96, 0.6) 100%);
  box-shadow: 0 0 20px rgba(46, 204, 113, 0.4);
}

.end-turn-btn .action-icon {
  font-size: 1.1rem;
}

/* Modals */
.modal {
  width: 90%;
  max-width: 400px;
}

.modal-large {
  max-width: 95vw;
  width: 380px;
  max-height: 95vh;
  overflow-y: auto;
  padding: 1rem 1.25rem 0.75rem;
}

.modal-large h2 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
}

.modal-hint {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-bottom: 1rem;
  font-family: 'Cinzel', serif;
  text-align: center;
}

.gem-selection {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.gem-select-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 3px solid var(--gold);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.gem-select-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  filter: grayscale(50%);
}

.gem-select-btn.selected {
  border-color: var(--gold-light);
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.6);
  animation: gemGlow 1.5s ease-in-out infinite;
}

.gem-select-btn .count-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 22px;
  height: 22px;
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 100%);
  color: #1a0a0a;
  border-radius: 50%;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--gold-dark);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
}

.modal-summary {
  text-align: center;
  margin-bottom: 1rem;
  color: var(--text-muted);
  font-family: 'Cinzel', serif;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 0.75rem;
}

.modal-large .modal-actions {
  margin-top: 0.5rem;
}

.modal-large .modal-actions .btn {
  padding: 0.5rem 1.25rem;
  font-size: 0.85rem;
}

/* Reserve/Purchase Market */
.reserve-market {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tier-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.tier-label {
  width: 24px;
  text-align: center;
  color: var(--gold);
  font-weight: bold;
  font-family: 'MedievalSharp', serif;
  font-size: 0.9rem;
  text-shadow: 0 0 5px rgba(212, 175, 55, 0.3);
}

.tier-cards {
  display: flex;
  gap: 0.5rem;
  flex: 1;
  justify-content: center;
}

.market-card-small {
  width: 76px;
  height: 95px;
  background:
    radial-gradient(ellipse at 25% 15%, rgba(212, 175, 55, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 75% 85%, rgba(107, 45, 91, 0.2) 0%, transparent 50%),
    linear-gradient(160deg,
      rgba(55, 35, 60, 0.95) 0%,
      rgba(40, 25, 50, 0.97) 40%,
      rgba(30, 18, 38, 1) 100%);
  border-radius: 6px;
  padding: 0.35rem;
  position: relative;
  cursor: pointer;
  border: 2px solid var(--border-gold);
  flex-shrink: 0;
  transition: all 0.15s;
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    inset 0 0 20px rgba(212, 175, 55, 0.05);
  overflow: hidden;
}

.market-card-small:active {
  border-color: var(--gold-light);
  transform: scale(0.96);
  box-shadow:
    0 0 12px rgba(212, 175, 55, 0.5),
    inset 0 0 15px rgba(212, 175, 55, 0.1);
}

.market-card-small.affordable {
  border-color: #2ecc71;
  box-shadow:
    0 0 8px rgba(46, 204, 113, 0.4),
    inset 0 0 10px rgba(46, 204, 113, 0.1);
}

.market-card-small.empty {
  background: rgba(30, 20, 40, 0.3);
  border-style: dashed;
  border-color: rgba(212, 175, 55, 0.2);
  cursor: default;
  box-shadow: none;
}

.market-card-small .points {
  position: absolute;
  top: 3px;
  left: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.7rem;
  color: var(--gold-light);
  text-shadow: 0 0 5px rgba(212, 175, 55, 0.5), 1px 1px 2px rgba(0, 0, 0, 0.8);
  z-index: 1;
}

.market-card-small .points.zero {
  display: none;
}

.market-card-small .bonus {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(212, 175, 55, 0.6);
  box-shadow:
    inset 0 0 4px rgba(0, 0, 0, 0.3),
    0 1px 2px rgba(0, 0, 0, 0.3);
  z-index: 1;
}

/* Unique gem shapes for market card bonus */
.market-card-small .bonus.gem-diamond {
  border-radius: 3px;
  transform: rotate(45deg);
}
.market-card-small .bonus.gem-sapphire {
  border-radius: 50% / 40%;
}
.market-card-small .bonus.gem-emerald {
  clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
  border: none;
}
.market-card-small .bonus.gem-ruby {
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
}
.market-card-small .bonus.gem-onyx {
  clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
  border: none;
}

.market-card-small .cost {
  z-index: 1;
  position: absolute;
  bottom: 3px;
  left: 3px;
  right: 3px;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

.market-card-small .cost-item {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: bold;
  border: 1px solid rgba(212, 175, 55, 0.4);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.purchase-section {
  margin-bottom: 1.5rem;
}

.purchase-section h3 {
  font-size: 0.9rem;
  color: var(--gold);
  margin-bottom: 0.75rem;
  font-family: 'Cinzel', serif;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.card-grid {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Game Over */
#game-over-content {
  text-align: center;
}

.winner-name {
  font-size: 1.5rem;
  color: var(--gold-light);
  font-weight: bold;
  font-family: 'MedievalSharp', serif;
  text-shadow: 0 0 15px rgba(212, 175, 55, 0.5);
}

/* Card Selection Modal */
.card-select-modal {
  width: 90%;
  max-width: 320px;
  padding: 1.25rem;
  text-align: center;
}

.selected-card-preview {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.preview-card {
  width: 100px;
  height: 130px;
  background:
    radial-gradient(ellipse at 25% 15%, rgba(212, 175, 55, 0.1) 0%, transparent 50%),
    linear-gradient(160deg, rgba(55, 35, 60, 0.95) 0%, rgba(30, 18, 38, 1) 100%);
  border-radius: 8px;
  border: 3px solid var(--gold);
  position: relative;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5), 0 0 20px rgba(212, 175, 55, 0.2);
}

.preview-card .points {
  position: absolute;
  top: 6px;
  left: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1rem;
  color: var(--gold-light);
  text-shadow: 0 0 6px rgba(212, 175, 55, 0.5), 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.preview-card .points.zero {
  display: none;
}

.preview-card .bonus {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(212, 175, 55, 0.6);
}

/* Unique gem shapes for preview card bonus */
.preview-card .bonus.gem-diamond {
  border-radius: 4px;
  transform: rotate(45deg);
}
.preview-card .bonus.gem-sapphire {
  border-radius: 50% / 40%;
}
.preview-card .bonus.gem-emerald {
  clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
  border: none;
}
.preview-card .bonus.gem-ruby {
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
}
.preview-card .bonus.gem-onyx {
  clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
  border: none;
}

.preview-card .cost {
  position: absolute;
  bottom: 6px;
  left: 6px;
  right: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.preview-card .cost-item {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: bold;
  border: 1.5px solid rgba(212, 175, 55, 0.4);
}

.card-actions-info {
  margin-bottom: 1rem;
  min-height: 50px;
}

.afford-status {
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.afford-status.can-afford {
  color: #2ecc71;
}

.afford-status.cannot-afford {
  color: var(--crimson);
}

.missing-gems {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.missing-gem {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  background: rgba(231, 76, 60, 0.2);
  border: 1px solid rgba(231, 76, 60, 0.4);
  border-radius: 4px;
  font-size: 0.75rem;
  font-family: 'Cinzel', serif;
}

.missing-gem .gem-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.reserve-status {
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.reserve-status.full {
  color: var(--crimson);
}

.card-action-buttons {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.btn-action {
  flex: 1;
  max-width: 120px;
  padding: 0.75rem 1rem;
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-buy {
  background: linear-gradient(145deg, #27ae60 0%, #1e8449 100%);
  border: 2px solid #2ecc71;
  color: #fff;
}

.btn-buy:not(:disabled):hover {
  background: linear-gradient(145deg, #2ecc71 0%, #27ae60 100%);
  box-shadow: 0 0 15px rgba(46, 204, 113, 0.4);
}

.btn-reserve {
  background: linear-gradient(145deg, #8e44ad 0%, #6c3483 100%);
  border: 2px solid #9b59b6;
  color: #fff;
}

.btn-reserve:not(:disabled):hover {
  background: linear-gradient(145deg, #9b59b6 0%, #8e44ad 100%);
  box-shadow: 0 0 15px rgba(155, 89, 182, 0.4);
}

.btn-action:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(40%);
}

.btn-cancel {
  width: 100%;
  padding: 0.5rem;
}

/* Already reserved indicator */
.already-reserved {
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

/* Utilities */
@media (min-width: 500px) {
  .join-container,
  .lobby-container {
    padding: 3rem;
  }
}
