/* ==========================================================================
   Portal de Juegos de Baraja Española Online - CSS3 Zero-Dependency
   Optimizado para Core Web Vitals (CLS = 0, 60 FPS GPU, Mobile-First)
   ========================================================================== */

:root {
  --bg-body: #0f172a;
  --bg-felt: #114b32;
  --bg-felt-accent: #0d3b27;
  --bg-surface: #1e293b;
  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --gold-accent: #fbbf24;
  --gold-border: #d97706;
  --danger-color: #ef4444;
  --radius-md: 10px;
  --radius-lg: 14px;
  --card-w: clamp(40px, 12.2vw, 108px);
  --card-h: calc(var(--card-w) * 1.54);
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.55;
  overflow-x: hidden;
}

/* Header & Navegación Principal */
.site-header {
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid rgba(251, 191, 36, 0.25);
  padding: 0.65rem 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.brand-logo {
  color: var(--gold-accent);
  text-decoration: none;
  font-weight: 800;
  font-size: 1.15rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.brand-logo-card {
  height: 1.55em;
  width: auto;
  border-radius: 3px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  display: block;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.nav-link {
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  touch-action: manipulation;
  transition: background 0.15s ease;
}

.nav-link:hover,
.nav-link[aria-current="page"] {
  background: var(--gold-accent);
  color: #0f172a;
  font-weight: 700;
}

/* Contenedores de Anuncios con Reserva Estricta (CLS = 0) */
.ad-slot-banner {
  max-width: 970px;
  min-height: 90px;
  height: 90px;
  margin: 0.75rem auto;
  background: rgba(30, 41, 59, 0.65);
  border: 1px dashed rgba(203, 213, 225, 0.25);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  overflow: hidden;
}

/* Contenedor Principal */
.main-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1rem 2.5rem;
}

/* Barra de Herramientas del Juego */
.game-toolbar {
  background: var(--bg-surface);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.9rem;
  margin-bottom: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.toolbar-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem;
  font-size: 0.92rem;
}

.stat-pill {
  background: rgba(15, 23, 42, 0.7);
  padding: 0.28rem 0.65rem;
  border-radius: 6px;
  border: 1px solid rgba(251, 191, 36, 0.25);
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.btn-action,
.select-control {
  background: #334155;
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.42rem 0.75rem;
  border-radius: 6px;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-action:hover:not(:disabled) {
  background: #475569;
  border-color: var(--gold-accent);
}

.btn-action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--gold-accent);
  color: #0f172a;
  border-color: var(--gold-border);
}

.btn-primary:hover:not(:disabled) {
  background: #f59e0b;
}

.status-banner {
  background: rgba(15, 23, 42, 0.8);
  border-left: 4px solid var(--gold-accent);
  padding: 0.45rem 0.85rem;
  margin-bottom: 0.75rem;
  border-radius: 4px;
  font-size: 0.92rem;
}

/* Tapete Verde Tradicional */
.felt-board {
  background: radial-gradient(circle at center, var(--bg-felt) 0%, var(--bg-felt-accent) 100%);
  border: 3px solid #78350f;
  box-shadow: inset 0 0 32px rgba(0, 0, 0, 0.55), 0 8px 24px rgba(0, 0, 0, 0.4);
  border-radius: var(--radius-lg);
  padding: 1rem;
  min-height: 540px;
  user-select: none;
  touch-action: manipulation;
  position: relative;
}

/* Escenario Jugable a Pantalla Completa (Solitaired-style: 100vh desde el inicio, scroll para ver reglas) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.solitario-page-body {
  background-color: var(--bg-body);
}

.solitario-compact-header {
  padding: 0.4rem 1rem;
  background: #0b2917;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.solitario-main-wrapper {
  width: 100%;
  margin: 0;
  padding: 0;
}

.solitario-viewport-stage {
  min-height: calc(100dvh - 44px);
  background: radial-gradient(ellipse at center, #1e6b3b 0%, #134626 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  position: relative;
  overflow: hidden;
}

.solitaired-top-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem 0.75rem;
  width: 100%;
  max-width: 100%;
  padding: 0.5rem 0.9rem;
  background: rgba(10, 38, 21, 0.45);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.solitaired-left-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.game-brand-title {
  font-size: 1.15rem;
  color: #ffffff;
  margin-right: 0.35rem;
}

.btn-pill,
.select-pill {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 0.32rem 0.68rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.15s ease, transform 0.1s ease;
}

.btn-pill:hover:not(:disabled),
.select-pill:hover {
  background: rgba(255, 255, 255, 0.24);
}

.btn-pill.is-active {
  background: #ffffff;
  color: #134626;
}

.btn-green-pill {
  background: #22c55e;
  color: #052e16;
  border-color: #4ade80;
}

.btn-green-pill:hover:not(:disabled) {
  background: #4ade80;
}

.btn-purple-pill {
  background: #9333ea;
  color: #ffffff;
  border-color: #a855f7;
}

.btn-purple-pill:hover:not(:disabled) {
  background: #a855f7;
}

.btn-orange-pill {
  background: #f97316;
  color: #ffffff;
  border-color: #fb923c;
}

.btn-orange-pill:hover:not(:disabled) {
  background: #fb923c;
}

.btn-gold-pill {
  background: var(--gold-accent);
  color: #0f172a;
  border-color: var(--gold-border);
}

.btn-gold-pill:hover:not(:disabled) {
  background: #f59e0b;
}

.btn-pill:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.solitaired-right-metrics {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}

.metric-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.1;
}

.metric-value {
  color: #fde047;
  font-weight: 800;
  font-size: 0.98rem;
  font-variant-numeric: tabular-nums;
}

.metric-label {
  color: #bbf7d0;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric-wins-badge {
  background: rgba(0, 0, 0, 0.28);
  padding: 0.28rem 0.65rem;
  border-radius: 6px;
  font-size: 0.8rem;
  color: #fde047;
}

.solitaired-felt-arena {
  flex: 1 1 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.85rem 1rem 1.5rem;
  position: relative;
}

.solitaired-board-inner {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  user-select: none;
  touch-action: none;
  --col-gap: clamp(4px, 1vw, 10px);
  --card-w: min(108px, calc((100% - (6 * var(--col-gap))) / 7));
  --card-h: calc(var(--card-w) * 1.54);
}

.solitario-top-row .card-pile {
  width: 100%;
  max-width: 108px;
  aspect-ratio: 100 / 154;
  height: auto;
}

.waste-fan-slot {
  position: absolute;
  top: 0;
  left: calc(var(--fan-index, 0) * 18%);
  width: 100%;
  height: 100%;
}

/* Toast inferior de Auto-Complete ("Game won! Finishing...") */
.autocomplete-toast {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.92);
  color: #ffffff;
  padding: 0.55rem 1.2rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
  z-index: 1200;
}

.autocomplete-toast[hidden] {
  display: none !important;
}

.toast-check {
  background: #22c55e;
  color: #052e16;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

/* Modal de Victoria "¡FELICIDADES!" estilo Solitaired */
.victory-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 28, 15, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1500;
  overflow: hidden;
}

.victory-modal-backdrop[hidden] {
  display: none !important;
}

.victory-cascade-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.cascade-trail-card {
  position: absolute;
  width: var(--card-w);
  height: var(--card-h);
  opacity: 0.88;
}

.victory-modal-card {
  position: relative;
  z-index: 2;
  background: #ffffff;
  color: #0f172a;
  width: min(92%, 480px);
  border-radius: 14px;
  padding: 1.75rem 1.5rem;
  text-align: center;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.55);
}

