/* ===== Fake-you-Fake-me — Antique Atlas Travel palette ===== */
:root {
  --background: #F4E8D0;
  --backgroundDeep: #E8D3A8;
  --surface: #FFF3D9;
  --surfaceMuted: #EAD8B8;
  --surfacePressed: #D9C09A;
  --ink: #1F1A14;
  --inkSoft: #3A3127;
  --textSecondary: #6E5A43;
  --ochre: #C8872D;
  --ochreDark: #8E5A1F;
  --clay: #A65F3A;
  --sienna: #7A4526;
  --umber: #5A3B27;
  --sand: #D8B977;
  --fadedGold: #BFA36A;
  --routeRed: #9D3F2F;
  --seaInk: #3F5F5A;
  --border: #B79B6D;
  --shadowMed: 0 18px 44px rgba(70,45,20,0.16);
  --shadowSm: 0 6px 18px rgba(70,45,20,0.12);
  --inkBlock: 6px 6px 0 #1F1A14;
  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--inkSoft);
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,0.28), transparent 24%),
    radial-gradient(circle at 80% 10%, rgba(120,80,30,0.08), transparent 26%),
    radial-gradient(circle at 50% 100%, rgba(63,95,90,0.12), transparent 35%),
    linear-gradient(145deg, #F4E8D0 0%, #E8D3A8 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

.wrap { max-width: 1180px; margin: 0 auto; padding: 18px 20px 24px; }

/* ---------- Barra superior (título a la izquierda, Empezar de nuevo a la derecha) ---------- */
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.brand h1 { font-family: var(--serif); font-size: clamp(24px, 3vw, 34px); color: var(--ink); margin: 0; line-height: 1.0; }
.brand .sub { font-family: var(--serif); font-style: italic; font-size: 15px; letter-spacing: 0.01em; color: var(--textSecondary); margin-top: 4px; line-height: 1.3; white-space: nowrap; }
@media (max-width: 820px) { .brand .sub { white-space: normal; } }
.brand .ribbon { display: inline-block; margin-top: 8px; padding: 5px 12px; background: var(--ink); color: var(--surface); border-radius: 999px; font-family: var(--mono); font-size: 11px; }
.topbar .btn-restart { flex-shrink: 0; }
.main-area { min-width: 0; }
@media (max-width: 620px) {
  .topbar { flex-direction: column; align-items: center; text-align: center; }
}

/* ---------- Header ---------- */
header.masthead { text-align: center; padding: 28px 0 12px; }
.masthead h1 {
  font-family: var(--serif);
  font-size: clamp(40px, 8vw, 68px);
  font-weight: 700; letter-spacing: -0.025em;
  color: var(--ink); margin: 0; line-height: 0.98;
}
.masthead .sub {
  font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.12em;
  font-size: 12px; color: var(--textSecondary); margin-top: 10px;
}
.masthead .ribbon {
  display: inline-block; margin-top: 14px; padding: 6px 16px;
  background: var(--ink); color: var(--surface);
  border-radius: 999px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em;
}
/* En la barra lateral del kiosko, cabecera compacta y alineada a la izquierda */
.sidebar .masthead { text-align: left; padding: 0; }
.sidebar .masthead h1 { font-size: 21px; line-height: 1.1; white-space: nowrap; }
.sidebar .masthead h1::before, .sidebar .masthead h1::after { display: none; }
.sidebar .masthead .sub { font-size: 11px; margin-top: 8px; }

/* ---------- Stepper vertical ---------- */
.stepper { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.step-dot {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em;
  padding: 11px 16px; border-radius: 12px; border: 2px solid var(--border);
  background: var(--surface); color: var(--textSecondary);
}
.step-dot.active { background: var(--ochre); color: var(--ink); border-color: var(--ink); font-weight: 700; }
.step-dot.done { background: var(--sand); color: var(--ink); border-color: var(--ochreDark); }

/* En pantallas estrechas, la barra pasa arriba y el stepper vuelve horizontal */
@media (max-width: 820px) {
  .app-layout { flex-direction: column; }
  .sidebar { position: static; flex-basis: auto; width: 100%; }
  .stepper { flex-direction: row; flex-wrap: wrap; justify-content: center; }
  header.masthead { text-align: center; }
}

/* ---------- Panels / cards ---------- */
.panel {
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 28px;
  box-shadow: var(--inkBlock);
  padding: 26px;
  margin-bottom: 24px;
}
.panel h2 {
  font-family: var(--serif); font-size: 34px; font-weight: 700;
  color: var(--ink); margin: 0 0 6px;
}
.panel .lede { color: var(--textSecondary); margin: 0 0 18px; }

.hidden { display: none !important; }

/* ---------- Map search ---------- */
.map-search { position: relative; max-width: 460px; margin: 0 auto 14px; }
.map-search input {
  width: 100%; box-sizing: border-box;
  padding: 12px 16px; font-family: var(--sans); font-size: 16px;
  color: var(--ink); background: var(--surface);
  border: 2px solid var(--ink); border-radius: 999px;
  box-shadow: 3px 3px 0 var(--ink); outline: none;
}
.map-search input::placeholder { color: var(--textSecondary); }
.map-search input:focus { box-shadow: 3px 3px 0 var(--ochreDark); }
.map-suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 1200;
  background: var(--surface); border: 2px solid var(--ink); border-radius: 14px;
  box-shadow: var(--shadowMed); overflow: hidden; max-height: 320px; overflow-y: auto;
}
.suggest-item {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 11px 16px; cursor: pointer; font-family: var(--serif); font-size: 18px;
  color: var(--ink); border-bottom: 1px solid var(--border);
}
.suggest-item:last-child { border-bottom: none; }
.suggest-item:hover { background: var(--ochre); }
.sg-country { font-family: var(--mono); font-size: 12px; color: var(--textSecondary); white-space: nowrap; }
.suggest-item:hover .sg-country { color: var(--umber); }

/* ---------- Map ---------- */
#map {
  height: 520px; border-radius: 20px; border: 2px solid var(--ink);
  box-shadow: var(--shadowMed); background: var(--backgroundDeep);
}

