@font-face {
    font-family: "Bebas Neue";
    src: url("/fonts/bebas-neue.woff2") format("woff2");
    font-display: swap;
}

:root {
    --bg: #ffffff;
    --panel: #f4f4f2;
    --line: #e2e2de;
    --text: #141414;
    --muted: #5e5e5a;
    --accent: #22d65e;
    --accent-ink: #141414;
    --accent-text: #15803d;
    --danger: #c62828;
    --radius: 14px;
    --display: "Bebas Neue", system-ui, sans-serif;
    --topbar: 60px;
    --tabbar: calc(68px + env(safe-area-inset-bottom));
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.45;
}

a { color: var(--text); text-decoration-color: var(--accent); text-underline-offset: 3px; }
h1 { font-family: var(--display); font-weight: 400; font-size: 2.4rem; line-height: 1; margin: .5rem 0 .7rem; letter-spacing: .01em; }
h2 { font-size: 1rem; margin: 1.6rem 0 .6rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
img { max-width: 100%; display: block; }

.muted { color: var(--muted); }
.small { font-size: .875rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Barra superior y menú */
.topbar {
    position: sticky; top: 0; z-index: 1100; /* sobre los controles del mapa (1000) */
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    height: calc(env(safe-area-inset-top) + var(--topbar));
    padding: env(safe-area-inset-top) 12px 0 16px;
    background: var(--bg); border-bottom: 1px solid var(--line);
}
.logo { font-family: var(--display); font-size: 2rem; line-height: 1; letter-spacing: .02em; color: var(--text); text-decoration: none; white-space: nowrap; }
.logo span { color: var(--accent); }
.burger { position: relative; width: 44px; height: 44px; display: grid; place-content: center; gap: 5px; background: none; border: 0; cursor: pointer; }
.burger span { display: block; width: 26px; height: 3px; background: var(--text); border-radius: 2px; transition: transform .2s, opacity .2s; }
.menu-open .burger span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.menu-open .burger span:nth-child(2) { opacity: 0; }
.menu-open .burger span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
.burger-dot { position: absolute; top: 8px; right: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg); }

.menu {
    position: fixed; z-index: 1050; top: 0; right: 0; bottom: 0;
    width: min(82vw, 320px); overflow-y: auto;
    padding: calc(env(safe-area-inset-top) + var(--topbar) + 16px) 24px 24px;
    background: var(--bg); border-left: 1px solid var(--line); box-shadow: -12px 0 30px rgba(0, 0, 0, .12);
    display: flex; flex-direction: column;
}
.menu[hidden] { display: none; }
.menu a, .menu button {
    font: inherit; font-size: 1.15rem; font-weight: 700; text-align: left;
    color: var(--text); text-decoration: none; background: none; border: 0;
    padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; width: 100%;
}
.menu .menu-cta { margin: 0 0 8px; padding: 12px 16px; border: 0; border-radius: 999px; background: var(--accent); color: var(--accent-ink); text-align: center; }

.page { max-width: 720px; margin: 0 auto; padding: 16px 16px calc(env(safe-area-inset-bottom) + 40px); }

.flash { background: var(--accent); color: var(--accent-ink); padding: 10px 14px; border-radius: var(--radius); font-weight: 600; }
.errors { background: #fdecea; border: 1px solid var(--danger); border-radius: var(--radius); padding: 4px 14px; margin-bottom: 12px; }
.errors p { margin: 8px 0; color: #8e1c1c; }

/* Botones y formularios */
.form { display: flex; flex-direction: column; gap: 16px; }
.form label, .field-label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; }
.optional { font-weight: 400; color: var(--muted); }
input:not([type=file], [type=checkbox], [type=radio], [type=range]), textarea, select {
    font: inherit; color: var(--text); background: var(--bg);
    border: 1px solid #cfcfca; border-radius: 12px; padding: 12px 14px; width: 100%; font-weight: 400;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
input[readonly] { background: var(--panel); }
textarea { resize: vertical; }
.button {
    display: inline-flex; justify-content: center; align-items: center; gap: 8px;
    font: inherit; font-weight: 700;
    background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 999px;
    padding: 13px 20px; cursor: pointer; text-decoration: none; min-height: 48px;
}
.button.secondary { background: var(--bg); color: var(--text); border: 1px solid #cfcfca; }
.button.danger { background: var(--danger); color: #fff; }
.button.small-button { padding: 7px 12px; min-height: 36px; font-size: .85rem; }
.button.block { width: 100%; }
.button:disabled { opacity: .45; cursor: not-allowed; }
.link-button { font: inherit; background: none; border: 0; padding: 0 0 0 8px; color: var(--muted); text-decoration: underline; cursor: pointer; }
form.inline { display: inline; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px;
    font: inherit; font-weight: 600; color: var(--text); background: var(--bg);
    border: 1px solid #cfcfca; border-radius: 999px; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.chip.on, .chip:has(input:checked) { background: var(--text); border-color: var(--text); color: #fff; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.type-chip { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }

.photo-input { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.photo-input .photo-preview { grid-column: 1 / -1; width: 100%; max-height: 50vh; object-fit: contain; border-radius: var(--radius); background: var(--panel); }

.search-form { display: flex; gap: 8px; margin-bottom: 8px; }
.search-form input { flex: 1; }

/* Inicio: visor a pantalla completa */
.immersive .topbar { position: fixed; left: 0; right: 0; background: linear-gradient(rgba(0, 0, 0, .45), rgba(0, 0, 0, 0)); border-bottom: 0; }
.immersive .logo { color: #fff; text-shadow: 0 1px 6px rgba(0, 0, 0, .4); }
.immersive .burger span { background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .35); }
.immersive.menu-open .burger span { background: var(--text); box-shadow: none; }
.immersive .page { max-width: none; padding: 0; }
.immersive .flash { position: fixed; z-index: 1200; top: calc(env(safe-area-inset-top) + var(--topbar)); left: 12px; right: 12px; }

.viewer {
    position: relative; height: 100vh; height: 100dvh; overflow: hidden;
    background: #111; color: #fff; user-select: none; -webkit-user-select: none;
}
.no-js .viewer { display: none; }
.viewer-stage { position: absolute; inset: 0; touch-action: none; }
.viewer-media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; -webkit-user-drag: none; -webkit-touch-callout: none; }
.viewer-media.landscape { object-fit: contain; }
.viewer-media.swap-next { animation: swap-next .28s ease-out; }
.viewer-media.swap-prev { animation: swap-prev .28s ease-out; }
.viewer-media.bounce-next { animation: bounce-next .3s ease-out; }
.viewer-media.bounce-prev { animation: bounce-prev .3s ease-out; }
@keyframes swap-next { from { transform: translateX(40%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes swap-prev { from { transform: translateX(-40%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes bounce-next { 50% { transform: translateX(-6%); } }
@keyframes bounce-prev { 50% { transform: translateX(6%); } }

.viewer-heart { position: absolute; top: 50%; left: 50%; width: 120px; height: 120px; margin: -60px 0 0 -60px; pointer-events: none; opacity: 0; }
.viewer-heart svg { width: 100%; height: 100%; fill: var(--accent); stroke: #fff; stroke-width: 1; filter: drop-shadow(0 4px 14px rgba(0, 0, 0, .35)); }
.viewer-heart.pop { animation: heart-pop .8s ease-out; }
@keyframes heart-pop { 0% { opacity: 0; transform: scale(.4); } 20% { opacity: 1; transform: scale(1.15); } 40% { transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: scale(1.1) translateY(-20px); } }

.viewer-dots { position: absolute; top: calc(env(safe-area-inset-top) + var(--topbar) + 4px); left: 0; right: 0; display: flex; justify-content: center; gap: 4px; pointer-events: none; }
.viewer-dots span { width: 18px; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .45); }
.viewer-dots span.on { background: #fff; }

.viewer-side { position: absolute; right: 8px; bottom: calc(env(safe-area-inset-bottom) + 170px); display: flex; flex-direction: column; gap: 14px; align-items: center; }
.viewer-btn {
    display: flex; flex-direction: column; align-items: center; gap: 2px; width: 56px; padding: 4px 0;
    font: inherit; font-size: .8rem; font-weight: 700; color: #fff; background: none; border: 0; cursor: pointer; text-decoration: none;
    text-shadow: 0 1px 4px rgba(0, 0, 0, .6);
}
.viewer-btn svg { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .5)); }
.viewer-btn.like.on svg { fill: var(--accent); stroke: var(--accent); }
.viewer-side form { margin: 0; }

.viewer-info {
    position: absolute; left: 0; right: 0; bottom: 0;
    padding: 40px 80px calc(env(safe-area-inset-bottom) + 18px) 16px;
    background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, .72) 40%);
    display: flex; flex-direction: column; gap: 6px;
}
.viewer-info { pointer-events: none; }
.viewer-info a { pointer-events: auto; }
.viewer-info h1 { margin: 0; font-size: 2.2rem; color: #fff; }
.viewer-info a { color: #fff; }
.viewer-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .85rem; color: #e6e6e6; }
.viewer-artist { font-weight: 600; }
.viewer-artist.unknown { color: #e6e6e6; font-weight: 400; }
.viewer-hint { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: .78rem; color: #cfcfcf; }
.viewer-hint svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.viewer-ad { display: none; position: absolute; left: 0; right: 0; bottom: 0; padding: 20px 16px calc(env(safe-area-inset-bottom) + 22px); background: rgba(0, 0, 0, .78); flex-direction: column; gap: 10px; }
.viewer-ad .ad-label { align-self: flex-start; border: 1px solid #ccc; border-radius: 999px; padding: 2px 10px; font-size: .72rem; font-weight: 700; letter-spacing: .06em; }
.viewer-ad strong { font-family: var(--display); font-weight: 400; font-size: 2rem; line-height: 1; }
.viewer.is-ad .viewer-ad { display: flex; }
.viewer.is-ad .viewer-info, .viewer.is-ad .viewer-side { display: none; }

.viewer-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px; text-align: center; background: var(--bg); color: var(--text); }

/* Capas que suben en el visor: comentarios y ubicación */
.sheet {
    position: absolute; z-index: 5; left: 0; right: 0; bottom: 0;
    display: flex; flex-direction: column;
    background: var(--bg); color: var(--text);
    border-radius: 22px 22px 0 0; box-shadow: 0 -8px 30px rgba(0, 0, 0, .25);
    transform: translateY(105%); transition: transform .28s ease-out; visibility: hidden;
}
.sheet.open { transform: none; visibility: visible; }
.sheet-comments { height: 66%; }
.sheet-map { height: 78%; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 8px 6px 16px; touch-action: none; }
.sheet-head::before { content: ""; position: absolute; top: 8px; left: 50%; width: 44px; height: 5px; margin-left: -22px; border-radius: 3px; background: #c9c9c4; }
.sheet-head h2 { margin: 12px 0 0; font-family: var(--display); font-weight: 400; font-size: 1.7rem; letter-spacing: .01em; text-transform: none; color: var(--text); }
.sheet-close { width: 44px; height: 44px; display: grid; place-content: center; background: none; border: 0; cursor: pointer; color: var(--text); }
.sheet-close svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.sheet-body { flex: 1; min-height: 0; overflow-y: auto; padding: 0 16px; overscroll-behavior: contain; }
.sheet-foot { padding: 10px 16px calc(env(safe-area-inset-bottom) + 14px); border-top: 1px solid var(--line); }
.sheet-foot form { display: flex; gap: 8px; }
.sheet-foot input { border-radius: 999px; }
.sheet-comment { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.sheet-comment strong { font-size: .9rem; }
.sheet-comment p { margin: 0; word-break: break-word; }
.sheet-comment .muted { font-size: .78rem; }
.sheet-map .viewer-map { height: 44%; min-height: 180px; margin: 0 16px; border-radius: var(--radius); overflow: hidden; }
.sheet-map .sheet-body { padding-top: 14px; display: flex; flex-direction: column; gap: 12px; }

/* Cómo llegar */
.directions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.direction { flex-direction: column; gap: 6px; padding: 12px 6px; border-radius: var(--radius); text-align: center; font-size: .85rem; line-height: 1.15; }
.direction svg { width: 26px; height: 26px; fill: none; stroke: var(--accent-text); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dir-sheet { position: fixed; inset: 0; z-index: 3000; display: flex; align-items: flex-end; }
.dir-sheet[hidden] { display: none; }
.dir-backdrop { position: absolute; inset: 0; border: 0; background: rgba(0, 0, 0, .5); }
.dir-box { position: relative; width: 100%; max-width: 520px; margin: 0 auto; display: grid; gap: 8px; padding: 18px 16px calc(env(safe-area-inset-bottom) + 16px); background: var(--bg); border-radius: 18px 18px 0 0; }
.dir-box h2 { margin: 0 0 4px; color: var(--text); text-transform: none; letter-spacing: 0; font-size: 1.1rem; }

/* Grilla de obras (perfil de artista, búsqueda e inicio sin JavaScript) */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.grid a { position: relative; display: block; color: #fff; text-decoration: none; }
.grid img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 6px; background: var(--panel); }
.grid a span { position: absolute; left: 0; right: 0; bottom: 0; padding: 4px 6px; font-size: .72rem; font-weight: 600; background: rgba(0, 0, 0, .55); border-radius: 0 0 6px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.js .slides { display: none; }
.slides { padding: calc(var(--topbar) + 16px) 16px 40px; }
.carousel { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 4px; }
.carousel::-webkit-scrollbar { display: none; }
.carousel a { flex: 0 0 132px; scroll-snap-align: start; color: var(--text); text-decoration: none; font-size: .85rem; font-weight: 600; }
.carousel img { width: 132px; height: 160px; object-fit: cover; border-radius: 12px; margin-bottom: 4px; background: var(--panel); }

/* Página de una obra */
.artwork-photo { margin: -16px -16px 0; background: #111; }
.artwork-photo img { width: 100%; max-height: 78vh; object-fit: contain; }
.artwork-head { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.artwork-head h1 { margin: 0; }
.artwork-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.like-button { display: inline-flex; align-items: center; gap: 6px; }
.like-button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.like-button.on svg { fill: var(--accent); stroke: var(--accent); }
.artist-box { padding: 14px 16px; background: var(--panel); border-radius: var(--radius); }
.artist-box p { margin: 0 0 8px; }
.artist-box form { display: flex; gap: 8px; }
.artist-box input { flex: 1; }
.comment { padding: 10px 0; border-bottom: 1px solid var(--line); }
.comment p { margin: 2px 0; word-break: break-word; }
.comment-form { margin: 12px 0 20px; }
.blocked-note { padding: 18px; background: var(--panel); border-radius: var(--radius); }
.blocked-note p { margin: 0 0 10px; }

/* Mapas */
.map { height: 280px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.map-page { position: relative; margin: -16px -16px 0; height: calc(100vh - var(--topbar)); height: calc(100dvh - var(--topbar) - env(safe-area-inset-top)); }
.map-page .map { height: 100%; border: 0; border-radius: 0; }
.map-filters { position: absolute; z-index: 1001; top: 12px; left: 0; right: 0; padding: 0 12px; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.map-filters::-webkit-scrollbar { display: none; }
.map-filters .chip { box-shadow: 0 2px 8px rgba(0, 0, 0, .15); }
.map-locate { position: absolute; z-index: 1001; right: 12px; bottom: 236px; width: 48px; height: 48px; display: grid; place-content: center; border-radius: 50%; border: 0; background: var(--bg); box-shadow: 0 2px 8px rgba(0, 0, 0, .2); cursor: pointer; color: var(--text); }
.map-locate svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.map-add { position: absolute; z-index: 1001; right: 12px; bottom: 296px; box-shadow: 0 2px 10px rgba(0, 0, 0, .25); }
.map-near { position: absolute; z-index: 1001; left: 0; right: 0; bottom: 0; height: 224px; padding: 12px 16px calc(env(safe-area-inset-bottom) + 12px); background: var(--bg); border-radius: 20px 20px 0 0; box-shadow: 0 -6px 20px rgba(0, 0, 0, .12); }
.map-near h2 { margin: 0 0 8px; display: flex; justify-content: space-between; align-items: baseline; color: var(--text); font-family: var(--display); font-weight: 400; font-size: 1.6rem; letter-spacing: .01em; text-transform: none; }
.map-near h2 span { font-family: system-ui, sans-serif; font-size: .8rem; color: var(--muted); }
.map-near .carousel img { height: 110px; }
.art-pin img { width: 44px; height: 44px; object-fit: cover; border: 3px solid #fff; border-radius: 10px; box-shadow: 0 2px 8px rgba(0, 0, 0, .35); }
.pick-pin span { display: block; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); border: 4px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .4); }
.me-pin span { display: block; width: 20px; height: 20px; border-radius: 50%; background: #1f6feb; border: 4px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .35); }
.leaflet-popup-content a { color: var(--text); text-decoration: none; text-align: center; display: block; font-weight: 600; }
.picker { height: 220px; }

/* Perfil de artista */
.profile-head { display: flex; gap: 16px; align-items: center; margin-top: 8px; }
.avatar { width: 88px; height: 88px; flex: none; border-radius: 50%; object-fit: cover; background: var(--panel); }
.profile-head h1 { margin: 0 0 4px; }

/* Listas (búsqueda) */
.list-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; }
.list-row img { width: 52px; height: 52px; object-fit: cover; border-radius: 50%; background: var(--panel); }
.list-row .name { flex: 1; min-width: 0; font-weight: 700; }
.list-row .count { color: var(--muted); font-size: .9rem; }

/* Administración */
.admin-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.admin-nav a { padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--text); text-decoration: none; font-weight: 700; font-size: .9rem; }
.admin-nav a.active { background: var(--text); border-color: var(--text); color: #fff; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.stats div { background: var(--panel); border-radius: var(--radius); padding: 12px 6px; text-align: center; }
.stats strong { display: block; font-size: 1.5rem; }
.stats span { color: var(--muted); font-size: .8rem; }
.big-button { display: block; margin-bottom: 10px; padding: 20px 22px; border-radius: var(--radius); background: var(--panel); color: var(--text); text-decoration: none; }
.big-button strong { display: block; font-family: var(--display); font-weight: 400; font-size: 1.7rem; line-height: 1.1; }
.big-button span { color: var(--muted); }
.big-button.accent { background: var(--accent); }
.big-button.accent span { color: #0b3d1c; }
.admin-item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.admin-item p { margin: 4px 0; }
.admin-item.unread { border-left: 3px solid var(--accent); padding-left: 10px; }
.admin-item.resolved { opacity: .55; }
.admin-title { font-weight: 800; font-size: 1.1rem; color: var(--text); text-decoration: none; }
.message-body { white-space: pre-line; word-break: break-word; }
.admin-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.admin-actions input, .admin-actions select { width: auto; padding: 6px 10px; }
.badge { font-size: .7rem; background: var(--accent); color: var(--accent-ink); padding: 2px 6px; border-radius: 6px; vertical-align: middle; }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; }
.report-thumb { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; vertical-align: middle; margin-right: 8px; }
.ad-thumb { width: 72px; height: 90px; object-fit: cover; border-radius: 8px; background: var(--panel); }

/* Mis mensajes y avisos de me gusta */
.count-badge { display: inline-block; min-width: 1.5em; margin-left: 6px; padding: 1px 6px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: .8rem; font-weight: 800; text-align: center; }
.inbox-write { margin-bottom: 14px; }
.inbox-write summary { display: inline-flex; list-style: none; cursor: pointer; }
.inbox-write summary::-webkit-details-marker { display: none; }
.inbox-write[open] summary { margin-bottom: 10px; }
.inbox { display: flex; flex-direction: column; gap: 8px; }
.inbox-item { display: block; background: var(--panel); border: 1px solid transparent; border-radius: var(--radius); padding: 10px 14px; color: var(--text); text-decoration: none; }
.inbox-item p { margin: 2px 0; }
.inbox-item.new { border-color: var(--accent); }
.inbox-item.message.mine { margin-left: 15%; background: var(--bg); border-color: var(--line); }
.inbox-item.notice { display: flex; align-items: center; gap: 12px; }
.notice-icon { flex: none; display: grid; place-content: center; width: 40px; height: 40px; border-radius: 50%; background: var(--bg); }
.notice-icon svg { width: 22px; height: 22px; fill: var(--accent); }
.notice-text { flex: 1; min-width: 0; line-height: 1.35; }
.notice-text .muted { display: block; }
.notice-thumb { flex: none; width: 52px; height: 52px; object-fit: cover; border-radius: 8px; }
.conversation-row { display: block; color: var(--text); text-decoration: none; }
.conversation-row .muted { display: block; margin-top: 4px; }
.chat { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.chat-bubble { max-width: 85%; background: var(--panel); border-radius: var(--radius); padding: 8px 12px; }
.chat-bubble p { margin: 2px 0; }
.chat-bubble.mine { align-self: flex-end; background: #dcfbe6; }

/* Reportar, bloquear, mi cuenta y privacidad */
.safety { margin: 10px 0 0; }
details.report { display: inline; }
details.report > summary { display: inline; list-style: none; }
details.report > summary::-webkit-details-marker { display: none; }
details.report[open] { display: block; }
.report-form { margin: 10px 0; padding: 12px 14px; background: var(--panel); border-radius: var(--radius); gap: 8px; color: var(--text); }
.report-form p { margin: 0; }
.form label.radio, .form label.check { flex-direction: row; align-items: center; gap: 10px; font-weight: 400; }
.form label.radio input, .form label.check input { width: auto; accent-color: var(--accent); }
.blocked-list { list-style: none; padding: 0; margin: 0; }
.blocked-list li { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.danger-zone { margin-top: 28px; padding: 16px; border: 1px solid var(--danger); border-radius: var(--radius); }
.danger-zone h2 { margin-top: 0; color: var(--danger); }
.prose p, .prose li { line-height: 1.55; }
.prose h2 { margin-top: 1.8rem; }
.gesture-list { list-style: none; padding: 0; display: grid; gap: 8px; }
.gesture-list li { display: flex; gap: 12px; align-items: baseline; padding: 10px 14px; background: var(--panel); border-radius: var(--radius); }
.gesture-list b { flex: none; width: 9.5em; }
span.avatar { display: block; }
.form label.chip { flex-direction: row; gap: 0; }

/* Barra de pestañas de abajo (como en Skatespots) */
body { padding-bottom: var(--tabbar); }
.tabbar {
    position: fixed; z-index: 1100; left: 0; right: 0; bottom: 0; height: var(--tabbar);
    display: flex; align-items: flex-start; justify-content: space-around;
    padding: 8px 12px env(safe-area-inset-bottom);
    background: var(--bg); border-top: 1px solid var(--line);
}
.tabbar a {
    display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 56px; min-height: 44px;
    color: var(--muted); text-decoration: none; font-size: .7rem; font-weight: 600;
}
.tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a.active { color: var(--accent-text); font-weight: 700; }
.tabbar .tab-add { width: 56px; height: 56px; min-width: 0; margin-top: -20px; border-radius: 50%; justify-content: center; background: var(--accent); color: var(--accent-ink); box-shadow: 0 4px 12px rgba(0, 0, 0, .18); }
.tabbar .tab-add svg { width: 28px; height: 28px; stroke-width: 2.5; }
.menu { bottom: var(--tabbar); }
.viewer { height: calc(100vh - var(--tabbar)); height: calc(100dvh - var(--tabbar)); }
.map-page { height: calc(100vh - var(--topbar) - var(--tabbar)); height: calc(100dvh - var(--topbar) - var(--tabbar) - env(safe-area-inset-top)); }
.immersive .flash { top: calc(env(safe-area-inset-top) + var(--topbar)); }
.dir-sheet { z-index: 3000; }

/* Tiendas, galerías y exposiciones */
.place-list { display: flex; flex-direction: column; }
.place-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; }
.place-row img { width: 64px; height: 64px; flex: none; object-fit: cover; border-radius: 50%; background: var(--panel); }
.place-icon { width: 64px; height: 64px; flex: none; display: grid; place-content: center; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-family: var(--display); font-size: 2rem; }
.place-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.place-distance { flex: none; font-weight: 700; font-size: .9rem; color: var(--accent-text); }
.contact-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.geo-results { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.geo-results button { width: 100%; text-align: left; font: inherit; font-weight: 400; font-size: .9rem; padding: 10px 12px; background: var(--bg); border: 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.geo-results li:last-child button { border-bottom: 0; }
.geocode .search-form { flex-direction: column; }

/* Pines de tiendas, galerías y exposiciones (y sus íconos en los filtros) */
.pin-icon { display: inline-grid; place-content: center; width: 38px; height: 38px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .35); box-sizing: border-box; }
.pin-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pin-tienda { background: var(--accent); color: var(--accent-ink); }
.pin-galeria { background: var(--text); color: #fff; }
.pin-expo { background: #fff; color: var(--text); border-color: var(--text); }
.place-pin { background: none; border: 0; }
.chip .pin-icon { width: 24px; height: 24px; margin: 0 6px 0 -6px; border-width: 2px; box-shadow: none; }
.chip .pin-icon svg { width: 13px; height: 13px; }
.chip.on .pin-galeria { border-color: #fff; }
.legend { display: inline-block; width: 20px; height: 20px; margin: 0 6px 0 -6px; border-radius: 5px; border: 2px solid #fff; box-shadow: 0 0 0 1px #cfcfca; background: linear-gradient(135deg, #22d65e 50%, #3bb8a8 50%); }

.photo-input.camera-only { grid-template-columns: 1fr; }

/* ¿Quién es el ART?ST? */
.game-q { display: inline-grid; place-content: center; flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--text); color: var(--accent); font-family: var(--display); font-size: 1.9rem; line-height: 1; }
.game-q.small-q { width: 24px; height: 24px; font-size: 1.1rem; vertical-align: middle; }
.game-title { margin: 0; font-family: var(--display); font-weight: 400; font-size: 1.9rem; letter-spacing: .01em; text-transform: none; color: var(--text); line-height: 1.05; }
.game-title span { color: var(--accent-text); }
.who-btn {
    pointer-events: auto; align-self: flex-start; display: flex; align-items: center; gap: 10px; margin-top: 4px;
    padding: 10px 16px 10px 10px; border: 0; border-radius: 16px; background: var(--accent); color: var(--accent-ink);
    font: inherit; text-align: left; cursor: pointer; animation: who-pulse 1.8s infinite;
}
.who-btn strong { display: block; font-size: 1rem; }
.who-btn small { display: block; font-size: .78rem; }
@keyframes who-pulse { 0% { box-shadow: 0 0 0 0 rgba(34, 214, 94, .65); } 70% { box-shadow: 0 0 0 14px rgba(34, 214, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 214, 94, 0); } }
@media (prefers-reduced-motion: reduce) { .who-btn { animation: none; } }
.who-link { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.sheet-game { height: 74%; }
.sheet-game .sheet-foot form { display: flex; gap: 8px; }
.claim-link { display: block; margin-top: 10px; text-align: center; font-size: .85rem; color: var(--muted); }
.game { margin-top: 20px; padding: 16px; border-radius: var(--radius); background: var(--panel); }
.game-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.game-head p { margin: 4px 0 0; }
.game-head.solved .game-q { background: var(--accent); color: var(--accent-ink); }
.guess { padding: 10px 12px; margin: 8px 0; border-radius: 12px; background: var(--bg); border: 2px solid transparent; }
.guess.voted { border-color: var(--accent); }
.guess-top, .guess-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.guess-bar { height: 8px; margin: 8px 0; border-radius: 4px; background: #e6e6e2; overflow: hidden; }
.guess-bar span { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.game-propose { display: flex; gap: 8px; margin-top: 10px; }
.game-propose input { flex: 1; }
details.claim { margin-top: 12px; }
.game-note { display: flex; align-items: center; gap: 10px; margin: 0; padding: 12px; border-radius: var(--radius); background: var(--panel); font-size: .9rem; }
.geo-line { margin: 0; font-weight: 600; }
.win { position: absolute; z-index: 20; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(0, 0, 0, .55); }
.win[hidden] { display: none; }
.win-card { width: min(340px, 100%); padding: 24px 22px; border-radius: 24px; background: var(--bg); color: var(--text); text-align: center; animation: win-pop .35s ease-out; }
.win-card p { margin: 8px 0; }
.win-big { font-family: var(--display); font-size: 6.5rem; line-height: .8; color: var(--accent); text-shadow: 3px 3px 0 var(--text); }
@keyframes win-pop { from { transform: scale(.8); opacity: 0; } to { transform: none; opacity: 1; } }
.points-badge { display: inline-block; margin-left: 4px; padding: 2px 10px; border-radius: 999px; background: var(--text); color: var(--accent); font-weight: 800; font-size: .85rem; }
.points-badge.big { margin: 4px 0 12px; font-size: 1.1rem; padding: 6px 16px; }
.notice-icon.game-icon { background: var(--text); color: var(--accent); font-family: var(--display); font-size: 1.5rem; }
.detective .stats { grid-template-columns: repeat(3, 1fr); }
.detective .stats strong { font-family: var(--display); font-weight: 400; font-size: 2.1rem; line-height: 1; }
.badge-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--text); color: #fff; text-decoration: none; }
.badge-card .game-q { border: 2px solid var(--accent); background: transparent; }
.badge-card small { display: block; color: #cfcfcf; }
.mystery-grid a span { background: var(--text); color: var(--accent); }
.top-row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.top-row.me { background: #ebfbf0; border-radius: 10px; }
.top-pos { width: 2em; text-align: center; font-family: var(--display); font-size: 1.6rem; }
.top-row:nth-child(-n+3 of .top-row) .top-pos { color: var(--accent-text); }
.top-name { flex: 1; min-width: 0; font-weight: 700; display: flex; flex-direction: column; }
.top-name small { font-weight: 400; }
.top-points { font-family: var(--display); font-size: 1.6rem; }
.art-pin { position: relative; }
.pin-q { position: absolute; top: -8px; right: -8px; width: 22px; height: 22px; display: grid; place-content: center; border-radius: 50%; background: var(--text); color: var(--accent); font-family: var(--display); font-size: 1rem; border: 2px solid #fff; }
.legend-q { display: inline-grid; place-content: center; width: 22px; height: 22px; margin: 0 6px 0 -6px; border-radius: 50%; background: var(--text); color: var(--accent); font-family: var(--display); font-size: 1rem; }
.chip.on .legend-q { background: var(--accent); color: var(--text); }

.register-tabs { margin: 0 0 14px; }
.register-tabs .chip .pin-icon { width: 22px; height: 22px; }
.date-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.date-row input { min-width: 0; }

/* Formulario rápido del botón + (aparece encima, con la foto recién sacada) */
.quick { position: fixed; z-index: 2000; inset: 0; overflow-y: auto; display: block; padding: 0; background: #111; }
.quick[hidden] { display: none; }
/* La foto recién sacada queda de fondo y el formulario va encima, semitransparente. */
.quick-preview { position: fixed; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.quick-panel {
    position: relative; display: flex; flex-direction: column; gap: 16px;
    min-height: 100%; margin-top: 38vh; padding: 18px 16px calc(env(safe-area-inset-bottom) + 24px);
    border-radius: 24px 24px 0 0; background: rgba(255, 255, 255, .78);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.quick-panel input:not([type=radio]), .quick-panel .chip:not(.on):not(:has(input:checked)) { background: rgba(255, 255, 255, .7); }
.quick-panel .game-note { background: rgba(255, 255, 255, .55); }
.quick-head { display: flex; align-items: center; justify-content: space-between; }
.quick-close { position: absolute; z-index: 1; top: calc(env(safe-area-inset-top) + 12px); right: 12px; width: 44px; height: 44px; display: grid; place-content: center; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .45); color: #fff; cursor: pointer; }
.quick-close svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.quick-retake { position: absolute; z-index: 1; top: calc(env(safe-area-inset-top) + 12px); left: 12px; padding: 10px 14px; border-radius: 999px; background: rgba(0, 0, 0, .45); color: #fff; font-weight: 700; font-size: .9rem; cursor: pointer; }
/* Variante oscura (vidrio negro, letras blancas). */
.quick.dark .quick-panel { background: rgba(15, 15, 15, .62); color: #fff; }
.quick.dark .quick-panel .muted, .quick.dark .quick-panel .optional { color: #d0d0d0; }
.quick.dark .quick-panel input:not([type=radio]) { background: rgba(255, 255, 255, .14); color: #fff; border-color: rgba(255, 255, 255, .35); }
.quick.dark .quick-panel input::placeholder { color: #c8c8c8; }
.quick.dark .quick-panel .chip { background: rgba(255, 255, 255, .14); color: #fff; border-color: rgba(255, 255, 255, .35); }
.quick.dark .quick-panel .chip:has(input:checked) { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.quick.dark .quick-panel .game-title { color: #fff; }
.quick.dark .quick-panel .game-note { background: rgba(255, 255, 255, .12); }
.quick-open { overflow: hidden; }
label.tab-add { cursor: pointer; }
.tabbar .tab-add { display: flex; align-items: center; justify-content: center; min-height: 0; padding: 0; }

.menu .menu-profile { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.menu .menu-profile svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; }
.menu .menu-profile small { margin-left: auto; color: var(--muted); font-weight: 400; font-size: .85rem; }
.menu { padding-bottom: 48px; }

/* Página de una obra: la foto a pantalla completa, como en el inicio */
.artwork-hero { position: relative; margin: 0; height: calc(100vh - var(--tabbar)); height: calc(100dvh - var(--tabbar)); background: #111; color: #fff; }
.artwork-hero img { width: 100%; height: 100%; object-fit: cover; }
.artwork-hero-info { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; gap: 8px; padding: 60px 16px 18px; background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, .72) 40%); }
.artwork-hero-info h1 { margin: 0; font-size: 2.4rem; color: #fff; }
.artwork-hero-info .who-btn { text-decoration: none; }
.immersive .artwork-body { max-width: 720px; margin: 0 auto; padding: 4px 16px 40px; }
.immersive .artwork-body > .artwork-actions:first-child { margin-top: 16px; }

/* Al bajar más allá de la foto, la barra de arriba vuelve a ser blanca. */
.immersive.scrolled .topbar { background: var(--bg); border-bottom: 1px solid var(--line); }
.immersive.scrolled .logo { color: var(--text); text-shadow: none; }
.immersive.scrolled .burger span { background: var(--text); box-shadow: none; }

/* El + de la barra: «¿Qué quieres agregar?» */
.tabbar .tab-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 56px; min-height: 44px; padding: 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: .7rem; font-weight: 600; cursor: pointer; }
.tabbar .tab-btn.active { color: var(--accent-text); font-weight: 700; }
.add-sheet { position: fixed; inset: 0; z-index: 3000; display: flex; align-items: flex-end; }
.add-box { position: relative; width: 100%; max-width: 520px; margin: 0 auto; display: grid; gap: 10px; padding: 10px 18px calc(env(safe-area-inset-bottom) + 18px); background: var(--bg); border-radius: 22px 22px 0 0; }
.add-box h2 { margin: 4px 0 0; color: var(--text); font-family: var(--display); font-weight: 400; font-size: 1.9rem; letter-spacing: .01em; text-transform: none; }
.add-box > p { margin: -8px 0 4px; }
.sheet-grab { display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 4px; }
.add-opt { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 16px; color: var(--text); text-decoration: none; cursor: pointer; }
.add-opt:hover, .add-opt:focus-visible { border-color: var(--text); }
.add-opt strong { display: block; font-size: 1.05rem; }
.add-opt small { display: block; color: var(--muted); font-size: .85rem; }
.add-opt-main { border-color: var(--accent); background: #effcf3; }
.add-ic { flex: none; }
.add-ic .pin-icon { width: 46px; height: 46px; }
.add-ic .pin-icon svg { width: 22px; height: 22px; }
.add-ic-art { display: grid; place-content: center; width: 46px; height: 46px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); }
.add-ic-art svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }

/* Agenda de expos */
.agenda { display: grid; gap: 10px; }
.agenda-row { display: flex; align-items: center; gap: 12px; padding: 8px; border: 1.5px solid var(--line); border-radius: 16px; color: var(--text); text-decoration: none; }
.agenda-row:hover { border-color: var(--text); }
.agenda-date { flex: none; width: 44px; text-align: center; }
.agenda-date b { display: block; font-family: var(--display); font-weight: 400; font-size: 1.9rem; line-height: 1; }
.agenda-date small { font-size: .7rem; font-weight: 800; color: var(--accent-text); letter-spacing: .05em; }
.agenda-flyer { flex: none; width: 70px; height: 88px; border-radius: 10px; object-fit: cover; background: var(--panel); }
.agenda-flyer-text { display: grid; place-content: center; padding: 6px; overflow: hidden; text-align: center; font-family: var(--display); font-size: 1.05rem; line-height: .95; color: #fff; word-break: break-word; }
.agenda-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.agenda-text strong { font-size: 1.02rem; }

/* Expos a pantalla completa */
.expo-viewer { position: relative; height: calc(100vh - var(--tabbar)); height: calc(100dvh - var(--tabbar)); background: #111; overflow: hidden; }
.expo-track { display: flex; height: 100%; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.expo-track::-webkit-scrollbar { display: none; }
.expo-slide { position: relative; flex: 0 0 100%; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; overflow: hidden; }
.expo-blur { position: absolute; inset: -30px; width: calc(100% + 60px); height: calc(100% + 60px); object-fit: cover; filter: blur(24px) brightness(.6); }
.expo-flyer { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.expo-flyer-text { position: absolute; inset: 0; display: grid; place-content: center; padding: 30px; text-align: center; color: #fff; font-family: var(--display); font-size: clamp(3.5rem, 18vw, 7rem); line-height: .88; word-break: break-word; }
.expo-g0 { background: radial-gradient(circle at 30% 30%, #ff5f2e, #7a1fa2 60%, #14002e); }
.expo-g1 { background: linear-gradient(150deg, #141414 20%, #15803d 70%, #22d65e); }
.expo-g2 { background: linear-gradient(150deg, #1f3c4f, #3bb8a8); }
.expo-g3 { background: linear-gradient(150deg, #f0c04c, #ff5f2e); }
.expo-tap { position: absolute; inset: 0; z-index: 1; border: 0; background: linear-gradient(transparent 55%, rgba(0, 0, 0, .75)); cursor: pointer; }
.expo-caption { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 18px 18px 20px; color: #fff; pointer-events: none; text-shadow: 0 1px 6px rgba(0, 0, 0, .4); }
.expo-caption h2 { margin: 8px 0 4px; color: #fff; font-family: var(--display); font-weight: 400; font-size: 2.4rem; line-height: 1; letter-spacing: .01em; text-transform: none; }
.expo-caption p { margin: 2px 0; }
.expo-caption .viewer-hint { margin-top: 10px; }
.chip-live { background: var(--accent) !important; color: var(--accent-ink) !important; }
.expo-close { position: absolute; z-index: 5; top: calc(env(safe-area-inset-top) + var(--topbar) + 14px); right: 14px; display: grid; place-content: center; width: 40px; height: 40px; border-radius: 50%; background: rgba(0, 0, 0, .35); color: #fff; }
.expo-close svg, .expo-sheet-x svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; }
.expo-dots { position: absolute; z-index: 5; top: calc(env(safe-area-inset-top) + var(--topbar) + 2px); left: 14px; right: 14px; display: flex; gap: 5px; pointer-events: none; }
.expo-dots i { flex: 1; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .4); }
.expo-dots i.on { background: #fff; }
.expo-sheet { position: fixed; inset: 0; z-index: 3000; display: flex; align-items: flex-end; }
.expo-sheet-box { position: relative; width: 100%; max-width: 560px; max-height: 82vh; max-height: 82dvh; margin: 0 auto; overflow-y: auto; padding: 10px 20px calc(env(safe-area-inset-bottom) + 22px); background: var(--bg); border-radius: 22px 22px 0 0; }
.expo-sheet-box h1 { margin: 8px 0 10px; }
.expo-sheet-x { position: absolute; top: 12px; right: 12px; display: grid; place-content: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--panel); color: var(--text); cursor: pointer; }
.expo-kv { display: flex; gap: 10px; margin: 10px 0; }
.expo-kv > span:first-child { flex: none; width: 22px; text-align: center; }
.expo-caption .type-chip:not(.chip-live) { background: #fff; color: var(--text); }
.expo-sheet-box .type-chip:not(.chip-live) { background: var(--panel); color: var(--text); }

/* Mapa: Top detectives */
.map-top { position: absolute; z-index: 1001; right: 12px; bottom: 296px; width: 48px; height: 48px; display: grid; place-content: center; border-radius: 50%; background: var(--bg); box-shadow: 0 2px 8px rgba(0, 0, 0, .2); color: var(--accent-text); }
.map-top svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* Los cuatro filtros del mapa caben en un celular sin deslizar. */
.map-page .map-filters { gap: 6px; padding: 0 10px; }
.map-page .map-filters .chip { padding: 7px 10px; font-size: .82rem; }
.map-page .map-filters .chip .pin-icon, .map-page .map-filters .legend-q, .map-page .map-filters .legend { margin-right: 4px; }

/* Cámara propia a pantalla completa (botón +) */
.cam { position: fixed; inset: 0; z-index: 2600; background: #000; color: #fff; }
.cam-open { overflow: hidden; }
.cam-video { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(100vw, 100vh * 9 / 16); width: min(100vw, 100dvh * 9 / 16); aspect-ratio: 9 / 16; object-fit: cover; }
.cam-close, .cam-flip { width: 48px; height: 48px; display: grid; place-content: center; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .45); color: #fff; cursor: pointer; }
.cam-close { position: absolute; z-index: 1; top: calc(env(safe-area-inset-top) + 12px); right: 12px; }
.cam-close svg, .cam-flip svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cam-hint { position: absolute; z-index: 1; top: calc(env(safe-area-inset-top) + 22px); left: 16px; margin: 0; padding: 6px 12px; border-radius: 999px; background: rgba(0, 0, 0, .45); font-size: .85rem; font-weight: 600; }
.cam-bar { position: absolute; z-index: 1; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; justify-items: center; padding: 16px 24px calc(env(safe-area-inset-bottom) + 20px); }
.cam-shutter { width: 78px; height: 78px; border-radius: 50%; border: 5px solid #fff; background: var(--accent); box-shadow: 0 0 0 3px rgba(0, 0, 0, .25); cursor: pointer; }
.cam-shutter:active { transform: scale(.94); }
.cam-shutter:disabled { opacity: .5; }
.cam-error { position: absolute; z-index: 2; left: 24px; right: 24px; top: 40%; text-align: center; }
.cam-error p { margin: 0 0 14px; font-weight: 600; }
.cam-flash .cam-video { opacity: .3; transition: opacity .08s; }

/* Compartir: imagen para la historia o el link */
.share-sheet { position: fixed; inset: 0; z-index: 3000; display: flex; align-items: flex-end; }
.share-box { position: relative; width: 100%; max-width: 520px; margin: 0 auto; display: grid; gap: 10px; justify-items: center; padding: 10px 18px calc(env(safe-area-inset-bottom) + 18px); background: var(--bg); border-radius: 22px 22px 0 0; }
.share-box h2 { margin: 0; color: var(--text); font-family: var(--display); font-weight: 400; font-size: 1.8rem; letter-spacing: .01em; text-transform: none; }
.share-preview { width: auto; height: min(42vh, 360px); aspect-ratio: 9 / 16; border-radius: 14px; background: var(--panel); object-fit: cover; box-shadow: 0 4px 16px rgba(0, 0, 0, .18); }
.share-box .button { width: 100%; }
.share-story { display: flex; align-items: center; justify-content: center; gap: 8px; background: linear-gradient(90deg, #f58529, #dd2a7b 50%, #8134af); color: #fff; }
.share-story svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; }
.share-story:disabled { opacity: .6; }
.share-tip { margin: -4px 0 0; text-align: center; }
.toast { position: fixed; z-index: 3500; left: 16px; right: 16px; bottom: calc(var(--tabbar) + 16px); max-width: 480px; margin: 0 auto; padding: 12px 16px; border-radius: 14px; background: #141414; color: #fff; font-weight: 600; font-size: .92rem; text-align: center; box-shadow: 0 6px 20px rgba(0, 0, 0, .3); animation: toast-in .2s ease-out; }
@keyframes toast-in { from { transform: translateY(12px); opacity: 0; } }

/* «Por descubrir | Descubiertas» */
.home-switch { display: flex; gap: 4px; width: max-content; max-width: 100%; margin: 4px auto 16px; padding: 4px; border-radius: 999px; background: var(--panel); }
.home-switch a { padding: 8px 16px; border-radius: 999px; color: var(--muted); font-weight: 700; font-size: .9rem; text-decoration: none; white-space: nowrap; }
.home-switch a.on { background: var(--text); color: var(--bg); }
.home-switch.on-photo { position: absolute; z-index: 6; top: calc(env(safe-area-inset-top) + var(--topbar) - 6px); left: 50%; transform: translateX(-50%); margin: 0; background: rgba(0, 0, 0, .35); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.home-switch.on-photo a { color: rgba(255, 255, 255, .8); }
.home-switch.on-photo a.on { background: #fff; color: var(--text); }
.viewer[data-viewer] .viewer-dots { top: calc(env(safe-area-inset-top) + var(--topbar) + 40px); }
.viewer-empty-wrap .home-switch { position: relative; z-index: 2; top: auto; left: auto; transform: none; margin: calc(env(safe-area-inset-top) + var(--topbar) + 8px) auto 0; background: var(--panel); }
.viewer-empty-wrap .home-switch a { color: var(--muted); }
.viewer-empty-wrap .home-switch a.on { background: var(--text); color: var(--bg); }
.viewer-empty-wrap { background: var(--bg); overflow-y: auto; }
.viewer-empty-wrap .viewer-empty { position: static; justify-content: flex-start; padding-top: 24px; }
.viewer-empty .disc-grid { width: 100%; max-width: 520px; }
.viewer-empty h2 { margin: 12px 0 0; }

/* Galería de descubiertas: el nombre del artista sobre cada foto */
.disc-grid a { position: relative; }
.disc-grid a span { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 6px 5px; background: linear-gradient(transparent, rgba(0, 0, 0, .75)); color: #fff; font-family: var(--display); font-size: 1.05rem; letter-spacing: .02em; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.disc-filters { display: grid; gap: 10px; margin: 16px 0 12px; }
.disc-filters .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.disc-filters select { width: 100%; }

/* Ranking */
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--panel); margin-bottom: 10px; }
.seg a { flex: 1; padding: 10px; border-radius: 11px; text-align: center; font-weight: 800; color: var(--muted); text-decoration: none; }
.seg a.on { background: var(--text); color: var(--bg); }
.period-chips { margin-bottom: 12px; }
.rank-card { padding: 14px; border: 1.5px solid var(--line); border-radius: 18px; }
.rank-head { display: flex; justify-content: space-between; align-items: baseline; }
.rank-head h2 { margin: 0 0 10px; }
.rank-head a { font-weight: 700; font-size: .9rem; color: var(--accent-text); }
.rank-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rank-col { display: grid; gap: 6px; align-content: start; padding: 10px; border-radius: 12px; background: var(--panel); color: var(--text); text-decoration: none; min-width: 0; }
.rank-col strong { font-size: .9rem; }
.rank-line { display: flex; gap: 6px; align-items: center; font-size: .88rem; min-width: 0; }
.rank-line b { flex: none; }
.rank-line em { margin-left: auto; font-style: normal; font-weight: 800; color: var(--accent-text); }

/* Racha e insignias */
.streak { margin: 4px 0 10px; padding: 10px 12px; border-radius: 12px; background: #fff4e5; font-size: .92rem; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.badge { display: grid; justify-items: center; gap: 2px; padding: 10px 6px; border-radius: 14px; background: var(--panel); text-align: center; opacity: .55; }
.badge.earned { opacity: 1; background: #ebfbf0; box-shadow: inset 0 0 0 1.5px var(--accent); }
.badge-icon { font-size: 1.7rem; filter: grayscale(1); }
.badge.earned .badge-icon { filter: none; }
.badge strong { font-size: .8rem; line-height: 1.2; }
.badge small { font-size: .7rem; color: var(--muted); line-height: 1.2; }
.top-streak { margin-left: 4px; font-size: .8rem; }

/* Pistas */
.hints { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.hints h3 { margin: 0 0 8px; font-size: .95rem; }
.hint { display: flex; justify-content: space-between; gap: 10px; margin: 0 0 6px; padding: 8px 10px; border-radius: 10px; background: #fffbe6; font-size: .92rem; }
.hint small { flex: none; }
.hint-form { margin-top: 8px; }

/* Desafío de la semana */
.challenge-banner { display: block; width: max-content; max-width: calc(100% - 32px); margin: 0 auto 12px; padding: 7px 14px; border-radius: 999px; background: #ff8a3d; color: #141414; font-weight: 800; font-size: .85rem; text-decoration: none; text-align: center; }
.challenge-banner.static { width: auto; max-width: none; border-radius: 12px; font-weight: 600; }
.viewer .challenge-banner { position: absolute; z-index: 6; top: calc(env(safe-area-inset-top) + var(--topbar) + 50px); left: 50%; transform: translateX(-50%); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 2px 10px rgba(0, 0, 0, .25); }
.viewer-empty-wrap .challenge-banner { position: static; transform: none; margin: 12px auto 0; }
.viewer[data-viewer]:has(.challenge-banner) .viewer-dots { top: calc(env(safe-area-inset-top) + var(--topbar) + 92px); }
.comuna-filter { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; }
.comuna-filter label { flex: none; font-weight: 700; font-size: .9rem; }
.comuna-filter select { flex: 1; min-width: 0; }
.own-note { margin: 0 0 8px; padding: 10px 12px; border-radius: 12px; background: #ebfbf0; font-size: .92rem; font-weight: 600; }

/* Cámara de arriba: desafíos nuevos, con el número */
.topbar-fire { position: relative; margin-left: auto; margin-right: 10px; display: grid; place-content: center; width: 40px; height: 40px; border-radius: 50%; color: var(--text); text-decoration: none; }
.topbar-fire svg { width: 27px; height: 27px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.immersive .topbar-fire { color: #fff; }
.immersive.scrolled .topbar-fire { color: var(--text); }
.topbar-fire b { position: absolute; top: 0; right: -2px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: #ff3b30; color: #fff; font-size: .72rem; line-height: 19px; text-align: center; border: 2px solid var(--bg); }
.immersive .topbar-fire { filter: drop-shadow(0 1px 4px rgba(0, 0, 0, .4)); }
.challenge-card { display: flex; gap: 14px; align-items: flex-start; margin: 0 0 12px; padding: 14px; border-radius: 16px; background: #fff4e5; box-shadow: inset 0 0 0 1.5px #ff8a3d; }
.challenge-card.next { background: var(--panel); box-shadow: none; }
.challenge-card h2 { margin: 6px 0 4px; color: var(--text); font-family: var(--display); font-weight: 400; font-size: 1.6rem; letter-spacing: .01em; text-transform: none; }
.challenge-card p { margin: 0; }
.challenge-fire { font-size: 2rem; line-height: 1; }
.dup-warning { display: flex; gap: 10px; align-items: center; margin: 8px 0; padding: 10px; border-radius: 12px; background: #fff4e5; box-shadow: inset 0 0 0 1.5px #ff8a3d; font-size: .88rem; font-weight: 600; }
.dup-warning img { flex: none; width: 52px; height: 52px; border-radius: 8px; object-fit: cover; }

/* Solo vertical: en un celular girado se tapa todo con un aviso. */
.rotate-lock { display: none; }
@media (orientation: landscape) and (max-height: 500px) and (pointer: coarse) {
    .rotate-lock { position: fixed; inset: 0; z-index: 99999; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: var(--text); color: #fff; text-align: center; }
    .rotate-lock svg { width: 56px; height: 56px; fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; transform: rotate(-90deg); animation: rotate-hint 1.6s ease-in-out infinite; }
    .rotate-lock strong { font-family: var(--display); font-weight: 400; font-size: 2rem; letter-spacing: .02em; }
    .rotate-lock span { color: #cfcfcf; }
    body { overflow: hidden; }
}
@keyframes rotate-hint { 50% { transform: rotate(0deg); } }
.visits { display: grid; gap: 2px; margin: 12px 0; padding: 10px 12px; border-radius: 12px; background: var(--panel); }

/* Expo: buscar la galería */
.gallery-pick { position: relative; }
.gallery-results { display: grid; gap: 4px; margin-top: 6px; padding: 6px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--bg); box-shadow: 0 6px 18px rgba(0, 0, 0, .08); }
.gallery-option { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; padding: 10px; border: 0; border-radius: 10px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.gallery-option:hover, .gallery-option:focus-visible { background: var(--panel); }
.gallery-option small { grid-column: 2; color: var(--muted); font-size: .8rem; }
.gallery-note { margin: 4px 6px; }
.gallery-chosen { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; background: #ebfbf0; box-shadow: inset 0 0 0 1.5px var(--accent); }
.gallery-chosen small { display: block; }
.dup-warning:has(.dup-grid) { display: block; }
.dup-warning[hidden] { display: none !important; }
.dup-title { margin: 0 0 8px; font-weight: 800; }
.dup-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.dup-option { position: relative; display: grid; gap: 4px; padding: 4px; border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 2px transparent; cursor: pointer; font-size: .75rem; font-weight: 700; text-align: center; }
.dup-option img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 9px; }
.dup-option input { position: absolute; top: 8px; left: 8px; width: 20px; height: 20px; accent-color: var(--accent-text); }
.dup-option:has(input:checked) { box-shadow: inset 0 0 0 3px var(--accent); background: #ebfbf0; }
.dup-option-none { place-content: center; min-height: 90px; }
.dup-option-none input { position: static; justify-self: center; }
.dup-none { font-size: .85rem; }
.dup-note { margin: 8px 0 0; }

/* Foto ancha: se arrastra para elegir qué parte se ve */
.quick-preview.pannable { cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-drag: none; }
.pan-hint { position: fixed; z-index: 1; top: calc(env(safe-area-inset-top) + 70px); left: 50%; transform: translateX(-50%); margin: 0; padding: 8px 14px; border-radius: 999px; background: rgba(0, 0, 0, .6); color: #fff; font-weight: 700; font-size: .9rem; white-space: nowrap; pointer-events: none; }
.fullview { position: fixed; inset: 0; z-index: 3200; display: flex; align-items: center; justify-content: center; background: #000; }
.fullview img { width: 100%; max-height: 100%; object-fit: contain; }
.fullview-close { position: absolute; top: calc(env(safe-area-inset-top) + 12px); right: 12px; width: 44px; height: 44px; display: grid; place-content: center; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .15); color: #fff; cursor: pointer; }
.fullview-close svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; }

/* Cámara girada: se puede sacar la foto en horizontal (16:9); el aviso «Gira tu celular» no tapa la cámara. */
.cam-open .rotate-lock { display: none !important; }
@media (orientation: landscape) {
    .cam-video { width: min(100vw, 100vh * 16 / 9); width: min(100vw, 100dvh * 16 / 9); aspect-ratio: 16 / 9; }
    .cam-bar { top: 0; bottom: 0; left: auto; right: 0; grid-template-columns: none; grid-template-rows: 1fr auto 1fr; padding: 16px calc(env(safe-area-inset-right) + 16px) 16px 16px; }
    .cam-close { right: auto; left: 12px; }
    .cam-hint { left: 50%; transform: translateX(-50%); }
}

/* Formulario rápido: se baja deslizando para ver la foto entera */
.quick-head { position: relative; display: block; padding-top: 10px; }
.quick-head .sheet-grab { position: absolute; top: -6px; left: 50%; width: 48px; margin: 0; transform: translateX(-50%); background: rgba(0, 0, 0, .25); }
.quick-head .game-title { margin: 0; }
.quick.collapsed { overflow: hidden; }
.quick.collapsed .quick-panel { margin-top: calc(100vh - 78px - env(safe-area-inset-bottom)); margin-top: calc(100dvh - 78px - env(safe-area-inset-bottom)); cursor: pointer; }
.quick-panel { transition: margin-top .25s ease; }

/* Administrar obras */
.admin-artwork { display: flex; gap: 12px; align-items: flex-start; }
.admin-thumb { flex: none; }
.admin-thumb img { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; display: block; }
.admin-artwork-body { flex: 1; min-width: 0; }
.admin-artwork details { margin: 6px 0; }
.admin-artwork summary { cursor: pointer; font-weight: 700; color: var(--accent-text); }
.admin-artwork-form { margin-top: 8px; gap: 10px; }
.admin-type-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.viewer-liquid { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; pointer-events: none; }

/* Patrocinador del desafío y lugares destacados (planes pagados) */
.sponsor { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; color: inherit; text-decoration: none; }
.sponsor small { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; }
.sponsor img { max-height: 32px; max-width: 120px; object-fit: contain; }
.challenge-prize { margin: 6px 0 0; }
.sponsor-fields { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; gap: 10px; }
.sponsor-fields legend { padding: 0 4px; font-weight: 700; }
.featured-tag { display: inline-block; width: max-content; padding: 2px 8px; border-radius: 999px; background: #ffd23f; color: #141414; font-size: .72rem; font-weight: 800; }
.place-row.featured { background: color-mix(in srgb, #ffd23f 12%, transparent); border-radius: 12px; padding-left: 8px; padding-right: 8px; }
.place-pin.featured .pin-icon { width: 46px; height: 46px; border-color: #ffd23f; box-shadow: 0 0 0 4px rgba(255, 210, 63, .45), 0 2px 8px rgba(0, 0, 0, .35); }
.logo-preview { display: block; max-height: 48px; max-width: 160px; object-fit: contain; margin: 4px 0 8px; background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 0 0 / 12px 12px; border-radius: 6px; }

/* Barrita de «pasan solas» bajo los puntitos del inicio */
.viewer-progress { position: absolute; z-index: 3; top: calc(env(safe-area-inset-top) + var(--topbar) + 50px); left: 50%; width: 102px; height: 2px; transform: translateX(-50%); border-radius: 2px; background: rgba(255, 255, 255, .3); overflow: hidden; pointer-events: none; }
.viewer[data-viewer]:has(.challenge-banner) .viewer-progress { top: calc(env(safe-area-inset-top) + var(--topbar) + 102px); }
.viewer-progress i { display: block; height: 100%; background: #fff; transform-origin: left; transform: scaleX(0); }
@keyframes viewer-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* Promoción de lugares destacados */
.promo-tag { display: inline-block; width: max-content; max-width: 100%; margin-top: 2px; padding: 2px 8px; border-radius: 999px; background: #ff8a3d; color: #141414; font-size: .74rem; font-weight: 800; }
.promo-banner { margin: 6px 0 10px; padding: 10px 14px; border-radius: 12px; background: #ff8a3d; color: #141414; font-weight: 800; }
.popup-promo { color: #c2410c; }
.map-near h2 .near-title { font-family: var(--display); font-size: 1.6rem; color: var(--text); }
.carousel .near-place { flex: 0 0 132px; }
.near-pic { position: relative; display: grid; place-content: center; width: 132px; height: 110px; margin-bottom: 4px; border-radius: 12px; background: var(--panel); overflow: hidden; font-family: var(--display); font-size: 2.6rem; color: var(--muted); }
.near-pic img { width: 100%; height: 100%; margin: 0; object-fit: cover; border-radius: 0; }
.near-pic.is-logo { background: #fff; border: 1px solid var(--line); }
.near-pic.is-logo img { object-fit: contain; padding: 14px; box-sizing: border-box; }
.near-place.featured .near-pic { outline: 3px solid #ffd23f; outline-offset: -3px; }
.near-promo { position: absolute; left: 6px; bottom: 6px; right: 6px; padding: 3px 6px; border-radius: 8px; background: #ff8a3d; color: #141414; font-family: system-ui, sans-serif; font-size: .72rem; font-weight: 800; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.place-row img.is-logo { object-fit: contain; background: #fff; border: 1px solid var(--line); padding: 6px; box-sizing: border-box; }
.hunts-left { margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; background: var(--panel); font-size: .9rem; }
.hunts-left.none { background: #fff1e6; border: 1px solid #ffc9a3; }

/* ===== Computador (pantallas anchas): mismas pantallas, ordenadas para mouse y teclado ===== */
.viewer-backdrop, .viewer-arrow, .desk-only { display: none; }
@media (min-width: 1024px) {
    :root { --tabbar: 0px; }
    body { padding-bottom: 0; }

    /* Las pestañas suben a la barra de arriba, al centro. */
    .tabbar {
        top: 0; bottom: auto; left: 50%; right: auto; transform: translateX(-50%);
        height: var(--topbar); padding: 0; gap: 4px; align-items: center;
        background: none; border: 0; z-index: 1150;
    }
    .tabbar a { flex-direction: row; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 999px; font-size: .95rem; align-items: center; }
    .tabbar .tab-btn { flex-direction: row; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 999px; font-size: .95rem; }
    .tabbar a:hover, .tabbar .tab-btn:hover { background: var(--panel); color: var(--text); }
    .tabbar svg { width: 20px; height: 20px; }
    /* Sacar foto es del celular (cámara y GPS en el lugar): en el computador no va el +. */
    .tabbar .tab-add { display: none; }
    .desk-only { display: inline; }
    .mob-only { display: none; }
    .menu { bottom: 0; }
    .immersive .topbar { background: #111; }
    .immersive .tabbar a, .immersive .tabbar .tab-btn { color: rgba(255, 255, 255, .8); }
    .immersive .tabbar a.active, .immersive .tabbar a:hover, .immersive .tabbar .tab-btn:hover { color: #fff; background: rgba(255, 255, 255, .12); }
    .immersive .tabbar .tab-add { color: var(--accent-ink); }

    /* Páginas con más aire; las grillas con más columnas. */
    .page { padding: 28px 32px 56px; }
    .page:has(.grid) { max-width: 1180px; }
    .immersive .page, .immersive .page:has(.grid) { max-width: none; padding: 0; }
    .page:has(.map-page) { max-width: none; padding: 0; }
    .map-page { margin: 0; }
    .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }

    /* Inicio: la foto completa, ajustada al alto, con la misma foto desenfocada a los lados. */
    .viewer { height: calc(100vh - var(--topbar)); margin-top: var(--topbar); }
    .viewer-stage { cursor: pointer; }
    .viewer-backdrop { display: block; position: absolute; inset: -60px; background: #111 center / cover no-repeat; filter: blur(48px) brightness(.4) saturate(1.2); transition: background-image .3s; }
    .viewer-media { object-fit: contain; }
    .viewer-media.wide { object-fit: cover; }
    .home-switch.on-photo { top: 14px; }
    .viewer-dots { top: 66px; }
    .viewer-progress { top: 78px; }
    .viewer-arrow {
        display: grid; place-content: center; position: absolute; z-index: 4; top: 50%; width: 56px; height: 56px; margin-top: -28px;
        border: 0; border-radius: 50%; background: rgba(0, 0, 0, .35); color: #fff; cursor: pointer; backdrop-filter: blur(6px);
    }
    .viewer-arrow:hover { background: rgba(0, 0, 0, .6); }
    .viewer-arrow svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
    .viewer-arrow.prev { left: 24px; }
    .viewer-arrow.next { right: 24px; }
    .viewer-side { right: 96px; bottom: 120px; }
    .viewer-info { padding: 60px 200px 28px 40px; max-width: 760px; background: none; }
    .viewer-info::before { content: ""; position: absolute; inset: 0 -200px 0 0; z-index: -1; background: linear-gradient(90deg, rgba(0, 0, 0, .55), rgba(0, 0, 0, 0)); }
    .viewer-hint { display: none; }
    .viewer.is-ad .viewer-ad { left: auto; right: 24px; bottom: 24px; width: 380px; border-radius: 18px; }

    /* Página de la obra: la foto entera, ajustada al ancho; se baja con scroll. */
    .artwork-hero { height: auto; margin-top: var(--topbar); }
    .artwork-hero img { display: block; height: auto; object-fit: initial; }
    .artwork-hero-info { padding: 80px 40px 28px; }
    .artwork-hero-info .viewer-hint { display: none; }

    /* Comentarios, juego y mapa: un panel a la derecha en vez de subir desde abajo. */
    .sheet { left: auto; top: 0; width: 440px; height: auto !important; border-radius: 0; transform: translateX(105%); box-shadow: -10px 0 30px rgba(0, 0, 0, .3); }
    .sheet.open { transform: none; }
    .sheet-head::before { display: none; }

    /* Mapa: la lista de cerca flota abajo a la izquierda. */
    .map-page { height: calc(100vh - var(--topbar)); }
    .map-near { left: 16px; right: auto; bottom: 16px; width: 460px; border-radius: 20px; padding-bottom: 12px; }
}

/* Mapa: buscar una ciudad o dirección en cualquier parte del mundo */
.map-find { position: absolute; z-index: 1001; right: 12px; bottom: 356px; width: 48px; height: 48px; display: grid; place-content: center; border-radius: 50%; border: 0; background: var(--bg); box-shadow: 0 2px 8px rgba(0, 0, 0, .2); cursor: pointer; color: var(--text); }
.map-find svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.map-search { position: absolute; z-index: 1002; top: 60px; left: 10px; right: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.map-search input { flex: 1; min-width: 0; border-radius: 999px; box-shadow: 0 2px 8px rgba(0, 0, 0, .15); }
.map-search .geo-results { flex-basis: 100%; margin: 0; background: var(--bg); border-radius: 12px; box-shadow: 0 4px 14px rgba(0, 0, 0, .18); }
@media (min-width: 1024px) {
    .map-search { left: auto; width: 460px; right: 76px; top: 12px; }
}
.map-search .geo-results li:not(:has(button)) { padding: 10px 12px; font-size: .9rem; }

/* Selector de idioma en el menú */
.lang-pick { display: flex; gap: 6px; margin: 10px 0 6px; }
.menu .lang-pick a { flex: 1; padding: 8px 6px; border: 1px solid var(--line); border-radius: 999px; text-align: center; font-size: .9rem; }
.menu .lang-pick a.on { background: var(--text); color: var(--bg); border-color: var(--text); }