.victory-heading {
  margin: 0;
  color: #15803d;
  font-size: 1.85rem;
  font-weight: 900;
  letter-spacing: 0.03em;
}

.no-moves-heading {
  margin: 0;
  color: #b45309;
  font-size: 1.55rem;
  font-weight: 900;
}

.modal-full-btn {
  width: 100%;
  padding: 0.68rem 1.2rem;
  font-size: 0.92rem;
}

.modal-secondary-btn {
  width: 100%;
  padding: 0.62rem 1.2rem;
  font-size: 0.9rem;
  background: #e2e8f0;
  color: #1e293b;
  border-color: #cbd5e1;
}

.modal-secondary-btn:hover {
  background: #cbd5e1;
}

/* Resaltado visual de Pista Sugerida (Hint Highlight sin ejecutar el movimiento) */
@keyframes hintPulseGlow {
  0%, 100% {
    box-shadow: 0 0 0 3px #fbbf24, 0 0 18px rgba(251, 191, 36, 0.95);
  }
  50% {
    box-shadow: 0 0 0 6px #f59e0b, 0 0 28px rgba(245, 158, 11, 1);
  }
}

.is-hint-source {
  border-radius: 8px;
  animation: hintPulseGlow 0.95s ease-in-out infinite;
  z-index: 980 !important;
}

