/* ==========================================================================
   DIXIT ONLINE — MODERN SURREALIST STYLESHEET
   Aesthetic: Oniric, Deep Indigo / Midnight Violet, Starlight Gold Accents,
   Smooth 3D Transforms, Responsive Glassmorphism.
   ========================================================================== */

:root {
  --bg-deep: #0d0b18;
  --bg-surface: rgba(26, 21, 48, 0.75);
  --bg-surface-elevated: rgba(40, 32, 74, 0.85);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-border-gold: rgba(246, 196, 67, 0.35);
  --accent-gold: #f6c443;
  --accent-gold-glow: rgba(246, 196, 67, 0.5);
  --accent-purple: #9d4edd;
  --accent-cyan: #4cc9f0;
  --text-main: #f8f9fa;
  --text-muted: #c4b5fd;
  --text-dim: #7f77a8;
  --danger: #ef476f;
  --success: #06d6a0;
  --card-radius: 14px;
  --card-aspect: 1.45;
  --font-family: 'Cinzel Decorative', 'Cinzel', 'Marcellus', 'Segoe UI', serif, sans-serif;
  --font-body: 'Quicksand', 'Nunito', 'Segoe UI', system-ui, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

body {
  background: radial-gradient(circle at 50% 20%, #1e1338 0%, #0d0b18 60%, #05040a 100%);
  color: var(--text-main);
  font-family: var(--font-body);
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* Floating Starlight Background */
.stars-overlay {
  position: fixed;
  inset: 0;
  background-image: 
    radial-gradient(1.5px 1.5px at 20px 30px, #ffffff, rgba(0,0,0,0)),
    radial-gradient(1px 1px at 100px 150px, #f6c443, rgba(0,0,0,0)),
    radial-gradient(1.5px 1.5px at 220px 80px, #ffffff, rgba(0,0,0,0)),
    radial-gradient(2px 2px at 340px 240px, #c4b5fd, rgba(0,0,0,0)),
    radial-gradient(1px 1px at 450px 120px, #ffffff, rgba(0,0,0,0)),
    radial-gradient(2px 2px at 600px 320px, #f6c443, rgba(0,0,0,0));
  background-repeat: repeat;
  background-size: 550px 550px;
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
  animation: starsDrift 140s linear infinite;
}

@keyframes starsDrift {
  from { background-position: 0 0; }
  to { background-position: 550px 1100px; }
}

/* App Container */
#app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Glass Panels */
.glass-panel {
  background: var(--bg-surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

.gold-border {
  border-color: var(--glass-border-gold);
  box-shadow: 0 0 20px rgba(246, 196, 67, 0.15), 0 10px 30px rgba(0,0,0,0.5);
}

/* Buttons */
.btn {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 10px 20px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #f6c443 0%, #e76f51 100%);
  color: #1a0b2e;
  box-shadow: 0 4px 15px rgba(246, 196, 67, 0.35);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 20px rgba(246, 196, 67, 0.55);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid var(--glass-border);
}
.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.16);
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  transform: translateY(-1px);
}

.btn-meet {
  background: linear-gradient(135deg, #00897b 0%, #00acc1 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(0, 150, 136, 0.35);
}
.btn-meet:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 150, 136, 0.55);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Top Navigation Bar */
header.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  background: rgba(13, 11, 24, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.header-logo h1 {
  font-family: var(--font-family);
  font-size: 1.6rem;
  letter-spacing: 2px;
  background: linear-gradient(135deg, #ffe066 0%, #ff9e00 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.room-badge {
  background: rgba(246, 196, 67, 0.15);
  border: 1px solid var(--glass-border-gold);
  padding: 6px 14px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--accent-gold);
  transition: all 0.2s ease;
}
.room-badge:hover {
  background: rgba(246, 196, 67, 0.25);
  transform: scale(1.03);
}

/* ==========================================================================
   VIEWS & SCREENS
   ========================================================================== */
.view-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px;
  max-width: 1300px;
  margin: 0 auto;
  width: 100%;
}

/* Welcome & Lobby Screen */
.welcome-card {
  max-width: 650px;
  margin: 40px auto;
  padding: 36px;
  text-align: center;
}
.welcome-title {
  font-family: var(--font-family);
  font-size: 2.2rem;
  margin-bottom: 8px;
  color: var(--accent-gold);
}
.welcome-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 28px;
}

.tabs-nav {
  display: flex;
  border-bottom: 1px solid var(--glass-border);
  margin-bottom: 24px;
}
.tab-btn {
  flex: 1;
  padding: 12px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease;
}
.tab-btn.active {
  color: var(--accent-gold);
  border-bottom-color: var(--accent-gold);
}

.input-group {
  margin-bottom: 20px;
  text-align: left;
}
.input-label {
  display: block;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 600;
}
.input-field {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(13, 11, 24, 0.6);
  border: 1px solid var(--glass-border);
  color: #ffffff;
  font-family: var(--font-body);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s ease;
}
.input-field:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 10px rgba(246, 196, 67, 0.25);
}

/* Token Picker Grid */
.token-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(65px, 1fr));
  gap: 12px;
  margin-top: 10px;
}
.token-option {
  aspect-ratio: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid transparent;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  padding: 6px;
  position: relative;
}
.token-option img {
  width: 70%;
  height: 70%;
  object-fit: contain;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.4));
  transition: transform 0.2s ease;
}
.token-option:hover:not(.disabled) {
  transform: translateY(-4px) scale(1.08);
  background: rgba(255, 255, 255, 0.12);
}
.token-option.selected {
  border-color: var(--accent-gold);
  background: rgba(246, 196, 67, 0.15);
  box-shadow: 0 0 14px rgba(246, 196, 67, 0.4);
}
.token-option.disabled {
  opacity: 0.3;
  cursor: not-allowed;
  filter: grayscale(0.8);
}
.token-name-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Expansion Deck Selector (Host Settings) */
.deck-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin: 16px 0;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 6px;
}
.deck-card-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.deck-card-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}
.deck-card-item.active {
  border-color: var(--accent-gold);
  background: rgba(246, 196, 67, 0.1);
}
.deck-thumb {
  width: 48px;
  height: 68px;
  border-radius: 6px;
  object-fit: cover;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}
.deck-info {
  flex: 1;
  text-align: left;
}
.deck-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 6px;
}
.deck-desc {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 2px;
}
.deck-checkbox {
  width: 20px;
  height: 20px;
  accent-color: var(--accent-gold);
}

/* ==========================================================================
   GAME TABLE & ANIMATION STAGE
   ========================================================================== */
.game-layout {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 75px);
  gap: 12px;
  padding-bottom: 10px;
}

/* ==========================================================================
   OPPONENTS TABLE BAR (VIRTUAL TABLE SEATING)
   ========================================================================== */
.opponents-table-bar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 12px;
  border-radius: 16px;
  background: rgba(20, 16, 38, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  scrollbar-width: thin;
  scrollbar-color: var(--accent-gold-glow) transparent;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.opponents-table-bar::-webkit-scrollbar {
  height: 5px;
}
.opponents-table-bar::-webkit-scrollbar-thumb {
  background: var(--accent-gold-glow);
  border-radius: 4px;
}

.opponent-seat {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 14px;
  background: rgba(32, 26, 60, 0.75);
  border: 1px solid var(--glass-border);
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  flex-shrink: 0;
}

.opponent-seat:hover {
  transform: translateY(-2px);
  background: rgba(45, 36, 85, 0.85);
  border-color: rgba(255, 255, 255, 0.25);
}

.opponent-seat.is-me {
  border-color: rgba(76, 201, 240, 0.5);
  background: rgba(25, 45, 75, 0.6);
}

.opponent-seat.is-storyteller {
  border-color: var(--accent-gold);
  background: linear-gradient(135deg, rgba(246, 196, 67, 0.18) 0%, rgba(157, 78, 221, 0.25) 100%);
  box-shadow: 0 0 16px rgba(246, 196, 67, 0.35);
  animation: storytellerSeatGlow 3s infinite alternate;
}

@keyframes storytellerSeatGlow {
  0% { box-shadow: 0 0 10px rgba(246, 196, 67, 0.25); border-color: rgba(246, 196, 67, 0.6); }
  100% { box-shadow: 0 0 24px rgba(246, 196, 67, 0.6); border-color: #ffd700; }
}

.opponent-avatar-box {
  position: relative;
  width: 44px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.opponent-rabbit-img {
  width: 38px;
  height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.6));
  transition: transform 0.25s ease;
}

.opponent-seat:hover .opponent-rabbit-img {
  transform: scale(1.15) translateY(-3px);
}

.storyteller-crown {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.25rem;
  filter: drop-shadow(0 2px 6px rgba(246, 196, 67, 0.9));
  animation: crownBounce 2.2s infinite ease-in-out;
  pointer-events: none;
  z-index: 5;
}

@keyframes crownBounce {
  0%, 100% { transform: translateX(-50%) translateY(0) rotate(0deg); }
  50% { transform: translateX(-50%) translateY(-5px) rotate(5deg); }
}

.opponent-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: left;
}

.opponent-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffffff;
  max-width: 110px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 4px;
}

.opponent-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
}

.opponent-score-badge {
  color: var(--accent-gold);
  font-weight: 800;
}

.opponent-status-badge {
  font-size: 0.7rem;
  padding: 1px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  white-space: nowrap;
}
.opponent-status-badge.ready {
  background: rgba(6, 214, 160, 0.18);
  color: #06d6a0;
  border: 1px solid rgba(6, 214, 160, 0.4);
}
.opponent-status-badge.voted {
  background: rgba(76, 201, 240, 0.2);
  color: #4cc9f0;
  border: 1px solid rgba(76, 201, 240, 0.4);
}
.opponent-status-badge.storyteller {
  background: rgba(246, 196, 67, 0.22);
  color: var(--accent-gold);
  border: 1px solid rgba(246, 196, 67, 0.55);
  font-weight: 700;
}