/* Racimos de marcadores con la estética del atlas */
.atlas-cluster {
  width: 40px; height: 40px; border-radius: 999px;
  background: var(--ochre); color: var(--ink);
  border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-weight: 700; font-size: 14px;
}
.marker-cluster, .marker-cluster div { background: transparent !important; }
.leaflet-control-zoom a {
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--ink) !important;
}
.leaflet-container { background: #d9c8a0; font-family: var(--sans); }
.atlas-pin {
  background: var(--routeRed); color: var(--surface);
  border: 2px solid var(--ink); border-radius: 999px;
  width: 18px; height: 18px; display: block;
  box-shadow: 0 0 0 4px rgba(157,63,47,0.18);
}
.leaflet-popup-content-wrapper {
  background: var(--surface); color: var(--ink);
  border: 2px solid var(--ink); border-radius: 16px;
}
.leaflet-popup-tip { background: var(--surface); border: 2px solid var(--ink); }
.popup-thumb {
  display: block; width: 180px; height: 110px; object-fit: cover;
  border: 2px solid var(--ink); border-radius: 8px; margin: 0 0 8px;
}
.popup-place { font-family: var(--serif); font-size: 22px; font-weight: 700; }
.popup-coord { font-family: var(--mono); font-size: 11px; color: var(--textSecondary); }

.place-chosen {
  margin-top: 16px; min-height: 20px;
}
/* Previsualización: Pedro + invitado + lugar */
.combo-preview {
  display: flex; align-items: flex-start; justify-content: center;
  gap: 12px; flex-wrap: wrap;
}
.combo-item { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.combo-thumb {
  width: 86px; height: 86px; object-fit: cover; display: block;
  border: 2px solid var(--ink); border-radius: 12px;
  box-shadow: 3px 3px 0 var(--ink); background: var(--surfacePressed);
}
.combo-empty {
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 30px; color: var(--textSecondary);
}
.combo-item figcaption {
  font-family: var(--mono); font-size: 11px; color: var(--textSecondary);
  max-width: 100px; text-align: center; line-height: 1.25;
}
.combo-plus {
  align-self: center; margin-top: 24px;
  font-family: var(--serif); font-weight: 700; font-size: 30px; color: var(--ochreDark);
}

/* ---------- Friends dashboard ---------- */
.grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.friend-card, .camera-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; padding: 14px; text-align: center; cursor: pointer;
  box-shadow: var(--shadowSm); transition: transform 120ms, box-shadow 120ms, border-color 120ms;
}
.friend-card:hover, .camera-card:hover { transform: translateY(-3px); box-shadow: var(--shadowMed); }
.friend-card.selected, .camera-card.selected {
  border: 2px solid var(--ink); box-shadow: var(--inkBlock); background: var(--sand);
}
.friend-card img, .camera-card .ph {
  width: 100%; aspect-ratio: 1; object-fit: cover;
  border-radius: 14px; border: 1px solid var(--border); margin-bottom: 10px;
  filter: sepia(0.18) saturate(0.95);
}
.friend-card .name { font-weight: 700; color: var(--ink); }
.camera-card .ph {
  display: flex; align-items: center; justify-content: center;
  background: var(--surfaceMuted); font-size: 40px;
}

/* ---------- Buttons ---------- */
.btn {
  font-family: var(--sans); font-weight: 800; font-size: 15px;
  border: 2px solid var(--ink); border-radius: 999px; padding: 13px 26px;
  cursor: pointer; box-shadow: 4px 4px 0 var(--ink);
  transition: transform 120ms, box-shadow 120ms; color: var(--ink);
}
.btn:active { transform: translate(2px,2px); box-shadow: 2px 2px 0 var(--ink); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--ochre); }
.btn-secondary { background: var(--surface); }
.btn-ghost { background: transparent; border: 2px dashed var(--ochreDark); box-shadow: none; color: var(--ochreDark); }
.btn-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 22px; }