.is-hint-target {
  border-color: #fbbf24 !important;
  box-shadow: 0 0 0 3px #fbbf24, inset 0 0 16px rgba(251, 191, 36, 0.55) !important;
  animation: hintPulseGlow 0.95s ease-in-out infinite;
}

.victory-subtitle {
  margin: 0.35rem 0 1.25rem;
  color: #475569;
  font-size: 0.92rem;
}

.victory-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  background: #f1f5f9;
  padding: 0.9rem 0.5rem;
  border-radius: 10px;
  margin-bottom: 1.35rem;
}

.v-stat-box {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.v-stat-num {
  font-size: 1.2rem;
  font-weight: 800;
  color: #15803d;
}

.v-stat-lbl {
  font-size: 0.7rem;
  color: #64748b;
  text-transform: uppercase;
  font-weight: 700;
}

.victory-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
}

.btn-play-next {
  background: #16a34a;
  color: #ffffff;
  border: none;
  padding: 0.75rem 1.8rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  width: 100%;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.35);
}

.btn-play-next:hover {
  background: #15803d;
}

.below-the-fold-content {
  width: 100%;
  background: var(--bg-body);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 2rem 1rem 3rem;
}

.below-the-fold-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.rules-grid-2col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin: 1.25rem 0;
}

.rule-box-card {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(251, 191, 36, 0.22);
  border-radius: 10px;
  padding: 1.15rem;
}

.rule-box-card h3 {
  margin-top: 0;
  font-size: 1.08rem;
}

.faq-item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.9rem 0;
}

.faq-item:last-child {
  border-bottom: none;
}

/* Ajustes Responsivos para Móviles (Evitar empalme de las 7 columnas) */
@media (max-width: 640px) {
  :root {
    --card-w: calc((100vw - 16px - (6 * 4px)) / 7);
    --card-h: calc(var(--card-w) * 1.54);
  }

  .solitaired-top-bar {
    padding: 0.45rem 0.5rem;
    gap: 0.4rem;
  }

  .btn-pill,
  .select-pill {
    padding: 0.26rem 0.48rem;
    font-size: 0.74rem;
  }

  .solitaired-felt-arena {
    padding: 0.5rem 8px 1rem;
  }

  .solitario-top-row,
  .solitario-tableau-grid {
    gap: 4px;
  }

  .empty-pile-label,
  .empty-pile-icon {
    font-size: 0.54rem;
    padding: 0.1rem;
    word-break: break-word;
  }

  .waste-fan-slot {
    left: calc(var(--fan-index, 0) * 10px);
  }

  .pile-count-badge {
    font-size: 0.65rem;
    padding: 0.05rem 0.32rem;
    bottom: -6px;
    right: -4px;
  }
}

/* Cartas SVG y Pilas */
.spanish-card-svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.45));
}

.card-pile {
  width: var(--card-w);
  height: var(--card-h);
  border: 2px dashed rgba(251, 191, 36, 0.4);
  border-radius: 8px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.18);
  padding: 0;
}

.stock-pile {
  cursor: pointer;
}

.pile-count-badge {
  position: absolute;
  bottom: -8px;
  right: -8px;
  background: var(--gold-accent);
  color: #0f172a;
  font-weight: 800;
  font-size: 0.75rem;
  padding: 0.1rem 0.42rem;
  border-radius: 999px;
  border: 1px solid #78350f;
}

.empty-pile-label,
.empty-pile-icon {
  font-size: 0.75rem;
  color: rgba(254, 243, 199, 0.75);
  text-align: center;
  padding: 0.25rem;
  font-weight: 600;
}

/* Layout de Solitario Español (Alineado en 7 columnas tipo Solitaired.com) */
.solitario-top-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--col-gap, 0.5rem);
  margin-bottom: 1.15rem;
  justify-items: center;
  width: 100%;
}

.top-row-spacer {
  width: 100%;
  height: 1px;
}

