/* ============================================================
   style.css — Estilos base para Yavii (Seguridad Comunitaria)
   ============================================================ */

/* ─── Variables de tema ────────────────────────────── */
:root {
  --bg-body: #fef2f2;
  --bg-card: #ffffff;
  --bg-card-alt: #fef2f2;
  --text-primary: #1a202c;
  --text-secondary: #4a5568;
  --text-muted: #718096;
  --border-light: #fecaca;
  --red-50: #fef2f2;
  --red-100: #fee2e2;
  --red-700: #b91c1c;
  --red-800: #991b1b;
  --red-900: #7f1d1d;
  --shadow-card: rgba(0,0,0,0.08);
  --header-bg: transparent;
  --offline-badge-bg: #dc2626;
  --map-border: #fecaca;
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.25rem;
  --fs-2xl: 1.5rem;
  --fs-3xl: 1.875rem;
  --min-touch: 44px;
}

.dark-mode {
  --bg-body: #0f172a;
  --bg-card: #1e293b;
  --bg-card-alt: #1e293b;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #94a3b8;
  --border-light: #334155;
  --red-50: #0f172a;
  --red-100: #1e293b;
  --red-700: #fca5a5;
  --red-800: #fecaca;
  --red-900: #fee2e2;
  --shadow-card: rgba(0,0,0,0.3);
  --header-bg: #0f172a;
  --offline-badge-bg: #991b1b;
  --map-border: #334155;
}

/* ─── Reseteo y tipografía ─────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ─── Touch targets mínimos (UI/UX Pro Max: 44x44px) ─── */
button, a, input[type="button"], input[type="submit"], .nav-btn, [role="button"] {
  min-height: var(--min-touch);
  min-width: var(--min-touch);
}

/* ─── Focus states accesibles ─── */
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--red-700);
  outline-offset: 2px;
}

/* ─── Transiciones suaves (150-300ms per pro-rules) ─── */
button, a, .nav-btn {
  transition: background-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

/* ─── Skeleton loading ─── */
.skeleton {
  background: linear-gradient(90deg, var(--border-light) 25%, transparent 50%, var(--border-light) 75%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  border-radius: 8px;
}
@keyframes skeleton-pulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── Icon helper ─── */
.icon-sm { width: 18px; height: 18px; }
.icon-md { width: 24px; height: 24px; }
.icon-lg { width: 32px; height: 32px; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-body);
  min-height: 100dvh;
  transition: background 0.3s, color 0.3s;
}

:focus-visible {
  outline: 2px solid #f59e0b;
  outline-offset: 2px;
  border-radius: 4px;
}

.solo-local { display: revert; }
.modo-embajador .solo-local { display: none !important; }

/* ─── Layout principal ─────────────────────────────────── */
.app-container {
  max-width: 480px;
  margin: 0 auto;
  padding: 1rem;
  padding-bottom: 5rem;
}

/* ─── Header ───────────────────────────────────────────── */
.app-header {
  text-align: center;
  padding: 1.5rem 0 1rem;
  position: relative;
  background: var(--header-bg);
  transition: background 0.3s;
}

.app-header .menu-hamburger {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  z-index: 10;
}

.app-header .menu-hamburger span {
  display: block;
  width: 24px;
  height: 3px;
  background: var(--red-800);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.app-header .header-center {
  flex: 1;
}

.app-header h1 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--red-800);
  line-height: 1.2;
}

.app-header p {
  font-size: 0.85rem;
  color: var(--red-700);
  margin-top: 0.25rem;
}

/* ─── Tarjetas de sitios ───────────────────────────────── */
.sitio-card {
  background: var(--bg-card);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 2px 12px var(--shadow-card);
  margin-bottom: 1rem;
  transition: transform 0.2s, background 0.3s, box-shadow 0.3s;
}

.sitio-card:active {
  transform: scale(0.98);
}

.sitio-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  background: #e2e8f0;
}

.sitio-card .sitio-body {
  padding: 1rem;
}

.sitio-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--red-800);
  margin-bottom: 0.25rem;
}

.sitio-card .desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.sitio-card .distancia {
  font-size: 0.8rem;
  color: #38a169;
  font-weight: 600;
}

/* ─── Modal ────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--bg-card);
  border-radius: 1.5rem;
  padding: 2rem 1.5rem;
  max-width: 400px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  transition: background 0.3s;
}

.modal-content h2 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--red-800);
  margin-bottom: 0.5rem;
}

.modal-content p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.modal-content .btn-grande {
  display: block;
  width: 100%;
  padding: 1rem;
  font-size: 1.1rem;
  font-weight: 700;
  border: none;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: background 0.2s;
  margin-bottom: 0.75rem;
}

.btn-registrar {
  background: #dc2626;
  color: white;
}

.btn-registrar:hover {
  background: #b91c1c;
}

.btn-audio {
  background: #2563eb;
  color: white;
}

.btn-audio:hover {
  background: #1d4ed8;
}

.btn-cerrar {
  background: #e2e8f0;
  color: #475569;
  font-weight: 600;
}

/* ─── Slider menu ──────────────────────────────────────── */
.slide-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  height: 100dvh;
  background: var(--bg-card);
  box-shadow: 4px 0 20px var(--shadow-card);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  padding: 1rem 0;
  transform: translateX(-100%);
  transition: transform 0.3s ease, background 0.3s, box-shadow 0.3s;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--red-700) transparent;
}
.slide-nav::-webkit-scrollbar {
  width: 4px;
}
.slide-nav::-webkit-scrollbar-thumb {
  background: var(--red-700);
  border-radius: 4px;
}

