/* ==================== Theme Tokens & Base ==================== */
:root {
  --bg: #fff7fb;
  --surface: #ffffff;
  --surface-veil: #ffffffcc;
  --text: black;
  --muted: black;
  --accent: #e11d48;
  --accent2: #fb7185;
  --ring: #fbcfe8;
  --ok: #16a34a;
  --error: #dc2626;
  --border: #d1d5db;
  --border-strong: #94a3b8;
  --block: #f3f4f6;
  --index-bg: #f3f4f6;
  --index-text: #374151;
  --shadow: 0 8px 20px #0001;
  --shadow-strong: 0 20px 60px #0008;
  --radius: 18px;
  --motion-fast: 140ms;
  --motion-med: 220ms;
  --motion-slow: 280ms;
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  --focus-ring: #9b87f5;
  --space: clamp(12px, 2vw, 22px);
  --fs-base: clamp(15px, 1.2vw, 18px);
  --fs-title: clamp(26px, 4.2vw, 46px);
  --cell: clamp(22px, 2.8vw, 34px);
  --script-fs: clamp(14px, 1.4vw, 20px);
  --panel-blur: 8px;
  --photo-pos: 50% 20%;
  /* ===== Tour button variables (global) ===== */
  --tour-btn-bg: #9d1732;
  --tour-btn-fg: #ffffff;
  --tour-btn-shadow: 0 8px 24px rgba(157, 23, 50, 0.35);
  --tour-btn-shadow-hover: 0 12px 32px rgba(157, 23, 50, 0.5);
  --tour-btn-radius: 48px;
  --tour-btn-pad-y: 14px;
  --tour-btn-pad-x: 22px;
}
:root.compact {
  --cell: clamp(18px, 2.2vw, 28px);
}
html[data-theme="dark"] {
  --bg: #0f1117;
  --surface: #12141c;
  --surface-veil: #12141ccc;
  --text: #e8e6ee;
  --muted: #a3a0ad;
  --accent: #f43f5e;
  --accent2: #fb7185;
  --ring: #a78bfa;
  --ok: #22c55e;
  --error: #ef4444;
  --border: #2b2f3a;
  --border-strong: #3b4250;
  --block: #1a1f2b;
  --index-bg: #151926;
  --index-text: #cbd5e1;
  --shadow: 0 8px 24px #0006;
  --shadow-strong: 0 24px 80px #0009;
  /* ===== Tour button variables (dark) ===== */
  --tour-btn-bg: #f43f5e; /* usa el accent en oscuro */
  --tour-btn-fg: #ffffff;
  --tour-btn-shadow: 0 8px 24px rgba(244, 63, 94, 0.35);
  --tour-btn-shadow-hover: 0 12px 32px rgba(244, 63, 94, 0.5);
}
/* ==================== Resets ==================== */
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  font-family: ui-serif, Georgia, Times, serif;
  color: var(--text);
  font-size: var(--fs-base);
  line-height: 1.55;
  background: radial-gradient(1200px 800px at 10% -20%, #ffd1dc55 0%, #0000 60%),
    radial-gradient(1000px 600px at 110% 10%, #fecdd355 0%, #0000 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'%3E%3Cg fill='none' opacity='.48'%3E%3Cpath d='M28 48s-16.5-9.7-16.5-21C11.5 21.3 16 17 21 17c3.6 0 6.1 1.9 7 4 0.9-2.1 3.4-4 7-4 5 0 9.5 4.3 9.5 10 0 11.3-16.5 21-16.5 21z' fill='%23e11d48'/%3E%3C/g%3E%3C/svg%3E");
  background-attachment: fixed;
}
html[data-theme="dark"] body {
  background: radial-gradient(1200px 800px at 10% -20%, #581c8733 0%, #0000 60%),
    radial-gradient(1000px 600px at 110% 10%, #1f293733 0%, #0000 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'%3E%3Cg fill='none' opacity='.28'%3E%3Cpath d='M28 48s-16.5-9.7-16.5-21C11.5 21.3 16 17 21 17c3.6 0 6.1 1.9 7 4 0.9-2.1 3.4-4 7-4 5 0 9.5 4.3 9.5 10 0 11.3-16.5 21-16.5 21z' fill='%23f43f5e'/%3E%3C/g%3E%3C/svg%3E");
  background-attachment: fixed;
}
.container {
  max-width: min(1100px, 92vw);
  margin: 0 auto;
  padding: calc(var(--space) * 1.2);
}
/* ==================== Sticky Header ==================== */
.sticky-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--surface-veil);
  backdrop-filter: blur(12px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  animation: slideDown 0.3s var(--ease-out);
}
html[data-theme="dark"] .sticky-header {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
.main-spacer {
  height: calc(var(--space) * 0.8);
}
.header {
  backdrop-filter: blur(6px);
  background: transparent;
  border-radius: 0;
  padding: calc(var(--space) * 1.2);
  box-shadow: none;
}
h1 {
  font-size: var(--fs-title);
  margin: 0 0 8px;
}
.tagline {
  color: var(--muted);
  margin: 0;
}
main {
  margin-top: var(--space);
}
section {
  background: var(--surface-veil);
  border-radius: var(--radius);
  padding: var(--space);
  box-shadow: var(--shadow);
}
/* Separación consistente entre secciones principales */
.container > section {
  margin-bottom: var(--space);
}
/* ==================== Photo ==================== */
.photo-section {
  backdrop-filter: blur(var(--panel-blur));
  background: linear-gradient(
    180deg,
    var(--surface-veil),
    color-mix(in oklab, var(--surface-veil) 88%, transparent)
  );
  position: relative;
  margin-bottom: var(--space);
}
.photo-section::after {
  content: "❤";
  display: block;
  text-align: center;
  font-size: clamp(18px, 2vw, 24px);
  color: var(--accent);
  opacity: 0.6;
  margin: calc(var(--space) * 1.2) auto 0;
}
.photo-card {
  display: grid;
  place-items: center;
  gap: 10px;
}
.photo-frame {
  position: relative;
  width: min(520px, 90%);
  aspect-ratio: 4/3;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 14px 36px #0003, inset 0 0 0 2px var(--ring);
}
.photo-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(120% 90% at 50% 80%, #0003 0%, transparent 55%);
  mix-blend-mode: multiply;
  opacity: 0.25;
}
.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--photo-pos);
  display: block;
}
.photo-legend {
  font-family: "Brush Script MT", "Segoe Script", "URW Chancery L", cursive;
  font-size: var(--script-fs);
  color: #8f6a82;
  letter-spacing: 0.3px;
  text-align: center;
}
/* ==================== Layout / Grid ==================== */
.grid-wrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space);
}
@media (min-width: 900px) {
  .grid-wrap {
    grid-template-columns: 0.9fr 1.05fr 1.35fr;
  }
}
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
button {
  border: 0;
  cursor: pointer;
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 700;
  background: linear-gradient(180deg, var(--accent2), var(--accent));
  color: #fff;
  box-shadow: 0 6px 16px color-mix(in oklab, var(--accent) 30%, transparent);
  transition: transform 0.06s;
}
button.secondary {
  background: var(--surface);
  color: var(--accent);
  outline: 1px solid color-mix(in oklab, var(--accent) 30%, transparent);
}
button:hover {
  transform: translateY(-1px);
}
button:active {
  transform: translateY(0);
}
button:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}
.status {
  margin-top: 8px;
  font-weight: 600;
}
.status.ok {
  color: var(--ok);
}
.status.err {
  color: var(--error);
}
/* ==================== Progress ==================== */
/* (Progreso removido del Instructivo; estilos no necesarios) */