.solitario-tableau-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--col-gap, 0.5rem);
  min-height: 410px;
  width: 100%;
}

.tableau-column {
  position: relative;
  width: 100%;
  min-height: calc(var(--card-h) + 220px);
  border: 2px dashed rgba(255, 255, 255, 0.14);
  border-radius: 8px;
}

.tableau-column .card-slot-item {
  width: 100%;
  max-width: 108px;
  aspect-ratio: 100 / 154;
  height: auto;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: var(--card-top, 0px);
  cursor: grab;
  will-change: transform;
}

.tableau-column .card-slot-item.is-dragging {
  cursor: grabbing;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.55));
}

.waste-pile .card-slot-item {
  width: 100%;
  height: 100%;
  cursor: pointer;
  will-change: transform;
}

/* Layout de Conquián Mexicano (100dvh Solitaired-style) */
.conquian-felt-arena {
  padding: 0.55rem 0.9rem 1rem;
  justify-content: space-between;
  gap: 0.45rem;
}

.conquian-status-bar {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  min-height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 38, 21, 0.58);
  border: 1px solid rgba(251, 191, 36, 0.32);
  border-left: 4px solid var(--gold-accent);
  color: #fef3c7;
  padding: 0.42rem 0.85rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
}

.conquian-board-inner {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.55rem;
  user-select: none;
  touch-action: manipulation;
  --card-w: clamp(46px, 10.5vw, 94px);
  --card-h: calc(var(--card-w) * 1.54);
}

.conquian-player-zone {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(251, 191, 36, 0.22);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.75rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.conquian-player-zone.is-active-turn {
  border-color: rgba(251, 191, 36, 0.75);
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.18);
}

.zone-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
  color: var(--gold-accent);
}

.bot-hand-center {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-height: calc(var(--card-h) * 0.72 + 8px);
  padding: 0.15rem 0 0.25rem;
}

.bot-hand-backs {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.bot-back-mini {
  width: 24px;
  height: 37px;
  margin-left: -10px;
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

.bot-back-mini:first-child {
  margin-left: 0;
}

.melds-showcase {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  min-height: 68px;
  align-items: center;
}

.empty-melds-hint {
  margin: 0;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.55);
  font-style: italic;
}

.meld-group-box {
  display: inline-flex;
  gap: 0.2rem;
  background: rgba(15, 23, 42, 0.5);
  padding: 0.25rem;
  border-radius: 8px;
  border: 1px solid rgba(251, 191, 36, 0.65);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.meld-group-box.is-extendable {
  cursor: pointer;
  border-color: #4ade80;
  box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.65), 0 0 14px rgba(34, 197, 94, 0.45);
}

.meld-group-box.is-extendable:hover {
  transform: translateY(-2px);
}

.meld-group-box.is-hint-target {
  border-color: #c084fc;
  box-shadow: 0 0 0 3px #a855f7, 0 0 16px rgba(168, 85, 247, 0.8);
}

.meld-card-mini {
  width: calc(var(--card-w) * 0.64);
  height: calc(var(--card-h) * 0.64);
  will-change: transform;
}

.conquian-center-arena {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(1rem, 4vw, 2.75rem);
  margin: 0.15rem 0;
  flex-wrap: wrap;
}

.center-pile-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.28rem;
}

.pile-caption {
  font-size: 0.78rem;
  color: #fef3c7;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.conquian-pile-slot {
  width: var(--card-w);
  height: var(--card-h);
  border-radius: 8px;
  border: 2px dashed rgba(255, 255, 255, 0.24);
  background: rgba(0, 0, 0, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.conquian-stock-btn {
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 8px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.conquian-stock-btn:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
}

.conquian-stock-btn:disabled {
  cursor: default;
  opacity: 0.85;
}

.conquian-stock-btn.is-hint-target,
.conquian-pile-slot.is-hint-target {
  box-shadow: 0 0 0 3px #a855f7, 0 0 18px rgba(168, 85, 247, 0.85);
}

.active-card-spotlight .conquian-pile-slot.has-card {
  border-style: solid;
  border-color: var(--gold-accent);
  box-shadow: 0 0 18px rgba(251, 191, 36, 0.35);
}

.conquian-active-card-wrap {
  width: 100%;
  height: 100%;
  will-change: transform;
}

.empty-pile-label {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.55);
  text-align: center;
  padding: 0.25rem;
}

.conquian-hand-row {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(0.25rem, 0.8vw, 0.48rem);
  justify-content: center;
  align-items: flex-start;
  min-height: calc(var(--card-h) + 12px);
  padding-top: 0.5rem;
}

.hand-card-btn {
  position: relative;
  width: var(--card-w);
  height: var(--card-h);
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
  will-change: transform;
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

.escoba-card-val-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(15, 23, 42, 0.88);
  color: #fde047;
  border: 1px solid #fbbf24;
  border-radius: 999px;
  min-width: 20px;
  height: 20px;
  padding: 0 4px;
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
  pointer-events: none;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.45);
}