.slide-nav.open {
  transform: translateX(0);
}

/* ─── Modo Desktop/Laptop: slider siempre visible (solo logueado) ─────── */
@media (min-width: 1024px) {
  body.logged-in .slide-nav {
    transform: translateX(0) !important;
    box-shadow: none;
    border-right: 1px solid var(--border-light);
    padding: 0.5rem 0;
  }
  body.logged-in .slide-nav .slide-nav-header {
    padding: 0.5rem 1rem 0.75rem;
    margin-bottom: 0.25rem;
  }
  body.logged-in .slide-nav .nav-btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }
  body.logged-in .slide-nav .nav-btn .icono {
    font-size: 1rem;
    width: 1.4rem;
  }
  body.logged-in .nav-overlay {
    display: none !important;
  }
  body.logged-in .menu-hamburger {
    display: none !important;
  }
  body.logged-in .map-blur {
    filter: none !important;
  }
  body.logged-in .theme-toggle {
    padding-top: 0.35rem !important;
    margin-top: 0.5rem;
  }
  body.logged-in .app-container {
    margin-left: 260px;
    width: calc(100% - 260px);
    max-width: 100%;
    padding: 1rem 2rem;
  }
  body.logged-in .offline-badge {
    left: 260px;
    width: calc(100% - 260px);
  }
  body.logged-in .app-header {
    left: 0;
    width: 100%;
    padding-left: 0;
    text-align: left;
    padding: 0.75rem 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
  }
  body.logged-in .app-header h1 {
    font-size: 1.2rem;
    margin: 0;
  }
  body.logged-in .header-center {
    margin-left: 0;
    flex: 1 0 100%;
    text-align: left;
    order: -1;
  }
  body.logged-in .app-header .header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
  }
  body.logged-in #seccionSitios {
    display: flex;
    flex-direction: column;
    height: 100vh;
  }
  body.logged-in #seccionSitios .map-container {
    flex: 1;
    height: auto;
    min-height: 300px;
  }
  body.logged-in .sitio-card {
    margin-bottom: 0.5rem;
  }
  body.logged-in #appFooter {
    margin-left: 260px;
    width: calc(100% - 260px);
  }
  body.logged-in #xunuBubble {
    right: 24px;
    bottom: 24px;
  }

  body.logged-in .content-area {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
  }
  body.logged-in .main-content {
    flex: 1;
    min-width: 0;
  }
  body.logged-in .side-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 300px;
    flex-shrink: 0;
    position: sticky;
    top: 1rem;
    align-self: flex-start;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    scrollbar-width: thin;
  }
  body.logged-in .side-widget {
    background: linear-gradient(180deg, var(--bg-card), var(--bg-body));
    border: 1px solid #f87171;
    border-radius: 0.75rem;
    padding: 1rem;
    box-shadow: 0 0 12px rgba(248, 113, 113, 0.15), inset 0 0 20px rgba(248, 113, 113, 0.03);
    position: relative;
    overflow: hidden;
  }
  body.logged-in .side-widget::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #fca5a5, transparent);
  }
  body.logged-in .side-widget-title {
    font-size: 0.75rem;
    font-weight: 800;
    color: #fca5a5;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    text-shadow: 0 0 8px rgba(252, 165, 165, 0.4);
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  body.logged-in .side-widget-body {
    font-size: 0.8rem;
  }
  body.logged-in .side-reto {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(74, 222, 128, 0.1);
  }
  body.logged-in .side-reto:last-child {
    border-bottom: none;
  }
  body.logged-in .side-reto-check {
    width: 16px; height: 16px;
    border: 2px solid #4ade80;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 10px;
  }
  body.logged-in .side-reto-check.done {
    background: #22c55e;
    border-color: #22c55e;
  }
  body.logged-in .side-reto-text {
    flex: 1;
    font-size: 0.75rem;
    color: #1f2937;
  }
  body.logged-in .side-reto-text.done {
    text-decoration: line-through;
    color: #9ca3af;
  }
  body.logged-in .side-reto-progress {
    font-size: 0.65rem;
    color: #4ade80;
    font-weight: 700;
  }
  body.logged-in .side-stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.3rem 0;
    border-bottom: 1px solid rgba(74, 222, 128, 0.08);
  }
  body.logged-in .side-stat:last-child {
    border-bottom: none;
  }
  body.logged-in .side-stat-label {
    color: #9ca3af;
    font-size: 0.75rem;
  }
  body.logged-in .side-stat-value {
    color: #e2e8f0;
    font-size: 0.8rem;
    font-weight: 700;
  }
  body.logged-in .side-stat-bar {
    width: 100%;
    height: 6px;
    background: #1f2937;
    border-radius: 3px;
    margin-top: 0.4rem;
    overflow: hidden;
  }
  body.logged-in .side-stat-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #22c55e, #4ade80);
    border-radius: 3px;
    transition: width 0.5s ease;
    box-shadow: 0 0 6px rgba(74, 222, 128, 0.5);
  }
  body.logged-in .side-activity-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid rgba(74, 222, 128, 0.08);
  }
  body.logged-in .side-activity-item:last-child {
    border-bottom: none;
  }
  body.logged-in .side-activity-icon {
    font-size: 0.8rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
  }
  body.logged-in .side-activity-text {
    flex: 1;
    font-size: 0.7rem;
    color: #d1d5db;
    line-height: 1.3;
  }
  body.logged-in .side-activity-time {
    font-size: 0.6rem;
    color: #6b7280;
    flex-shrink: 0;
  }
}

