/* FotoConcurso — identidad visual «Revelado» (el cuarto oscuro)
   La foto es la protagonista. Tipografía: Archivo variable — titulares anchos (wdth 112–125) y pesados,
   acentos condensados (wdth 62) en rojo. Color: carbón, papel fotográfico y el rojo de la luz de seguridad.
   Esquinas rectas, líneas finas, sin sombras blandas. */

:root {
    --ink: #15130f;          /* carbón: texto principal / marca */
    --paper: #f2f0eb;        /* papel fotográfico */
    --surface: #faf9f6;      /* superficies */
    --muted: #6b665e;
    --line: #dcd8cf;
    --gold: #c8250f;         /* acento: rojo de luz de seguridad (el nombre --gold se mantiene por compatibilidad) */
    --gold-ink: #ffffff;     /* texto sobre el acento */
    --gold-soft: #f8ddd6;
    --signal: var(--gold);
    --teal: #15130f;         /* enlaces: tinta subrayada */
    --font-display: "Archivo", "Arial Narrow", system-ui, sans-serif;
    --font-ui: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --danger: #b3261e;
    --ok-bg: #e5f3ea; --ok-fg: #1d6236;
    --stage: #0d0c0a;        /* fondo de duelo y visores */
    --radius: 2px;
    --shadow: none;
    /* compatibilidad con estilos existentes */
    --bg: var(--paper); --fg: var(--ink); --card: var(--surface); --accent: var(--gold); --border: var(--line);
}
@media (prefers-color-scheme: dark) {
    :root {
        --ink: #f1efe9; --paper: #15130f; --surface: #1e1b16; --muted: #9a948a; --line: #2e2a24;
        --gold: #ff4a2f; --gold-ink: #15130f; --gold-soft: #3d1710; --teal: #f1efe9; --danger: #ff6b5b;
        --ok-bg: #173523; --ok-fg: #9adcb0;
    }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font-ui); background: var(--paper); color: var(--ink); line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2 { font-family: var(--font-display); font-weight: 800; font-stretch: 112%; line-height: 1; letter-spacing: -0.025em; }
h1 i, h2 i, .statement i, .ed-title i { font-style: normal; font-stretch: 62%; color: var(--gold); letter-spacing: -0.01em; }
h2 { font-size: 1.7rem; margin: 0 0 10px; }
h3 { font-size: 1rem; font-weight: 700; letter-spacing: -0.005em; }
a { color: var(--ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.muted { color: var(--muted); }
button { cursor: pointer; font: inherit; }

/* ---- Cabecera y marca ---- */
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; background: var(--paper); border-bottom: 1px solid var(--ink); }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-family: var(--font-display); font-weight: 800; font-stretch: 112%; font-size: 1.45rem; letter-spacing: -0.01em; white-space: nowrap; line-height: 1; }
.brand svg { width: 24px; height: 24px; flex: none; }
.brand { font-weight: 800; font-size: 1.25rem; letter-spacing: -0.02em; }
.brand .w1 { font-stretch: 125%; }
.brand .w2 { font-stretch: 62%; color: var(--gold); }
.crumb { display: block; color: var(--muted); font-size: .85rem; text-decoration: none; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60vw; }
.header-right { display: flex; align-items: center; gap: 10px; font-size: .85rem; }
.link { background: none; border: 0; color: var(--muted); text-decoration: underline; padding: 0; }
.logout { font-size: .8rem; white-space: nowrap; }
main { max-width: 1100px; margin: 0 auto; padding: 16px; }
.site-footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 24px 16px 32px; }