/* Opponent Mini Cards Hand (Face-down cards held in player's hands) */
.opponent-cards-fan {
  display: flex;
  align-items: center;
  margin-left: 6px;
  height: 38px;
  padding-right: 4px;
}

.mini-card-back {
  width: 22px;
  height: 32px;
  border-radius: 4px;
  box-shadow: -2px 2px 6px rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: #1e1338;
  overflow: hidden;
  margin-left: -13px;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), margin-left 0.25s ease;
  transform-origin: bottom center;
}
.mini-card-back:first-child {
  margin-left: 0;
}
.mini-card-back img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.opponent-seat:hover .mini-card-back {
  margin-left: -7px;
  transform: translateY(-2px);
}


/* Stage Header & Storyteller Clue Banner */
.stage-banner {
  background: linear-gradient(90deg, rgba(157, 78, 221, 0.2) 0%, rgba(246, 196, 67, 0.2) 50%, rgba(76, 201, 240, 0.2) 100%);
  border: 1px solid var(--glass-border-gold);
  border-radius: 14px;
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  animation: glowPulse 4s infinite alternate;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

@keyframes glowPulse {
  0% { box-shadow: 0 0 10px rgba(246, 196, 67, 0.2); }
  100% { box-shadow: 0 0 25px rgba(246, 196, 67, 0.45); }
}

.stage-banner-clue {
  min-width: 0;
  flex: 1 1 auto;
}

.clue-title-tag {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent-gold);
  font-weight: 700;
}
.clue-phrase {
  font-family: var(--font-family);
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0,0,0,0.8);
  margin-top: 2px;
  word-break: break-word;
  overflow-wrap: break-word;
}

.stage-banner-actions {
  min-width: 0;
  flex: 0 1 auto;
}
.stage-instruction {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: right;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* Card Zoom Overlay Button */
.card-zoom-overlay-btn {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(13, 11, 24, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #ffffff;
  font-size: 0.72rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 15;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}
.card-zoom-overlay-btn:hover {
  background: var(--accent-gold);
  border-color: #ffe066;
  color: #1a1530;
  transform: scale(1.15);
}

/* Empty Table Notice */
.table-empty-notice {
  text-align: center;
  color: var(--text-dim);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
}
.table-empty-notice-icon {
  font-size: 2.8rem;
  margin-bottom: 8px;
  animation: popIn 1.2s infinite alternate;
}
.table-empty-notice-text {
  font-size: clamp(0.9rem, 3.2vw, 1.1rem);
  color: var(--text-muted);
  max-width: 380px;
  line-height: 1.4;
  word-break: break-word;
}

/* Center Table Area (Cards in play) */
.table-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 240px;
  padding: 10px;
  border-radius: 18px;
  background: radial-gradient(circle at center, rgba(40, 32, 74, 0.6) 0%, rgba(13, 11, 24, 0.7) 100%);
  border: 1px dashed var(--glass-border);
}

.cards-stage-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 1100px;
}

/* 3D Card Structure */
.dixit-card {
  width: 140px;
  height: 205px;
  perspective: 1000px;
  position: relative;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@media (min-width: 900px) {
  .dixit-card {
    width: 160px;
    height: 235px;
  }
}

.dixit-card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.4, 0.2, 0.2, 1);
  border-radius: var(--card-radius);
  box-shadow: 0 8px 20px rgba(0,0,0,0.5);
}

.dixit-card.flipped .dixit-card-inner {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--card-radius);
  overflow: hidden;
  border: 2px solid var(--glass-border);
}

.card-front {
  transform: rotateY(180deg);
  background: #110d21;
}
.card-front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-back {
  background: #1a1530;
}
.card-back img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dixit-card:hover:not(.disabled) {
  transform: translateY(-8px) scale(1.04);
}
.dixit-card.selected .dixit-card-inner {
  box-shadow: 0 0 25px rgba(246, 196, 67, 0.8);
  border: 3px solid var(--accent-gold);
}

.dixit-card.is-own-card .dixit-card-inner {
  border: 2px dashed rgba(246, 196, 67, 0.8);
  box-shadow: 0 0 20px rgba(246, 196, 67, 0.35);
}

.own-card-badge {
  background: rgba(246, 196, 67, 0.15);
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
  padding: 6px 14px;
  border-radius: 12px;
  font-size: 0.82rem;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 10px rgba(246, 196, 67, 0.2);
  animation: pulseOwnCard 2.5s infinite alternate;
}
.own-card-badge span {
  display: flex;
  align-items: center;
  gap: 5px;
}
.own-card-badge small {
  font-size: 0.7rem;
  color: var(--text-dim);
  font-weight: 500;
}
@keyframes pulseOwnCard {
  0% { transform: scale(1); box-shadow: 0 0 8px rgba(246, 196, 67, 0.2); }
  100% { transform: scale(1.02); box-shadow: 0 0 18px rgba(246, 196, 67, 0.45); }
}

.own-card-floating-tag {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(13, 11, 24, 0.9);
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  z-index: 12;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,0.6);
  pointer-events: none;
}

.card-owner-badge {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(13, 11, 24, 0.92);
  border: 1px solid var(--glass-border);
  color: #ffffff;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 2px 8px rgba(0,0,0,0.6);
  z-index: 12;
  pointer-events: none;
}
.card-owner-badge.is-storyteller {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  box-shadow: 0 0 10px rgba(246, 196, 67, 0.4);
}

.card-stage-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
}

/* Card Number Badge & Voters Container */
.card-number-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #f6c443, #e76f51);
  color: #1a0b2e;
  font-weight: 800;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  box-shadow: 0 3px 10px rgba(0,0,0,0.6);
  z-index: 10;
}

/* ==========================================================================
   3D TOKENS / FICHAS ISOMÉTRICAS SOBRE LAS CARTAS
   ========================================================================== */
.card-voters-row {
  position: absolute;
  bottom: -24px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  z-index: 25;
  perspective: 500px;
  pointer-events: auto;
}

.voter-token-3d {
  position: relative;
  width: 44px;
  height: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transform: perspective(400px) rotateX(20deg) translateZ(15px);
  transform-style: preserve-3d;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  animation: tokenDropBounce3D 0.65s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

.voter-token-3d:hover {
  transform: perspective(400px) rotateX(10deg) translateY(-14px) translateZ(35px) scale(1.18);
  z-index: 35;
}

/* 3D Physical Token Coin Body with Edge Thickness & Specular Glare */
.token-coin-3d {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 
    0 1px 1px rgba(255,255,255,0.6) inset,
    0 -3px 2px rgba(0,0,0,0.5) inset,
    0 2px 0 #2b1f06,
    0 4px 0 #1a1303,
    0 6px 2px rgba(0,0,0,0.5),
    0 10px 18px rgba(0, 0, 0, 0.7),
    0 0 16px var(--accent-gold-glow);
  border: 2px solid #ffd166;
  background: radial-gradient(circle at 35% 30%, #fff 0%, #ffeaa7 20%, #fdcb6e 50%, #e17055 100%);
}

.token-coin-3d::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 6px;
  width: 26px;
  height: 14px;
  border-radius: 50% 50% 40% 40%;
  background: linear-gradient(180deg, rgba(255,255,255,0.75) 0%, rgba(255,255,255,0) 100%);
  pointer-events: none;
}

.token-coin-3d img {
  width: 28px;
  height: 30px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
  z-index: 2;
  transition: transform 0.2s ease;
}

.voter-token-3d:hover .token-coin-3d img {
  transform: scale(1.12);
}

.token-shadow-3d {
  position: absolute;
  bottom: -6px;
  width: 36px;
  height: 12px;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 75%);
  border-radius: 50%;
  transform: rotateX(60deg);
  pointer-events: none;
}

.token-tooltip-3d {
  position: absolute;
  top: -34px;
  background: rgba(13, 11, 24, 0.95);
  border: 1px solid var(--accent-gold);
  color: #ffffff;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.7);
  z-index: 40;
}
.token-tooltip-3d::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 4px 4px 0 4px;
  border-style: solid;
  border-color: var(--accent-gold) transparent transparent transparent;
}
.voter-token-3d:hover .token-tooltip-3d {
  opacity: 1;
  transform: translateY(0);
}

@keyframes tokenDropBounce3D {
  0% {
    transform: perspective(400px) rotateX(45deg) translateY(-85px) translateZ(80px) scale(1.8);
    opacity: 0;
  }
  50% {
    transform: perspective(400px) rotateX(15deg) translateY(2px) translateZ(10px) scale(0.95);
    opacity: 1;
  }
  75% {
    transform: perspective(400px) rotateX(25deg) translateY(-10px) translateZ(25px) scale(1.05);
  }
  100% {
    transform: perspective(400px) rotateX(20deg) translateY(0) translateZ(15px) scale(1);
    opacity: 1;
  }
}

/* ==========================================================================
   MAGICAL CRYSTAL ORB SUSPENSE OVERLAY
   ========================================================================== */
.magic-orb-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(30, 19, 56, 0.94) 0%, rgba(13, 11, 24, 0.98) 85%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  animation: fadeInOrb 0.35s ease-out;
  overflow: hidden;
}

@keyframes fadeInOrb {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.magic-orb-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
}

