/* ============================================================
   El jardín de recuerdos de Camilla · Tema zen (rama paralela)
   Capa de pulido sobre prototipo-fotos-zen.html.
   El original (prototipo-fotos.html) queda intacto.
   ============================================================ */

/* ---------- Fondo general: papel cálido con luz de amanecer ---------- */
html,
body {
  background:
    radial-gradient(1200px 640px at 82% -10%, rgba(233, 197, 142, .28), transparent 60%),
    radial-gradient(900px 520px at -8% 28%, rgba(195, 210, 182, .35), transparent 55%),
    linear-gradient(160deg, #faf6ec 0%, #f5efe2 55%, #efe8d6 100%);
}

body {
  color: #333d34;
}

/* Texto secundario por defecto */
::selection {
  background: rgba(196, 112, 63, .22);
}

/* ---------- Tipografía: serif editorial para títulos ---------- */
h1, h2, h3, h4 {
  font-family: Lora, Georgia, "Times New Roman", serif;
  letter-spacing: .1px;
}

/* ---------- Tarjetas principales: orgánicas y luminosas ---------- */
.welcome-hero,
.setup-panel,
.photo-card,
.map-card,
.modal-card,
.result-card {
  border-radius: 22px;
}

.welcome-hero,
.setup-panel {
  border-color: rgba(125, 140, 118, .18);
  background: rgba(255, 253, 246, .88);
  backdrop-filter: blur(16px);
  box-shadow: 0 18px 46px rgba(96, 90, 70, .12);
}

.welcome-hero::before {
  display: none;
}

/* ---------- Portada / home: avatar de Camilla ---------- */
.welcome {
  background:
    radial-gradient(760px 420px at 78% 8%, rgba(233, 197, 142, .3), transparent 60%),
    radial-gradient(900px 520px at -6% 90%, rgba(195, 210, 182, .4), transparent 55%),
    linear-gradient(170deg, #faf5e9 0%, #f2ecdb 60%, #ece4cf 100%);
}

.welcome-hero {
  align-content: center;
  justify-items: center;
  gap: 18px;
  text-align: center;
}

.welcome-hero .eyebrow,
.zen-hero-text {
  justify-self: stretch;
}

.zen-hero-text {
  text-align: center;
}

.welcome-hero .eyebrow {
  margin-bottom: 6px;
}

.welcome-hero h1 {
  font-size: clamp(30px, 4.6vw, 52px);
  font-weight: 600;
  line-height: 1.12;
  color: #3c4a3a;
  text-wrap: balance;
}

.welcome-copy {
  color: #5d6a58;
  font-size: 16px;
  line-height: 1.55;
  max-width: 46ch;
  margin: 0 auto;
}

.zen-avatar {
  width: clamp(150px, 24vw, 235px);
  border-radius: 50%;
  overflow: visible;
  filter: drop-shadow(0 14px 22px rgba(140, 110, 70, .18));
  animation: zen-float 7s ease-in-out infinite;
}

.zen-avatar svg {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 50%;
}

@keyframes zen-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-7px); }
}

/* Panel derecho: mismo lenguaje visual */
.setup-panel {
  color: #333d34;
}

/* ---------- Botones ---------- */
.primary:disabled,
.btn-next:disabled {
  background: rgba(125, 140, 118, .4) !important;
  border: 1px solid rgba(125, 140, 118, .45);
  color: rgba(51, 61, 52, .62) !important;
  box-shadow: none;
}

.primary {
  background: linear-gradient(135deg, #cd7a47, #b96033);
  color: #fffdf6 !important;
  box-shadow: 0 8px 20px rgba(185, 96, 51, .25);
}

.primary:hover:not(:disabled) {
  box-shadow: 0 10px 24px rgba(185, 96, 51, .34);
  transform: translateY(-1px);
}

.secondary {
  background: rgba(196, 112, 63, .12);
  border-color: rgba(196, 112, 63, .3);
  color: #333d34;
}

.secondary:hover:not(:disabled) {
  background: rgba(196, 112, 63, .2);
}

.ghost {
  background: rgba(125, 140, 118, .08);
  border-color: rgba(125, 140, 118, .3);
  color: #333d34;
}

.ghost:hover {
  background: rgba(125, 140, 118, .16);
}

/* Botón "Siguiente" (antes degradado neón) */
.btn-next {
  background: linear-gradient(135deg, #cd7a47, #c98a5e) !important;
}

/* ---------- HUD / cabecera de partida ---------- */
.hud {
  background: rgba(255, 253, 246, .82);
  border-bottom: 1px solid rgba(125, 140, 118, .16);
  box-shadow: 0 10px 26px rgba(96, 90, 70, .1);
  color: #333d34;
}

.meter {
  border-color: rgba(125, 140, 118, .2);
  color: #333d34;
}

.menu-link {
  background: rgba(125, 140, 118, .1);
  border-color: rgba(125, 140, 118, .26);
  color: #333d34;
}

.menu-link:hover {
  background: rgba(125, 140, 118, .18);
}

/* ---------- Cartas de reto ---------- */
.photo-card,
.map-card,
.game-footer,
.answer-panel {
  background: rgba(255, 253, 246, .82);
  border-color: rgba(125, 140, 118, .18);
  box-shadow: 0 14px 38px rgba(96, 90, 70, .1);
  color: #333d34;
}

.game-footer {
  border-top-color: rgba(125, 140, 118, .18);
}

/* La foto como estampa de álbum */
.photo-frame {
  background: #262b23;
  box-shadow: 0 0 0 1px rgba(125, 140, 118, .25), 0 12px 28px rgba(96, 90, 70, .22);
}

/* Pistas / pasos de revelado */
.step.active {
  background: #c4703f;
}

/* ---------- Deslizador de año ---------- */
#yearRange::-webkit-slider-runnable-track {
  background: linear-gradient(90deg, var(--green) 0%, var(--blue) var(--fill), rgba(125, 140, 118, .24) var(--fill), rgba(125, 140, 118, .24) 100%);
}

/* ---------- Mapa ---------- */
#map,
.result-map,
#summaryMap {
  background: #e9e4d5;
  border-radius: 14px;
}

.leaflet-container {
  font-family: Nunito, sans-serif;
  background: #e9e4d5;
}

.leaflet-control-attribution {
  background: rgba(255, 253, 246, .85) !important;
  color: #6b7867 !important;
  font-size: 10px;
}

.leaflet-control-attribution a {
  color: #8a7556 !important;
}

.leaflet-bar a {
  background: #fffdf6;
  color: #5d6a58;
  border-bottom-color: rgba(125, 140, 118, .25);
}

.leaflet-bar a:hover {
  background: #f3ecdb;
}

.leaflet-popup-content-wrapper {
  background: #fffdf6;
  color: #333d34;
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(96, 90, 70, .22);
}

.leaflet-popup-tip {
  background: #fffdf6;
}

/* ---------- Resultado de ronda ---------- */
.result-panel {
  background: rgba(61, 66, 58, .45);
}

.result-card {
  border-color: rgba(95, 138, 80, .45);
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(95, 138, 80, .1), transparent 55%),
    #fffdf6;
  box-shadow: 0 0 0 1px rgba(95, 138, 80, .18), 0 26px 60px rgba(96, 90, 70, .28);
}

.round-points {
  -webkit-text-stroke: 0;
  color: #33402e;
}

.score-row {
  background: rgba(250, 245, 234, .8);
  border-color: rgba(125, 140, 118, .18);
}

/* ---------- Toast ---------- */
.toast {
  background: rgba(95, 138, 80, .96);
  color: #fffdf6;
  box-shadow: 0 14px 30px rgba(70, 100, 60, .3);
}

/* ---------- Modales ---------- */
.modal {
  background: rgba(61, 66, 58, .46);
  backdrop-filter: blur(2px);
}

.modal-card {
  background: #fffdf6;
  border: 1px solid rgba(125, 140, 118, .22);
  color: #333d34;
  box-shadow: 0 30px 70px rgba(80, 75, 60, .3);
}

.name-input,
.weight-row,
.lang-option,
.leaderboard,
.leaderboard-tab,
.record-row,
.summary-stat {
  background: rgba(250, 245, 234, .85);
  border-color: rgba(125, 140, 118, .2);
  color: #333d34;
}