/* Botón pequeño (paginador de caras) */
.btn-small {
  font-size: 13px; padding: 8px 14px; font-weight: 700;
  box-shadow: 2px 2px 0 var(--ink); background: var(--surface);
}
/* Botón "Empezar de nuevo" siempre visible */
.btn-restart {
  background: var(--sand); border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink); font-weight: 800;
}
.btn-restart:hover { background: var(--fadedGold); }

/* Pulso para llamar la atención sobre "Continuar" al elegir foto */
@keyframes ctaPulse {
  0%,100% { transform: scale(1); box-shadow: 4px 4px 0 var(--ink); }
  50%     { transform: scale(1.05); box-shadow: 6px 6px 0 var(--ink); }
}
.btn.pulse { animation: ctaPulse 1s ease-in-out infinite; }

/* ---------- Camera ---------- */
.camera-stage { display: flex; flex-direction: column; align-items: center; gap: 14px; }
#camVideo, #camCanvas, #capturedPreview {
  width: 320px; max-width: 100%; aspect-ratio: 4/3; object-fit: cover;
  border-radius: 16px; border: 2px solid var(--ink); background: var(--surfaceMuted);
}

/* ---------- Result / validation ---------- */
.result-stage { display: flex; flex-direction: column; align-items: center; gap: 16px; }

/* ---------- Postal: foto a un lado, anécdota manuscrita al otro ---------- */
.postcard {
  display: flex; align-items: stretch; max-width: 760px; width: 100%;
  background: var(--surface); border: 2px solid var(--ink); border-radius: 12px;
  box-shadow: var(--inkBlock); overflow: hidden;
}
.postcard-photo {
  width: 50%; object-fit: cover; display: block;
  border-right: 2px solid var(--ink); max-height: 66vh;
}
.postcard-note {
  width: 50%; position: relative; padding: 58px 22px 22px;
  display: flex; align-items: flex-start; justify-content: flex-start;
  background:
    repeating-linear-gradient(transparent 0, transparent 33px, rgba(120,80,30,0.12) 34px);
}
.postcard-text {
  font-family: var(--serif); font-style: italic; font-size: 21px;
  line-height: 1.62; color: var(--inkSoft); margin: 0; text-align: left;
}
.postcard-stamp {
  position: absolute; top: 12px; right: 14px; width: 46px; height: 56px;
  border: 2px dashed var(--ochreDark); border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ochreDark); font-size: 22px; transform: rotate(5deg); opacity: 0.85;
}
@media (max-width: 680px) {
  .postcard { flex-direction: column; }
  .postcard-photo { width: 100%; max-height: 46vh; border-right: none; border-bottom: 2px solid var(--ink); }
  .postcard-note { width: 100%; }
}
#resultImg:not(.postcard-photo) {
  width: 460px; max-width: 100%; border-radius: 16px;
  border: 4px solid var(--surface); box-shadow: var(--inkBlock);
}
.sim-note {
  font-family: var(--mono); font-size: 12px; color: var(--clay);
  background: var(--surfaceMuted); border: 1px dashed var(--clay);
  border-radius: 999px; padding: 6px 14px;
}