.magic-crystal-orb {
  width: 125px;
  height: 125px;
  border-radius: 50%;
  position: relative;
  margin-bottom: 24px;
  background: radial-gradient(circle at 35% 30%, #ffffff 0%, #c4b5fd 18%, #8b5cf6 45%, #4c1d95 75%, #1e1035 100%);
  box-shadow: 
    0 0 25px rgba(246, 196, 67, 0.6),
    0 0 65px rgba(157, 78, 221, 0.85),
    inset -10px -10px 25px rgba(0, 0, 0, 0.85),
    inset 8px 8px 20px rgba(255, 255, 255, 0.7);
  animation: orbFloat 2.6s ease-in-out infinite alternate;
}

@keyframes orbFloat {
  0% { transform: translateY(0) scale(1); box-shadow: 0 0 30px rgba(157, 78, 221, 0.7), 0 0 70px rgba(246, 196, 67, 0.4); }
  100% { transform: translateY(-12px) scale(1.05); box-shadow: 0 0 45px rgba(157, 78, 221, 0.9), 0 0 95px rgba(246, 196, 67, 0.7); }
}

.orb-inner-swirl {
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent, rgba(246, 196, 67, 0.6), rgba(157, 78, 221, 0.8), rgba(76, 201, 240, 0.7), transparent);
  filter: blur(6px);
  animation: spinNebula 2s linear infinite;
  opacity: 0.85;
}

@keyframes spinNebula {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.orb-highlight {
  position: absolute;
  top: 14px;
  left: 20px;
  width: 40px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0) 80%);
  transform: rotate(-30deg);
  pointer-events: none;
}

.orb-ring {
  position: absolute;
  top: -15px;
  left: -15px;
  right: -15px;
  bottom: -15px;
  border-radius: 50%;
  border: 2px dashed rgba(246, 196, 67, 0.5);
  animation: spinRing 4s linear infinite;
  box-shadow: 0 0 15px rgba(246, 196, 67, 0.3);
  pointer-events: none;
}

.orb-ring-reverse {
  position: absolute;
  top: -24px;
  left: -24px;
  right: -24px;
  bottom: -24px;
  border-radius: 50%;
  border: 1.5px dotted rgba(157, 78, 221, 0.6);
  animation: spinRing 5s linear infinite reverse;
  pointer-events: none;
}