.record-row {
  color: #333d34;
}

.lang-option.active {
  background: rgba(95, 138, 80, .14);
  border-color: rgba(95, 138, 80, .6);
}

.lang-option small {
  color: #6b7867;
}

/* ---------- Toggles de mazo: chips suaves ---------- */
.deck-toggle {
  background: rgba(250, 245, 234, .9);
  border-color: rgba(125, 140, 118, .24);
  color: #333d34;
}

.deck-toggle:hover {
  border-color: rgba(125, 140, 118, .42);
}

.deck-toggle.active {
  border-color: rgba(95, 138, 80, .55);
  background: rgba(95, 138, 80, .08);
}

.deck-toggle span:first-child {
  background: rgba(125, 140, 118, .16);
  color: #4c5948;
  font-weight: 800;
}

.deck-toggle.active span:first-child {
  background: rgba(95, 138, 80, .2);
  color: #33502f;
}

.deck-toggle small {
  color: #6b7867;
}

.count-option {
  background: rgba(250, 245, 234, .9);
  border-color: rgba(125, 140, 118, .22);
  color: #333d34;
}

.count-option.active {
  background: #c4703f;
  border-color: #c4703f;
  color: #fffdf6;
}

/* ---------- Tarjeta de noticia: recorte de papel de época ---------- */
.view-noticia .news-card {
  background:
    radial-gradient(140% 100% at 50% 0%, rgba(125, 140, 118, .12), transparent 60%),
    #fdfaf1;
  border: 1px solid rgba(125, 140, 118, .28);
  color: #333d34;
  box-shadow: 0 12px 30px rgba(96, 90, 70, .14);
}

.news-headline {
  color: #2f3a2d;
}

/* ---------- Reproductor de audio ---------- */
.audio-times {
  color: #4c5849;
}

.play-btn {
  background: rgba(196, 112, 63, .9);
  border-color: rgba(255, 253, 247, .9);
  box-shadow: 0 8px 20px rgba(120, 80, 40, .3);
}

.play-btn:hover {
  background: #c4703f;
}

.audio-controls input[type="range"] {
  accent-color: #c4703f;
}

/* ---------- Nota al pie de la tarjeta ---------- */
.note,
.caption,
.settings-note {
  color: #6b7867;
}

/* ---------- Foco accesible ---------- */
button:focus-visible,
input:focus-visible,
.leaflet-container:focus-visible {
  outline-color: rgba(196, 112, 63, .6);
}

/* ---------- Movimiento suave ---------- */
* {
  transition-duration: .22s;
}

@media (prefers-reduced-motion: reduce) {
  .zen-avatar {
    animation: none;
  }
  * {
    transition-duration: .01s !important;
  }
}

/* ---------- Móvil ---------- */
@media (max-width: 1040px) {
  .welcome-hero {
    min-height: auto;
    padding: 34px 26px 26px;
  }
}

@media (max-width: 680px) {
  .zen-avatar {
    width: 148px;
  }
  .welcome-hero h1 {
    font-size: 30px;
  }
  .photo-card,
  .map-card,
  .modal-card,
  .result-card {
    border-radius: 18px;
  }
  .screen.game {
    padding-bottom: 132px;
  }
}

/* ============================================================
   CAPA ACUARELA · recortes y manchas (v2, 07/09)
   Quita cajas con borde: papel manchado, esquinas orgánicas,
   sombras de recorte, botones tipo sello. Sin bordes fijos.
   ============================================================ */

/* ---------- Grano de papel + manchas de acuarela de fondo ---------- */
html,
body {
  background:
    radial-gradient(900px 520px at 88% -6%, rgba(226, 195, 150, .3), transparent 62%),
    radial-gradient(700px 460px at -4% 16%, rgba(185, 205, 168, .34), transparent 60%),
    radial-gradient(560px 420px at 60% 108%, rgba(240, 214, 190, .4), transparent 65%),
    linear-gradient(163deg, #faf5e8 0%, #f3ecdb 55%, #ece2cc 100%);
}

/* veladuras que respiran (se mueven muy lento) */
body::before {
  content: "";
  position: fixed;
  inset: -12%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(34% 30% at 22% 30%, rgba(196, 112, 63, .10), transparent 70%),
    radial-gradient(30% 26% at 78% 62%, rgba(95, 138, 80, .10), transparent 70%),
    radial-gradient(26% 30% at 55% 12%, rgba(233, 197, 142, .12), transparent 70%);
  filter: blur(46px);
  animation: zen-wash 26s ease-in-out infinite alternate;
}

@keyframes zen-wash {
  0%   { transform: translate3d(-1.4%, -1%, 0) scale(1); }
  100% { transform: translate3d(1.6%, 1.2%, 0) scale(1.06); }
}

/* grano de papel muy sutil sobre toda la página */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 900;
  pointer-events: none;
  opacity: .04;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/><feColorMatrix type='saturate' values='0'/></filter><rect width='160' height='160' filter='url(%23n)' opacity='0.6'/></svg>");
}

/* ---------- Papel recortado: sin borde, sombra de papel ---------- */
.welcome-hero,
.setup-panel,
.photo-card,
.map-card,
.modal-card,
.result-card,
.news-card {
  border: none !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .75),
    0 2px 5px rgba(96, 90, 70, .07),
    0 16px 34px rgba(96, 90, 70, .13);
}