/* ---------- Loading ---------- */
.loader { text-align: center; padding: 30px; }
.plane-loader { width: 210px; height: 190px; margin: 0 auto 6px; display: block; }
.loader .compass {
  width: 64px; height: 64px; margin: 0 auto 16px;
  border: 4px solid var(--border); border-top-color: var(--ochre);
  border-radius: 50%; animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader p { font-family: var(--mono); color: var(--textSecondary); letter-spacing: 0.05em; }

/* ---------- Email form ---------- */
.field { margin-bottom: 16px; }
.field label {
  display: block; font-family: var(--mono); text-transform: uppercase;
  font-size: 11px; letter-spacing: 0.08em; color: var(--textSecondary); margin-bottom: 6px;
}
.field input {
  width: 100%; font-family: var(--sans); font-size: 16px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 14px 16px; box-shadow: inset 0 2px 8px rgba(70,45,20,0.18);
}
.field input:focus { outline: 3px solid rgba(200,135,45,0.25); border-color: var(--ochreDark); }

.success-stamp {
  text-align: center; font-family: var(--serif); font-size: 30px; color: var(--routeRed);
  border: 4px solid var(--routeRed); border-radius: 18px; padding: 20px;
  transform: rotate(-3deg); display: inline-block; margin: 10px auto;
}

footer { text-align: center; font-family: var(--mono); font-size: 11px; color: var(--textSecondary); margin-top: 40px; }

/* ============================================================
   TEMA "MAPA DEL TESORO" (capa decorativa sobre el atlas base)
   ============================================================ */

/* Papel envejecido con manchas y viñeta quemada en toda la página */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(circle at 12% 16%, rgba(120,69,38,0.10), transparent 28%),
    radial-gradient(circle at 86% 80%, rgba(90,59,39,0.13), transparent 30%),
    radial-gradient(circle at 70% 12%, rgba(120,80,30,0.10), transparent 24%),
    radial-gradient(circle at 50% 50%, transparent 52%, rgba(58,38,20,0.26) 100%);
  mix-blend-mode: multiply;
}
.wrap { position: relative; z-index: 1; }