@keyframes spinRing {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.orb-sparkle {
  position: absolute;
  top: -10px;
  right: -10px;
  font-size: 1.4rem;
  animation: sparkleTwinkle 1.5s infinite alternate;
}

@keyframes sparkleTwinkle {
  0% { transform: scale(0.8) rotate(0deg); opacity: 0.4; }
  100% { transform: scale(1.3) rotate(35deg); opacity: 1; filter: drop-shadow(0 0 8px #f6c443); }
}

.orb-text-box {
  max-width: 450px;
  padding: 0 15px;
}

.orb-title {
  font-family: var(--font-family);
  font-size: 1.7rem;
  color: var(--accent-gold);
  letter-spacing: 1.5px;
  margin-bottom: 6px;
  text-shadow: 0 2px 14px rgba(246, 196, 67, 0.5);
}

.orb-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 18px;
}

.orb-progress-track {
  width: 270px;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
  margin: 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.orb-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #9d4edd 0%, #f6c443 100%);
  box-shadow: 0 0 12px #f6c443;
  border-radius: 10px;
  transition: width 2.4s cubic-bezier(0.1, 0.6, 0.2, 1);
}


/* Player Hand Arc at Bottom */
.hand-container {
  background: rgba(15, 12, 28, 0.9);
  backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  border-radius: 20px 20px 0 0;
  padding: 12px 16px 8px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hand-header {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 1100px;
  margin-bottom: 6px;
  align-items: center;
  min-width: 0;
  gap: 8px;
}
.hand-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.hand-title {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.hand-swipe-hint {
  display: none;
  font-size: 0.7rem;
  color: var(--accent-gold);
  font-weight: 600;
  background: rgba(246, 196, 67, 0.15);
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid var(--glass-border-gold);
}
.hand-prompt-notice {
  color: var(--accent-gold);
  font-size: 0.85rem;
  font-weight: 700;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.hand-cards-list {
  display: flex;
  gap: 10px;
  justify-content: flex-start;
  align-items: flex-end;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  max-width: 100%;
  padding: 8px 12px 14px 12px;
  scrollbar-width: thin;
}
@media (min-width: 800px) {
  .hand-cards-list {
    justify-content: center;
    gap: 12px;
  }
}

.hand-card-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  scroll-snap-align: center;
  flex-shrink: 0;
}
.hand-card-wrapper .dixit-card {
  width: 120px;
  height: 175px;
}
@media (min-width: 768px) {
  .hand-card-wrapper .dixit-card {
    width: 140px;
    height: 205px;
  }
}

.card-action-bar {
  display: flex;
  width: 100%;
  margin-top: 4px;
}
.card-action-bar .btn {
  width: 100%;
  font-size: 0.75rem;
  padding: 6px 8px;
  font-weight: 700;
  justify-content: center;
}
.btn-card-action {
  font-size: 0.72rem;
  padding: 4px 8px;
  border-radius: 6px;
}

/* ==========================================================================
   SCOREBOARD (TABLERO DE PIEDRAS 0-30)
   ========================================================================== */
.board-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 4, 10, 0.8);
  backdrop-filter: blur(8px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.board-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.board-modal-content {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--glass-border-gold);
  border-radius: 20px;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: 0 15px 40px rgba(0,0,0,0.7);
  position: relative;
}

.board-track-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
  gap: 8px;
  margin: 20px 0;
}
.board-stone-cell {
  aspect-ratio: 1;
  background: radial-gradient(circle at 40% 40%, #3e3363 0%, #1e1836 100%);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}
.board-stone-cell.goal {
  border-color: var(--accent-gold);
  background: radial-gradient(circle at 40% 40%, #7d5b12 0%, #382502 100%);
}
.stone-number {
  font-family: var(--font-family);
  font-size: 0.85rem;
  color: var(--text-dim);
}
.board-stone-cell.goal .stone-number {
  color: var(--accent-gold);
  font-weight: 800;
}
.stone-rabbits-slot {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  justify-content: center;
  align-items: center;
  min-height: 30px;
}
.rabbit-mini-token {
  width: 24px;
  height: 28px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6));
  animation: rabbitHop 0.5s ease-out;
}

@keyframes rabbitHop {
  0% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-12px) scale(1.2); }
  100% { transform: translateY(0) scale(1); }
}

/* Fullscreen Zoom Modal */
.zoom-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.zoom-modal.open {
  opacity: 1;
  pointer-events: auto;
}
.zoom-modal img {
  max-width: 90vw;
  max-height: 80vh;
  border-radius: 16px;
  box-shadow: 0 0 35px rgba(246, 196, 67, 0.35);
  border: 1px solid var(--glass-border-gold);
  object-fit: contain;
}

/* Notifications Toast */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  background: rgba(26, 21, 48, 0.95);
  border: 1px solid var(--accent-gold);
  color: #ffffff;
  padding: 12px 20px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideLeft 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes slideLeft {
  from { transform: translateX(50px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ==========================================================================
   RESPONSIVE DESIGN SYSTEM (MOBILE, TABLET & SMALL DEVICES)
   ========================================================================== */

/* TABLETS (iPads, Android Tablets: 681px - 1024px) */
@media (min-width: 681px) and (max-width: 1024px) {
  .view-container {
    padding: 14px 12px;
    max-width: 98vw;
  }
  .welcome-card {
    max-width: 85vw;
    padding: 24px 18px;
  }
  .token-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
  }
  #waitingPlayersList {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 10px !important;
  }
  .cards-stage-grid {
    gap: 12px;
  }
  .card-stage-wrapper {
    flex: 0 1 calc(25% - 10px);
    max-width: 125px;
  }
  .card-stage-wrapper .dixit-card {
    width: 100%;
    max-width: 120px;
    height: 175px;
  }
  .hand-card-wrapper .dixit-card {
    width: 95px;
    height: 138px;
  }
  .stage-banner {
    padding: 12px 16px;
  }
  .clue-phrase {
    font-size: 1.35rem;
  }
  .board-modal-content {
    max-width: 90vw;
    padding: 20px;
  }
  .board-track-container {
    grid-template-columns: repeat(auto-fill, minmax(54px, 1fr));
    gap: 6px;
  }
}

/* SMARTPHONES & MOBILE SCREENS (<= 680px) */
@media (max-width: 680px) {
  /* 1. Global & Header */
  html, body {
    overflow-x: clip !important;
    max-width: 100vw !important;
    width: 100% !important;
  }
  .view-container, .game-layout {
    padding: 6px 4px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    overflow-x: clip !important;
  }
  header.app-header {
    padding: 6px 10px !important;
    gap: 6px !important;
  }
  .header-logo {
    gap: 4px !important;
  }
  .header-logo span {
    font-size: 1.3rem !important;
  }
  .header-logo h1 {
    font-size: 1.1rem !important;
    letter-spacing: 1px !important;
  }
  .hide-mobile {
    display: none !important;
  }
  .header-actions {
    gap: 6px !important;
  }
  .btn-meet {
    padding: 5px 8px !important;
    font-size: 0.78rem !important;
  }
  .room-badge {
    padding: 4px 8px !important;
    font-size: 0.8rem !important;
  }

  /* 2. Welcome & Waiting Room (Lobby) */
  .welcome-card {
    padding: 18px 12px !important;
    margin: 8px auto !important;
    border-radius: 14px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .welcome-title {
    font-size: 1.5rem !important;
    margin-bottom: 4px !important;
  }
  .welcome-subtitle {
    font-size: 0.85rem !important;
    margin-bottom: 16px !important;
  }
  .tabs-nav {
    margin-bottom: 14px !important;
  }
  .tab-btn {
    padding: 8px 6px !important;
    font-size: 0.88rem !important;
  }
  .token-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 6px !important;
  }
  .token-option {
    padding: 4px !important;
    border-radius: 10px !important;
  }
  .token-option img {
    width: 60% !important;
    height: 60% !important;
  }
  .token-name-label {
    font-size: 0.58rem !important;
  }
  #waitingPlayersList {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    margin-bottom: 18px !important;
  }
  .deck-selector-grid {
    grid-template-columns: 1fr !important;
    max-height: 260px !important;
    gap: 8px !important;
  }

  /* 3. Game Layout & Opponents Bar */
  .game-layout {
    gap: 6px !important;
    min-height: calc(100vh - 55px) !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
  .opponents-table-bar {
    padding: 4px 6px !important;
    gap: 6px !important;
    border-radius: 12px !important;
    scrollbar-width: none !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
  .opponents-table-bar::-webkit-scrollbar {
    display: none !important;
  }
  .opponent-seat {
    padding: 4px 8px !important;
    gap: 6px !important;
    border-radius: 10px !important;
    flex-shrink: 0 !important;
  }
  .opponent-avatar-box {
    width: 30px !important;
    height: 34px !important;
  }
  .opponent-rabbit-img {
    width: 24px !important;
    height: 30px !important;
  }
  .storyteller-crown {
    font-size: 0.9rem !important;
    top: -10px !important;
  }
  .opponent-name {
    font-size: 0.74rem !important;
    max-width: 65px !important;
  }
  .opponent-score-badge {
    font-size: 0.68rem !important;
  }
  .opponent-status-badge {
    font-size: 0.62rem !important;
    padding: 1px 4px !important;
  }
  .mini-card-back {
    width: 14px !important;
    height: 20px !important;
    margin-left: -9px !important;
  }

  /* 4. Clue Banner (Stacked for clean visibility with fluid font) */
  .stage-banner {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 6px !important;
    padding: 10px 12px !important;
    border-radius: 12px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
  }
  .stage-banner-clue {
    width: 100% !important;
    text-align: center !important;
    min-width: 0 !important;
  }
  .clue-title-tag {
    font-size: 0.68rem !important;
    letter-spacing: 1.5px !important;
  }
  .clue-phrase {
    font-size: clamp(0.92rem, 4.2vw, 1.15rem) !important;
    line-height: 1.35 !important;
    margin-top: 1px !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    max-width: 100% !important;
  }
  .stage-banner-actions {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 6px !important;
    width: 100% !important;
    min-width: 0 !important;
  }
  .stage-instruction {
    text-align: center !important;
    font-size: 0.78rem !important;
    line-height: 1.3 !important;
    width: 100% !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
  }
  .next-round-btn-container {
    width: 100% !important;
  }
  .next-round-btn-container button {
    width: 100% !important;
    padding: 10px 14px !important;
    font-size: 0.95rem !important;
    justify-content: center !important;
    box-sizing: border-box !important;
  }

  /* 5. Center Table Arena (Compact on mobile) */
  .table-stage {
    min-height: 125px !important;
    padding: 8px 6px !important;
    border-radius: 14px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }
  .table-empty-notice {
    padding: 10px 4px !important;
  }
  .table-empty-notice-icon {
    font-size: 2rem !important;
    margin-bottom: 2px !important;
  }
  .table-empty-notice-text {
    font-size: 0.85rem !important;
    line-height: 1.3 !important;
    max-width: 280px !important;
  }
  .cards-stage-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: flex-start !important;
    gap: 6px !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  .card-stage-wrapper {
    flex: 0 0 calc(33.333% - 5px) !important;
    max-width: 96px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    box-sizing: border-box !important;
  }
  .card-stage-wrapper .dixit-card {
    width: 100% !important;
    max-width: 92px !important;
    height: 134px !important;
  }
  .card-number-badge {
    width: 20px !important;
    height: 20px !important;
    font-size: 0.72rem !important;
    top: -6px !important;
  }
  .voter-token-3d {
    width: 28px !important;
    height: 30px !important;
  }
  .token-coin-3d {
    width: 24px !important;
    height: 24px !important;
  }
  .token-coin-3d img {
    width: 16px !important;
    height: 16px !important;
  }
  .token-shadow-3d {
    width: 22px !important;
    height: 6px !important;
  }
  .btn-card-action {
    font-size: 0.68rem !important;
    padding: 4px 6px !important;
    width: 100% !important;
    max-width: 92px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    box-sizing: border-box !important;
  }
  .own-card-badge {
    padding: 3px 6px !important;
    font-size: 0.66rem !important;
    border-radius: 8px !important;
    max-width: 92px !important;
    text-align: center !important;
    box-sizing: border-box !important;
  }
  .own-card-badge small {
    display: none !important;
  }
  .card-owner-badge {
    font-size: 0.58rem !important;
    padding: 1px 4px !important;
    max-width: 92% !important;
    top: 4px !important;
  }
  .own-card-floating-tag {
    font-size: 0.58rem !important;
    padding: 1px 4px !important;
    top: 4px !important;
  }

  /* 6. Hand Container (Bottom Drawer with full-width action buttons) */
  .hand-container {
    padding: 6px 6px 8px 6px !important;
    border-radius: 16px 16px 0 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
  .hand-header {
    width: 100% !important;
    padding: 0 4px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 4px !important;
    min-width: 0 !important;
    gap: 6px !important;
  }
  .hand-header-left {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-shrink: 0 !important;
  }
  .hand-title {
    font-size: 0.74rem !important;
    font-weight: 700 !important;
  }
  .hand-swipe-hint {
    display: inline-block !important;
    font-size: 0.64rem !important;
    color: var(--accent-gold) !important;
    font-weight: 600 !important;
    background: rgba(246, 196, 67, 0.15) !important;
    padding: 1px 6px !important;
    border-radius: 8px !important;
  }
  .hand-prompt-notice {
    font-size: 0.7rem !important;
    max-width: 150px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    min-width: 0 !important;
  }
  .hand-cards-list {
    display: flex !important;
    gap: 8px !important;
    justify-content: flex-start !important;
    align-items: flex-end !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scroll-snap-type: x mandatory !important;
    overscroll-behavior: contain !important;
    padding: 4px 2px 6px 2px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    scrollbar-width: thin !important;
    scrollbar-color: var(--accent-gold) transparent !important;
  }
  .hand-cards-list::-webkit-scrollbar {
    height: 4px !important;
  }
  .hand-cards-list::-webkit-scrollbar-thumb {
    background: var(--accent-gold) !important;
    border-radius: 4px !important;
  }
  .hand-card-wrapper {
    flex: 0 0 auto !important;
    scroll-snap-align: start !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
  }
  .hand-card-wrapper .dixit-card {
    width: 78px !important;
    height: 114px !important;
  }
  .card-zoom-overlay-btn {
    width: 22px !important;
    height: 22px !important;
    font-size: 0.65rem !important;
    top: 4px !important;
    left: 4px !important;
  }
  .card-action-bar {
    width: 100% !important;
    margin-top: 3px !important;
  }
  .card-action-bar .btn {
    width: 100% !important;
    font-size: 0.72rem !important;
    padding: 5px 4px !important;
    font-weight: 700 !important;
    justify-content: center !important;
    letter-spacing: 0.5px !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
  }

  /* 7. Modals */
  .board-modal-content {
    padding: 14px 10px !important;
    border-radius: 14px !important;
    max-height: 94vh !important;
    width: 96vw !important;
    box-sizing: border-box !important;
  }
  .board-track-container {
    grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)) !important;
    gap: 4px !important;
    margin: 10px 0 !important;
  }
  .board-stone-cell {
    border-radius: 8px !important;
  }
  .stone-number {
    font-size: 0.68rem !important;
  }
  .rabbit-mini-token {
    width: 16px !important;
    height: 20px !important;
  }
  #clueCardPreview {
    width: 90px !important;
    height: 130px !important;
  }
  #storytellerClueText {
    font-size: 0.9rem !important;
    padding: 8px !important;
  }
}

/* COMPACT PHONES (<= 380px) */
@media (max-width: 380px) {
  .token-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }
  .card-stage-wrapper {
    flex: 0 0 calc(33.333% - 4px) !important;
    max-width: 86px !important;
  }
  .card-stage-wrapper .dixit-card {
    width: 100% !important;
    max-width: 82px !important;
    height: 120px !important;
  }
  .hand-card-wrapper .dixit-card {
    width: 68px !important;
    height: 100px !important;
  }
  .board-track-container {
    grid-template-columns: repeat(auto-fill, minmax(36px, 1fr)) !important;
  }
}

/* ==========================================================================
   BOARDLAIR (LA GUARIDA DEL TABLERO) — BRAND & SANCTUM IDENTITY
   Dungeon Boss Sanctum, Molten Gold & Ember Glow, View Transitions & Arkham UI
   ========================================================================== */