.slide-nav-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 0.25rem;
  flex-shrink: 0;
}

.slide-nav .nav-btn {
  background: none;
  border: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  text-align: left;
  width: 100%;
  flex-shrink: 0;
}

.slide-nav .nav-btn .icono {
  font-size: 1.1rem;
  width: 1.6rem;
  text-align: center;
}

.slide-nav .nav-btn:hover {
  background: var(--red-100);
}

.slide-nav .nav-btn.active {
  color: var(--red-700);
  background: var(--red-100);
  font-weight: 700;
}

/* 🚨 Botón de alerta de emergencia en el menú */
.slide-nav .nav-btn-alerta {
  background: linear-gradient(135deg, #dc2626, #b91c1c) !important;
  color: #fff !important;
  margin-top: 0.25rem;
  animation: alertaNavPulso 1.5s ease-in-out infinite;
}
.slide-nav .nav-btn-alerta:hover {
  background: linear-gradient(135deg, #ef4444, #dc2626) !important;
  transform: scale(1.03);
}
@keyframes alertaNavPulso {
  0%, 100% { box-shadow: 0 2px 8px rgba(220,38,38,0.4); }
  50% { box-shadow: 0 2px 16px rgba(220,38,38,0.8); }
}

/* ─── Overlay del menú ─────────────────────────────────── */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.nav-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* ─── Secciones ────────────────────────────────────────── */
.seccion {
  display: none;
}

.seccion.active {
  display: block;
  padding-bottom: 3rem;
}

/* ─── Memorama ─────────────────────────────────────────── */
.memorama-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  max-width: 400px;
  margin: 1rem auto;
}

.memorama-carta {
  aspect-ratio: 1;
  font-size: 1.5rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  transition: all 0.3s;
}
.memorama-texto {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

@media (max-width: 360px) {
  .memorama-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ─── Sopa de Letras ───────────────────────────────────── */
.sopa-letras-grid {
  display: grid;
  gap: 2px;
  max-width: 400px;
  margin: 0 auto;
  background: var(--border-light);
  padding: 4px;
  border-radius: 0.5rem;
}

.sopa-letra {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: bold;
  background: white;
  border-radius: 2px;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s;
}
.sopa-letra:hover {
  background: var(--red-100);
}
.sopa-letra.seleccionada {
  background: #fef08a;
}
.sopa-letra.encontrada {
  background: #86efac;
  color: #991b1b;
}

/* ─── Crucigrama ───────────────────────────────────────── */
.crucigrama-container {
  max-width: 400px;
  margin: 0 auto;
}
.crucigrama-pregunta {
  background: var(--bg-card-alt);
  border-radius: 0.75rem;
  padding: 1rem;
  margin-bottom: 0.75rem;
  border: 1px solid var(--border-light);
}
.crucigrama-pregunta p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}
.crucigrama-pregunta input {
  width: 100%;
  padding: 0.5rem;
  border: 2px solid var(--border-light);
  border-radius: 0.5rem;
  font-size: 1rem;
  text-align: center;
  text-transform: uppercase;
  background: var(--bg-card);
  color: var(--text-primary);
}
.crucigrama-pregunta input.correcto {
  border-color: #22c55e;
  background: #dcfce7;
}
.crucigrama-pregunta input.incorrecto {
  border-color: #ef4444;
  background: #fee2e2;
}

/* ─── Offline indicator ────────────────────────────────── */
.offline-badge {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #dc2626;
  color: white;
  text-align: center;
  font-size: 0.8rem;
  padding: 0.3rem;
  font-weight: 600;
  z-index: 200;
  display: none;
}

/* ─── Welcome banner ──────────────────────────────────── */
.welcome-banner {
  background: linear-gradient(135deg, var(--red-800), var(--red-700));
  border-radius: 1rem;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  box-shadow: 0 4px 16px rgba(22,101,52,0.3);
  animation: slideDown 0.4s ease-out;
}

.welcome-banner.hidden {
  display: none;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ─── Leaflet map container ───────────────────────────── */
.map-container {
  height: 280px;
  border-radius: 1rem;
  overflow: hidden;
  margin-bottom: 1rem;
  box-shadow: 0 2px 12px var(--shadow-card);
  border: 2px solid var(--map-border);
  position: relative;
  z-index: 1;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.map-container.map-blur {
  filter: blur(3px);
  opacity: 0.5;
  pointer-events: none;
}

/* ─── GPS loader overlay ──────────────────────────────── */
.gps-loader {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  z-index: 1000;
  font-size: 0.9rem;
  color: var(--red-800);
  font-weight: 600;
}

.dark-mode .gps-loader {
  background: rgba(15,23,42,0.92);
}

.gps-spinner {
  width: 32px;
  height: 32px;
  border: 4px solid #bbf7d0;
  border-top-color: #dc2626;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ─── GPS dato curioso ───────────────────────────── */
.gps-dato {
  margin-top: 1rem;
  background: #ecfdf5;
  border-radius: 0.75rem;
  padding: 0.75rem;
  max-width: 260px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.gps-dato.hidden {
  display: none;
}
.gps-dato-titulo {
  color: #064e3b;
  font-weight: 700;
  font-size: 0.8rem;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gps-dato-texto {
  color: #374151;
  font-size: 0.72rem;
  line-height: 1.4;
}

/* ─── Offline badge ───────────────────────────── */
.offline-badge {
  background: #dc2626;
  color: white;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem;
  letter-spacing: 0.5px;
}

/* ─── Dark mode Leaflet tiles ─────────────────────── */
.dark-mode #map .leaflet-tile-pane {
  filter: brightness(0.7);
}

/* ─── Dark mode: side-widget text ──────────────────── */
.dark-mode .side-reto-text { color: #d1d5db !important; }
.dark-mode .side-reto-text.done { color: #6b7280 !important; }

/* ─── Dark mode overrides para Tailwind inline ────── */
.dark-mode .bg-white { background: var(--bg-card) !important; }
.dark-mode .text-gray-400 { color: var(--text-muted) !important; }
.dark-mode .text-gray-500 { color: var(--text-muted) !important; }
.dark-mode .text-gray-600 { color: var(--text-secondary) !important; }
.dark-mode .text-green-800 { color: var(--red-800) !important; }
.dark-mode .text-green-700 { color: var(--red-700) !important; }
.dark-mode .ring-green-300 { --tw-ring-color: var(--red-700); }
.dark-mode .bg-green-50 { background: var(--red-50) !important; }
.dark-mode .bg-green-100 { background: var(--red-100) !important; }
.dark-mode .bg-yellow-50 { background: #1e293b !important; }
.dark-mode .bg-yellow-50,
.dark-mode .bg-yellow-50 * { color: #fde68a !important; }
.dark-mode .bg-yellow-100 { background: #334155 !important; }
.dark-mode .bg-yellow-100,
.dark-mode .bg-yellow-100 * { color: #fbbf24 !important; }
.dark-mode .border-gray-200 { border-color: var(--border-light) !important; }
.dark-mode .shadow-sm { box-shadow: 0 1px 3px var(--shadow-card) !important; }
.dark-mode .shadow-md { box-shadow: 0 4px 6px var(--shadow-card) !important; }
.dark-mode .vr-card-foto-placeholder { background: linear-gradient(135deg, #7c2d12, #991b1b); }
.dark-mode .vr-badge-time { background: rgba(255,255,255,0.15); color: #fbbf24; }
.dark-mode .vr-expired { background: rgba(220,38,38,0.6); }
.dark-mode .vr-badge-qty { background: rgba(234,88,12,0.7); }
.dark-mode .vr-distancia { background: rgba(34,197,94,0.15); color: #4ade80; }
.dark-mode .vr-card-foto-wrap { background: #1e293b; }

/* ─── Theme toggle button ─────────────────────────── */
.theme-toggle {
  justify-content: center !important;
  gap: 0.5rem !important;
  border-top: 1px solid var(--border-light);
  margin-top: auto;
  padding-top: 0.5rem !important;
  color: var(--text-secondary);
  flex-shrink: 0;
}

/* ─── Mascota Xunu' ─────────────────────────────── */
#xunuBubble {
  animation: xunuFloat 3s ease-in-out infinite;
}
@keyframes xunuFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
#xunuBubble .bg-white {
  position: relative;
}
#xunuBubble .bg-white::after {
  content: '';
  position: absolute;
  bottom: -8px;
  right: 24px;
  left: auto;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid white;
}

/* ─── Confetti / Animaciones ──────────────────────── */
.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #ffd700;
  animation: confettiFall 2s ease-out forwards;
}
@keyframes confettiFall {
  0% { transform: translateY(-100px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ─── Barra de XP ─────────────────────────────────── */
.xp-bar {
  background: linear-gradient(90deg, #22c55e 0%, #dc2626 100%);
  transition: width 0.5s ease-out;
}

/* ─── Sticker locked/unlocked ─────────────────────── */
.sticker-locked {
  filter: grayscale(1) opacity(0.3);
}
.sticker-unlocked {
  animation: stickerPop 0.5s ease-out;
}
@keyframes stickerPop {
  0% { transform: scale(0.5); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* ─── Nivel badge ─────────────────────────────────── */
.nivel-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: bold;
  color: white;
}

/* ─── Quiz modal ──────────────────────────────────── */
#modalQuiz .modal-content {
  max-width: 400px;
}
.quiz-opcion {
  width: 100%;
  text-align: left;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: 2px solid #e5e7eb;
  background: white;
  transition: all 0.2s;
  cursor: pointer;
}
.quiz-opcion:hover {
  border-color: #22c55e;
  background: #fef2f2;
}
.quiz-opcion.correcta {
  border-color: #22c55e;
  background: #dcfce7;
}
.quiz-opcion.incorrecta {
  border-color: #ef4444;
  background: #fee2e2;
}

/* ─── Misiones ────────────────────────────────────── */
.mision-card {
  background: white;
  border-radius: 1rem;
  padding: 1rem;
  border: 2px solid #e5e7eb;
  transition: all 0.2s;
}
.mision-card.completada {
  border-color: #22c55e;
  background: #fef2f2;
}
.mision-card .mision-progreso {
  height: 0.5rem;
  background: #e5e7eb;
  border-radius: 9999px;
  overflow: hidden;
}
.mision-card .mision-progreso-fill {
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #dc2626);
  border-radius: 9999px;
  transition: width 0.3s ease-out;
}

/* ─── Side Panel (gamer, solo escritorio) ──────────── */
.side-panel { display: none; }

/* ─── Caza del Tesoro ─────────────────────────────── */
.tesoro-pista {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 2px dashed #f59e0b;
}

/* ─── Crucigrama Grid ─────────────────────────────── */
.crucigrama-grid {
  display: grid;
  gap: 1px;
  max-width: 100%;
  margin: 0 auto;
  justify-content: center;
  background: #d1d5db;
  padding: 2px;
  border-radius: 0.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding-bottom: 4px;
}
.crucigrama-celda {
  width: 26px;
  height: 26px;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  font-size: 0.75rem;
  font-weight: bold;
  text-transform: uppercase;
  color: #991b1b;
}
.crucigrama-celda.vacia {
  background: #374151;
}
.crucigrama-celda.rellena {
  background: #86efac;
  color: #991b1b;
}
@media (max-width: 400px) {
  .crucigrama-celda {
    font-size: 0.6rem;
  }
  .crucigrama-num {
    font-size: 5px;
  }
}
.crucigrama-num {
  position: absolute;
  top: 1px;
  left: 2px;
  font-size: 7px;
  color: #6b7280;
  font-weight: bold;
  line-height: 1;
}
.clue-input {
  padding: 0.3rem 0.5rem;
  border: 2px solid #e5e7eb;
  border-radius: 0.5rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  outline: none;
  min-width: 100px;
}
.clue-input:focus {
  border-color: #22c55e;
  box-shadow: 0 0 0 3px rgba(34,197,94,0.3);
}
.clue-input.correcto {
  border-color: #22c55e;
  background: #dcfce7;
}
.clue-input.incorrecto {
  border-color: #ef4444;
  background: #fee2e2;
}
.clue-box {
  width: 24px;
  height: 28px;
  border: 2px solid #d1d5db;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: bold;
  text-transform: uppercase;
  color: #991b1b;
  background: white;
}
.clue-box.rellena {
  background: #86efac;
  border-color: #22c55e;
}

/* ─── Adivina la Palabra (Ahorcado) ──────────────── */
.ahorcado-btn {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  background: white;
  font-weight: bold;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
}
.ahorcado-btn:hover:not(:disabled) {
  background: #86efac;
  border-color: #22c55e;
}

/* ─── Lotería Triqui ─────────────────────────────── */
.loteria-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  max-width: 400px;
  margin: 0 auto;
}
.loteria-casilla {
  aspect-ratio: 1;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  padding: 4px;
  text-align: center;
}
.loteria-casilla:hover {
  border-color: #22c55e;
}
.loteria-casilla.acertada {
  background: #86efac;
  border-color: #22c55e;
  opacity: 0.7;
}
.loteria-casilla.destacada {
  border-color: #eab308;
  background: #fef9c3;
  transform: scale(1.05);
}

/* ─── Clasificación ──────────────────────────────── */
.clasif-categoria {
  min-width: 80px;
  min-height: 80px;
  background: white;
  border: 2px dashed #d1d5db;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  gap: 2px;
  flex: 1;
}
.clasif-categoria:hover {
  border-color: #22c55e;
  background: #fef2f2;
}
.clasif-categoria .clasif-count {
  background: #22c55e;
  color: white;
  border-radius: 999px;
  padding: 0 6px;
  font-size: 11px;
  min-width: 20px;
  text-align: center;
}
.clasif-palabra {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: white;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.clasif-palabra:hover:not(:disabled) {
  border-color: #22c55e;
  background: #fef2f2;
}
.clasif-palabra.seleccionada {
  background: #22c55e;
  color: white;
  border-color: #991b1b;
}
.clasif-palabra.correcta {
  background: #86efac;
  border-color: #22c55e;
  opacity: 0.6;
  pointer-events: none;
}
.clasif-palabra:disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ─── Flashcards (Tarjetas de Estudio) ────────────── */
.flashcard-contenedor {
  width: 100%;
  max-width: 320px;
  height: 260px;
  margin: 0.75rem auto;
  perspective: 800px;
  cursor: pointer;
  position: relative;
}
.flashcard-cara {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  transition: transform 0.5s;
  border: 2px solid #e5e7eb;
  background: white;
}
.flashcard-frente { transform: rotateY(0deg); }
.flashcard-reverso { transform: rotateY(180deg); }
.flashcard-contenedor.girada .flashcard-frente { transform: rotateY(180deg); }
.flashcard-contenedor.girada .flashcard-reverso { transform: rotateY(0deg); }
.flashcard-img {
  max-width: 120px;
  max-height: 120px;
  border-radius: 0.75rem;
  object-fit: cover;
}
.flashcard-img-fallback {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}
.flashcard-cat-btn {
  transition: all 0.15s;
}

/* ─── Quiz visual ─────────────────────────────────── */
.quiz-card {
  max-width: 320px;
  margin: 0 auto;
  text-align: center;
}
.quiz-img {
  max-width: 140px;
  max-height: 140px;
  border-radius: 0.75rem;
  object-fit: cover;
  display: block;
  margin: 0 auto;
}
.quiz-img-fallback {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto;
}
.quiz-opcion {
  padding: 0.75rem 0.5rem;
  border-radius: 0.75rem;
  border: 2px solid #e5e7eb;
  background: white;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}
.quiz-opcion:hover { border-color: #22c55e; background: #fef2f2; }
.quiz-opcion.correcta { border-color: #22c55e; background: #86efac; }
.quiz-opcion.incorrecta { border-color: #ef4444; background: #fecaca; }
.quiz-opcion.destacada { border-color: #22c55e; background: #bbf7d0; }

/* ─── Ordena las Letras ───────────────────────────── */
.scramble-letra {
  width: 40px;
  height: 44px;
  border-radius: 8px;
  border: 2px solid #d1d5db;
  background: white;
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.15s;
  text-transform: uppercase;
}
.scramble-letra:hover { border-color: #22c55e; background: #fef2f2; }
.scramble-letra.usada { opacity: 0.3; pointer-events: none; }
.scramble-respuesta-letra {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 42px;
  border-bottom: 3px solid #22c55e;
  font-size: 1.2rem;
  font-weight: bold;
  color: #991b1b;
  text-transform: uppercase;
}

/* ─── Notificación de proximidad (Tablero) ───────── */
@keyframes notifSlideIn {
  from { opacity: 0; transform: translateX(100%) scale(0.8); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes notifSlideOut {
  from { opacity: 1; transform: translateX(0) scale(1); }
  to   { opacity: 0; transform: translateX(100%) scale(0.8); }
}

/* ─── Ventas Rápidas feed ───────────────────────── */
.vr-card {
  background: var(--bg-card);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 2px 12px var(--shadow-card);
  transition: transform 0.2s, box-shadow 0.3s;
}
.vr-card:active { transform: scale(0.98); }
.vr-card-foto-wrap {
  position: relative;
  width: 100%;
  height: 220px;
  overflow: hidden;
  background: #f3f4f6;
}
.vr-card-foto {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.vr-card-foto-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  background: linear-gradient(135deg, #fed7aa, #fecaca);
}
.vr-card-badges {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: flex-end;
}
.vr-badge-time {
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}
.vr-expired { background: rgba(220,38,38,0.8); }
.vr-badge-qty {
  background: rgba(234,88,12,0.9);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}
.vr-card-body {
  padding: 1rem;
}
.vr-card-titulo {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}
.vr-card-precio {
  font-size: 1.4rem;
  font-weight: 800;
  color: #ea580c;
  margin-top: 0.25rem;
}
.vr-card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
  line-height: 1.4;
}
.vr-card-ubicacion {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}
.vr-distancia {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  color: #dc2626;
  background: #dcfce7;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  margin-top: 0.5rem;
}
.vr-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-light);
}
.vr-card-vendedor {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.vr-avatar {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  background: #e5e7eb;
  object-fit: cover;
}
.vr-btn-agotado {
  background: #dc2626;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}
.vr-btn-agotado:hover { background: #b91c1c; }

/* ─── Combo / Racha ───────────────────────────────── */
.racha-flame {
  animation: flameFlicker 0.5s ease-in-out infinite alternate;
}
@keyframes flameFlicker {
  0% { transform: scale(1); }
  100% { transform: scale(1.1); }
}

/* ─── Accesibilidad: SR only ──────────────────────── */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0,0,0,0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ─── High contrast: botones grandes ──────────────── */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #f59e0b !important;
  outline-offset: 2px;
}

/* Asegurar contraste 4.5:1 mínimo */
.text-green-600 { color: #dc2626; }
.text-green-700 { color: #b91c1c; }
.text-green-800 { color: #991b1b; }
.text-amber-600 { color: #d97706; }
.text-amber-700 { color: #b45309; }
.text-red-600 { color: #dc2626; }
.text-blue-600 { color: #2563eb; }
.text-purple-700 { color: #7c3aed; }

/* Zonas de toque grandes (mín. 44px) */
button, a, .btn-grande, .nav-btn, .menu-hamburger {
  min-height: 44px;
}
button, a {
  min-width: 44px;
}

/* Aumentar legibilidad en mobile */
@media (max-width: 480px) {
  body { font-size: 16px; }
  input, select, textarea, button {
    font-size: 16px !important;
  }
}


/* ═══════════════════════════════════════════════════════
   Cartero Digital v2 — Mensajería Privada P2P E2EE
   ═══════════════════════════════════════════════════════ */

/* Tutorial */
.cartero-tutorial-paso {
  animation: carteroFadeIn 0.3s ease-out;
}

@keyframes carteroFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Tabs */
.cartero-tab-active {
  background: white;
  color: #4f46e5;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Mensajes / Sobres */
.cartero-mensaje-enviado {
  background: #e0e7ff;
  border-left: 3px solid #6366f1;
}

.cartero-mensaje-recibido {
  background: #f3e8ff;
  border-left: 3px solid #a78bfa;
}

.cartero-msg-item {
  transition: transform 0.2s ease, opacity 0.2s ease;
  will-change: transform, opacity;
}

/* Sobre cerrado */
.cartero-sobre-cerrado {
  position: relative;
  overflow: hidden;
}

.cartero-sobre-cerrado::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 10px,
    rgba(99, 102, 241, 0.03) 10px,
    rgba(99, 102, 241, 0.03) 20px
  );
  pointer-events: none;
}

.cartero-sobre-cerrado:active {
  transform: scale(0.98);
}

/* Sobre abriéndose */
.cartero-sobre-abriendo {
  animation: carteroSobreAbrir 0.6s ease-out;
}

@keyframes carteroSobreAbrir {
  0% { transform: scale(1); }
  30% { transform: scale(1.05); box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3); }
  60% { transform: scale(0.95); }
  100% { transform: scale(1); }
}

/* Sobre abierto */
.cartero-sobre-abierto {
  border-left: 3px solid #a78bfa;
}

/* Estado de entrega */
.cartero-estado-entrega {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* Contactos */
.cartero-contacto-item {
  border-bottom: 1px solid #f3f4f6;
}

.cartero-contacto-item:last-child {
  border-bottom: none;
}

/* Animación de envío */
.cartero-send-anim {
  animation: carteroSendPulse 0.8s ease-in-out infinite alternate;
}

@keyframes carteroSendPulse {
  from { transform: scale(1); }
  to   { transform: scale(1.05); }
}

.cartero-envelope-send {
  animation: carteroEnvelopeFly 1.2s ease-in-out infinite;
}

@keyframes carteroEnvelopeFly {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-10px) rotate(-3deg); }
  50% { transform: translateY(-5px) rotate(0deg); }
  75% { transform: translateY(-10px) rotate(3deg); }
}

.cartero-lock-send {
  animation: carteroLockBounce 0.6s ease-in-out infinite alternate;
}

@keyframes carteroLockBounce {
  from { transform: scale(1); }
  to   { transform: scale(1.15); }
}

/* Dark mode */
.dark-mode .cartero-mensaje-enviado { background: #312e81; border-left-color: #818cf8; }
.dark-mode .cartero-mensaje-recibido { background: #4c1d95; border-left-color: #a78bfa; }
.dark-mode .cartero-sobre-cerrado { background: linear-gradient(135deg, #1e1b4b, #2e1065); border-color: #4338ca; }
.dark-mode .cartero-sobre-abierto { border-left-color: #a78bfa; }
.dark-mode .cartero-contacto-item { border-bottom-color: #334155; }

#seccionCartero .bg-gradient-to-br {
  background: linear-gradient(135deg, #eef2ff, #f5f3ff);
}

.dark-mode #seccionCartero .bg-gradient-to-br {
  background: linear-gradient(135deg, #1e1b4b, #2e1065);
}

/* ═══════════════════════════════════════════════════════
   Encuentro de Saberes — Game Mechanic
   ═══════════════════════════════════════════════════════ */

.encuentro-btn-saludar {
  position: relative;
  overflow: hidden;
}

.encuentro-btn-saludar::after {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(45deg, #ec4899, #f43f5e, #ec4899);
  border-radius: inherit;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s;
}

.encuentro-btn-saludar:active::after {
  opacity: 1;
}

/* Estado del saludo */
.encuentro-estado {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: encuentroFadeIn 0.3s ease-out;
}

.encuentro-estado.hidden {
  display: none;
}

@keyframes encuentroFadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.encuentro-buscando {
  border-left: 3px solid #f59e0b;
}

.encuentro-encontrado {
  border-left: 3px solid #3b82f6;
}

.encuentro-exito {
  border-left: 3px solid #22c55e;
  background: #fef2f2;
}

.encuentro-cooldown {
  border-left: 3px solid #9ca3af;
}

.encuentro-error {
  border-left: 3px solid #ef4444;
}

/* Animación de éxito overlay */
.encuentro-anim-content {
  animation: encuentroBounceIn 0.5s ease-out;
}

@keyframes encuentroBounceIn {
  0% { transform: scale(0.3); opacity: 0; }
  50% { transform: scale(1.1); }
  70% { transform: scale(0.9); }
  100% { transform: scale(1); opacity: 1; }
}

/* Contador de saberes */
#encuentroSaberesCount {
  transition: transform 0.3s ease;
}

#encuentroSaberesCount.updated {
  transform: scale(1.2);
  color: #db2777;
}

/* Dark mode */
.dark-mode .encuentro-exito { background: #312e81; }
.dark-mode .encuentro-buscando { border-left-color: #fbbf24; }
.dark-mode .encuentro-encontrado { border-left-color: #60a5fa; }

/* ─── prefers-reduced-motion (OS-level a11y) ─── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .animate-bounce, .animate-pulse, .animate-spin {
    animation: none !important;
  }
}

/* ─── Modo Ahorro de Batería ───────────── */
.modo-ahorro *,
.modo-ahorro *::before,
.modo-ahorro *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}
.modo-ahorro .animate-bounce,
.modo-ahorro .animate-pulse,
.modo-ahorro .active\:scale-\[0\.98\],
.modo-ahorro .hover\:scale-*,
.modo-ahorro .cartero-send-anim,
.modo-ahorro .cartero-envelope-send,
.modo-ahorro .cartero-lock-send {
  animation: none !important;
  transform: none !important;
}
.modo-ahorro .encuentro-animacion {
  display: none !important;
}
.modo-ahorro [data-vibrar] {
  -webkit-tap-highlight-color: transparent;
}

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

@keyframes monedaSlideOut {
  from { opacity: 1; transform: translateX(-50%) translateY(0); }
  to { opacity: 0; transform: translateX(-50%) translateY(-20px); }
}

/* ═══════════════════════════════════════════════════════
   Android Native Accessibility Media Queries
   - TalkBack lee aria-live, role="alert", labels automáticamente
   - forced-colors = alto contraste Android (Ajustes > Accesibilidad)
   - prefers-contrast = modo contraste elevado
   - Font scaling: Android escala automáticamente unidades rem/em
   ═══════════════════════════════════════════════════════ */

/* Alto contraste nativo Android (Windows High Contrast también) */
@media (forced-colors: active) {
  *, *::before, *::after {
    forced-color-adjust: auto;
  }
  .border, [class*="border-"] {
    border-color: ButtonText !important;
  }
  button, .btn, [role="button"], .nav-btn {
    border: 2px solid ButtonText !important;
    background: ButtonFace !important;
    color: ButtonText !important;
  }
  input, select, textarea {
    border: 2px solid ButtonText !important;
    background: Field !important;
    color: FieldText !important;
  }
  a, .link { color: LinkText !important; }
  /* Mantener iconos visibles forzando currentColor */
  svg, [data-lucide] { fill: currentColor !important; color: inherit !important; }
}

/* Contraste elevado (Android + navegadores modernos) */
@media (prefers-contrast: high) {
  body {
    --text-primary: #000000;
    --text-secondary: #1a1a1a;
    --text-muted: #333333;
    --bg-body: #ffffff;
    --bg-card: #ffffff;
    --border-light: #000000;
    --red-700: #cc0000;
    --red-800: #990000;
  }
  .dark-mode {
    --text-primary: #ffffff;
    --text-secondary: #e0e0e0;
    --text-muted: #cccccc;
    --bg-body: #000000;
    --bg-card: #111111;
    --border-light: #ffffff;
    --red-700: #ff4444;
    --red-800: #ff6666;
  }
  button, input, select, textarea { border-width: 2px !important; }
}
