/* ============================================================
   COMPATIBILIDAD

   La pagina tiene que verse de lejos: el numero es el
   protagonista y todo lo demas lo explica.
   ============================================================ */

.match {
    max-width: 58rem;
    margin-inline: auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

.match__title {
    margin: 0;
    font-size: clamp(1.8rem, 6vw, 3rem);
    line-height: var(--leading-tight);
}

.match__lead {
    max-width: 50ch;
    margin: var(--space-2) auto 0;
    color: var(--text-secondary);
    text-wrap: pretty;
}

/* --- Los dos selectores -------------------------------------- */

.match__form {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: end;
    gap: var(--space-3);
    padding: var(--space-5);
    background: var(--surface-celestial);
    border: var(--border-width) solid var(--border-accent);
    border-radius: var(--radius-lg);
    box-shadow: var(--ring-gold), var(--shadow-md);
}

.match__go {
    grid-column: 1 / -1;
    justify-self: center;
}

@media (max-width: 639px) {
    .match__form {
        grid-template-columns: 1fr;
    }
}

.match__join {
    /* Late despacio: es lo unico que dice que esto va de una pareja y no
       de dos consultas puestas una al lado de la otra. */
    padding-bottom: var(--space-2);
    font-size: 1.75rem;
    color: var(--secondary-contrast);
    animation: match-beat 2.6s var(--ease-in-out) infinite;
}

@keyframes match-beat {
    0%, 100% { transform: scale(1); }
    12%      { transform: scale(1.18); }
    24%      { transform: scale(1); }
    36%      { transform: scale(1.12); }
    48%      { transform: scale(1); }
}

/* --- La rueda -------------------------------------------------
   El angulo del degradado es el propio resultado, asi que lo que
   se ve es el numero y no una ilustracion de un numero.
   -------------------------------------------------------------- */

.match__result {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    text-align: center;
    padding: var(--space-6) var(--space-5);
    background: var(--surface-celestial-strong);
    border: var(--border-width) solid var(--border-accent);
    border-radius: var(--radius-lg);
    box-shadow: var(--ring-gold-strong), var(--shadow-lg);
}

/* `@property` es lo que permite animar un numero. Sin registrarlo, el
   navegador trata `--score` como texto y la rueda salta de golpe al
   valor final en vez de llenarse. */
@property --score {
    syntax: "<number>";
    inherits: true;
    initial-value: 0;
}

.match__dial {
    position: relative;
    display: grid;
    place-items: center;
    width: clamp(10rem, 34vw, 14rem);
    aspect-ratio: 1;
    border-radius: 50%;
    background: conic-gradient(
        from -90deg,
        var(--gold-bright) 0deg,
        var(--secondary) calc(var(--score, 0) * 3.6deg),
        color-mix(in srgb, var(--secondary) 14%, transparent) calc(var(--score, 0) * 3.6deg)
    );
    animation: match-fill 1100ms var(--ease-out) both;
}

@keyframes match-fill {
    from {
        --score: 0;
        opacity: 0.4;
        transform: rotate(-12deg) scale(0.92);
    }
    to {
        opacity: 1;
        transform: rotate(0) scale(1);
    }
}

.match__dial-face {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.1em;
    width: 78%;
    height: 78%;
    border-radius: 50%;
    background: var(--bg-surface);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold) 30%, transparent);
}

.match__score {
    align-self: center;
    font-family: var(--font-display);
    font-size: clamp(2.75rem, 10vw, 4.25rem);
    font-weight: var(--weight-bold);
    line-height: 1;
    /* Tabulares: el numero cuenta hacia arriba y no puede mover el `%`
       de al lado en cada fotograma. */
    font-variant-numeric: lining-nums tabular-nums;
    color: var(--text-primary);
}

.match__percent {
    align-self: center;
    font-size: var(--text-lg);
    font-weight: var(--weight-semibold);
    color: var(--accent-ink);
}

.match__pair {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-wrap: wrap;
    justify-content: center;
    font-size: var(--text-lg);
}

.match__sign {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: var(--weight-semibold);
}

.match__symbol {
    font-size: 1.5rem;
    color: var(--secondary-contrast);
}

.match__amp {
    color: var(--accent-ink);
    font-weight: var(--weight-bold);
}

.match__verdict {
    margin: var(--space-2) 0 0;
    font-size: clamp(1.4rem, 5vw, 2.25rem);
    line-height: var(--leading-tight);
}

.match__verdict-note {
    max-width: 46ch;
    margin: 0;
    color: var(--text-secondary);
    text-wrap: pretty;
}

.match__aspect {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin: var(--space-2) 0 0;
    padding: var(--space-1) var(--space-4);
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    color: var(--accent-ink);
    background: var(--gold-soft);
    border-radius: var(--radius-pill);
}

.match__aspect .material-symbols-rounded {
    font-size: 1.05rem;
}

/* --- El porque ------------------------------------------------- */

.match__why-title {
    margin: 0 0 var(--space-4);
    font-size: var(--text-xl);
    text-align: center;
}

.match__factors {
    display: grid;
    gap: var(--space-3);
    margin: 0;
    padding: 0;
    list-style: none;
}

.match__factor {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    padding: var(--space-4);
    background: var(--surface-celestial);
    border: var(--border-width) solid var(--border);
    border-left: 3px solid var(--secondary);
    border-radius: var(--radius-md);
}

.match__factor-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
}

.match__factor-label {
    font-size: var(--text-2xs);
    font-weight: var(--weight-bold);
    letter-spacing: var(--tracking-wider);
    text-transform: uppercase;
    color: var(--accent-ink);
}

.match__factor-points {
    font-size: var(--text-xs);
    font-weight: var(--weight-bold);
    font-variant-numeric: lining-nums tabular-nums;
    color: var(--secondary-contrast);
}

.match__factor-note {
    line-height: var(--leading-normal);
    color: var(--text-primary);
    text-wrap: pretty;
}

/* --- Cada uno en el amor --------------------------------------- */

.match__inlove {
    display: grid;
    gap: var(--space-4);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
}

.match__card {
    padding: var(--space-5);
    background: var(--surface-celestial);
    border: var(--border-width) solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--ring-gold), var(--shadow-sm);
}

.match__card-title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0 0 var(--space-2);
    font-size: var(--text-lg);
}

.match__card-text {
    margin: 0;
    line-height: var(--leading-normal);
    color: var(--text-secondary);
    text-wrap: pretty;
}

/* --- Avisos ----------------------------------------------------- */

.match__note,
.match__empty {
    max-width: 52ch;
    margin-inline: auto;
    text-align: center;
    font-size: var(--text-sm);
    color: var(--text-muted);
    text-wrap: pretty;
}

@media (prefers-reduced-motion: reduce) {
    .match__join,
    .match__dial {
        animation: none;
    }
}

/* El signo al que corresponde la fecha, debajo del campo: confirma que
   la web entendio bien antes de pulsar nada. */
.match__resolved {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin: var(--space-2) 0 0;
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    color: var(--secondary-contrast);
}

/* La via de los signos, para quien ya sabe el suyo. Plegada, porque son
   dos formas de hacer lo mismo y ensenar las dos a la vez obliga a
   elegir antes de entender. */
.match__by-sign {
    margin-top: calc(var(--space-5) * -1);
}

.match__by-sign > summary {
    cursor: pointer;
    padding: var(--space-2) 0;
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.match__by-sign > summary:hover {
    color: var(--secondary-contrast);
}

.match__form--signs {
    margin-top: var(--space-3);
    box-shadow: var(--ring-gold), var(--shadow-sm);
}