/* ==================== Toasts ==================== */
.toast-host {
  position: fixed;
  bottom: 18px;
  right: 18px;
  display: grid;
  gap: 10px;
  z-index: 10000;
}
.toast-host.centered {
  left: 0;
  right: 0;
  justify-items: center;
}
/* Overlay sutil cuando un toast está expandido */
#toastOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none; /* no bloquea clics */
  transition: opacity var(--motion-med) var(--ease-out);
  z-index: 9999; /* debajo de los toasts (10000) */
}
#toastOverlay.show {
  opacity: 1;
}
.toast {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  animation: slideUp var(--motion-med) var(--ease-out) both;
  max-width: min(380px, 92vw);
  position: relative;
}
.toast img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.toast .img-wrap {
  cursor: pointer;
  display: grid;
  place-items: center;
}
.toast .img-wrap img {
  transition: transform var(--motion-med) var(--ease-out),
    box-shadow var(--motion-med) var(--ease-out),
    border-color var(--motion-med) var(--ease-out),
    border-width var(--motion-med) var(--ease-out);
}
.toast.expanded-lg .img-wrap img:hover {
  transform: scale(1.03);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}
/* Borde sutil en modo expandido */
.toast.expanded .img-wrap img,
.toast.expanded-lg .img-wrap img {
  border-width: 2px;
  border-color: color-mix(in oklab, var(--accent) 70%, var(--border));
}
@media (prefers-reduced-motion: reduce) {
  .toast .img-wrap img {
    transition: none;
  }
}
.toast .note {
  font-weight: 700;
  line-height: 1.25;
}
.toast .meta {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.2px;
}
.toast .meta .heart {
  color: var(--accent);
  margin-left: 4px;
  display: inline-block;
  animation: heartBeat 1.2s ease-in-out infinite;
  transform-origin: center;
}
@keyframes heartBeat {
  0%,
  20%,
  100% {
    transform: scale(1);
  }
  10% {
    transform: scale(1.18);
  }
}
@media (prefers-reduced-motion: reduce) {
  .toast .meta .heart {
    animation: none;
  }
}
.toast .actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}
.toast .actions button {
  padding: 6px 10px;
  font-weight: 700;
}
/* Cierre flotante */
.toast .close-x {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 900;
  line-height: 1;
  display: none; /* por defecto oculto */
}
.toast.expanded .close-x,
.toast.expanded-lg .close-x {
  display: inline-block;
}
/* No se fijan en pantalla; guardado descarga archivo */