body[data-active-game="arkham"] {
  background: radial-gradient(circle at 50% 15%, #0c261d 0%, #091318 55%, #040608 100%);
}

/* Rising Dungeon Boss Lair Embers Overlay */
.lair-embers-overlay {
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(2px 2px at 15% 85%, rgba(255, 110, 64, 0.7), transparent),
    radial-gradient(2.5px 2.5px at 45% 92%, rgba(246, 196, 67, 0.65), transparent),
    radial-gradient(1.5px 1.5px at 75% 80%, rgba(230, 57, 70, 0.7), transparent),
    radial-gradient(2px 2px at 88% 95%, rgba(246, 196, 67, 0.55), transparent);
  background-size: 420px 420px;
  opacity: 0.45;
  pointer-events: none;
  z-index: 0;
  animation: embersRise 28s linear infinite;
}

@keyframes embersRise {
  from { background-position: 0 0; }
  to { background-position: -120px -420px; }
}

/* Brand Header Stack */
.header-brand-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-logo {
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 12px;
  transition: transform 0.2s ease, background 0.2s ease;
}
.header-logo:hover {
  background: rgba(246, 196, 67, 0.08);
  transform: translateY(-1px);
}

.boardlair-emblem-sm {
  filter: drop-shadow(0 2px 8px rgba(246, 196, 67, 0.35));
  flex-shrink: 0;
}

.brand-text-stack {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-main-title {
  font-family: 'Cinzel Decorative', var(--font-family);
  font-size: 1.45rem !important;
  letter-spacing: 2.5px;
  width: fit-content;
}

.brand-sub-tag {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 2.2px;
  color: #e76f51;
  text-transform: uppercase;
}

.active-game-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 1px;
  background: rgba(246, 196, 67, 0.14);
  border: 1px solid rgba(246, 196, 67, 0.4);
  color: var(--accent-gold);
}

.btn-lair-back {
  background: rgba(231, 111, 81, 0.15);
  border: 1px solid rgba(246, 196, 67, 0.4);
  color: #ffe066;
  padding: 8px 14px;
  font-size: 0.85rem;
}
.btn-lair-back:hover {
  background: rgba(231, 111, 81, 0.3);
  transform: translateY(-1px);
}

/* ==========================================================================
   BOARDLAIR HUB — BOSS SANCTUM HERO & GAME VAULT
   ========================================================================== */
.lair-hub-container {
  gap: 26px;
  padding-top: 24px;
  padding-bottom: 48px;
}

.lair-runic-border {
  border: 1px solid rgba(246, 196, 67, 0.42);
  box-shadow:
    0 0 35px rgba(230, 57, 70, 0.16),
    0 16px 40px rgba(0, 0, 0, 0.65),
    inset 0 1px 0 rgba(255, 224, 102, 0.25);
}

.lair-hero-banner {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: auto 1fr minmax(260px, 310px);
  align-items: center;
  gap: 28px;
  padding: 32px 36px;
  background:
    radial-gradient(circle at 12% 50%, rgba(230, 57, 70, 0.2), transparent 55%),
    radial-gradient(circle at 88% 20%, rgba(246, 196, 67, 0.16), transparent 50%),
    rgba(18, 12, 34, 0.88);
}

.lair-hero-emblem-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.boardlair-hero-crest {
  animation: bossCrestPulse 5s ease-in-out infinite;
}

@keyframes bossCrestPulse {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-4px) scale(1.03); }
}

.lair-lore-pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 1.8px;
  color: #ff9e00;
  background: rgba(255, 158, 0, 0.12);
  border: 1px solid rgba(255, 158, 0, 0.35);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.lair-hero-title {
  font-family: 'Cinzel Decorative', var(--font-family);
  font-size: 2.6rem;
  letter-spacing: 4px;
  background: linear-gradient(135deg, #fff3b0 0%, #f6c443 50%, #e76f51 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
  width: fit-content;
  outline: none;
}

.lair-hero-subtitle {
  color: var(--text-muted);
  font-size: 0.98rem;
  line-height: 1.55;
  margin-bottom: 16px;
  max-width: 680px;
}

.lair-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.lair-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  font-size: 0.84rem;
  color: var(--text-main);
}

.lair-quick-join-box {
  background: rgba(8, 6, 18, 0.65);
  border: 1px solid rgba(246, 196, 67, 0.3);
  border-radius: 14px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lair-quick-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-gold);
}

.lair-quick-input-row {
  display: flex;
  gap: 8px;
}

.lair-code-input {
  text-transform: uppercase;
  letter-spacing: 3px;
  font-weight: 800;
  text-align: center;
  font-size: 1.05rem;
}

.lair-quick-hint {
  font-size: 0.74rem;
  color: var(--text-dim);
}

.lair-section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 10px;
}
.lair-section-header h3 {
  font-family: var(--font-family);
  font-size: 1.45rem;
  color: var(--accent-gold);
}
.lair-section-header p {
  color: var(--text-dim);
  font-size: 0.9rem;
}

/* Game Vault Selection Cards */
.lair-games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 28px;
}

.lair-game-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.32s ease, border-color 0.32s ease;
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.lair-game-card:hover {
  transform: translateY(-6px);
}

.lair-card-dixit:hover {
  border-color: var(--accent-gold);
  box-shadow: 0 18px 42px rgba(246, 196, 67, 0.22);
}

.lair-card-arkham {
  border-color: rgba(45, 198, 83, 0.3);
}
.lair-card-arkham:hover {
  border-color: #2dc653;
  box-shadow: 0 18px 42px rgba(45, 198, 83, 0.24);
}

.lair-card-visual {
  position: relative;
  height: 235px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid var(--glass-border);
}

.lair-card-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.dixit-backdrop {
  background: radial-gradient(circle at 50% 40%, rgba(157, 78, 221, 0.45), rgba(18, 12, 40, 0.95));
}
.arkham-backdrop {
  background: radial-gradient(circle at 50% 40%, rgba(27, 67, 50, 0.7), rgba(8, 18, 16, 0.96));
}

.lair-card-fan-preview {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 190px;
}

.fan-img {
  width: 118px;
  height: 170px;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.65);
  border: 2px solid rgba(255, 255, 255, 0.22);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.fan-left {
  transform: translateX(26px) rotate(-14deg) scale(0.9);
}
.fan-center {
  z-index: 2;
  width: 132px;
  height: 184px;
  border-color: var(--accent-gold);
  transform: translateY(-4px);
}
.fan-right {
  transform: translateX(-26px) rotate(14deg) scale(0.9);
}

.lair-game-card:hover .fan-left {
  transform: translateX(8px) rotate(-22deg) scale(0.94);
}
.lair-game-card:hover .fan-center {
  transform: translateY(-10px) scale(1.05);
}
.lair-game-card:hover .fan-right {
  transform: translateX(-8px) rotate(22deg) scale(0.94);
}

.lair-game-realm-tag {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 1.4px;
  padding: 5px 12px;
  border-radius: 999px;
  backdrop-filter: blur(8px);
}
.realm-dream {
  background: rgba(157, 78, 221, 0.35);
  border: 1px solid rgba(246, 196, 67, 0.5);
  color: #ffe066;
}
.realm-eldritch {
  background: rgba(27, 67, 50, 0.75);
  border: 1px solid rgba(45, 198, 83, 0.6);
  color: #7bf1a8;
}

.lair-card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 12px;
}

.lair-card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.lair-game-title {
  font-family: var(--font-family);
  font-size: 1.55rem;
  color: var(--accent-gold);
  width: fit-content;
}

.arkham-title-accent {
  color: #52b788 !important;
}

.lair-players-badge {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(246, 196, 67, 0.14);
  color: var(--accent-gold);
  border: 1px solid rgba(246, 196, 67, 0.3);
}
.arkham-badge {
  background: rgba(45, 198, 83, 0.14);
  color: #7bf1a8;
  border-color: rgba(45, 198, 83, 0.35);
}

.lair-game-tagline {
  font-weight: 700;
  color: #ffffff;
  font-size: 0.96rem;
}

.lair-game-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
  flex: 1;
}

.lair-feature-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.lair-feature-tags span {
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
}
.arkham-tags span {
  border-color: rgba(82, 183, 136, 0.28);
  color: #b7e4c7;
}

.lair-card-footer {
  margin-top: 10px;
  display: flex;
  gap: 10px;
}
.lair-play-btn {
  flex: 1;
  padding: 13px 18px;
  font-size: 1rem;
}

.btn-arkham-primary {
  background: linear-gradient(135deg, #2d6a4f 0%, #40916c 50%, #52b788 100%);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(45, 198, 83, 0.3);
}
.btn-arkham-primary:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 6px 20px rgba(45, 198, 83, 0.5);
}

.btn-sm {
  padding: 7px 13px;
  font-size: 0.84rem;
}
.btn-xs {
  padding: 4px 9px;
  font-size: 0.76rem;
  border-radius: 8px;
}

.game-view-back-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.game-realm-pill {
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--accent-gold);
}

/* ==========================================================================
   VIEW TRANSITIONS API & DISCRETE ENTRY/EXIT ANIMATIONS (Modern Web Guidance)
   ========================================================================== */
#dixitLobbyHeading,
#arkhamLobbyHeading,
#lairHubHeading {
  width: fit-content;
  margin-inline: auto;
  outline: none;
}

::view-transition-old(lair-hero-art),
::view-transition-new(lair-hero-art) {
  height: 100%;
}

