body {
    margin: 0;
    padding: 0;
    background-color: #f4f6f9;
    color: #333;
    user-select: text;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    height: var(--headerHeight-large);
    font-size: 2rem;
    width: 100%;

    .logo {
        margin-left: 0.5em;
        height: 70px;
    }
}

h1,
h2,
h3 {
    margin: 0;
    font-weight: 700;
}

/* The top strip: what the site is, and the join box for players */
.hero {
    background:
        linear-gradient(120deg, rgba(2, 80, 140, 0.92), rgba(2, 150, 224, 0.82)),
        url('/images/welcome.jpeg') center / cover;
    color: #fff;
}

.hero-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 3rem 2rem;
    display: flex;
    align-items: center;
    gap: 3rem;
}

.hero-text {
    flex: 1;

    h1 {
        font-size: 2.6rem;
        line-height: 1.2;
        margin-bottom: 1rem;
    }

    p {
        font-size: 1.25rem;
        line-height: 1.5;
        margin: 0;
        opacity: 0.95;
    }
}

.join-card {
    flex: 0 1 380px;
    background: #fff;
    color: #333;
    border-radius: 12px;
    padding: 1.75rem;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);

    h2 {
        color: #0296e0;
        font-size: 1.6rem;
        margin-bottom: 0.25rem;
    }

    p {
        margin: 0 0 1rem 0;
    }
}

.join-form {
    display: flex;
    gap: 0.5rem;

    sl-input {
        flex: 1;
    }

    sl-input::part(input) {
        text-transform: uppercase;
        letter-spacing: 0.2em;
        font-weight: 600;
    }
}

/* Small "who is this for" label above the player and quizmaster headings */
.card-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #0296e0;
    margin-bottom: 0.4rem;
}

.google-login {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.8rem 1.5rem;
    background: #fff;
    border-radius: 8px;
    color: #3c4043;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);

    img {
        width: 22px;
        height: 22px;
    }

    &:hover {
        background: #f1f5fa;
    }
}

.container {
    flex: 1;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 2.5rem 2rem 3rem;
    box-sizing: border-box;
}

/* Quizmasters: a section of its own, dark so it can't be mistaken for the players' join box */
.quizmasters {
    background: linear-gradient(135deg, #1c2633, #2c3e55);
    color: #fff;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2.5rem;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);

    .card-label {
        color: #7cc8f5;
    }

    h2 {
        font-size: 1.8rem;
        line-height: 1.25;
        margin-bottom: 0.5rem;
    }

    .quizmasters-head p {
        margin: 0;
        font-size: 1.1rem;
        color: #d0d8e2;
    }
}

.quizmasters-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 1.75rem;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.feature {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 1.25rem;

    i {
        font-size: 1.6rem;
        color: #7cc8f5;
        margin-bottom: 0.75rem;
    }

    h3 {
        font-size: 1.1rem;
        margin-bottom: 0.4rem;
    }

    p {
        margin: 0;
        line-height: 1.5;
        color: #c3ccd7;
    }
}

/* The Roaring Meg */
.meg {
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border-top: 5px solid #0296e0;

    h2 {
        color: #0296e0;
        font-size: 1.8rem;
        line-height: 1.25;
        margin-bottom: 1rem;
    }
}

.meg-when {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;

    > * {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        background: #e8f5fd;
        color: #02507f;
        padding: 0.5rem 1rem;
        border-radius: 999px;
        font-weight: 600;
        text-decoration: none;
    }

    a:hover {
        background: #d4ecfb;
    }
}

.meg-body {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.video {
    flex: 1.2;

    iframe {
        width: 100%;
        aspect-ratio: 16 / 9;
        border: 0;
        border-radius: 8px;
        display: block;
    }
}

.meg-text {
    flex: 1;

    p {
        font-size: 1.1rem;
        line-height: 1.6;
        margin: 0 0 1rem 0;
    }

    .meg-welcome {
        font-weight: 600;
        color: #02507f;
    }
}

/* The quiz's story at the Roaring Meg, under the current venue */
.meg-history {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f4f9fd;
    border-left: 4px solid #0296e0;
    border-radius: 0 8px 8px 0;

    h3 {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        color: #02507f;
        font-size: 1.25rem;
        margin-bottom: 0.75rem;
    }

    p {
        line-height: 1.6;
        margin: 0 0 0.75rem 0;
    }

    p:last-child {
        margin-bottom: 0;
    }
}

footer {
    background-color: #333;
    color: #ccc;
    text-align: center;
    padding: 0.5rem 0;

    a {
        color: #fff;
    }
}

@media (max-width: 840px) {
    header {
        height: var(--headerHeight);
        font-size: 1.4rem;

        .logo {
            height: 38px;
        }
    }

    .hero-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 1.5rem;
        padding: 1.5rem 1rem;
    }

    .hero-text h1 {
        font-size: 1.9rem;
    }

    .hero-text p {
        font-size: 1.05rem;
    }

    .join-card {
        flex-basis: auto;
        padding: 1.25rem;
    }

    .container {
        padding: 1.5rem 1rem 2rem;
    }

    .quizmasters {
        padding: 1.25rem;
        margin-bottom: 1.5rem;

        h2 {
            font-size: 1.4rem;
        }
    }

    .quizmasters-head {
        flex-direction: column;
        align-items: stretch;
        gap: 1.25rem;
        margin-bottom: 1.25rem;
    }

    .features {
        gap: 0.75rem;
    }

    /* Icon beside the text, so the four cards don't fill the whole phone screen */
    .feature {
        display: grid;
        grid-template-columns: 2.25rem 1fr;
        padding: 1rem;

        i {
            grid-row: span 2;
            margin: 0;
        }
    }

    .meg {
        padding: 1.25rem;

        h2 {
            font-size: 1.4rem;
        }
    }

    .meg-body {
        flex-direction: column;
    }

    .video {
        width: 100%;
    }
}

/* join.html - the player-only page (play.ecke.uk): one centred join box filling the page */
.join-page {
    .hero {
        flex: 1;
        display: flex;
        align-items: center;
    }

    .hero-inner {
        justify-content: center;
        width: 100%;
        box-sizing: border-box;
    }

    .join-card {
        flex: 0 1 420px;
        text-align: center;

        h1 {
            color: #0296e0;
            font-size: 2rem;
            margin-bottom: 0.25rem;
        }

        p {
            font-size: 1.1rem;
        }
    }

    .join-logo {
        width: 140px;
        height: 140px;
        margin: 0 auto 1rem;
        display: block;
    }

    @media (max-width: 840px) {
        .join-card {
            flex: none; /* stacked layout: 420px would become the card's height */
        }

        .join-logo {
            width: 110px;
            height: 110px;
        }
    }
}