/* ===== Toast expanded ===== */
.toast.expanded {
  grid-template-columns: 1fr;
  max-width: min(520px, 92vw);
  padding: 14px 16px;
}
.toast.expanded img {
  width: 200px;
  height: 200px;
  justify-self: center;
}
.toast.expanded .note {
  font-size: 1.05em;
  line-height: 1.35;
}
/* Nivel un poco más grande */
.toast.expanded-lg {
  grid-template-columns: 1fr;
  max-width: min(620px, 95vw);
  padding: 16px 18px;
}
.toast.expanded-lg img {
  width: 260px;
  height: 260px;
  justify-self: center;
}
.toast.expanded-lg .note {
  font-size: 1.12em;
  line-height: 1.4;
}
/* ==================== Crossword Board ==================== */
.board {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto 1fr;
  gap: 6px;
  align-items: start;
  overflow: auto;
  justify-self: center;
}
#crosswordGrid {
  display: grid;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  min-height: calc(var(--cell) * 3);
}
#crosswordGrid .cell {
  width: var(--cell);
  height: var(--cell);
  position: relative;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
}
#crosswordGrid .cell.block {
  background: var(--block);
}
#crosswordGrid .cell input {
  width: 100%;
  height: 100%;
  text-align: center;
  text-transform: uppercase;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  font-size: calc(var(--cell) * 0.44);
  font-weight: 800;
  letter-spacing: 0.4px;
  line-height: 1;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
}
#crosswordGrid .cell input:focus {
  box-shadow: inset 0 0 0 2px
    color-mix(in oklab, var(--accent) 65%, transparent);
  border-radius: 4px;
}
#crosswordGrid .cell.acrostic {
  box-shadow: inset 0 0 0 2px #f43f5e;
}
.col-index {
  display: grid;
  grid-auto-flow: column;
}
.row-index {
  display: grid;
  grid-auto-rows: var(--cell);
}
.index-cell {
  display: grid;
  place-items: center;
  font-size: 11px;
  color: var(--index-text);
  background: var(--index-bg);
  border: 1px solid var(--border);
  width: var(--cell);
  height: var(--cell);
  border-radius: 4px;
}
.corner {
  width: var(--cell);
  height: var(--cell);
}
#crosswordGrid.contrast-high {
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
}
#crosswordGrid.contrast-high .cell {
  border: 1.5px solid var(--border-strong);
}
#crosswordGrid.contrast-high .cell.block {
  background: color-mix(in oklab, var(--block) 90%, transparent);
  border-color: var(--border);
}
#crosswordGrid.contrast-high .cell.acrostic {
  box-shadow: inset 0 0 0 2px #f43f5e, inset 0 0 0 4px #fff;
}
#crosswordGrid.clarin {
  background: transparent;
  border: 0;
  gap: 2px;
}
#crosswordGrid.clarin .cell {
  border: 1.6px solid var(--border-strong);
  border-radius: 6px;
}
#crosswordGrid.clarin .cell.block {
  background: transparent;
  border: 0;
}
#crosswordGrid.clarin .cell.acrostic {
  box-shadow: inset 0 0 0 2px #f43f5e;
}
#crosswordGrid .cell.good {
  outline: 2px solid #86efac;
}
#crosswordGrid .cell.bad {
  outline: 2px solid #fca5a5;
}
#crosswordGrid .cell.empty-hint {
  outline: 2px dashed #fbbf24;
}
/* Resaltado sutil de palabra activa (mientras se completa) */
#crosswordGrid .cell.active-word {
  /* Usamos box-shadow inset para evitar cortes en bordes externos */
  box-shadow: inset 0 0 0 2px var(--ring);
  background: color-mix(in oklab, var(--ring) 18%, transparent);
}
/* Palabra correcta completa (persistente, elegante) */
#crosswordGrid .cell.word-ok {
  box-shadow: inset 0 0 0 2px var(--ok);
  background: color-mix(in oklab, var(--ok) 20%, transparent);
}
/* ==================== Syllables ==================== */
.syllables {
  background: var(--surface-veil);
  border-radius: var(--radius);
  padding: var(--space);
  box-shadow: var(--shadow);
}
.syllables-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.syll-grid {
  display: grid;
  grid-template-columns: repeat(4, var(--cell));
  gap: 8px;
  justify-content: start;
}
@media (min-width: 640px) {
  .syll-grid {
    grid-template-columns: repeat(5, var(--cell));
  }
}
@media (min-width: 1024px) {
  .syll-grid {
    grid-template-columns: repeat(6, var(--cell));
  }
}
.sy {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--cell);
  height: var(--cell);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: inset 0 0 0 2px var(--border);
  cursor: pointer;
  user-select: none;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  font-weight: 800;
  letter-spacing: 0.2px;
  font-size: calc(var(--cell) * 0.44);
  color: var(--text);
  line-height: 1;
  padding: 0;
  transition: transform var(--motion-med) var(--ease-out),
    box-shadow var(--motion-fast) var(--ease-out), background var(--motion-fast);
}
.sy:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: inset 0 0 0 2px
    color-mix(in oklab, var(--accent) 60%, var(--border));
}
.sy:active {
  transform: translateY(0) scale(0.98);
}
.sy:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}
.sy.used {
  text-decoration: line-through;
  opacity: 0.55;
}
.sy.correct {
  background: #e6ffe8;
  box-shadow: inset 0 0 0 2px #34d399;
  color: #065f46;
  text-decoration: none;
  opacity: 1;
}
.syll-hint {
  color: var(--muted);
  font-size: 0.92em;
  margin-top: 8px;
}
.toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  user-select: none;
}
.toggle .label {
  font-weight: 700;
  color: #374151;
}
.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: #e5e7eb;
  border: 1px solid #d1d5db;
  transition: background 0.2s, border-color 0.2s;
  flex: 0 0 auto;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 3px #0002;
  transition: transform 0.2s;
}
input[type="checkbox"].switch-input {
  appearance: none;
  margin: 0;
  width: 46px;
  height: 26px;
  position: absolute;
  opacity: 0;
}
.toggle input.switch-input:checked + .switch {
  background: #fb7185;
  border-color: #fb7185;
}
.toggle input.switch-input:checked + .switch::after {
  transform: translateX(20px);
}
.grid-style {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0.4rem 0 1rem;
}
.grid-style label {
  font-weight: 700;
  color: #374151;
}
/* ==================== Clues ==================== */
.clues ol {
  /* Que el número del <ol> quede pegado al contenido (emoji+pista) */
  list-style-position: inside;
  padding-left: 0;
  margin-left: 0;
  margin: 0;
}
.clues li {
  margin: 0.4rem 0 0.6rem;
  /* Hanging indent: líneas siguientes alinean con el inicio del texto */
  text-indent: -1.6ch; /* ancho aproximado del marcador "1." */
  padding-left: 1.6ch;
}
.clues li .chip {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 10px;
}
.clues li::marker {
  font-weight: 800;
  color: var(--accent);
}
.clues li.ok {
  color: var(--ok);
  font-weight: 700;
}
/* ==================== Animations ==================== */
@keyframes rowFlash {
  0% {
    background: #dcfce7;
  }
  100% {
    background: transparent;
  }
}
.row-ok {
  animation: rowFlash 0.9s ease forwards;
}
@keyframes cellFlashPink {
  0% {
    box-shadow: 0 0 0 0 #fda4af;
    background: #ffe4e6;
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
    background: transparent;
  }
}
.good-pulse {
  animation: cellFlashPink 0.9s ease;
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes subtlePop {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.anim-fade-in {
  animation: fadeIn var(--motion-slow) var(--ease-out) both;
}
.anim-pop {
  animation: subtlePop var(--motion-med) var(--ease-out) both;
}
.anim-slide-up {
  animation: slideUp var(--motion-slow) var(--ease-out) both;
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
/* ==================== Theme Button ==================== */
.theme-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--motion-fast) var(--ease-out),
    box-shadow var(--motion-fast) var(--ease-out);
}
.theme-btn:hover {
  transform: translateY(-1px);
}
.theme-btn:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}
/* ==================== Modal (Share Card) ==================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.modal-backdrop.show,
.modal-backdrop.is-open {
  display: flex;
}
.modal {
  background: var(--surface);
  color: var(--text);
  border-radius: 16px;
  max-width: min(720px, 96vw);
  padding: 24px;
  box-shadow: var(--shadow-strong);
  text-align: center;
}
.modal h3 {
  margin: 0 0 8px;
  font-size: clamp(22px, 3.8vw, 34px);
}
.modal p {
  margin: 0 0 12px;
  color: var(--muted);
}
.modal-backdrop.show .modal,
.modal-backdrop.is-open .modal {
  animation: slideUp 260ms var(--ease-out) both;
}
#shareCanvas {
  width: min(560px, 88vw);
  height: auto;
  border-radius: 12px;
  box-shadow: 0 10px 30px #0003;
}
/* ==================== Footer ==================== */
footer {
  text-align: center;
  margin-top: var(--space);
  box-shadow: var(--shadow);
}
footer a {
  transition: opacity 0.2s ease;
}
footer a:hover {
  opacity: 0.8;
}
footer small {
  font-size: 0.875rem;
  line-height: 1.6;
}
footer p {
  margin: 0;
}
/* ==================== Botón flotante Amor en Páginas ==================== */
.amor-badge {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 1050;
  background: #ffffff;
  color: #2d2d2d;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  padding: 8px 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
  font: 600 13px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui,
    sans-serif;
  transition: all 0.2s ease;
}
.amor-badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  background: #f9f9f9;
}
.amor-badge svg {
  flex-shrink: 0;
  color: #e11d48;
}
html[data-theme="dark"] .amor-badge {
  background: #1a1f2b;
  color: #e8e6ee;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}
html[data-theme="dark"] .amor-badge:hover {
  background: #1e2331;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}
@media (min-width: 1280px) {
  :root:not(.compact) {
    --cell: 28px;
  }
}
/* ===== TOUR CSS — START ========================================================= */
/* ==================== Tour (overlay, spotlight, modal, triggers) ==================== */
.tour-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(2px);
  z-index: 9998;
  display: none;
}
.tour-spotlight {
  position: fixed;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.75);
  border-radius: 16px;
  pointer-events: none;
  z-index: 9999;
  display: none;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.tour-modal-love {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--surface);
  color: var(--text);
  border-radius: 28px;
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.35);
  padding: 2.4rem 2rem;
  max-width: 640px;
  width: 92vw;
  max-height: 85vh;
  overflow-y: auto;
  z-index: 10000;
  display: none;
  animation: tourFadeIn 0.4s ease-out;
}
@keyframes tourFadeIn {
  from { opacity: 0; transform: translate(-50%, -45%); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}
.tour-modal-love h2 {
  font-size: clamp(22px, 3.6vw, 32px);
  margin: 0 0 12px;
  color: var(--text);
}
.tour-modal-love p { color: var(--muted); line-height: 1.7; }
.tour-benefit-box {
  background: color-mix(in oklab, var(--surface) 88%, #ffffff);
  border: 2px dashed var(--accent);
  border-radius: 16px;
  padding: 1rem;
  margin: 1rem 0 1.2rem;
}
.tour-benefit-box h3 { font-size: 1.05rem; color: var(--accent); margin: 0 0 6px; }
.tour-benefit-box p { margin: 0; color: var(--text); }
.tour-btn-next, .tour-btn-skip {
  padding: var(--tour-btn-pad-y) var(--tour-btn-pad-x);
  border-radius: var(--tour-btn-radius);
  font-weight: 800;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
}
.tour-btn-next { background: var(--tour-btn-bg); color: var(--tour-btn-fg); box-shadow: var(--tour-btn-shadow); }
.tour-btn-next:hover { transform: translateY(-2px); box-shadow: var(--tour-btn-shadow-hover); }
.tour-btn-skip { background: transparent; color: var(--muted); }
.tour-progress-dots { display: flex; gap: 8px; justify-content: center; margin-top: 1rem; }
.tour-progress-dots span { width: 8px; height: 8px; border-radius: 50%; background: #e5e7eb; transition: all 0.3s ease; }
.tour-progress-dots span.active { background: var(--accent); width: 22px; border-radius: 4px; }
.tour-floating-trigger {
  position: fixed; bottom: 86px; right: 16px;
  background: var(--tour-btn-bg);
  color: var(--tour-btn-fg);
  border: none; border-radius: var(--tour-btn-radius); padding: var(--tour-btn-pad-y) var(--tour-btn-pad-x);
  font-weight: 800; font-size: 0.95rem; cursor: pointer;
  box-shadow: var(--tour-btn-shadow);
  z-index: 9997; animation: pulseBtn 2.5s ease-in-out infinite; transition: all 0.3s ease;
}
@keyframes pulseBtn { 0%,100%{ transform: translateY(0);} 50%{ transform: translateY(-6px);} }
.tour-floating-trigger:hover { transform: translateY(-4px); box-shadow: var(--tour-btn-shadow-hover); }
@media (max-width: 600px){ .tour-modal-love{ padding: 1.8rem 1.2rem; } .tour-floating-trigger{ bottom: 76px; padding: 12px 18px; font-size: .88rem; } }
@media (prefers-reduced-motion: reduce){ .tour-spotlight,.tour-modal-love,.tour-floating-trigger{ transition:none; animation:none; } }
/* ===== TOUR CSS — END =========================================================== */
/* ===== Mobile refinements ===== */
@media (max-width: 480px) {
  /* Celdas y letras más grandes para tacto */
  :root:not(.compact) {
    --cell: 32px;
    --fs-base: 16px;
  }
  #crosswordGrid .cell input {
    font-size: calc(var(--cell) * 0.56);
  }
  /* Área de toque más grande alrededor de la foto del toast */
  .toast .img-wrap {
    padding: 10px;
  }
  /* Botones ocupan el ancho disponible en móvil */
  .controls {
    gap: 8px;
  }
  .controls button {
    flex: 1 1 auto;
    min-width: 44px;
    padding: 12px 14px;
  }
  /* Toast centrado y con ancho seguro */
  .toast-host {
    left: 0;
    right: 0;
    bottom: max(10px, env(safe-area-inset-bottom));
    justify-items: center;
  }
  .toast {
    max-width: 92vw;
  }
  /* Modal: margen con notch/safe-area */
  .modal {
    margin: 0 10px;
  }
  /* Botón de cierre flotante más grande en móvil */
  .toast .close-x {
    top: 8px;
    right: 10px;
    width: 34px;
    height: 34px;
    font-size: 18px;
  }
}
/* ===== Mejoras visuales rápidas ===== */

/* Glow sutil cuando la celda está correcta */
#crosswordGrid .cell.good {
  box-shadow: inset 0 0 0 2px #34d399,
    /* aro verde */ 0 0 0 4px rgba(52, 211, 153, 0.15); /* halo suave */
  border-color: #34d399;
}

/* Pista correcta -> chip verde (solo al texto, no al número) */
.clues li.ok .chip {
  background: color-mix(in oklab, #34d399 18%, transparent);
  border-left: 4px solid #34d399;
}

/* Celdas incompletas de la palabra validada */
#crosswordGrid .cell.empty-hint {
  animation: blinkSoft 900ms ease-in-out 2;
  box-shadow: inset 0 0 0 2px #fca5a5;
}
@keyframes blinkSoft {
  0% {
    background: #fee2e2;
  }
  100% {
    background: transparent;
  }
}

/* Sílabas usadas y correctas */
.sy.used {
  opacity: 0.45;
  text-decoration: line-through;
}
.sy.correct {
  background: #ecfdf5;
  box-shadow: inset 0 0 0 2px #34d399;
  color: #065f46;
}

/* Botones principales un poco más “premium” */
button#checkBtn {
  filter: drop-shadow(0 6px 16px rgba(244, 63, 94, 0.25));
}
button#checkBtn:active {
  transform: translateY(1px) scale(0.99);
}