.hand-card-btn:hover {
  transform: translateY(-4px);
}

.hand-card-btn.is-selected {
  transform: translateY(-12px);
  border-color: var(--gold-accent);
  box-shadow: 0 6px 14px rgba(251, 191, 36, 0.5);
}

.hand-card-btn.is-hint-source,
.hand-card-btn.is-hint-target {
  border-color: #c084fc;
  box-shadow: 0 0 0 3px #a855f7, 0 0 16px rgba(168, 85, 247, 0.8);
  transform: translateY(-8px);
}

.escoba-sum-badge {
  background: rgba(0, 0, 0, 0.35);
  color: #fef3c7;
  padding: 0.32rem 0.72rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.escoba-sum-badge.is-ready-15 {
  background: #16a34a;
  color: #ffffff;
  border-color: #4ade80;
}

.escoba-score-detail {
  font-size: 0.82rem;
  color: #475569;
  margin: 0.65rem 0 0;
  line-height: 1.45;
}

.escoba-table-layout {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  flex-wrap: wrap;
}

.escoba-stock-pile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  flex: 0 0 auto;
}

.escoba-stock-card {
  width: calc(var(--card-w) * 0.82);
  height: calc(var(--card-h) * 0.82);
  border-radius: 6px;
  box-shadow: -2px 2px 0 rgba(255, 255, 255, 0.45), -4px 4px 8px rgba(0, 0, 0, 0.45);
}

