/* Spec 428: the guest landing's "Free, no account needed" tiles, loaded on the landing only (home-landing.css also
   serves the rules pages). */

.gl-free {
    padding: 0.5rem 0 1.75rem;
    /* The sticky top bar must not cover the heading after the hero's anchor jump. */
    scroll-margin-top: 4.5rem;
}

.gl-free-lead {
    margin: -0.4rem 0 1rem;
    color: var(--gl-muted);
}

.gl-free-tiles {
    display: grid;
    gap: 0.75rem;
}

.gl-free-tile {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    min-width: 0;
    padding: 0.85rem 1rem;
    border-top: 3px solid var(--tt-rule);
    background: var(--tt-area);
    color: var(--gl-text);
    text-decoration: none;
    transition: transform 0.15s ease;
}

.guest-landing a.gl-free-tile {
    color: var(--gl-text);
}

.gl-free-tile:hover,
.gl-free-tile:focus-visible {
    transform: translateY(-3px);
}

.gl-free-teaser {
    flex: 0 0 64px;
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    background: var(--tt-field);
    color: var(--tt-accent);
    overflow: hidden;
}

.gl-free-text {
    display: grid;
    gap: 0.2rem;
    min-width: 0;
}

.gl-free-head {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--tt-accent);
}

.gl-free-icon {
    flex: 0 0 auto;
}

.gl-free-tile h3 {
    font-size: 1.05rem;
    line-height: 1.25;
}

.gl-free-hook {
    color: var(--gl-muted);
    font-size: 0.92rem;
}

.gl-free-action {
    color: var(--tt-accent);
    font-size: 0.9rem;
    font-weight: 700;
}

.gl-free-note {
    margin-top: 1rem;
    color: var(--gl-muted);
}

/* Rule 5: the die - a 3 x 3 grid of pips, the face in data-face; it tumbles while .is-playing. */
.gl-free-die {
    display: grid;
    grid-template-columns: repeat(3, 8px);
    grid-template-rows: repeat(3, 8px);
    gap: 4px;
    padding: 7px;
    background: var(--tt-ink);
}

.gl-free-die .gl-free-dice-pip {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--tt-page);
    visibility: hidden;
}

.gl-free-die[data-face="1"] .gl-free-dice-pip:nth-child(5),
.gl-free-die[data-face="2"] .gl-free-dice-pip:is(:nth-child(1), :nth-child(9)),
.gl-free-die[data-face="3"] .gl-free-dice-pip:is(:nth-child(1), :nth-child(5), :nth-child(9)),
.gl-free-die[data-face="4"] .gl-free-dice-pip:is(:nth-child(1), :nth-child(3), :nth-child(7), :nth-child(9)),
.gl-free-die[data-face="5"] .gl-free-dice-pip:is(:nth-child(1), :nth-child(3), :nth-child(5), :nth-child(7), :nth-child(9)),
.gl-free-die[data-face="6"] .gl-free-dice-pip:is(:nth-child(1), :nth-child(3), :nth-child(4), :nth-child(6), :nth-child(7), :nth-child(9)) {
    visibility: visible;
}

.is-playing .gl-free-die {
    animation: gl-free-roll 0.6s ease-out;
}

@keyframes gl-free-roll {
    0% { transform: rotate(0) scale(1); }
    40% { transform: rotate(200deg) scale(0.8); }
    70% { transform: rotate(330deg) scale(1.08); }
    100% { transform: rotate(360deg) scale(1); }
}

/* The podium: three bars that swap heights while .is-playing. */
.gl-free-podium {
    display: flex;
    align-items: flex-end;
    gap: 5px;
    height: 40px;
}

.gl-free-podium i {
    width: 11px;
    background: var(--tt-accent);
    transition: height 0.45s ease;
}

.gl-free-podium i:nth-child(1) { height: 26px; }
.gl-free-podium i:nth-child(2) { height: 40px; }
.gl-free-podium i:nth-child(3) { height: 16px; opacity: 0.75; }
.is-playing .gl-free-podium i:nth-child(1) { height: 40px; }
.is-playing .gl-free-podium i:nth-child(2) { height: 18px; }
.is-playing .gl-free-podium i:nth-child(3) { height: 30px; }

/* The quiz card: "?" turns to "!" while .is-playing. */
.gl-free-card {
    position: relative;
    width: 32px;
    height: 42px;
    transition: transform 0.5s ease;
    transform-style: preserve-3d;
}

.gl-free-card b {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: var(--tt-accent);
    color: var(--tt-on-accent);
    font-size: 1.4rem;
    font-weight: 800;
    backface-visibility: hidden;
}

.gl-free-card b:last-child {
    transform: rotateY(180deg);
}

.is-playing .gl-free-card {
    transform: rotateY(180deg);
}

/* The headlines: three lines of a page that slide in while .is-playing. */
.gl-free-lines {
    display: grid;
    gap: 6px;
    width: 40px;
}

.gl-free-lines i {
    height: 5px;
    background: var(--tt-muted);
}

.gl-free-lines i:first-child {
    height: 7px;
    background: var(--tt-accent);
}

.gl-free-lines i:last-child {
    width: 65%;
}

.is-playing .gl-free-lines i {
    animation: gl-free-slide 0.5s ease-out both;
}

.is-playing .gl-free-lines i:nth-child(2) { animation-delay: 0.08s; }
.is-playing .gl-free-lines i:nth-child(3) { animation-delay: 0.16s; }

@keyframes gl-free-slide {
    from { transform: translateX(-120%); }
    to { transform: translateX(0); }
}

@media (min-width: 600px) {
    .gl-free-tiles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1000px) {
    .gl-free-tiles {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .gl-free-tile {
        flex-direction: column;
        align-items: flex-start;
    }
}