/* Modal de share: centra contenido y eleva overlay */
.modal-backdrop.show {
  backdrop-filter: blur(4px);
}
.share-card-wrap {
  display: grid;
  place-items: center;
  margin: 12px 0 18px;
}
#shareCanvas {
  width: min(560px, 88vw);
  height: auto;
  border-radius: 12px;
  box-shadow: 0 10px 30px #0003;
}

/* Botonera de modal */
.modal .actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 14px;
}
/* Leyenda debajo de la foto: más contraste, legible sobre fondo oscuro */
.photo-legend {
  font-family: "Brush Script MT", "Segoe Script", "URW Chancery L", cursive;
  font-size: clamp(16px, 1.6vw, 22px); /* ↑ un toque más grande */
  color: #f4e7ef; /* claro para buen contraste */
  letter-spacing: 0.3px;
  text-align: center;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35), 0 2px 10px rgba(0, 0, 0, 0.25);
  margin-top: 10px;
}

/* Corazón separador: más grande, 100% visible y con sombra para contraste */
.photo-section::after {
  content: "❤";
  display: block;
  text-align: center;
  font-size: clamp(26px, 3vw, 36px); /* ↑ tamaño */
  color: var(--accent);
  opacity: 1; /* antes 0.6 */
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35); /* halo para legibilidad */
  margin: calc(var(--space) * 0.8) auto 0;
}
