:root {
    --fondo: #f6f2f7;
    --texto: #2e2a33;
    --suave: #7a7382;
    --borde: #e6dfe9;
    --acento: #8a4f9e;
    --acentoClaro: #f3e9f7;
    --dorado: #c9a24d;
}

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

body {
    font-family: "Montserrat", "Segoe UI", system-ui, sans-serif;
    font-size: 15px;
    color: var(--texto);
    background: var(--fondo);
    padding-bottom: 40px;
}

/* ---------- ENCABEZADO ---------- */
.encabezado {
    text-align: center;
    color: #fff;
    padding: 34px 20px 70px;
    background: linear-gradient(160deg, #5a2a3c, #1d1420);
}
.encabezado small { letter-spacing: 5px; text-transform: uppercase; color: #e6c97c; font-size: .75rem; }
.encabezado h1 { font-family: "Great Vibes", cursive; font-weight: 400; font-size: clamp(2.6rem, 11vw, 4rem); margin: 6px 0 8px; }
.encabezado p { opacity: .85; font-weight: 300; max-width: 380px; margin: 0 auto; line-height: 1.5; }

main { max-width: 520px; margin: -46px auto 0; padding: 0 14px; display: grid; gap: 14px; }

/* ---------- TARJETAS ---------- */
.tarjeta {
    background: #fff;
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 6px 24px rgba(60, 20, 70, .08);
    display: grid;
    gap: 12px;
}

h2 { font-size: 1.05rem; font-weight: 600; display: flex; align-items: center; gap: 10px; }
h2 span {
    width: 26px; height: 26px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--acento); color: #fff; font-size: .85rem;
}
h2 em { font-style: normal; font-weight: 400; color: var(--suave); font-size: .9rem; }

.ayuda { color: var(--suave); font-size: .82rem; line-height: 1.45; }

/* ---------- ZONAS PARA SUBIR ---------- */
.zona {
    display: grid;
    gap: 4px;
    text-align: center;
    padding: 22px 14px;
    border: 2px dashed #d6c3de;
    border-radius: 14px;
    background: var(--acentoClaro);
    cursor: pointer;
}
.zona b { color: var(--acento); }
.zona span { font-size: .82rem; color: var(--suave); }
.zona.chica { padding: 14px; }

.zona.auto {
    border: none;
    background: linear-gradient(135deg, #8e44ad, #c0507a);
    box-shadow: 0 8px 22px rgba(142, 68, 173, .3);
    padding: 28px 14px;
}
.zona.auto b { color: #fff; font-size: 1.15rem; }
.zona.auto span { color: rgba(255, 255, 255, .88); }
.zona.encima { filter: brightness(1.1); }

/* ---------- ESTILOS ---------- */
.mas summary { cursor: pointer; color: var(--acento); font-weight: 600; font-size: .9rem; }
.estilos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.estilo {
    font: inherit; border: 2px solid transparent; border-radius: 12px; padding: 0;
    overflow: hidden; cursor: pointer; background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}
.estilo.activo { border-color: var(--acento); box-shadow: 0 0 0 3px var(--acentoClaro); }
.estilo div { height: 60px; display: grid; place-items: center; font-size: 20px; color: #fff; -webkit-text-stroke: 1px rgba(0, 0, 0, .6); }
.estilo b { display: block; font-size: 12px; padding: 6px; }

/* ---------- VISTA PREVIA ---------- */
.vista { justify-items: center; }
#lienzo {
    width: min(100%, 330px);
    aspect-ratio: 9 / 16;
    border-radius: 18px;
    background: #000;
    box-shadow: 0 16px 40px rgba(0, 0, 0, .25);
}
.controles { display: flex; align-items: center; gap: 10px; width: 100%; }
.controles .bt { white-space: nowrap; }
.controles input { flex: 1; accent-color: var(--acento); }
#textoTiempo { min-width: 48px; color: var(--suave); font-size: .85rem; text-align: right; }

/* ---------- DATOS ---------- */
#formDatos { display: grid; gap: 10px; }
#formDatos label { display: grid; gap: 4px; font-size: .85rem; color: var(--suave); }
#formDatos input {
    font: inherit; font-size: 16px; color: var(--texto);
    padding: 11px 12px; border: 1px solid var(--borde); border-radius: 10px; background: #fdfcfe;
}
#formDatos input:focus { outline: none; border-color: var(--acento); box-shadow: 0 0 0 3px var(--acentoClaro); }

/* ---------- BOTONES ---------- */
.bt {
    font: inherit; font-weight: 600; padding: 10px 16px; border-radius: 10px;
    border: 1px solid var(--borde); background: #fff; color: var(--texto); cursor: pointer;
}
.bt.principal { background: var(--acento); border-color: var(--acento); color: #fff; }
.bt.grande { padding: 15px; font-size: 1.05rem; width: 100%; }

/* ---------- DERECHOS ---------- */
.derechos {
    display: flex; gap: 10px; align-items: flex-start;
    font-size: .85rem; line-height: 1.45; color: var(--suave);
    padding: 12px; border-radius: 12px; background: #faf7fb; border: 1px solid var(--borde);
}
.derechos input { width: 20px; height: 20px; margin-top: 1px; flex: none; accent-color: var(--acento); }
.derechos.falta { border-color: #d9534f; background: #fdf1f1; color: #a33; }

.pie { text-align: center; color: var(--suave); font-size: .85rem; line-height: 1.6; margin-top: 6px; }

/* ---------- AVISOS ---------- */
.aviso {
    position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 30px);
    background: #2e2a33; color: #fff; padding: 11px 16px; border-radius: 10px;
    font-size: .9rem; opacity: 0; pointer-events: none; transition: .25s; z-index: 30;
    width: max-content; max-width: 90vw; text-align: center;
}
.aviso.ver { opacity: 1; transform: translate(-50%, 0); }

.grabando {
    position: fixed; inset: 0; background: rgba(20, 10, 30, .75);
    display: grid; place-items: center; z-index: 20; color: #fff; text-align: center; padding: 16px;
}
.grabando > div { max-width: 320px; display: grid; gap: 10px; }
.grabando b { font-size: 1.2rem; }
.progreso { height: 10px; border-radius: 10px; background: rgba(255, 255, 255, .2); overflow: hidden; }
.progreso i { display: block; height: 100%; width: 0; background: var(--dorado); }

/* Miniaturas de las imágenes subidas */
.imgs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-top: 10px; }
.imgs:empty { display: none; }
.img { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 0 0 / 14px 14px; border: 1px solid #e4dfe8; }
.img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.img span { position: absolute; top: 2px; left: 2px; background: #8e44ad; color: #fff; font-size: 10px; padding: 0 5px; border-radius: 5px; }
.img button { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border: none; border-radius: 50%; background: rgba(255, 255, 255, .92); font-size: 11px; line-height: 20px; padding: 0; cursor: pointer; }
@media (max-width: 380px) { .imgs { grid-template-columns: repeat(3, 1fr); } }