/* Título grabado, más épico */
.masthead h1 {
  color: #3b2412;
  text-shadow: 0 1px 0 #fff7e0, 0 2px 3px rgba(58,38,20,0.35);
}
.masthead h1::before, .masthead h1::after {
  content: "✦"; color: var(--ochreDark); font-size: 0.42em;
  vertical-align: middle; margin: 0 0.32em; opacity: 0.75;
}
.masthead .sub { color: #6b4a2a; }
.masthead .ribbon { background: #3a2614; box-shadow: 3px 3px 0 rgba(58,38,20,0.4); }

.panel h2 { color: #3b2412; }

/* Marco ornamental de madera/cuero alrededor del mapa */
.map-frame {
  position: relative; padding: 14px; border-radius: 24px;
  background: linear-gradient(135deg, #c9a468 0%, #9a6a35 45%, #7a4d27 100%);
  box-shadow: 0 20px 48px rgba(40,25,10,0.45), inset 0 0 0 3px #3a2614;
  margin-bottom: 8px;
}
.map-frame::after {            /* costura punteada interior */
  content: ""; position: absolute; inset: 8px; border: 2px dashed rgba(58,38,20,0.55);
  border-radius: 16px; pointer-events: none; z-index: 500;
}
#map {
  height: 540px; border-radius: 14px; border: 2px solid #3a2614;
  box-shadow: none; position: relative; z-index: 1;
}
/* Tinte cálido SUTIL: conserva el detalle dibujado de la base atlas */
.leaflet-tile-pane {
  filter: sepia(0.32) saturate(1.05) contrast(1.08) brightness(1.0);
}
.leaflet-container { background: #cbb07e; }

/* Viñeta quemada suave por encima del mapa (no bloquea clics ni tapa el centro) */
.map-vignette {
  position: absolute; inset: 14px; border-radius: 14px; pointer-events: none; z-index: 450;
  box-shadow: inset 0 0 60px rgba(58,30,12,0.32), inset 0 0 18px rgba(58,30,12,0.28);
}
/* Rosa de los vientos decorativa */
.compass-rose {
  position: absolute; right: 26px; bottom: 26px; width: 96px; height: 96px;
  z-index: 500; opacity: 0.9; pointer-events: none;
  filter: drop-shadow(0 2px 3px rgba(40,25,10,0.5));
}
@media (max-width: 560px) { .compass-rose { width: 62px; height: 62px; right: 16px; bottom: 16px; } }

/* Marcador "✗ marca el lugar" */
.x-pin {
  font-family: var(--serif); font-weight: 700; color: #9D2F1F;
  font-size: 24px; line-height: 1; display: block; text-align: center;
  text-shadow: 0 1px 0 rgba(255,247,224,0.8), 0 0 2px rgba(120,30,18,0.4);
}
/* Racimo como sello de lacre */
.atlas-cluster {
  background: radial-gradient(circle at 35% 30%, #c0532f, #7a1f12);
  color: #fff3d9; border: 2px solid #3a2614;
  box-shadow: 2px 2px 0 #3a2614, inset 0 0 6px rgba(0,0,0,0.45);
}
/* Botones de zoom con aspecto envejecido */
.leaflet-control-zoom a { background: #f3e3bd; color: #3a2614; border-color: #3a2614 !important; }

/* ---------- Paginador (admin y kiosko) ---------- */
.pager {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  margin-top: 20px; flex-wrap: wrap;
}
.pager:empty { display: none; }
.pageinfo { font-family: var(--mono); font-size: 13px; color: var(--textSecondary); }

/* ---------- Tarjeta de amigo en admin: botón eliminar ---------- */
.friend-card { position: relative; }
.btn-del {
  position: absolute; top: 8px; right: 8px; z-index: 5;
  width: 34px; height: 34px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  background: #9D2F1F; color: #fff3d9; border: 2px solid #3a2614;
  cursor: pointer; font-size: 15px; line-height: 1;
  box-shadow: 2px 2px 0 #3a2614;
}
.btn-del:hover { background: #7a1f12; }

/* ---------- Nombre editable en las tarjetas del admin ---------- */
.name-edit {
  width: 100%; text-align: center; font-weight: 700; color: var(--ink);
  font-family: var(--sans); font-size: 15px;
  background: transparent; border: 1px dashed transparent; border-radius: 8px;
  padding: 3px 4px; transition: border-color 120ms, background 120ms;
}
.name-edit:hover { border-color: var(--border); }
.name-edit:focus {
  outline: none; background: var(--surface);
  border: 1px solid var(--ochreDark); box-shadow: inset 0 1px 4px rgba(70,45,20,0.15);
}
.name-edit.saved { border-color: #3F5F5A; background: #eef3ef; }

.scene-edit {
  width: 100%; margin-top: 8px; resize: vertical; min-height: 44px;
  font-family: var(--sans); font-size: 12px; color: var(--inkSoft); line-height: 1.35;
  background: var(--surface); border: 1px dashed var(--border); border-radius: 8px;
  padding: 6px 8px; transition: border-color 120ms, background 120ms;
}
.scene-edit::placeholder { color: var(--textSecondary); }
.scene-edit:focus {
  outline: none; border: 1px solid var(--ochreDark);
  box-shadow: inset 0 1px 4px rgba(70,45,20,0.15);
}
.scene-edit.saved { border-color: #3F5F5A; background: #eef3ef; }

/* ---------- Tarjetas de lugar (admin) ---------- */
.place-card {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 14px 10px 10px; text-align: center;
  box-shadow: var(--shadowSm);
}
.pl-pin {
  font-family: var(--serif); font-weight: 700; color: #9D2F1F; font-size: 22px; line-height: 1;
  text-shadow: 0 1px 0 rgba(255,247,224,0.8);
}
.pl-meta { font-family: var(--mono); font-size: 11px; color: var(--textSecondary); margin-top: 4px; line-height: 1.4; }
.pl-ref {
  width: 100%; aspect-ratio: 16/10; object-fit: cover;
  border-radius: 10px; border: 1px solid var(--ink); margin-bottom: 6px;
  filter: sepia(0.12);
}
.pl-reflabel {
  display: inline-block; margin-top: 8px; cursor: pointer;
  font-family: var(--mono); font-size: 11px; color: var(--ochreDark);
  border: 1px dashed var(--ochreDark); border-radius: 999px; padding: 4px 10px;
}
.pl-reflabel:hover { background: var(--surfaceMuted); }
#adminMap { cursor: crosshair; }

/* ---------- Estado de la IA ---------- */
.ai-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px;
  font-size: 14px; color: var(--inkSoft);
}
.ai-grid code {
  background: var(--surfaceMuted); padding: 1px 6px; border-radius: 6px;
  font-family: var(--mono); font-size: 12px;
}
@media (max-width: 560px) { .ai-grid { grid-template-columns: 1fr; } }
.ai-settings { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; margin-top: 14px; }
.ai-settings select {
  font-family: var(--sans); font-size: 14px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 8px 12px; box-shadow: inset 0 2px 8px rgba(70,45,20,0.12);
}
.ai-settings select:focus { outline: 3px solid rgba(200,135,45,0.25); border-color: var(--ochreDark); }

/* ---------- Previsualización de subida múltiple ---------- */
.previews { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 14px; }
.previews:empty { display: none; }
.previews .thumb {
  width: 84px; height: 84px; object-fit: cover;
  border-radius: 12px; border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
}

/* ---------- Modal de recorte ---------- */
.modal {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(31,20,12,0.6); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-card {
  background: var(--surface); border: 2px solid var(--ink);
  border-radius: 24px; box-shadow: var(--inkBlock);
  padding: 24px; width: min(680px, 100%); max-height: 92vh; overflow: auto;
}
.crop-stage { max-height: 56vh; }
.crop-stage img { max-width: 100%; display: block; }
/* el recuadro de Cropper se ve mejor como círculo de cara, pero cuadrado va bien */
.cropper-view-box, .cropper-face { border-radius: 0; }

/* ---------- Pantalla de bienvenida (landing) ---------- */
.landing {
  position: fixed; inset: 0; z-index: 2000; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 34px; padding: 24px; text-align: center;
  background:
    radial-gradient(circle at 50% 28%, rgba(255,255,255,0.40), transparent 42%),
    radial-gradient(circle at 80% 90%, rgba(120,80,30,0.10), transparent 40%),
    linear-gradient(145deg, #F4E8D0 0%, #E8D3A8 100%);
  animation: landing-fade 0.45s ease;
}
.landing.hidden { display: none; }
.landing-logo {
  max-width: min(64vw, 380px); max-height: 62vh; width: auto; height: auto;
  filter: drop-shadow(5px 7px 0 rgba(31,26,20,0.10));
}
.landing-fallback {
  font-family: var(--serif); font-weight: 700; color: var(--ink);
  font-size: clamp(52px, 13vw, 130px); line-height: 0.92; letter-spacing: -0.01em;
}
.landing-hint {
  font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.18em;
  font-size: 14px; color: var(--ochreDark);
  padding: 12px 24px; border: 2px solid var(--ink); border-radius: 999px;
  background: var(--surface); box-shadow: 3px 3px 0 var(--ink);
  animation: landing-pulse 1.9s ease-in-out infinite;
}
@keyframes landing-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes landing-pulse {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(-5px); opacity: 0.65; }
}

/* ---------- Anécdota durante la espera ---------- */
.anecdote {
  max-width: 460px; margin: 18px auto 0; min-height: 1em;
  font-family: var(--serif); font-size: 19px; line-height: 1.5; font-style: italic;
  color: var(--inkSoft); text-align: center;
  animation: landing-fade 0.6s ease;
}
.anecdote:not(:empty) {
  padding: 16px 20px; background: var(--surface);
  border: 2px solid var(--ink); border-radius: 14px; box-shadow: 3px 3px 0 var(--ink);
}

/* ---------- Pantalla de error de generación (recuperable) ---------- */
.gen-error {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  max-width: 460px; margin: 10px auto; text-align: center;
  padding: 26px; background: var(--surface);
  border: 2px solid var(--ink); border-radius: 18px; box-shadow: var(--inkBlock);
  animation: landing-fade 0.4s ease;
}
.gen-error-icon {
  width: 56px; height: 56px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  background: var(--ochre); color: var(--ink); font-size: 28px;
  border: 2px solid var(--ink);
}
.gen-error .lede { margin: 0; color: var(--inkSoft); font-size: 18px; }

/* ---------- Check del admin y prompt de depuración ---------- */
.check-row {
  display: flex; align-items: center; gap: 9px; margin-top: 12px;
  font-family: var(--mono); font-size: 13px; color: var(--inkSoft); cursor: pointer;
}
.check-row input { width: 18px; height: 18px; accent-color: var(--ochreDark); }

.prompt-debug {
  max-width: 720px; width: 100%; margin: 4px auto 0; text-align: left;
  background: var(--surface); border: 2px dashed var(--ochreDark); border-radius: 12px;
  padding: 8px 14px;
}
.prompt-debug summary {
  cursor: pointer; font-family: var(--mono); font-size: 12px; color: var(--ochreDark);
  letter-spacing: 0.03em;
}
.prompt-debug pre {
  white-space: pre-wrap; word-break: break-word; margin: 10px 0 4px;
  font-family: var(--mono); font-size: 12px; line-height: 1.5; color: var(--inkSoft);
}

/* ---------- Buscador de localizaciones (admin) ---------- */
.geo-search { position: relative; margin-bottom: 12px; }
.geo-search input {
  width: 100%; box-sizing: border-box;
  padding: 11px 16px; font-family: var(--sans); font-size: 15px;
  color: var(--ink); background: var(--surface);
  border: 2px solid var(--ink); border-radius: 999px; box-shadow: 3px 3px 0 var(--ink); outline: none;
}
.geo-search input::placeholder { color: var(--textSecondary); }
.geo-search input:focus { box-shadow: 3px 3px 0 var(--ochreDark); }
.geo-suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 1500;
  background: var(--surface); border: 2px solid var(--ink); border-radius: 12px;
  box-shadow: var(--shadowMed); overflow: hidden; max-height: 280px; overflow-y: auto;
}
.geo-item {
  padding: 10px 14px; cursor: pointer; font-family: var(--sans); font-size: 14px;
  color: var(--ink); border-bottom: 1px solid var(--border); line-height: 1.3;
}
.geo-item:last-child { border-bottom: none; }
.geo-item[data-i]:hover { background: var(--ochre); }
.geo-item.geo-info { color: var(--textSecondary); cursor: default; font-family: var(--mono); font-size: 13px; }

/* ---------- Selector de anfitrión (admin) ---------- */
.host-tabs { display: flex; gap: 10px; flex-wrap: wrap; }
.host-tab {
  font-family: var(--mono); font-size: 14px; cursor: pointer;
  padding: 10px 18px; border-radius: 12px; border: 2px solid var(--border);
  background: var(--surface); color: var(--textSecondary);
}
.host-tab.sel { background: var(--ochre); color: var(--ink); border-color: var(--ink); font-weight: 700; box-shadow: 2px 2px 0 var(--ink); }

/* ---------- Elección de anfitrión en el kiosko (tarjetas centradas) ---------- */
#hostGrid { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; }
#hostGrid .friend-card { width: 190px; }