.welcome-hero,
.setup-panel {
  background:
    radial-gradient(260px 170px at 8% 6%, rgba(233, 197, 142, .12), transparent 70%),
    radial-gradient(340px 220px at 96% 96%, rgba(95, 138, 80, .08), transparent 72%),
    linear-gradient(165deg, #fffdf6 0%, #faf3e2 100%);
  backdrop-filter: blur(14px);
}

.welcome-hero {
  border-radius: 46px 38px 52px 34px / 36px 50px 32px 46px;
}

.setup-panel {
  border-radius: 38px 46px 34px 42px / 44px 34px 46px 36px;
}

.photo-card {
  border-radius: 34px 42px 32px 40px / 40px 32px 42px 34px;
  background:
    radial-gradient(300px 190px at 90% 6%, rgba(196, 112, 63, .07), transparent 70%),
    radial-gradient(360px 240px at 6% 96%, rgba(95, 138, 80, .09), transparent 72%),
    linear-gradient(165deg, #fffdf6, #f9f2e2);
}

.map-card {
  border-radius: 40px 34px 44px 32px / 34px 44px 32px 40px;
  background:
    radial-gradient(300px 200px at 92% 92%, rgba(196, 112, 63, .06), transparent 70%),
    linear-gradient(165deg, #fffdf6, #f9f2e2);
}

.game-footer {
  border: none !important;
  background: linear-gradient(180deg, rgba(255, 253, 246, 0), rgba(255, 253, 246, .92) 22%);
  box-shadow: none;
}

.modal-card {
  border-radius: 34px 42px 30px 40px / 40px 30px 42px 32px;
  background:
    radial-gradient(260px 180px at 92% 4%, rgba(233, 197, 142, .14), transparent 70%),
    linear-gradient(165deg, #fffdf6, #f8f1e0);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .8),
    0 30px 70px rgba(80, 75, 60, .28);
}

/* ---------- Botones como sellos de acuarela: sin borde ---------- */
.primary,
.secondary,
.ghost,
.btn-next {
  border: none !important;
}

.primary,
.btn-next {
  border-radius: 18px 24px 16px 26px / 22px 16px 26px 18px;
  background:
    radial-gradient(120% 160% at 18% 12%, rgba(255, 255, 255, .35), transparent 55%),
    linear-gradient(140deg, #d08350, #b45a2e);
  box-shadow: 0 10px 20px rgba(180, 90, 46, .3), inset 0 1px 0 rgba(255, 255, 255, .35);
}

.primary:hover:not(:disabled),
.btn-next:hover:not(:disabled) {
  transform: translateY(-1px) rotate(-.5deg) scale(1.012);
  box-shadow: 0 13px 26px rgba(180, 90, 46, .36);
}

.primary:active,
.btn-next:active {
  transform: rotate(.4deg) scale(.985);
}

.secondary {
  border-radius: 14px 20px 12px 22px / 18px 12px 22px 14px;
  background: rgba(196, 112, 63, .13);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5);
}

.secondary:hover:not(:disabled) {
  background: rgba(196, 112, 63, .22);
  transform: rotate(-.4deg);
}

.ghost {
  border-radius: 14px 18px 12px 20px / 16px 12px 20px 14px;
  background: rgba(125, 140, 118, .1);
}

.ghost:hover {
  background: rgba(125, 140, 118, .18);
  transform: rotate(.4deg);
}

.gear-btn {
  border: none !important;
  background: rgba(125, 140, 118, .12);
  border-radius: 16px;
}

/* ---------- Caminos: notas recortadas, cada una con su mancha ---------- */
.deck-toggle {
  border: none !important;
  background:
    radial-gradient(150px 90px at 8% 0%, var(--wash, rgba(233, 197, 142, .16)), transparent 75%),
    linear-gradient(160deg, #fffdf6, #f6efdf);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .8),
    0 6px 14px rgba(96, 90, 70, .08);
  border-radius: 18px 24px 16px 22px / 22px 16px 24px 18px;
}

.deck-toggle:nth-child(1) { --wash: rgba(224, 196, 150, .25); transform: rotate(-.5deg); }
.deck-toggle:nth-child(2) { --wash: rgba(214, 175, 160, .24); transform: rotate(.45deg); }
.deck-toggle:nth-child(3) { --wash: rgba(186, 205, 170, .26); transform: rotate(-.4deg); }
.deck-toggle:nth-child(4) { --wash: rgba(230, 205, 150, .26); transform: rotate(.5deg); }
.deck-toggle:nth-child(5) { --wash: rgba(210, 168, 140, .22); transform: rotate(-.45deg); }
.deck-toggle:nth-child(6) { --wash: rgba(170, 195, 165, .26); transform: rotate(.4deg); }

.deck-toggle:hover {
  transform: rotate(0) translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .85), 0 9px 18px rgba(96, 90, 70, .12);
}

.deck-toggle.active {
  border: none !important;
  background:
    radial-gradient(150px 90px at 8% 0%, rgba(95, 138, 80, .18), transparent 75%),
    linear-gradient(160deg, #f3f7ea, #e9efdc);
}

.deck-toggle span:first-child {
  border-radius: 40% 55% 45% 50% / 50% 45% 55% 45%;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .06);
}

/* switch más suave */
.deck-toggle .switch {
  border-radius: 999px;
}

/* ---------- Conteo y tabs: píldoras recortadas ---------- */
.count-option,
.leaderboard-tab {
  border: none !important;
  background: linear-gradient(160deg, #fffdf6, #f4ecd9);
  border-radius: 14px 20px 12px 18px / 18px 12px 20px 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 4px 10px rgba(96, 90, 70, .07);
}

.count-option.active,
.leaderboard-tab.active {
  background: linear-gradient(140deg, #d08350, #b45a2e);
  border: none !important;
  box-shadow: 0 6px 14px rgba(180, 90, 46, .28);
}

/* ---------- HUD: menos caja, más mancha ---------- */
.hud {
  border-bottom: none !important;
  background: linear-gradient(180deg, rgba(255, 253, 246, .9), rgba(255, 253, 246, .72));
  box-shadow: 0 6px 18px rgba(96, 90, 70, .07);
}

.meter {
  border: none !important;
  background: rgba(255, 253, 246, .6);
  border-radius: 16px 22px 14px 20px / 20px 14px 22px 16px;
}

.menu-link {
  border: none !important;
}

/* ---------- La foto: estampa polaroid con marco blanco pintado ---------- */
.photo-frame {
  border-radius: 12px;
  background: #2b2f26;
  box-shadow:
    inset 0 0 0 7px #fffdf6,
    inset 0 0 0 8px rgba(125, 140, 118, .25),
    0 4px 6px rgba(96, 90, 70, .08),
    0 18px 34px rgba(96, 90, 70, .2);
  transform: rotate(-.3deg);
}

/* retos de música/vídeo: mismo marco, tienden a cero */
.view-musica .photo-frame,
.view-video .photo-frame {
  transform: rotate(.25deg);
}

/* pistas: puntitos de acuarela */
.step {
  border-radius: 50%;
  box-shadow: none;
}

.step.active {
  background: radial-gradient(circle at 32% 30%, #d9925f, #b45a2e);
}

/* ---------- Resultado: recorte con mancha verde ---------- */
.result-card {
  border: none !important;
  background:
    radial-gradient(200px 130px at 92% 0%, rgba(95, 138, 80, .14), transparent 70%),
    radial-gradient(220px 150px at 4% 96%, rgba(196, 112, 63, .08), transparent 70%),
    linear-gradient(165deg, #fffdf6, #f8f1e0);
}

.score-row,
.summary-stat,
.record-row,
.weight-row,
.lang-option,
.name-input,
.leaderboard {
  border: none !important;
  background: rgba(250, 245, 234, .7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
  border-radius: 14px 18px 12px 16px / 16px 12px 18px 14px;
}

.round-points {
  -webkit-text-stroke: 0;
  color: #b45a2e;
}

/* ---------- Noticia: papel de época manchado ---------- */
.view-noticia .news-card {
  border: none !important;
  border-radius: 6px 22px 8px 20px / 18px 8px 22px 8px;
  background:
    radial-gradient(240px 140px at 10% 8%, rgba(160, 130, 80, .10), transparent 70%),
    radial-gradient(200px 120px at 95% 90%, rgba(95, 138, 80, .07), transparent 70%),
    #fbf5e6;
}

.news-rule {
  border-top: 2px dashed rgba(180, 90, 46, .4) !important;
}

/* ---------- Toast y progreso: manchas ---------- */
.toast {
  border-radius: 22px 16px 24px 14px / 16px 24px 14px 22px;
  box-shadow: 0 14px 30px rgba(70, 100, 60, .3);
}

.progress {
  border-radius: 999px;
  background: rgba(125, 140, 118, .18);
}

.progress i {
  border-radius: 999px;
  background: linear-gradient(90deg, #8fae7d, #c4703f);
}

/* ---------- Tiempos y pequeñas etiquetas ---------- */
.audio-times {
  color: #4c5849;
}

/* ---------- Respeto al movimiento ---------- */
@media (prefers-reduced-motion: reduce) {
  body::before {
    animation: none;
  }
  .deck-toggle,
  .primary,
  .secondary,
  .ghost,
  .photo-frame {
    transform: none !important;
  }
}

/* esquinas orgánicas más suaves en pantallas pequeñas */
@media (max-width: 680px) {
  .welcome-hero { border-radius: 30px 26px 34px 24px / 26px 32px 24px 30px; }
  .setup-panel,
  .photo-card,
  .map-card,
  .modal-card,
  .result-card { border-radius: 24px 28px 22px 26px / 26px 22px 28px 24px; }
  .deck-toggle { transform: none; }
}

/* ============================================================
   CAPA COLLAGE · menos cajas, piezas sueltas sobre el papel
   (v3, 07/09) — sobreescribe v2 donde haga falta
   ============================================================ */

/* El hero de la home flota sin tarjeta: avatar + texto sobre el papel */
.welcome-hero {
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  border-radius: 0;
  min-height: 520px;
}

/* El panel de configuración mantiene papel, pero más ligero y recortado */
.setup-panel {
  background:
    radial-gradient(280px 180px at 90% 4%, rgba(233, 197, 142, .16), transparent 72%),
    radial-gradient(340px 230px at 2% 96%, rgba(95, 138, 80, .09), transparent 74%),
    linear-gradient(165deg, rgba(255, 253, 246, .92), rgba(250, 243, 226, .88));
}

/* Reto: la columna de texto/acciones deja de ser caja */
.photo-card {
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
  min-height: 0;
}

/* Solo el escenario con la foto conserva marco; el resto flota */
/* El escenario de la foto es un fieltro beige oscuro (textura de fibra) */
.photo-stage {
  position: relative;
  padding: 22px 22px 58px;
  border-radius: 18px 22px 14px 20px / 20px 14px 22px 16px;
  background:
    radial-gradient(130% 90% at 50% -12%, rgba(255, 248, 230, .3), transparent 55%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='f'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/><feColorMatrix type='matrix' values='0 0 0 0 0.42  0 0 0 0 0.36  0 0 0 0 0.24  0 0 0 0.6 0'/></filter><rect width='120' height='120' filter='url(%23f)'/></svg>"),
    linear-gradient(160deg, #a89777 0%, #94825f 60%, #87754f 100%);
  box-shadow:
    inset 0 2px 5px rgba(255, 246, 225, .4),
    inset 0 -4px 12px rgba(60, 46, 22, .35),
    0 16px 30px rgba(96, 90, 70, .16);
}
/* Mapa: lámina sobre el papel, sin caja */
.map-card {
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
}

/* El panel de respuesta (año/edad) va suelto, no dentro de una caja */
.answer-panel {
  background: transparent;
  border: none;
  box-shadow: none;
}

/* La chincheta del año queda sobre el papel */
.year-readout strong {
  font-size: 22px;
}

/* HUD: solo una veladura ligera */
.hud {
  background: linear-gradient(180deg, rgba(252, 248, 236, .88), rgba(252, 248, 236, .62));
  box-shadow: none;
}

/* La lámina del mapa con sombra de papel recortado (drop-shadow respeta esquinas) */
#map,
.result-map,
#summaryMap {
  filter: drop-shadow(0 10px 18px rgba(96, 90, 70, .16));
  border-radius: 10px;
  overflow: hidden;
}

/* Botón principal y "Siguiente": refuerzo de sello */
.primary,
.btn-next {
  border-radius: 20px 26px 18px 28px / 24px 18px 28px 20px;
  transform: rotate(-.35deg);
}

.primary:hover:not(:disabled),
.btn-next:hover:not(:disabled) {
  transform: translateY(-1px) rotate(-.8deg) scale(1.015);
}

.primary:active,
.btn-next:active {
  transform: rotate(.3deg) scale(.98);
}

/* Caminos: notas con rotación más visible y esquina doblada */
.deck-toggle {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .85),
    0 7px 16px rgba(96, 90, 70, .1),
    0 1px 0 rgba(96, 90, 70, .05);
}

/* Subtítulo de bienvenida con algo más de aire */
.welcome-copy {
  font-size: 17px;
}

@media (max-width: 1040px) {
  .welcome-hero {
    min-height: 0;
    padding: 26px 22px 12px;
  }
}

/* ============ v3 finos ============ */
.primary:disabled,
.btn-next:disabled {
  background: rgba(125, 140, 118, .32) !important;
  color: rgba(51, 61, 52, .75) !important;
  transform: none !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5) !important;
}

/* la lámina del mapa, levemente ladeada como recorte */
#map {
  transform: rotate(-.18deg);
}

@media (prefers-reduced-motion: reduce) {
  #map {
    transform: none;
  }
}

/* ============================================================
   CAPA V4 · mesa + polaroid real + fieltro + jardín zen
   (07/09) — sobreescribe v3
   ============================================================ */

/* ---------- El escenario de la foto es una mesa de madera ---------- */
.photo-stage {
  position: relative;
  padding: 22px 22px 58px;
  border-radius: 18px 22px 14px 20px / 20px 14px 22px 16px;
  background:
    radial-gradient(130% 90% at 50% -10%, rgba(255, 250, 235, .5), transparent 55%),
    repeating-linear-gradient(90deg,
      rgba(122, 88, 52, .06) 0 2px, transparent 2px 30px,
      rgba(122, 88, 52, .045) 30px 32px, transparent 32px 66px,
      rgba(122, 88, 52, .05) 66px 69px, transparent 69px 100px),
    linear-gradient(158deg, #ecdcbe 0%, #e2cda6 55%, #d8bf94 100%);
  box-shadow:
    inset 0 2px 6px rgba(255, 255, 255, .5),
    inset 0 -3px 10px rgba(90, 62, 32, .25),
    0 16px 30px rgba(96, 90, 70, .16);
}

/* Carta polaroid blanca que envuelve la foto (bajo el contenido) */
.photo-stage::after {
  content: "";
  position: absolute;
  inset: 14px 14px 46px;
  z-index: 0;
  background: linear-gradient(165deg, #fffef9 0%, #f8f1df 90%);
  border-radius: 7px;
  box-shadow:
    0 26px 44px rgba(66, 48, 22, .34),
    0 5px 12px rgba(66, 48, 22, .22);
  transform: rotate(var(--tilt, 0deg));
  transform-origin: 50% 42%;
  transition: transform .5s cubic-bezier(.2, .9, .25, 1);
  pointer-events: none;
}

/* La foto (con su revelado) queda por encima de la carta */
.photo-stage .photo-frame {
  z-index: 1;
  overflow: hidden;
  background: #1f231c;
  border-radius: 3px;
  transform: rotate(var(--tilt, 0deg));
  transform-origin: 50% 42%;
  transition: transform .5s cubic-bezier(.2, .9, .25, 1);
  box-shadow: 0 1px 2px rgba(66, 48, 22, .35), 0 0 0 1px rgba(255, 255, 255, .25);
  margin: 0 auto;
}

/* Cada tipo conserva su proporción, centrado en la carta */
.photo-stage .photo-frame.video-ratio {
  width: 100%;
  max-width: min(860px, 100%);
}

/* Aire para que la carta polaroid no quede pegada a la mesa */
.photo-actions {
  padding-top: 18px;
}

/* ---------- Botones de fieltro: textura real, sin bordes ---------- */
.primary,
.btn-next,
.secondary,
.ghost {
  position: relative;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='90' height='90'><filter id='f'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/><feColorMatrix type='matrix' values='0 0 0 0 0.35  0 0 0 0 0.28  0 0 0 0 0.2  0 0 0 0.85 0'/></filter><rect width='90' height='90' filter='url(%23f)'/></svg>"),
    linear-gradient(160deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, 0) 45%),
    linear-gradient(140deg, #c97a47, #a94e24);
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, .28),
    inset 0 -4px 0 rgba(0, 0, 0, .22),
    0 8px 16px rgba(120, 70, 35, .3);
}

.primary:hover:not(:disabled),
.btn-next:hover:not(:disabled) {
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, .3),
    inset 0 -4px 0 rgba(0, 0, 0, .24),
    0 11px 22px rgba(120, 70, 35, .38);
}

.btn-next {
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='90' height='90'><filter id='f'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/><feColorMatrix type='matrix' values='0 0 0 0 0.35  0 0 0 0 0.28  0 0 0 0 0.2  0 0 0 0.85 0'/></filter><rect width='90' height='90' filter='url(%23f)'/></svg>"),
    linear-gradient(160deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, 0) 45%),
    linear-gradient(140deg, #cf8652, #b45e33);
}

.secondary {
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='90' height='90'><filter id='f'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/><feColorMatrix type='matrix' values='0 0 0 0 0.35  0 0 0 0 0.28  0 0 0 0 0.2  0 0 0 0.85 0'/></filter><rect width='90' height='90' filter='url(%23f)'/></svg>"),
    linear-gradient(160deg, rgba(255, 255, 255, .3), rgba(255, 255, 255, 0) 50%),
    linear-gradient(160deg, #cfd6bd, #b5bf9c);
  color: #39422f;
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, .5),
    inset 0 -3px 0 rgba(70, 82, 55, .25),
    0 6px 13px rgba(96, 90, 70, .18);
}

.secondary:hover:not(:disabled) {
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='90' height='90'><filter id='f'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/><feColorMatrix type='matrix' values='0 0 0 0 0.35  0 0 0 0 0.28  0 0 0 0 0.2  0 0 0 0.85 0'/></filter><rect width='90' height='90' filter='url(%23f)'/></svg>"),
    linear-gradient(160deg, rgba(255, 255, 255, .35), rgba(255, 255, 255, 0) 50%),
    linear-gradient(160deg, #c2ccab, #a5b08c);
  color: #2e3727;
}

.ghost {
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='90' height='90'><filter id='f'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/><feColorMatrix type='matrix' values='0 0 0 0 0.35  0 0 0 0 0.28  0 0 0 0 0.2  0 0 0 0.85 0'/></filter><rect width='90' height='90' filter='url(%23f)'/></svg>"),
    linear-gradient(160deg, rgba(255, 255, 255, .5), rgba(255, 255, 255, 0) 55%),
    linear-gradient(160deg, #eee5cf, #dfd2b2);
  color: #4a4333;
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, .65),
    inset 0 -3px 0 rgba(120, 105, 70, .22),
    0 5px 11px rgba(96, 90, 70, .16);
}

.ghost:hover {
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='90' height='90'><filter id='f'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/><feColorMatrix type='matrix' values='0 0 0 0 0.35  0 0 0 0 0.28  0 0 0 0 0.2  0 0 0 0.85 0'/></filter><rect width='90' height='90' filter='url(%23f)'/></svg>"),
    linear-gradient(160deg, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0) 55%),
    linear-gradient(160deg, #e3d7bd, #d3c3a0);
  color: #3d372b;
}

.primary,
.btn-next {
  color: #fffaf0;
}

/* ---------- Jardín de arena zen en la portada ---------- */
.zen-garden {
  width: min(430px, 92%);
  margin: 6px auto 0;
  opacity: .95;
}

.zen-garden svg {
  display: block;
  width: 100%;
  height: auto;
}

/* ---------- Pequeños retoques de cohesión ---------- */
.round-kicker {
  letter-spacing: .06em;
}

.deck-toggle.active {
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, .6),
    inset 0 -2px 0 rgba(80, 110, 70, .18),
    0 7px 16px rgba(96, 90, 70, .12);
}

@media (max-width: 1040px) {
  .photo-stage {
    padding: 18px 18px 46px;
  }
  .photo-stage::after {
    inset: 12px 12px 38px;
  }
}

@media (max-width: 680px) {
  .zen-garden {
    display: none;
  }
  .photo-stage {
    padding: 14px 14px 38px;
  }
  .photo-stage::after {
    inset: 10px 10px 32px;
  }
}

/* finos v4 móvil */
@media (max-width: 680px) {
  .screen.game {
    padding-top: 4px;
    padding-bottom: 160px;
  }
  .photo-stage {
    margin-top: 6px;
  }
}

/* ============================================================
   CAPA V5 · patchwork de fieltro real (07/09 noche)
   Fieltro en botones y cajas, costuras, marco bordado del mapa,
   polaroid realista sobre parche de fieltro, avatar parche yoga
   ============================================================ */

:root {
  --fiber: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='110' height='110'><filter id='f'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/><feColorMatrix type='matrix' values='0 0 0 0 0.42  0 0 0 0 0.36  0 0 0 0 0.24  0 0 0 0.5 0'/></filter><rect width='110' height='110' filter='url(%23f)'/></svg>");
}

/* ---------- Cajas = parches de fieltro marfil con costura ---------- */
.setup-panel,
.modal-card,
.result-card,
.answer-panel {
  position: relative;
  border: none;
  border-radius: 24px 28px 21px 25px / 26px 20px 29px 22px;
  background-image:
    var(--fiber),
    radial-gradient(420px 260px at 88% 2%, rgba(233, 197, 142, .22), transparent 70%),
    radial-gradient(380px 260px at 4% 98%, rgba(95, 138, 80, .10), transparent 72%),
    linear-gradient(162deg, rgba(255, 252, 242, .96) 0%, rgba(247, 240, 222, .94) 55%, rgba(240, 230, 207, .94) 100%);
  outline: 2px dashed rgba(158, 132, 90, .4);
  outline-offset: -7px;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, .7),
    inset 0 -2px 0 rgba(120, 100, 65, .12),
    0 16px 34px rgba(120, 105, 70, .18);
}

/* ---------- Parche grande de fieltro beige oscuro con costura ---------- */
/* (la v4 dejó la madera activa; aquí el fieltro manda) */
.photo-stage {
  border: 2.5px dashed rgba(60, 47, 26, .55);
  border-radius: 30px 38px 26px 34px / 34px 26px 36px 28px;
  background:
    radial-gradient(130% 95% at 50% -12%, rgba(255, 246, 222, .34), transparent 58%),
    var(--fiber),
    linear-gradient(160deg, #ae9e7e 0%, #99875f 55%, #8a7850 100%);
  box-shadow:
    inset 0 3px 6px rgba(255, 246, 225, .35),
    inset 0 -5px 14px rgba(52, 40, 18, .38),
    0 18px 34px rgba(96, 90, 70, .18);
}

/* ---------- Polaroid realista (brillo, papel, microsombra) ---------- */
.photo-stage::after {
  inset: 15px 15px 47px;
  border-radius: 9px;
  background:
    linear-gradient(116deg, rgba(255, 255, 255, .75) 0%, rgba(255, 255, 255, 0) 24%, rgba(205, 178, 130, .08) 48%, rgba(255, 255, 255, 0) 70%, rgba(255, 255, 255, .22) 100%),
    linear-gradient(178deg, #fffef9 0%, #fbf5e7 74%, #f2ead5 100%);
  box-shadow:
    inset 0 0 0 1px rgba(173, 145, 102, .16),
    0 2px 3px rgba(66, 48, 22, .16),
    var(--tilt-shadow, 4px) 20px 34px rgba(66, 48, 22, .30),
    0 46px 70px rgba(66, 48, 22, .14);
}

/* La impresión asoma ligeramente de la carta (brillo de papel) */
.photo-stage .photo-frame {
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, .8),
    0 0 0 3px rgba(180, 152, 108, .25),
    0 1px 2px rgba(66, 48, 22, .3);
  border-radius: 2px;
}

/* ---------- Botones: parches de fieltro con costura ---------- */
.primary,
.btn-next,
.secondary,
.ghost {
  border-radius: 15px 11px 14px 12px / 12px 14px 11px 15px;
  outline: 2px dashed rgba(120, 60, 25, .5);
  outline-offset: -5px;
}
.secondary { outline-color: rgba(62, 84, 50, .55); }
.ghost    { outline-color: rgba(124, 105, 70, .42); }
.primary:disabled,
.btn-next:disabled {
  outline-color: rgba(125, 140, 118, .3);
  outline-offset: -3px;
}

/* ---------- Caminos (mazos): cada uno un color de fieltro ---------- */
.deck-toggle {
  border: none;
  border-radius: 15px 12px 17px 13px / 13px 17px 12px 15px;
  transition: transform .18s ease, box-shadow .18s ease, background-image .18s ease;
}
.deck-toggle:hover:not(:disabled) { transform: translateY(-1px); }

/* estado inactivo (fieltro pálido) y activo (fieltro de color) */
.deck-toggle[data-deck="fotos"] {
  background-image: var(--fiber), linear-gradient(160deg, #e4ead6, #c9d6b5);
  color: #3d4a33;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .7), inset 0 -2px 0 rgba(70, 100, 55, .18), 0 4px 10px rgba(96, 110, 80, .12);
}
.deck-toggle[data-deck="fotos"].active {
  background-image: var(--fiber), linear-gradient(160deg, #84a170, #5e7c49);
  color: #fffdf2;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .25), inset 0 -3px 0 rgba(35, 55, 25, .4), 0 7px 16px rgba(70, 100, 50, .3);
}
.deck-toggle[data-deck="musica"] {
  background-image: var(--fiber), linear-gradient(160deg, #f6e3d1, #ebc9ad);
  color: #5a3b24;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .7), inset 0 -2px 0 rgba(150, 80, 35, .16), 0 4px 10px rgba(130, 90, 60, .12);
}
.deck-toggle[data-deck="musica"].active {
  background-image: var(--fiber), linear-gradient(160deg, #d0834f, #aa5526);
  color: #fff8ec;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .25), inset 0 -3px 0 rgba(105, 45, 15, .45), 0 7px 16px rgba(150, 80, 40, .3);
}
.deck-toggle[data-deck="peliculas"] {
  background-image: var(--fiber), linear-gradient(160deg, #f8ecd2, #edd8ac);
  color: #5c451f;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .75), inset 0 -2px 0 rgba(150, 115, 45, .16), 0 4px 10px rgba(140, 115, 60, .12);
}
.deck-toggle[data-deck="peliculas"].active {
  background-image: var(--fiber), linear-gradient(160deg, #dcaa50, #b5832a);
  color: #fff9e9;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .3), inset 0 -3px 0 rgba(120, 85, 20, .45), 0 7px 16px rgba(170, 130, 45, .3);
}
.deck-toggle[data-deck="series"] {
  background-image: var(--fiber), linear-gradient(160deg, #efe2cb, #decaa6);
  color: #4a3a24;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .7), inset 0 -2px 0 rgba(130, 100, 55, .16), 0 4px 10px rgba(130, 105, 60, .12);
}
.deck-toggle[data-deck="series"].active {
  background-image: var(--fiber), linear-gradient(160deg, #b58c52, #8d6631);
  color: #fff7e6;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .3), inset 0 -3px 0 rgba(95, 65, 25, .45), 0 7px 16px rgba(150, 110, 55, .3);
}
.deck-toggle[data-deck="noticias"] {
  background-image: var(--fiber), linear-gradient(160deg, #e8ecdd, #d4ddc3);
  color: #37422e;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .75), inset 0 -2px 0 rgba(85, 110, 65, .16), 0 4px 10px rgba(100, 120, 80, .12);
}
.deck-toggle[data-deck="noticias"].active {
  background-image: var(--fiber), linear-gradient(160deg, #b3c29c, #8da176);
  color: #2c3522;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .35), inset 0 -3px 0 rgba(60, 85, 45, .4), 0 7px 16px rgba(90, 115, 70, .3);
}
.deck-toggle[data-deck="comida"] {
  background-image: var(--fiber), linear-gradient(160deg, #f7e1cb, #efcba9);
  color: #5a3b24;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .75), inset 0 -2px 0 rgba(150, 90, 45, .16), 0 4px 10px rgba(140, 95, 55, .12);
}
.deck-toggle[data-deck="comida"].active {
  background-image: var(--fiber), linear-gradient(160deg, #d98e56, #b96a33);
  color: #fff8ec;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .28), inset 0 -3px 0 rgba(120, 60, 20, .45), 0 7px 16px rgba(160, 95, 45, .3);
}
.deck-toggle:disabled {
  background-image: var(--fiber), linear-gradient(160deg, #e8e2d2, #d5cdb8);
  color: rgba(90, 85, 70, .55);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .6);
}

/* ---------- Avatar: parche de fieltro con la Camilla de yoga ---------- */
.zen-avatar {
  position: relative;
  overflow: hidden;
  border-radius: 46% 54% 52% 48% / 50% 46% 54% 50%;
  background: #f7f1e1;
  box-shadow:
    inset 0 0 0 1px rgba(190, 170, 130, .55),
    0 16px 28px rgba(140, 110, 70, .22);
  transform-origin: 50% 86%;
  will-change: transform;
  animation: zen-float 7s ease-in-out infinite;
}
.zen-avatar::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: inherit;
  border: 2px dashed rgba(148, 122, 78, .55);
  pointer-events: none;
}
.zen-avatar-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: inherit;
  transform-origin: 50% 62%;
  will-change: transform;
  animation: avatar-breathe 4.4s ease-in-out .4s infinite;
}

@keyframes avatar-breathe {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-3px) scale(1.018, .986);
  }
}

@media (prefers-reduced-motion: reduce) {
  .zen-avatar,
  .zen-avatar-img {
    animation: none;
  }
}

/* ---------- Bienvenida: retal de fieltro cosido alrededor del mensaje ---------- */
.zen-hero-text {
  position: relative;
  max-width: 570px;
  margin: 0 auto;
  padding: 28px 34px 30px;
  border-radius: 34px 28px 38px 30px / 30px 36px 28px 34px;
  background-image:
    var(--fiber),
    radial-gradient(160px 120px at 12% 8%, rgba(255, 255, 255, .42), transparent 70%),
    radial-gradient(220px 140px at 94% 92%, rgba(166, 181, 139, .22), transparent 72%),
    linear-gradient(155deg, #fbf3df 0%, #eee0bf 58%, #e5d5ad 100%);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, .7),
    inset 0 -3px 0 rgba(125, 104, 66, .14),
    0 16px 30px rgba(125, 105, 72, .16);
  transform: rotate(-.25deg);
}
.zen-hero-text::before {
  content: "";
  position: absolute;
  inset: 9px;
  border: 2px dashed rgba(129, 106, 68, .46);
  border-radius: inherit;
  pointer-events: none;
}
.zen-hero-text::after {
  content: "";
  position: absolute;
  width: 74px;
  height: 34px;
  right: 22px;
  top: -13px;
  border-radius: 18px 14px 16px 20px / 16px 20px 14px 18px;
  background-image:
    var(--fiber),
    linear-gradient(145deg, #cf8452, #b96636);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .32),
    0 8px 14px rgba(130, 80, 45, .18);
  transform: rotate(3deg);
  pointer-events: none;
}
.zen-hero-text .eyebrow,
.zen-hero-text h1,
.zen-hero-text .welcome-copy {
  position: relative;
  z-index: 1;
}
.zen-hero-text h1 {
  color: #394936;
}
.zen-hero-text .welcome-copy {
  color: #445442;
}

@media (max-width: 680px) {
  .zen-hero-text {
    max-width: 342px;
    padding: 24px 22px 25px;
    border-radius: 28px 24px 32px 26px / 24px 30px 24px 30px;
  }
  .zen-hero-text::after {
    width: 56px;
    height: 26px;
    right: 18px;
    top: -10px;
  }
}

/* ---------- Mapa: marco bordado (bastidor de fieltro) + atlas artístico ---------- */
#map,
#resultMap {
  border: 14px solid transparent;
  border-radius: 60px 60px 26px 26px / 60px 60px 22px 22px;
  background-image:
    var(--fiber),
    radial-gradient(120% 60% at 30% 0%, rgba(255, 255, 255, .3), transparent 55%),
    linear-gradient(160deg, #cfd7b6 0%, #a5b58b 60%, #93a47a 100%);
  background-clip: padding-box, padding-box, border-box;
  box-shadow:
    inset 0 0 0 4px rgba(255, 252, 240, .55),
    0 24px 40px rgba(110, 100, 80, .25);
  outline: 2px dashed rgba(92, 106, 70, .6);
  outline-offset: -3px;
}
/* El mapa un poco más recogido dentro de su bastidor */
#map {
  width: 100%;
  display: block;
  max-width: min(720px, 100%);
  margin: 0 auto;
}

/* Lavado artístico de las teselas (atlas antiguo, casi acuarela) */
#map .leaflet-tile-pane,
#resultMap .leaflet-tile-pane {
  filter: sepia(.16) saturate(.76) brightness(1.07) contrast(.95);
}
/* Grano de papel sobre el mapa (veladura acuarela) */
#map::after,
#resultMap::after {
  content: "";
  position: absolute;
  inset: 14px;
  z-index: 800;
  pointer-events: none;
  border-radius: 48px 48px 12px 12px / 48px 48px 10px 10px;
  background-image: var(--fiber);
  opacity: .4;
  mix-blend-mode: multiply;
}

/* Controles del mapa dentro del bastidor */
#map .leaflet-top.leaflet-left {
  top: auto;
  left: auto;
  bottom: 40px;
  right: 14px;
}
#map .leaflet-control-zoom {
  border: none !important;
  border-radius: 13px;
  overflow: hidden;
  box-shadow: 0 5px 12px rgba(90, 80, 60, .28);
}
#map .leaflet-control-zoom a {
  width: 36px;
  height: 36px;
  line-height: 36px;
  background: #f6f0e0;
  color: #5a4c33;
  border-bottom: 1px solid rgba(155, 130, 90, .35);
}
#map .leaflet-control-zoom a:hover {
  background: #ece4cc;
  color: #3d3322;
}
#map .leaflet-control-zoom a:last-child { border-bottom: none; }
#map .leaflet-control-attribution {
  background: rgba(250, 246, 234, .82);
  color: #77694f;
  font-size: 10px;
  border-radius: 9px 9px 0 0;
  margin: 0 26px 10px 0 !important;
}

@media (max-width: 680px) {
  #map,
  #resultMap {
    border-width: 10px;
    border-radius: 38px 38px 16px 16px / 38px 38px 14px 14px;
  }
  #map::after,
  #resultMap::after {
    inset: 10px;
    border-radius: 30px 30px 10px 10px / 30px 30px 9px 9px;
  }
  #map .leaflet-top.leaflet-left {
    bottom: 30px;
    right: 8px;
  }
  #map .leaflet-control-zoom a {
    width: 34px;
    height: 34px;
    line-height: 34px;
  }
  .setup-panel,
  .modal-card,
  .result-card {
    outline-offset: -6px;
  }
}

/* ---------- V5 finos: revelado zen + contraste caminos ---------- */
/* La foto borrosa ya no es oscura: parece una polaroid desenfocada */
.photo-blur {
  filter: blur(13px) saturate(.96) brightness(.94);
}
/* El marco de pista deja de ser "escáner": costura clara redondeada */
.scan-frame {
  border: 2px solid rgba(255, 251, 240, .92);
  border-radius: 12px;
  box-shadow:
    0 0 0 999px rgba(63, 56, 40, .14),
    0 0 0 1px rgba(150, 125, 85, .4),
    0 8px 20px rgba(120, 100, 70, .28);
}
.photo-frame.full .scan-frame {
  opacity: 0;
}

/* Subtexto de los caminos hereda el color del parche (contraste) */
.deck-toggle small {
  color: currentColor;
  opacity: .78;
}
.deck-toggle.active small {
  opacity: .88;
}
.deck-toggle:disabled {
  color: #6b6353;
  background-image: var(--fiber), linear-gradient(160deg, #ece5d2, #dcd3ba);
}

/* ---------- Cierre: caja de recuerdos ---------- */
.summary-card {
  width: min(780px, 100%);
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  align-items: center;
  gap: 14px;
  padding: clamp(18px, 3vw, 26px);
  border-radius: 32px 27px 34px 25px / 28px 33px 25px 31px;
}

.summary-copy {
  display: grid;
  gap: 7px;
}

.summary-card .eyebrow {
  color: #7a6d54;
}

.summary-card h2 {
  max-width: 13ch;
  color: #33402e;
  font-size: clamp(28px, 5vw, 46px);
  line-height: .94;
}

.summary-copy p:not(.eyebrow),
.summary-letter {
  color: #4f5949;
  font-size: 16px;
  line-height: 1.45;
}

.summary-family-patch {
  width: min(100%, 320px);
  justify-self: center;
  margin: 0;
  grid-column: 2;
  grid-row: 1 / span 3;
  transform: rotate(-1.2deg);
  filter: drop-shadow(0 16px 24px rgba(75, 65, 44, .18));
}

.summary-family-patch img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 24px;
}

.summary-card .summary-grid {
  grid-column: 1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.summary-card .summary-stat {
  min-height: 74px;
  display: grid;
  align-content: center;
  border: 0;
  border-radius: 18px 16px 19px 15px / 16px 19px 15px 18px;
  background-image:
    var(--fiber),
    linear-gradient(155deg, rgba(246, 235, 205, .9), rgba(232, 214, 176, .86));
  outline: 1.5px dashed rgba(130, 105, 66, .36);
  outline-offset: -5px;
}

.summary-card .summary-stat strong {
  color: #33402e;
  font-size: clamp(23px, 4vw, 34px);
}

.summary-letter {
  grid-column: 1 / -1;
  display: grid;
  gap: 9px;
  padding: 14px 16px;
  border-radius: 20px 18px 21px 17px / 18px 21px 17px 20px;
  background:
    var(--fiber),
    linear-gradient(160deg, rgba(255, 250, 236, .9), rgba(242, 230, 203, .82));
  outline: 1.5px dashed rgba(158, 132, 90, .36);
  outline-offset: -6px;
}

.summary-letter p {
  margin: 0;
}

.summary-love {
  color: #7a3f2d;
  font-size: clamp(22px, 4vw, 34px);
  font-weight: 900;
  line-height: 1.1;
}

.summary-card #summaryMap {
  display: none;
}

.summary-card #summaryMap::after {
  display: none;
}

.summary-card .primary {
  grid-column: 1 / -1;
  justify-self: center;
  width: min(100%, 360px);
}

@media (max-width: 680px) {
  .summary-card {
    grid-template-columns: 1fr;
    gap: 10px;
    max-height: calc(100vh - 20px);
    padding: 14px;
  }

  .summary-card h2 {
    max-width: 12ch;
    font-size: 26px;
  }

  .summary-family-patch {
    width: min(100%, 218px);
    grid-column: 1;
    grid-row: auto;
  }

  .summary-card .summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .summary-card .summary-stat {
    min-height: 58px;
    padding: 8px;
  }

  .summary-copy p:not(.eyebrow),
  .summary-letter {
    font-size: 14px;
    line-height: 1.36;
  }

  .summary-letter {
    gap: 7px;
    padding: 11px 13px;
  }

  .summary-love {
    font-size: 24px;
  }
}

/* ---------- Ajustes de encaje desktop: portada, juego y cierre ---------- */
@media (min-width: 1041px) {
  .welcome {
    padding: 14px;
  }

  .welcome-shell {
    width: min(1220px, 100%);
    max-height: calc(100dvh - 28px);
    grid-template-columns: minmax(0, .86fr) minmax(330px, .64fr);
    gap: 14px;
  }

  .welcome-hero {
    align-content: start;
    justify-items: center;
    min-height: calc(100dvh - 28px);
    padding: 18px;
    text-align: center;
  }

  .welcome-hero .zen-avatar {
    justify-self: center;
    width: clamp(112px, 15vw, 176px);
    margin: 0 0 4px;
  }

  .welcome-hero .eyebrow,
  .zen-hero-text {
    justify-self: center;
  }

  .zen-hero-text {
    max-width: 520px;
    padding: 23px 28px 25px;
  }

  .welcome-copy {
    font-size: 15px;
    line-height: 1.42;
  }

  .setup-panel {
    max-height: calc(100dvh - 28px);
    gap: 10px;
    padding: 14px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  .setup-panel h2 {
    font-size: 24px;
  }

  .setup-block {
    gap: 7px;
  }

  .deck-grid {
    gap: 6px;
  }

  .deck-toggle {
    min-height: 46px;
    grid-template-columns: 36px 1fr 42px;
    gap: 8px;
    padding: 5px 8px;
  }

  .deck-toggle span:first-child {
    width: 30px;
    height: 30px;
  }

  .deck-toggle strong {
    font-size: 14px;
  }

  .deck-toggle small,
  .deck-summary,
  .empty-records {
    font-size: 12px;
    line-height: 1.25;
  }

  .leaderboard {
    gap: 8px;
    padding: 9px;
  }

  .leaderboard-list {
    min-height: 54px;
    max-height: none;
    overflow: visible;
  }

  .record-row {
    min-height: 27px;
    padding: 3px 6px;
    font-size: 12px;
  }

  .screen.game {
    padding: 8px;
    gap: 8px;
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  .hud {
    min-height: 54px;
    padding: 8px 10px;
  }

  .meter {
    padding: 7px 10px;
  }

  .meter strong {
    font-size: 19px;
  }

  .primary-score strong {
    font-size: clamp(24px, 3vw, 34px);
  }

  .game-grid {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: 10px;
  }

  .card-top,
  .photo-actions,
  .answer-panel {
    padding: 10px 12px;
  }

  .photo-stage {
    padding: 10px;
  }

  .map-card {
    grid-template-rows: minmax(0, 1fr) auto;
  }

  #map {
    min-height: 0;
    max-width: 100%;
  }

  .game-footer {
    padding: 8px 10px;
  }

  .footer-actions .primary {
    min-height: 48px;
  }
}

@media (max-width: 1040px) {
  .welcome-shell {
    max-height: none;
  }

  .setup-panel {
    overflow: visible;
  }
}

.summary-copy {
  align-self: center;
}

.summary-copy #summaryIntro:empty {
  display: none;
}

.summary-card h2 {
  max-width: 16ch;
}

.summary-card .summary-stat,
.summary-card .primary {
  display: grid;
  place-items: center;
  text-align: center;
}

.summary-card .summary-stat {
  align-content: center;
  justify-content: center;
}

/* ---------- Partida desktop: controles dentro de la columna del mapa ---------- */
@media (min-width: 1041px) {
  .screen.game {
    grid-template-rows: minmax(0, 1fr);
  }

  .game-grid {
    min-height: 0;
    height: 100%;
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas:
      "photo hud"
      "photo map";
  }

  .photo-card {
    grid-area: photo;
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  .photo-stage {
    place-items: center;
    overflow: hidden;
  }

  .photo-frame:not(.video-ratio) {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    justify-self: center;
    align-self: center;
  }

  .game-grid > .hud {
    grid-area: hud;
    position: static;
    min-height: 0;
    margin: 0 10px;
    grid-template-columns: minmax(0, 1fr) minmax(78px, auto) auto;
    background: rgba(255, 252, 243, .86);
    border: 1px solid rgba(125, 140, 118, .22);
    border-radius: var(--radius);
  }

  .map-card {
    grid-area: map;
    grid-template-rows: minmax(0, 1fr) auto auto;
    gap: 8px;
    padding: 0 0 8px;
  }

  .map-card .answer-panel {
    margin: 0 10px;
    border: 1px solid rgba(125, 140, 118, .18);
    border-radius: 18px 16px 19px 15px / 16px 19px 15px 18px;
  }

  .map-card .game-footer {
    position: static;
    margin: 0 10px;
    border-radius: 18px 16px 19px 15px / 16px 19px 15px 18px;
    box-shadow: 0 10px 22px rgba(110, 90, 60, .12);
  }

  .footer-actions {
    width: 100%;
  }
}

/* ---------- Polaroid y reproductores: más altos, sin solapes ---------- */
.photo-frame:not(.video-ratio) {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  background-image:
    linear-gradient(#fffaf0, #f4ead2);
  padding: 12px;
}

.photo-frame:not(.video-ratio) img {
  border-radius: 8px;
}

.view-musica,
.view-video {
  grid-template-rows: minmax(0, 1fr) auto;
  align-content: stretch;
  place-items: stretch center;
}

.view-musica .photo-frame.video-ratio,
.view-video .photo-frame.video-ratio {
  align-self: end;
  width: min(100%, 820px);
  max-height: 100%;
}

.view-musica .audio-controls {
  align-self: start;
  width: min(100%, 820px);
  margin-top: 12px;
  padding: 12px 14px 10px;
  border-radius: 18px 16px 19px 15px / 16px 19px 15px 18px;
  background:
    var(--fiber),
    linear-gradient(155deg, rgba(250, 243, 222, .96), rgba(232, 217, 184, .92));
  outline: 1.5px dashed rgba(130, 105, 66, .34);
  outline-offset: -5px;
  box-shadow: 0 10px 18px rgba(110, 90, 60, .12);
}

.view-musica .audio-controls input[type="range"] {
  height: 28px;
}

.view-video .video-title {
  align-self: start;
  width: min(100%, 820px);
  margin-top: 12px;
  padding: 9px 12px;
  border-radius: 16px 14px 17px 13px / 14px 17px 13px 16px;
  background:
    var(--fiber),
    linear-gradient(155deg, rgba(250, 243, 222, .94), rgba(232, 217, 184, .9));
  outline: 1.5px dashed rgba(130, 105, 66, .32);
  outline-offset: -5px;
  box-shadow: 0 10px 18px rgba(110, 90, 60, .12);
}

.view-video .vt-vo {
  color: #3c4a3a;
  text-shadow: none;
}

.view-video .vt-es {
  color: #6b7867;
}

/* ---------- Ampliación de foto a pantalla completa ---------- */
.full-photo-modal {
  padding: 12px;
  background: rgba(35, 38, 31, .86);
}

.full-photo-card {
  width: min(100vw - 24px, 1440px);
  height: min(100dvh - 24px, 980px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  border-radius: 22px 18px 24px 17px / 18px 24px 17px 22px;
  background:
    var(--fiber),
    linear-gradient(155deg, rgba(250, 243, 222, .98), rgba(232, 217, 184, .94));
  outline: 2px dashed rgba(130, 105, 66, .35);
  outline-offset: -7px;
  box-shadow: 0 30px 70px rgba(20, 18, 12, .42);
}

.full-photo-close {
  justify-self: end;
  min-height: 42px;
}

.full-photo-card img {
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 14px;
  background: #2d3028;
}

/* ---------- Cierre con posicion en Top 10 ---------- */
.summary-rank {
  grid-column: 1 / -1;
  margin: 0;
  padding: 12px 14px;
  text-align: center;
  font-weight: 900;
  color: #33402e;
  border-radius: 18px 16px 19px 15px / 16px 19px 15px 18px;
  background:
    var(--fiber),
    linear-gradient(155deg, rgba(246, 235, 205, .9), rgba(232, 214, 176, .86));
  outline: 1.5px dashed rgba(130, 105, 66, .34);
  outline-offset: -5px;
}

.summary-top {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  width: 100%;
  max-height: 180px;
  overflow-y: auto;
  padding: 12px;
  border-radius: 20px 18px 21px 17px / 18px 21px 17px 20px;
  background:
    var(--fiber),
    linear-gradient(160deg, rgba(255, 250, 236, .9), rgba(242, 230, 203, .82));
  outline: 1.5px dashed rgba(158, 132, 90, .34);
  outline-offset: -6px;
}

.summary-top-note {
  margin: 2px 0 0;
  color: #6b7867;
  font-size: 13px;
  font-weight: 800;
}

.summary-top-list {
  display: grid;
  gap: 5px;
}

.current-record {
  background: rgba(196, 112, 63, .16);
  outline: 1px solid rgba(196, 112, 63, .35);
}

/* ---------- Marco limpio: sin polaroid ni elementos que tapen la imagen ---------- */
.photo-stage {
  padding: 12px;
  background:
    var(--fiber),
    linear-gradient(155deg, rgba(250, 244, 226, .86), rgba(232, 220, 194, .72));
}

.photo-stage::before,
.photo-stage::after {
  display: none !important;
}

.photo-stage .photo-frame,
.photo-stage .photo-frame.video-ratio,
.view-musica .photo-frame,
.view-video .photo-frame {
  transform: none !important;
  padding: 0 !important;
  border: 10px solid #fffdf7;
  border-radius: 22px;
  background: #fffdf7;
  box-shadow:
    0 0 0 1px rgba(132, 119, 91, .16),
    0 16px 34px rgba(91, 78, 54, .18);
}

.photo-stage .photo-frame img,
.photo-stage .photo-frame video {
  border-radius: 12px;
}

.photo-frame:not(.video-ratio) {
  outline: none;
}

@media (max-width: 680px) {
  .photo-stage .photo-frame,
  .photo-stage .photo-frame.video-ratio,
  .view-musica .photo-frame,
  .view-video .photo-frame {
    border-width: 7px;
    border-radius: 18px;
  }

  .photo-stage .photo-frame img,
  .photo-stage .photo-frame video {
    border-radius: 10px;
  }
}

/* ---------- Móvil/tablet (≤1040px): marcador arriba del todo ----------
   08/09 19:40: el hud se movió fuera de .map-card a primer hijo de
   .game-grid (DOM), así que en una columna el orden es: marcador →
   foto → mapamundi → respuesta. En desktop (min-width:1041px) el grid
   usa áreas «photo hud / photo map» para el mismo layout de antes.
   .map-card queda solo con #map + answer-panel + footer. */
@media (max-width: 1040px) {
  .game-grid {
    grid-template-rows: none;
    grid-template-areas: none;
  }

  .game-grid > .hud {
    min-height: 54px;
    margin: 0;
    position: static;
    background: rgba(255, 252, 243, .86);
    border: 1px solid rgba(125, 140, 118, .22);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
  }

  .map-card {
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .map-card .answer-panel {
    margin: 0;
    border-radius: 0;
  }
}

/* ---------- Tilt orgánico sutil en marcos de imagen (foto/comida) ----------
   Cada reto de imagen rota un poco (var --tilt puesta por tiltPolaroid,
   ±1.5° máx) como recuerdos puestos a mano. Solo aplica a .photo-frame de
   imagen: foto/comida reciben --tilt; música/vídeo/noticia lo limpian → 0deg.
   Los vídeos en movimiento nunca giran. */
.photo-stage .photo-frame {
  transform: rotate(var(--tilt, 0deg)) !important;
  transform-origin: center;
  transition: transform .45s cubic-bezier(.2, .9, .25, 1);
  will-change: transform;
}

/* Nota bajo el Top 10 (compartido en servidor vs. local) */
.leaderboard-note {
  font-size: 11px;
  line-height: 1.3;
  color: rgba(70, 82, 60, .75);
  margin: 4px 2px 0;
  min-height: 14px;
}