/* Directional Navigation Transitions (Modern Web Guidance) */
::view-transition-group(root) {
  animation: 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes slide-to-left {
  to { transform: translateX(-100%); opacity: 0; }
}
@keyframes slide-from-right {
  from { transform: translateX(100%); opacity: 0; }
}
@keyframes slide-to-right {
  to { transform: translateX(100%); opacity: 0; }
}
@keyframes slide-from-left {
  from { transform: translateX(-100%); opacity: 0; }
}

html:active-view-transition-type(forward)::view-transition-old(root) {
  animation-name: slide-to-left;
}
html:active-view-transition-type(forward)::view-transition-new(root) {
  animation-name: slide-from-right;
}

html:active-view-transition-type(backward)::view-transition-old(root) {
  animation-name: slide-to-right;
}
html:active-view-transition-type(backward)::view-transition-new(root) {
  animation-name: slide-from-left;
}

.lair-animated-panel {
  opacity: 1;
  translate: 0;
  transition:
    display 0.32s,
    opacity 0.32s ease-out,
    translate 0.32s ease-out;
  transition-behavior: allow-discrete;
}

@starting-style {
  .lair-animated-panel {
    opacity: 0;
    translate: 0 14px;
  }
}

.lair-animated-panel:where([hidden], [data-closing]) {
  opacity: 0;
  translate: 0 14px;
}

.lair-animated-panel[hidden] {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }

  .lair-animated-panel {
    translate: none;
    transition-duration: 0.1s;
  }

  @starting-style {
    .lair-animated-panel {
      translate: none;
    }
  }

  .lair-animated-panel:where([hidden], [data-closing]) {
    translate: none;
  }
}

/* ==========================================================================
   ARKHAM HORROR — LOBBY & DIGITAL TABLETOP STYLES
   ========================================================================== */
.arkham-border {
  border-color: rgba(82, 183, 136, 0.42);
  box-shadow: 0 0 24px rgba(45, 106, 79, 0.25), 0 10px 30px rgba(0, 0, 0, 0.6);
}

.arkham-lobby-hero {
  display: flex;
  align-items: center;
  gap: 22px;
  text-align: left;
  background: rgba(12, 32, 24, 0.55);
  border: 1px solid rgba(82, 183, 136, 0.28);
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 24px;
}

.arkham-lobby-cover {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 12px;
  border: 2px solid #52b788;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6);
  flex-shrink: 0;
}

.arkham-era-tag {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #7bf1a8;
}

.arkham-investigator-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.arkham-inv-option {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid var(--glass-border);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}
.arkham-inv-option:hover {
  border-color: rgba(82, 183, 136, 0.6);
  transform: translateY(-2px);
}
.arkham-inv-option.selected {
  border-color: #52b788;
  background: rgba(45, 106, 79, 0.32);
  box-shadow: 0 0 16px rgba(82, 183, 136, 0.3);
}

.arkham-inv-option img {
  width: 100%;
  height: 125px;
  object-fit: cover;
  border-radius: 8px;
}

.arkham-inv-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Arkham Tabletop Layout */
.arkham-table-layout {
  max-width: 1440px;
  gap: 14px;
  padding: 12px 18px 24px 18px;
}

.arkham-mythos-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  padding: 12px 20px;
  background: rgba(10, 26, 20, 0.88);
}

.mythos-info-group {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.mythos-badge {
  font-family: var(--font-family);
  font-weight: 700;
  color: #7bf1a8;
  font-size: 1rem;
}

.mythos-counters {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mythos-stat-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 5px 12px;
  border-radius: 10px;
}
.doom-box {
  border-color: rgba(230, 57, 70, 0.45);
}
.mythos-stat-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-dim);
}
.mythos-stat-val {
  font-size: 1rem;
  color: var(--accent-gold);
}

.mythos-counter-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-mini-counter {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}
.btn-mini-counter:hover {
  background: rgba(255, 255, 255, 0.22);
}

.mythos-actions-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.arkham-workspace-grid {
  display: grid;
  grid-template-columns: 1fr 330px;
  gap: 14px;
  align-items: start;
}

.arkham-board-zones {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.arkham-zone-panel {
  padding: 14px 18px;
  background: rgba(14, 24, 28, 0.78);
}

.arkham-zone-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 8px;
}
.arkham-zone-header h4 {
  font-family: var(--font-family);
  font-size: 1rem;
  color: #7bf1a8;
}
.arkham-zone-header h4 small {
  font-family: var(--font-body);
  font-weight: 500;
  color: var(--text-dim);
  font-size: 0.78rem;
  margin-left: 6px;
}

.arkham-cards-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  min-height: 150px;
  align-items: flex-start;
}

.arkham-table-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(0, 0, 0, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 8px;
  width: 175px;
  transition: transform 0.22s ease, border-color 0.22s ease;
}
.arkham-table-card.is-horizontal {
  width: 235px;
}
.arkham-table-card:hover {
  transform: translateY(-3px);
  border-color: #52b788;
}

.arkham-table-card-img-wrap {
  position: relative;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
}
.arkham-table-card-img-wrap img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

.arkham-card-tokens-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(15, 35, 28, 0.85);
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 0.78rem;
}

.arkham-card-controls {
  display: flex;
  gap: 4px;
  justify-content: space-between;
}
.arkham-card-controls button {
  flex: 1;
}

/* Right Sidebar: Chaos Bag, Party & Log */
.arkham-sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.arkham-chaos-panel,
.arkham-party-panel,
.arkham-log-panel {
  padding: 16px;
}

.sidebar-panel-title {
  font-family: var(--font-family);
  font-size: 1.05rem;
  color: var(--accent-gold);
  margin-bottom: 6px;
}
.sidebar-panel-sub {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.chaos-skill-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.chaos-result-box {
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.chaos-token-circle {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #2b2d42, #0d0b18);
  border: 3px solid var(--accent-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  font-weight: 900;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
}

.chaos-token-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.8rem;
}
.chaos-token-info strong {
  color: var(--accent-gold);
  font-size: 0.9rem;
}
.chaos-token-info span {
  color: var(--text-muted);
  line-height: 1.35;
}

.arkham-party-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.party-inv-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.82rem;
}
.party-inv-row img {
  width: 32px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
}

.arkham-log-list {
  max-height: 190px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.arkham-log-entry {
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border-left: 2px solid #52b788;
}

/* Bottom Investigator Dashboard */
.arkham-player-dashboard {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: rgba(10, 22, 20, 0.9);
}

.arkham-my-investigator-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.my-inv-card-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 190px;
  flex-shrink: 0;
}
.my-inv-card-box img {
  width: 100%;
  border-radius: 10px;
  border: 2px solid #52b788;
  cursor: pointer;
}
.my-inv-card-actions {
  display: flex;
  gap: 6px;
}
.my-inv-card-actions button {
  flex: 1;
}

.my-inv-stats-wrap {
  flex: 1;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.my-inv-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.my-inv-title-row strong {
  font-family: var(--font-family);
  font-size: 1.25rem;
  color: #7bf1a8;
}
.inv-skills-pills {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-gold);
  background: rgba(246, 196, 67, 0.12);
  padding: 4px 12px;
  border-radius: 999px;
}

.arkham-counters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(115px, 1fr));
  gap: 10px;
}

.arkham-counter-card {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.counter-label {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--text-muted);
}
.counter-ctrl {
  display: flex;
  align-items: center;
  gap: 10px;
}
.counter-ctrl strong {
  font-size: 1.25rem;
  min-width: 22px;
  text-align: center;
}
.counter-ctrl button {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}
.counter-ctrl button:hover {
  background: rgba(82, 183, 136, 0.35);
}

.arkham-hand-and-assets {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 14px;
}

.arkham-subzone {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.subzone-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--accent-gold);
}

.arkham-mini-cards-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  min-height: 140px;
}

.arkham-hand-item {
  width: 112px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: rgba(0, 0, 0, 0.4);
  padding: 6px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
}
.arkham-hand-item.exhausted img {
  transform: rotate(12deg) scale(0.92);
  opacity: 0.65;
}
.arkham-hand-item img {
  width: 100%;
  height: 138px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

/* Rulebook & Vault Modals */
.rulebook-viewer-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  margin-bottom: 12px;
}
.rulebook-page-stage {
  max-height: 70vh;
  overflow-y: auto;
  text-align: center;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 12px;
  padding: 12px;
}
.rulebook-page-stage img {
  max-width: 100%;
  max-height: 66vh;
  border-radius: 8px;
  cursor: zoom-in;
}

.arkham-vault-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
  max-height: 68vh;
  overflow-y: auto;
  padding: 6px;
}