.escoba-zone-right {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.escoba-captured-pile {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(15, 23, 42, 0.42);
  padding: 0.22rem 0.55rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.escoba-stack-visual {
  position: relative;
  width: 28px;
  height: 42px;
  flex-shrink: 0;
}

.escoba-stack-base {
  width: 26px;
  height: 40px;
  border-radius: 4px;
  box-shadow: -2px 2px 0 rgba(255, 255, 255, 0.5), 0 2px 6px rgba(0, 0, 0, 0.45);
}

.escoba-stack-empty {
  width: 26px;
  height: 40px;
  border-radius: 4px;
  border: 1px dashed rgba(255, 255, 255, 0.3);
}

.escoba-golden-marker {
  position: absolute;
  top: 2px;
  width: 22px;
  height: 34px;
  border-radius: 3px;
  background: linear-gradient(135deg, #fde047 0%, #eab308 100%);
  border: 1.5px solid #fef9c3;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.45);
  transform: rotate(12deg);
}

.escoba-stack-meta {
  font-size: 0.75rem;
  color: #fef3c7;
  font-weight: 700;
  white-space: nowrap;
}

.escoba-dealer-badge {
  background: rgba(251, 191, 36, 0.2);
  color: #fde047;
  border: 1px solid rgba(251, 191, 36, 0.45);
  border-radius: 999px;
  padding: 0.08rem 0.45rem;
  font-size: 0.68rem;
  font-weight: 700;
  margin-left: 0.4rem;
}

.escoba-bot-play-preview {
  display: inline-flex;
  align-items: center;
  animation: escobaBotReveal 720ms cubic-bezier(0.22, 1, 0.36, 1);
}

.escoba-bot-play-preview .hand-card-btn {
  width: calc(var(--card-w) * 0.72);
  height: calc(var(--card-h) * 0.72);
}

.hand-card-btn.is-bot-target {
  transform: translateY(-6px) scale(1.04);
  box-shadow: 0 0 0 3px #fbbf24, 0 0 18px rgba(251, 191, 36, 0.75);
  border-radius: 7px;
  z-index: 15;
}

@keyframes escobaBotReveal {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.conquian-action-dock {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.6rem;
  background: rgba(10, 38, 21, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
}

.mobile-games-dropdown {
  display: none;
  position: relative;
}

@media (max-width: 640px) {
  .site-header .header-inner {
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: 0.5rem;
  }
  .solitario-compact-header {
    padding: 0.35rem 0.6rem;
  }
  .brand-logo,
  .solitario-compact-header .brand-logo {
    font-size: 0.92rem;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .main-nav {
    display: none;
  }
  .mobile-games-dropdown {
    display: block;
    flex-shrink: 0;
  }
  .mobile-games-trigger {
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 36px;
    padding: 0.32rem 0.78rem;
    border-radius: 8px;
    background: var(--gold-accent);
    color: #0f172a;
    font-size: 0.85rem;
    font-weight: 800;
    cursor: pointer;
    touch-action: manipulation;
    user-select: none;
  }
  .mobile-games-trigger::-webkit-details-marker {
    display: none;
  }
  .mobile-games-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 0.4rem);
    min-width: 210px;
    background: #0f172a;
    border: 1px solid rgba(251, 191, 36, 0.45);
    border-radius: 10px;
    padding: 0.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.55);
    z-index: 300;
  }
  .mobile-games-menu .nav-link {
    width: 100%;
    min-height: 40px;
    display: flex;
    align-items: center;
    padding: 0.45rem 0.75rem;
    font-size: 0.88rem;
    border-radius: 7px;
    white-space: nowrap;
  }
  .solitaired-top-bar {
    padding: 0.38rem 0.5rem;
    gap: 0.35rem;
  }
  .solitaired-left-controls {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }
  .solitaired-left-controls::-webkit-scrollbar {
    display: none;
  }
  .solitaired-left-controls .btn-pill,
  .solitaired-left-controls .select-pill {
    white-space: nowrap;
    flex-shrink: 0;
    min-height: 36px;
  }
  .solitaired-right-metrics {
    width: 100%;
    justify-content: space-between;
    gap: 0.5rem;
  }
  .solitaired-felt-arena {
    padding: 0.45rem 0.38rem 0.85rem;
  }
  .solitario-top-row {
    margin-bottom: 0.55rem;
  }
  .solitario-tableau-grid {
    min-height: 300px;
  }
  .tableau-column {
    min-height: calc(var(--card-h) + 140px);
  }
  .conquian-felt-arena {
    padding: 0.35rem 0.4rem 0.65rem;
    gap: 0.35rem;
  }
  .conquian-status-bar {
    min-height: 3.1rem;
    font-size: 0.78rem;
    padding: 0.32rem 0.55rem;
  }
  .conquian-board-inner {
    --card-w: clamp(44px, 14.5vw, 68px);
    gap: 0.38rem;
  }
  .conquian-player-zone {
    padding: 0.38rem 0.5rem;
  }
  .zone-header {
    font-size: 0.78rem;
    gap: 0.35rem;
  }
  .escoba-table-layout {
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
  }
  .escoba-stock-pile {
    flex-direction: row;
    justify-content: center;
    gap: 0.5rem;
  }
  .escoba-stock-card {
    width: 32px;
    height: 49px;
  }
  .conquian-action-dock {
    padding: 0.38rem 0.45rem;
    gap: 0.35rem;
  }
  .conquian-action-dock .btn-pill {
    font-size: 0.76rem;
    padding: 0.32rem 0.55rem;
    min-height: 38px;
  }
  .victory-modal-card {
    padding: 1.25rem 1rem;
  }
}

@media (max-width: 420px) {
  .victory-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Grid de Catálogo en Hub Principal */
.games-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1.15rem;
  margin: 1.5rem 0;
}

.game-card-tile {
  background: var(--bg-surface);
  border: 1px solid rgba(251, 191, 36, 0.28);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.game-card-tile h2 {
  margin-top: 0;
  color: var(--gold-accent);
  font-size: 1.25rem;
}

/* Contenido Editorial SEO (Reglas, Estrategia, FAQ) */
.seo-guide-section {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-top: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.seo-guide-section h1,
.seo-guide-section h2,
.seo-guide-section h3 {
  color: var(--gold-accent);
}

.site-footer {
  text-align: center;
  padding: 1.5rem 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