/* ---- Tarjetas, formularios y botones ---- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; max-width: 460px; margin: 32px auto; }
.card.wide { max-width: 600px; margin: 16px auto; }
.lbl { display: block; font-weight: 600; margin: 14px 0 6px; font-size: .95rem; }
.hint { font-size: .85rem; color: var(--muted); margin: 4px 0 0; }
input.text, input[type=tel], input[type=text], input[type=number], input[type=datetime-local], textarea, select.input {
    width: 100%; padding: 12px; font-size: 1rem; border: 1px solid var(--line); border-radius: 2px; background: var(--surface); color: var(--ink); font-family: inherit;
}
textarea { min-height: 110px; resize: vertical; }
input:focus-visible, textarea:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid color-mix(in srgb, var(--gold) 60%, transparent); outline-offset: 2px; }
input.code { width: 100%; padding: 12px; font-size: 1.6rem; letter-spacing: .4em; text-align: center; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); color: var(--ink); }
.btn { display: block; width: 100%; margin-top: 14px; padding: 14px 18px; border: 1px solid var(--ink); border-radius: 2px; background: var(--ink); color: var(--paper); font-weight: 600; font-size: .98rem; letter-spacing: .01em; text-align: center; text-decoration: none; }
.btn:hover { filter: brightness(1.04); }
.btn:disabled { opacity: .6; }
.btn.secondary { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.btn.dark { background: var(--ink); color: var(--paper); }
/* Acciones que abren o usan WhatsApp: verde WhatsApp, un tono más oscuro para que el texto blanco se lea (4.8:1) */
.btn.wa { display: flex; align-items: center; justify-content: center; gap: 10px; background: #13843f; border-color: #13843f; color: #fff; }
.btn.wa.inline { display: inline-flex; }
.btn.wa svg { width: 22px; height: 22px; flex: none; }
.btn.inline { display: inline-block; width: auto; margin-top: 0; padding: 10px 16px; }
.error { color: var(--danger); margin-top: 8px; font-size: .92rem; }
.ok { background: var(--ok-bg); color: var(--ok-fg); border-radius: var(--radius); padding: 10px 12px; margin: 8px 0; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 2px; cursor: pointer; line-height: 1.35; }
.check input { width: 20px; height: 20px; flex: none; margin: 0; accent-color: var(--gold); }
.alert-toggle { margin-top: 16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; justify-content: space-between; font-size: .92rem; }
.badge { display: inline-block; font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; padding: 4px 8px; border-radius: 2px; background: transparent; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.badge.gold { border-color: var(--gold); color: var(--ink); }
.badge.live { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.badge.live::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); margin-right: 6px; vertical-align: 1px; }

/* ---- Subida y "mis fotos" ---- */
.drop { display: block; border: 2px dashed var(--line); border-radius: var(--radius); padding: 24px; text-align: center; font-weight: 700; cursor: pointer; margin-top: 12px; background: var(--paper); }
.drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.previews, .mine { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; margin-top: 10px; }
.previews figure, .mine figure { margin: 0; }
.previews img, .mine img, .previews canvas { width: 100%; aspect-ratio: 1; object-fit: contain; background: var(--stage); border-radius: var(--radius); display: block; }
.mine figcaption { font-size: .8rem; color: var(--muted); text-align: center; }
.mine-open { padding: 0; border: 0; background: none; width: 100%; display: block; cursor: zoom-in; }
.mine-actions { display: flex; gap: 4px; margin-top: 4px; }
.mine-actions form { flex: 1; }
.mini { display: block; width: 100%; text-align: center; font-size: .78rem; font-weight: 700; padding: 6px 2px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; position: relative; overflow: hidden; }
.mini input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.mini.danger { color: var(--danger); }
figure.busy { opacity: .5; pointer-events: none; }
.processing { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; background: var(--line); border-radius: var(--radius); font-size: .75rem; color: var(--muted); padding: 4px; text-align: center; word-break: break-all; }
.lightbox { position: fixed; inset: 0; background: rgba(13,12,10,.94); z-index: 20; display: flex; align-items: center; justify-content: center; padding: 12px; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox-close { position: absolute; top: 10px; right: 12px; background: none; border: 0; color: #fff; font-size: 1.5rem; }

/* ---- Pantallas de alto fijo (duelo): sin scroll, fondo de galería ---- */
body.fixed { height: 100dvh; overflow: hidden; display: flex; flex-direction: column; background: var(--stage); color: #f1efe9; }
body.fixed .site-header { padding: 8px 12px; flex: none; background: var(--stage); border-bottom-color: #2e2a24; }
body.fixed .brand, body.fixed .crumb { color: #f1efe9; }
body.fixed .crumb { color: #9a948a; }
body.fixed .site-footer { display: none; }
body.fixed main { flex: 1; min-height: 0; max-width: none; width: 100%; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; }
body.fixed .muted { color: #9a948a; }
body.fixed .link { color: #9a948a; }

/* ---- Panel de organización ---- */
.panel-nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.panel-nav::-webkit-scrollbar { display: none; }
.panel-nav a { padding: 12px 10px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: .92rem; white-space: nowrap; border-bottom: 3px solid transparent; }
.panel-nav a.on { color: var(--ink); border-bottom-color: var(--ink); }
@media (max-width: 480px) { .panel-nav { padding: 0 6px; gap: 0; } .panel-nav a { padding: 12px 8px; font-size: .86rem; } }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 8px 0 16px; }
.page-head h2 { margin: 0; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); color: inherit; text-decoration: none; display: block; }
.tile h3 { margin: 6px 0 4px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 12px 0; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.stat b { display: block; font-family: var(--font-display); font-size: 2.2rem; font-weight: 800; font-stretch: 112%; line-height: 1; }
.stat span { color: var(--muted); font-size: .85rem; }
.panel-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 14px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .row2 { grid-template-columns: 1fr; } }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; cursor: pointer; background: var(--paper); }
.chips input { accent-color: var(--gold); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.gallery figure { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: contain; background: var(--stage); display: block; }
.gallery figcaption { padding: 8px; font-size: .82rem; }
.timeline { list-style: none; padding: 0; margin: 12px 0; border-left: 3px solid var(--line); }
.timeline li { padding: 6px 12px; margin-left: -3px; border-left: 3px solid transparent; }
.timeline li.now { border-left-color: var(--gold); }
.timeline li.past { opacity: .55; }

/* =====================================================================
   Páginas internas — composición editorial (sin tarjetas con sombra ni emojis)
   ===================================================================== */
.kicker { font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 600; color: var(--muted); }
.ed { max-width: 1100px; margin: 0 auto; padding: 36px 6px 60px; }
.ed-title { font-family: var(--font-display); font-weight: 800; font-stretch: 112%; font-size: clamp(2rem, 5vw, 3.8rem); line-height: .95; letter-spacing: -0.02em; margin: 10px 0 14px; }
.ed-sub { font-size: 1.08rem; color: var(--muted); max-width: 40em; margin: 0; }
.ed-rule { border: 0; border-top: 1px solid var(--ink); margin: 34px 0; }

/* Dos columnas asimétricas: declaración a la izquierda, acción a la derecha */
.split { display: grid; grid-template-columns: 6fr 5fr; gap: 56px; align-items: start; padding: 40px 6px 60px; max-width: 1100px; margin: 0 auto; }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; gap: 26px; padding-top: 24px; } }
.split .statement { font-family: var(--font-display); font-weight: 800; font-stretch: 112%; font-size: clamp(1.9rem, 4.4vw, 3.4rem); line-height: .95; letter-spacing: -0.02em; margin: 10px 0 16px; }
.split .statement i { color: var(--gold); }
.form-col { border-top: 1px solid var(--ink); padding-top: 18px; }
.form-col .lbl:first-child { margin-top: 0; }

/* Fases: tres columnas con línea superior; la actual se marca en tinta */
.phase-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 30px 0; }
@media (max-width: 700px) { .phase-strip { grid-template-columns: 1fr; } }
.phase-strip > div { border-top: 1px solid var(--line); padding: 14px 18px 14px 0; }
.phase-strip > div.now { border-top: 3px solid var(--ink); }
.phase-strip > div.past { opacity: .5; }
.phase-strip .n { font-family: var(--font-display); font-weight: 800; font-stretch: 112%; font-size: 2rem; line-height: 1; color: var(--gold); }
.phase-strip h3 { margin: 6px 0 2px; }
.phase-strip p { margin: 0; color: var(--muted); font-size: .92rem; }

/* Bloque de acción principal */
.action { display: grid; grid-template-columns: 1fr auto; gap: 14px 24px; align-items: center; background: var(--ink); color: var(--paper); padding: 22px 24px; margin: 10px 0 0; }
@media (max-width: 700px) { .action { grid-template-columns: 1fr; } }
.action h2 { color: var(--paper); font-size: 1.5rem; margin: 0; }
.action p { margin: 4px 0 0; color: #b5afa4; }
.action .btn { margin: 0; background: var(--gold); border-color: var(--gold); color: var(--gold-ink); width: auto; padding: 15px 26px; }
.action .btn.ghost { background: transparent; color: var(--paper); border-color: #5a554d; }
.action form { margin: 0; }
.notice { border-left: 3px solid var(--gold); padding: 8px 0 8px 14px; margin: 14px 0; }

/* Lista de datos (definición) con líneas finas */
.facts-list { display: grid; grid-template-columns: max-content 1fr; gap: 0 24px; margin: 0; }
.facts-list dt, .facts-list dd { margin: 0; padding: 10px 0; border-top: 1px solid var(--line); }
.facts-list dt { color: var(--muted); font-size: .88rem; }

/* Resultados: podio editorial */
.podium-first, .podium-rest figure { margin: 0; }
.podium-first img, .podium-rest img { width: 100%; height: auto; max-height: 80vh; object-fit: contain; background: var(--stage); display: block; }
.podium-rest { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 28px; margin-top: 40px; }
.place { display: flex; align-items: baseline; gap: 14px; margin-top: 12px; border-top: 1px solid var(--ink); padding-top: 10px; }
.place .num { font-family: var(--font-display); font-weight: 800; font-stretch: 112%; font-size: 3.4rem; line-height: .8; color: var(--gold); }
.place .who { font-family: var(--font-display); font-weight: 800; font-stretch: 112%; font-size: 1.3rem; line-height: 1.05; }
.place .code { color: var(--muted); font-size: .85rem; }

/* Panel: filas en vez de tarjetas */
.rows { border-top: 1px solid var(--ink); }
.row-link { display: grid; grid-template-columns: 180px 1fr auto; gap: 18px; align-items: baseline; padding: 18px 0; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.row-link:hover h3 { text-decoration: underline; }
.row-link h3 { font-family: var(--font-display); font-weight: 800; font-stretch: 112%; font-size: 1.3rem; margin: 0; line-height: 1.05; }
.row-link .meta { color: var(--muted); font-size: .88rem; }
@media (max-width: 700px) { .row-link { grid-template-columns: 1fr; gap: 4px; } }
.section-num { display: grid; grid-template-columns: 70px 1fr; gap: 18px; border-top: 1px solid var(--ink); padding: 22px 0 30px; }
.section-num > .n { font-family: var(--font-display); font-weight: 800; font-stretch: 112%; font-size: 2.6rem; line-height: .9; color: var(--gold); }
.section-num h3 { margin: 4px 0 8px; font-size: 1.15rem; }
@media (max-width: 600px) { .section-num { grid-template-columns: 1fr; gap: 6px; } }
.stats.ed-stats { gap: 0; border-top: 1px solid var(--ink); }
.stats.ed-stats .stat { border: 0; border-right: 1px solid var(--line); border-radius: 0; background: none; padding: 16px 16px 16px 0; }
.stats.ed-stats .stat:last-child { border-right: 0; }

/* Botón ocupado: aviso inmediato al tocar (evita dobles toques) */
.btn.busy, button.busy { opacity: .75; pointer-events: none; }
.btn.busy::after, button.busy::after { content: ""; display: inline-block; width: .9em; height: .9em; margin-left: .55em; vertical-align: -.1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Menú de cuenta del participante */
.my-link { font-weight: 600; font-size: .88rem; color: var(--ink); text-decoration: none; border: 1px solid var(--ink); padding: 6px 10px; border-radius: 2px; white-space: nowrap; }
body.fixed .my-link { color: #f1efe9; border-color: #5a554d; }

/* Avatar (foto de WhatsApp o iniciales) */
.avatar { border-radius: 50%; object-fit: cover; display: inline-block; flex: none; background: var(--line); }
.avatar-ini { display: inline-grid; place-items: center; font-weight: 700; color: var(--paper); background: var(--ink); letter-spacing: .02em; }
.me-chip { display: inline-flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; font-size: .88rem; font-weight: 600; }
body.fixed .me-chip { color: #f1efe9; }
@media (max-width: 520px) { .me-chip .me-name { display: none; } }
/* Encabezado en celular: si los enlaces no caben junto al logo, pasan a una segunda fila (nunca encima). */
@media (max-width: 700px) {
    .site-header { flex-wrap: wrap; row-gap: 10px; }
    .site-header > div:first-child { flex: 0 1 auto; max-width: 100%; }
    .header-right { flex-wrap: wrap; justify-content: flex-end; margin-left: auto; gap: 8px; }
}
@media (max-width: 520px) {
    .hide-sm { display: none; }
    .site-header .header-right { width: 100%; }
    .my-link { font-size: .8rem; padding: 5px 8px; }
}

/* Logo de la organización junto a su nombre */
.org-crumb { display: inline-flex; align-items: center; gap: 6px; }
.org-crumb img { width: 18px; height: 18px; object-fit: contain; border-radius: 3px; }

/* Marca de la organización y portada del concurso */
.contest-cover { margin: 0 0 22px; }
.contest-cover img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.org-line { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; font-weight: 600; font-size: .95rem; }
.org-line img { width: 40px; height: 40px; object-fit: contain; border: 1px solid var(--line); background: #fff; }