/* Responsive adjustments for BoardLair Hub & Arkham */
@media (max-width: 980px) {
  .lair-hero-banner {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 24px 20px;
  }
  .lair-hero-title {
    margin-inline: auto;
    font-size: 2rem;
  }
  .lair-meta-bar {
    justify-content: center;
  }
  .lair-games-grid {
    grid-template-columns: 1fr;
  }
  .arkham-workspace-grid {
    grid-template-columns: 1fr;
  }
  .arkham-hand-and-assets {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   DIXIT RECONNECT BANNER & LIVE TOKEN LOCKING STYLES
   ========================================================================== */
.reconnect-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: linear-gradient(135deg, rgba(6, 214, 160, 0.16) 0%, rgba(246, 196, 67, 0.18) 100%);
  border: 1px solid rgba(6, 214, 160, 0.55);
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 20px;
  text-align: left;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.reconnect-banner-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.reconnect-banner-info strong {
  display: block;
  color: #06d6a0;
  font-size: 0.95rem;
}
.reconnect-banner-info span {
  font-size: 0.82rem;
  color: var(--text-main);
}

.reconnect-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.join-room-live-status {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.84rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
}

.join-reconnect-box {
  background: rgba(246, 196, 67, 0.08);
  border: 1px dashed rgba(246, 196, 67, 0.45);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 18px;
  text-align: left;
}

.join-reconnect-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.btn-reconnect-seat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(246, 196, 67, 0.45);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-reconnect-seat:hover {
  background: rgba(246, 196, 67, 0.25);
  transform: translateY(-1px);
}
.btn-reconnect-seat img {
  width: 20px;
  height: 24px;
}

/* Locked / Taken Rabbit Token Styles */
.token-option {
  position: relative;
}
.token-option.disabled {
  opacity: 0.35 !important;
  filter: grayscale(0.65);
  cursor: not-allowed !important;
  border-color: rgba(239, 71, 111, 0.45) !important;
  background: rgba(239, 71, 111, 0.08) !important;
  transform: none !important;
  box-shadow: none !important;
}

.token-taken-badge {
  position: absolute;
  top: 3px;
  right: 3px;
  font-size: 0.62rem;
  font-weight: 800;
  background: rgba(155, 17, 30, 0.92);
  color: #fff;
  padding: 1px 5px;
  border-radius: 6px;
  max-width: 92%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

/* ==========================================================================
   INICIO RÁPIDO & REGLAS EN ESPAÑOL (3 AGENTES ESPECIALIZADOS)
   ========================================================================== */
.btn-quickstart-glow {
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 55%, #b91c1c 100%);
  color: #ffffff;
  border: 1px solid rgba(254, 240, 138, 0.7);
  font-weight: 800;
  box-shadow: 0 4px 16px rgba(234, 88, 12, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.btn-quickstart-glow:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.6);
}

.btn-rules-es {
  background: linear-gradient(135deg, rgba(45, 198, 83, 0.22), rgba(246, 196, 67, 0.2));
  color: #ffe066;
  border: 1px solid rgba(246, 196, 67, 0.55);
  font-weight: 700;
}
.btn-rules-es:hover {
  background: linear-gradient(135deg, rgba(45, 198, 83, 0.38), rgba(246, 196, 67, 0.34));
  color: #ffffff;
  transform: translateY(-1px);
}

/* Bilingual 24-Page Arkham Rulebook Split View */
.rulebook-bilingual-split {
  display: grid;
  grid-template-columns: minmax(300px, 1.15fr) minmax(300px, 1fr);
  gap: 18px;
  align-items: start;
}
@media (max-width: 880px) {
  .rulebook-bilingual-split {
    grid-template-columns: 1fr;
  }
}
.rulebook-es-companion {
  padding: 18px;
  border-radius: 14px;
  border: 1px solid rgba(45, 198, 83, 0.4);
  background: rgba(11, 20, 16, 0.88);
  max-height: 68vh;
  overflow-y: auto;
  text-align: left;
}
.rulebook-es-companion h4 {
  font-family: var(--font-family);
  color: #72efdd;
  font-size: 1.2rem;
  margin: 0 0 8px 0;
}
.rulebook-es-companion p {
  color: #e2e8f0;
  font-size: 0.94rem;
  line-height: 1.55;
  margin-bottom: 12px;
}
.rulebook-es-keypoints {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rulebook-es-keypoints li {
  background: rgba(255, 255, 255, 0.04);
  border-left: 3px solid #2dc653;
  padding: 8px 12px;
  border-radius: 0 8px 8px 0;
  font-size: 0.88rem;
  color: #cbd5e1;
  line-height: 1.45;
}

/* Spanish Rules & Quick Start Modal (3 Agents) */
.rules-es-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(246, 196, 67, 0.22);
}
.rules-game-switcher {
  display: inline-flex;
  background: rgba(0, 0, 0, 0.45);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  gap: 4px;
}
.rules-game-switcher .btn {
  background: transparent;
  color: var(--text-muted);
  border: none;
  border-radius: 9px;
  padding: 7px 14px;
  font-weight: 700;
}
.rules-game-switcher .btn.active {
  background: linear-gradient(135deg, #f6c443, #d97706);
  color: #120924;
  box-shadow: 0 2px 10px rgba(246, 196, 67, 0.35);
}

.rules-quickstart-hero-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  padding: 14px 18px;
  margin-bottom: 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.16), rgba(45, 198, 83, 0.14));
  border: 1px solid rgba(246, 196, 67, 0.45);
}

.rules-es-dynamic-body {
  max-height: 66vh;
  overflow-y: auto;
  padding-right: 6px;
}

.theory-golden-box {
  background: linear-gradient(135deg, rgba(246, 196, 67, 0.14), rgba(26, 16, 48, 0.85));
  border: 1px solid rgba(246, 196, 67, 0.48);
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 18px;
  line-height: 1.6;
  color: #f8fafc;
}
.theory-phases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.theory-phase-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.theory-phase-card h5 {
  font-family: var(--font-family);
  color: var(--accent-gold);
  font-size: 1.02rem;
  margin: 0;
}
.theory-phase-card p {
  font-size: 0.88rem;
  color: #e2e8f0;
  line-height: 1.5;
  margin: 0;
}
.theory-pro-tip {
  margin-top: auto;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(45, 198, 83, 0.12);
  border-left: 3px solid #2dc653;
  font-size: 0.8rem;
  color: #a7f3d0;
}
.specialist-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.specialist-inv-card {
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(246, 196, 67, 0.3);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.specialist-inv-top {
  display: flex;
  gap: 12px;
  align-items: center;
}
.specialist-inv-top img {
  width: 84px;
  height: 62px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--accent-gold);
  cursor: pointer;
}

/* ==========================================================================
   LA ISLA PROHIBIDA (FORBIDDEN ISLAND) — THEME, 6x6 DIAMOND BOARD & UI
   ========================================================================== */
body[data-active-game="forbidden_island"] {
  background: radial-gradient(circle at 50% 15%, #072a40 0%, #051626 58%, #020a13 100%);
}

.lair-card-island:hover {
  border-color: rgba(76, 201, 240, 0.72);
  box-shadow: 0 18px 44px rgba(0, 180, 216, 0.25);
}

.island-backdrop {
  background: radial-gradient(circle at 50% 35%, rgba(0, 180, 216, 0.38) 0%, rgba(3, 4, 94, 0.78) 70%, #03071e 100%);
}

.realm-island {
  background: rgba(0, 180, 216, 0.22);
  border: 1px solid rgba(76, 201, 240, 0.6);
  color: #90e0ef;
}

.island-title-accent {
  color: #4cc9f0 !important;
}

.island-badge {
  background: rgba(76, 201, 240, 0.16) !important;
  border-color: rgba(76, 201, 240, 0.45) !important;
  color: #90e0ef !important;
}

.island-tags span {
  border-color: rgba(76, 201, 240, 0.35) !important;
  color: #caf0f8 !important;
}

.btn-island-primary {
  background: linear-gradient(135deg, #00b4d8 0%, #0077b6 55%, #03045e 100%);
  color: #ffffff;
  border: 1px solid rgba(144, 224, 239, 0.65);
  font-weight: 800;
  box-shadow: 0 4px 16px rgba(0, 180, 216, 0.35);
}
.btn-island-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
  box-shadow: 0 8px 24px rgba(76, 201, 240, 0.52);
}

.island-border {
  border: 1px solid rgba(76, 201, 240, 0.42) !important;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(144, 224, 239, 0.2);
}

.island-era-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #90e0ef;
  background: rgba(0, 180, 216, 0.16);
  border: 1px solid rgba(76, 201, 240, 0.4);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 6px;
}

.island-table-layout {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 12px 16px 28px 16px;
}

/* ==========================================================================
   ISLAND TACTICAL TABLETOP HUD (Pixel RPG & Dark Fantasy Control Deck)
   ========================================================================== */
.island-top-hud,
.island-top-bar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(8, 14, 28, 0.94) 0%, rgba(4, 9, 20, 0.98) 100%);
  border: 1px solid rgba(76, 201, 240, 0.42);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(144, 224, 239, 0.2);
}

.island-hud-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.island-hud-top-row {
  flex-wrap: wrap;
}

.island-status-cluster {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.island-badge-pill {
  background: rgba(0, 180, 216, 0.18);
  border: 1.5px solid rgba(76, 201, 240, 0.55);
  color: #90e0ef;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.8px;
  padding: 5px 12px;
  border-radius: 999px;
  box-shadow: inset 0 0 10px rgba(0, 180, 216, 0.2);
}

.island-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 5px 12px;
  border-radius: 10px;
  font-size: 0.82rem;
}
.island-stat-pill .stat-lbl {
  color: #94a3b8;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}
.island-stat-pill strong {
  color: #f8fafc;
  font-weight: 800;
}
.island-stat-pill.water-pill strong {
  color: #72efdd;
}

/* Active Adventurer Hero Card in HUD */
.island-active-actor-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px 4px 6px;
  background: rgba(15, 23, 42, 0.88);
  border-radius: 999px;
  border: 1.5px solid rgba(246, 196, 67, 0.45);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}
.actor-avatar-ring {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid #00b4d8;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #020617;
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(0, 180, 216, 0.45);
}
.actor-avatar-ring img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.actor-meta-info {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.actor-tag-sub {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #94a3b8;
  text-transform: uppercase;
}
.actor-name-title {
  font-size: 0.86rem;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
}

.actions-left-chip {
  background: linear-gradient(135deg, rgba(246, 196, 67, 0.28), rgba(217, 119, 6, 0.4));
  border: 1.5px solid #f6c443;
  color: #fff3b0;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.3px;
  box-shadow: 0 0 12px rgba(246, 196, 67, 0.35);
  white-space: nowrap;
}
.actions-left-chip.no-actions-left {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #fca5a5;
  box-shadow: none;
}

/* Sacred Relics Sanctuary HUD */
.island-relics-shrine-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
.relics-shrine-label {
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 1.5px;
  color: var(--accent-gold);
  text-transform: uppercase;
  white-space: nowrap;
}

.island-treasures-topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.island-relic-medallion,
.island-treasure-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 6px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.85);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.island-relic-medallion:hover,
.island-treasure-chip:hover {
  transform: translateY(-2px);
  border-color: var(--relic-color, #4cc9f0);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.55);
}

.relic-token-frame {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.15) 0%, rgba(2, 6, 18, 0.9) 80%);
  border: 1.5px solid var(--relic-color, rgba(255, 255, 255, 0.3));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.8);
}
.relic-token-frame img {
  width: 26px;
  height: 28px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
}
.relic-check-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #10b981;
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #ffffff;
  box-shadow: 0 0 8px #10b981;
}

.relic-info-stack {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.relic-short-title {
  font-weight: 800;
  font-size: 0.76rem;
  color: #f8fafc;
  white-space: nowrap;
}
.relic-status-badge {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 1px 5px;
  border-radius: 4px;
  display: inline-block;
  white-space: nowrap;
}
.relic-status-badge.captured {
  background: rgba(16, 185, 129, 0.22);
  border: 1px solid #10b981;
  color: #6ee7b7;
}
.relic-status-badge.pending {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
}

.island-relic-medallion.captured,
.island-treasure-chip.captured {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.18), rgba(246, 196, 67, 0.16));
  border-color: var(--relic-color, #2dc653);
  box-shadow: 0 0 16px rgba(45, 198, 83, 0.35);
}

/* Row 2: Tactical Action Command Deck */
.island-action-command-deck {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid rgba(76, 201, 240, 0.2);
  width: 100%;
}

.island-action-mode-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-tactical-mode {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 15px;
  border-radius: 11px;
  background: rgba(15, 23, 42, 0.85);
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  color: #e2e8f0;
  font-weight: 800;
  font-size: 0.86rem;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
}
.btn-tactical-mode:hover {
  transform: translateY(-2px);
  border-color: #4cc9f0;
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(76, 201, 240, 0.28);
}
.btn-tactical-mode.active {
  background: linear-gradient(135deg, rgba(0, 180, 216, 0.28) 0%, rgba(3, 4, 94, 0.55) 100%);
  border-color: #00b4d8;
  color: #ffffff;
  box-shadow: 0 0 16px rgba(0, 180, 216, 0.45), inset 0 0 10px rgba(0, 180, 216, 0.25);
}
.tactical-btn-cost {
  font-size: 0.7rem;
  font-weight: 800;
  background: rgba(0, 0, 0, 0.5);
  color: #ffe066;
  border: 1px solid rgba(246, 196, 67, 0.4);
  padding: 1px 6px;
  border-radius: 6px;
}

.btn-capture-treasure.treasure-claim-ready {
  background: linear-gradient(135deg, rgba(246, 196, 67, 0.35), rgba(217, 119, 6, 0.45)) !important;
  border-color: #f6c443 !important;
  color: #fff3b0 !important;
  animation: goldPulse 1.6s infinite alternate;
}

.island-action-end-group {
  margin-left: auto;
}

.btn-island-end-turn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 22px;
  border-radius: 12px;
  background: linear-gradient(135deg, #00b4d8 0%, #0077b6 55%, #03045e 100%);
  border: 1.5px solid rgba(144, 224, 239, 0.7);
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0, 180, 216, 0.45);
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-island-end-turn:hover {
  transform: translateY(-2px);
  filter: brightness(1.15);
  box-shadow: 0 8px 26px rgba(76, 201, 240, 0.6);
}
.btn-island-end-turn:active {
  transform: translateY(1px);
}
.end-turn-main {
  font-size: 0.94rem;
  font-weight: 900;
  letter-spacing: 0.4px;
}
.end-turn-sub {
  font-size: 0.68rem;
  font-weight: 700;
  opacity: 0.92;
  color: #caf0f8;
}

@keyframes goldPulse {
  0% {
    box-shadow: 0 0 8px rgba(246, 196, 67, 0.4);
    border-color: rgba(246, 196, 67, 0.6);
  }
  100% {
    box-shadow: 0 0 22px rgba(246, 196, 67, 0.9), inset 0 0 10px rgba(255, 243, 176, 0.35);
    border-color: #fff3b0;
  }
}

.island-instruction-banner {
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 0.9rem;
  color: #e2e8f0;
  border: 1px solid rgba(76, 201, 240, 0.35);
  background: rgba(7, 42, 64, 0.65);
}
.island-instruction-banner.banner-emergency {
  background: rgba(155, 17, 30, 0.45);
  border-color: #ff4d6d;
  color: #ffe5ec;
}
.island-instruction-banner.banner-warning {
  background: rgba(217, 119, 6, 0.32);
  border-color: #f6c443;
}
.island-instruction-banner.banner-victory {
  background: rgba(45, 198, 83, 0.32);
  border-color: #2dc653;
}
.island-instruction-banner.banner-defeat {
  background: rgba(155, 17, 30, 0.55);
  border-color: #e63946;
}

.island-workspace-grid {
  display: grid;
  grid-template-columns: 1fr 330px;
  gap: 16px;
  align-items: start;
}

.island-board-stage {
  padding: 16px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 50%, rgba(0, 119, 182, 0.28) 0%, rgba(3, 22, 46, 0.85) 75%);
  border: 1px solid rgba(76, 201, 240, 0.32);
  overflow-x: auto;
}

.island-grid-6x6 {
  display: grid;
  grid-template-columns: repeat(6, minmax(112px, 1fr));
  gap: 10px;
  max-width: 840px;
  margin: 0 auto;
}

.island-cell {
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  position: relative;
}

.ocean-void-cell {
  background: radial-gradient(circle at 50% 50%, rgba(0, 180, 216, 0.05), transparent 70%);
  border: 1px dashed rgba(76, 201, 240, 0.08);
  pointer-events: none;
}

.island-tile-card {
  display: flex;
  flex-direction: column;
  background: rgba(15, 23, 42, 0.88);
  border: 2px solid rgba(255, 255, 255, 0.18);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.island-tile-card:hover {
  transform: translateY(-2px);
  border-color: rgba(246, 196, 67, 0.65);
}

.island-tile-card.status-flooded {
  border-color: #00b4d8;
  box-shadow: 0 0 14px rgba(0, 180, 216, 0.45), inset 0 0 18px rgba(0, 180, 216, 0.35);
}

.island-tile-card.status-sunk {
  background: radial-gradient(circle at 50% 50%, rgba(2, 12, 27, 0.92), rgba(0, 0, 0, 0.96));
  border: 1px dashed rgba(76, 201, 240, 0.28);
  cursor: default;
}

.island-tile-card.tile-valid-target {
  border-color: #2dc653 !important;
  box-shadow: 0 0 18px rgba(45, 198, 83, 0.65) !important;
}

.island-tile-img-wrap {
  position: relative;
  flex: 1;
  width: 100%;
  overflow: hidden;
}
.island-tile-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tile-corner-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  z-index: 3;
}

.tile-zoom-mini-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.68);
  color: #fff;
  font-size: 0.68rem;
  cursor: pointer;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tile-flooded-ribbon {
  position: absolute;
  top: 30px;
  left: 0;
  right: 0;
  background: rgba(0, 119, 182, 0.86);
  color: #caf0f8;
  font-size: 0.62rem;
  font-weight: 800;
  text-align: center;
  padding: 2px 0;
  letter-spacing: 0.8px;
  z-index: 2;
}

.tile-action-hint-pill {
  position: absolute;
  bottom: 4px;
  left: 4px;
  background: rgba(45, 198, 83, 0.92);
  color: #04130a;
  font-size: 0.62rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 6px;
  z-index: 3;
}

.tile-pawns-container {
  position: absolute;
  bottom: 4px;
  right: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  z-index: 5;
}

.island-pawn-badge {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.island-pawn-badge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.island-tile-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  background: rgba(5, 12, 24, 0.94);
  min-height: 22px;
}

.island-tile-name {
  font-size: 0.65rem;
  font-weight: 700;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tile-quick-shore-btn {
  background: #00b4d8;
  color: #03045e;
  border: none;
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.6rem;
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
}

.sunk-abyss-inner {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px;
  text-align: center;
  color: #64748b;
}
.sunk-abyss-inner .sunk-icon {
  font-size: 1.3rem;
  opacity: 0.5;
}
.sunk-abyss-inner small {
  font-size: 0.64rem;
}
.sunk-abyss-inner .sunk-tag {
  font-size: 0.58rem;
  font-weight: 800;
  color: #ef4444;
  letter-spacing: 1px;
}

/* Water Level Track Sidebar */
.island-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.island-water-panel {
  padding: 12px 14px;
  border-radius: 14px;
}

.island-water-track {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.water-rung {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.75rem;
  color: #94a3b8;
}
.water-rung.skull-rung {
  border-color: rgba(239, 68, 68, 0.45);
  color: #fca5a5;
}
.water-rung.active-rung {
  background: linear-gradient(90deg, rgba(0, 180, 216, 0.35), rgba(76, 201, 240, 0.18));
  border-color: #4cc9f0;
  color: #ffffff;
  font-weight: 800;
}
.rung-marker {
  background: #4cc9f0;
  color: #03045e;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 800;
}

.island-decks-counters {
  display: flex;
  flex-direction: column;
  gap: 5px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 8px;
  font-size: 0.78rem;
}
.deck-counter-chip {
  display: flex;
  justify-content: space-between;
  color: #cbd5e1;
}

.active-turn-row {
  background: rgba(76, 201, 240, 0.14) !important;
}

.island-dashboard-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.island-active-player-meta {
  flex: 1;
  min-width: 260px;
}
.island-hand-card {
  width: 122px;
  align-items: center;
}
.island-card-mini-lbl {
  font-size: 0.68rem;
  font-weight: 700;
  color: #e2e8f0;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

@media (max-width: 1024px) {
  .island-workspace-grid {
    grid-template-columns: 1fr;
  }
}


