/* Bundled: style.css + letter-filter.css + lazy-load.css + wobble-tiles.css + typewriter-effect.css + modern-effects.css + chain-game.css + lockword-game.css + bridge-game.css + game-history.css */
/* Generated by scripts/build_css_bundle.sh - do not edit directly */
/* Common CSS for Pangram application */
:root {
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --accent-color: #f72585;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --success-color: #4cc9f0;
    
    /* Extended color palette */
    --primary-light: #7b90f5;
    --primary-dark: #2a3f9d;
    --accent-light: #ff6ba8;
    --accent-dark: #c01e66;
    --neutral-100: #ffffff;
    --neutral-200: #f8f9fa;
    --neutral-300: #e9ecef;
    --neutral-400: #dee2e6;
    --neutral-500: #adb5bd;
    --neutral-600: #6c757d;
    --neutral-700: #495057;
    --neutral-800: #343a40;
    --neutral-900: #212529;
    /* Dark navy behind every game statistic number. It had no token and was
       written out eight times across the two game stylesheets. */
    --game-stat-navy: #26347a;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
    padding-top: 40px;
    color: var(--dark-color);
    line-height: 1.6;
}

.site-header {
    margin-bottom: 2rem;
}

/* Improved mobile responsiveness */
@media (max-width: 768px) {
    body {
        padding-top: 10px;
    }
    
    .container {
        padding-left: 12px;
        padding-right: 12px;
    }
    
    .pangram-title {
        font-size: 1.8rem;
    }

    .site-header {
        margin-bottom: .85rem;
    }
    
    .pangram-slogan {
        font-size: 1.05rem;
    }
    
    .list-group-item {
        padding: 12px 15px;
    }
    
    .word-title {
        font-size: 2rem;
    }
}

/* Homepage: one clear task first, followed by the daily game and a concise
   explanation. The landing page drops the old outer card so a phone does not
   pay for three nested layers of horizontal padding. Search-result pages keep
   that outer card because it groups long result lists. */
.home-landing-page .pangram-container {
    overflow: visible;
    padding: 0;
    border-top: 0;
    background: transparent !important;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.home-landing-page .pangram-container:hover {
    transform: none;
    box-shadow: none;
}

.home-search-card {
    overflow: hidden;
    border: 1px solid rgba(67, 97, 238, .14);
    border-radius: 1.2rem;
    background: #fff;
    box-shadow: 0 .9rem 2.3rem rgba(38, 52, 122, .10);
}

.home-search-intro {
    padding: 1.6rem 1.75rem 1.15rem;
    background:
        radial-gradient(circle at 95% 0, rgba(247, 37, 133, .10), transparent 38%),
        linear-gradient(135deg, rgba(67, 97, 238, .08), rgba(114, 9, 183, .035));
}

.home-eyebrow {
    display: inline-block;
    margin-bottom: .35rem;
    color: var(--primary-color);
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.home-search-intro h2,
.home-section-heading h2 {
    margin: 0;
    color: var(--primary-dark);
    font-size: clamp(1.45rem, 3vw, 2rem);
    font-weight: 800;
    letter-spacing: -.035em;
}

.home-search-intro p,
.home-section-heading p {
    margin: .45rem 0 0;
    color: var(--neutral-600);
    font-size: .94rem;
}

.search-example {
    display: flex;
    align-items: center;
    gap: .45rem;
    margin-top: .85rem;
}

.search-example-letters {
    display: inline-flex;
    gap: .2rem;
}

.search-example-letter,
.search-example-word {
    display: inline-grid;
    height: 2.2rem;
    place-items: center;
    border-radius: .5rem;
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1;
}

.search-example-letter {
    width: 2rem;
    border: 1px solid rgba(67, 97, 238, .25);
    background: #fff;
    color: var(--primary-dark);
    text-transform: uppercase;
}

.search-example-word {
    padding: 0 .75rem;
    background: #2b2d7c;
    color: #fff;
}

.search-example-joint {
    flex: none;
    width: 1.9rem;
    height: 1.9rem;
}

.home-search-body {
    padding: 1.3rem 1.75rem 1.55rem;
}

.home-search .input-group {
    height: 3.35rem;
    min-height: 3.35rem;
    overflow: hidden;
    border: 2px solid var(--neutral-300);
    border-radius: .85rem;
}

.home-search .input-group:focus-within {
    border-color: var(--primary-color);
}

.home-search .input-group-text,
.home-search .form-control {
    min-height: 0;
    border: 0;
}

.home-search .input-group-text {
    padding-left: 1rem;
    border-radius: 0;
}

.home-search .form-control {
    border-radius: 0;
}

.home-search .form-control:focus {
    box-shadow: none;
    transform: none;
}

.home-search-help {
    line-height: 1.4;
}

.home-search-actions {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(9rem, 1fr);
    gap: .65rem;
}

.home-search-actions .btn {
    display: inline-flex;
    min-height: 3rem;
    align-items: center;
    justify-content: center;
}

.home-facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 1.1rem 0 2.7rem;
    border: 1px solid rgba(67, 97, 238, .12);
    border-radius: 1rem;
    background: rgba(255, 255, 255, .82);
    box-shadow: 0 .45rem 1.3rem rgba(38, 52, 122, .06);
}

.home-fact {
    display: flex;
    min-width: 0;
    padding: .95rem;
    align-items: center;
    gap: .7rem;
}

.home-fact + .home-fact {
    border-left: 1px solid var(--neutral-300);
}

.home-fact i {
    display: grid;
    width: 2.35rem;
    height: 2.35rem;
    flex: 0 0 auto;
    place-items: center;
    border-radius: .75rem;
    background: rgba(67, 97, 238, .1);
    color: var(--primary-color);
}

.home-fact span {
    display: grid;
    min-width: 0;
    color: var(--neutral-600);
    font-size: .72rem;
    line-height: 1.3;
}

.home-fact strong {
    overflow-wrap: anywhere;
    color: var(--primary-dark);
    font-size: .96rem;
}

/* "Popular today": word links from pangrammer_insights. The radios before the
   list choose what it shows: nothing, a definition per word with its letters
   as dots, or the definition with the word. */
.home-popular {
    display: flex;
    margin: 1.1rem 0 1.4rem;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: .4rem .7rem;
    text-align: center;
}

.home-popular-title {
    margin: 0;
    color: var(--neutral-600);
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.home-popular-title i {
    margin-right: .35rem;
    color: var(--primary-color);
}

.home-popular-views {
    display: inline-flex;
    max-width: 100%;
    overflow: hidden;
    border: 1px solid rgba(67, 97, 238, .18);
    border-radius: 999px;
    background: rgba(255, 255, 255, .82);
}

.home-popular-views label {
    display: block;
    margin: 0;
    padding: .38rem .8rem;
    color: var(--primary-dark);
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
}

.home-popular-views label + label {
    border-left: 1px solid rgba(67, 97, 238, .18);
}

.home-popular-views label:hover {
    background: rgba(67, 97, 238, .1);
}

#popular-words-none:checked ~ .home-popular-views label[for="popular-words-none"],
#popular-words-hint:checked ~ .home-popular-views label[for="popular-words-hint"],
#popular-words-show:checked ~ .home-popular-views label[for="popular-words-show"] {
    background: var(--primary-color);
    color: #fff;
}

#popular-words-none:focus-visible ~ .home-popular-views label[for="popular-words-none"],
#popular-words-hint:focus-visible ~ .home-popular-views label[for="popular-words-hint"],
#popular-words-show:focus-visible ~ .home-popular-views label[for="popular-words-show"] {
    outline: 2px solid var(--primary-dark);
    outline-offset: -2px;
}

.home-popular-note {
    margin: 0;
    color: var(--neutral-600);
    font-size: .75rem;
}

#popular-words-none:checked ~ .home-popular-list,
#popular-words-hint:checked ~ .home-popular-list a,
#popular-words-show:checked ~ .home-popular-list .home-popular-mask,
#popular-words-show:checked ~ .home-popular-list .home-popular-no-definition {
    display: none;
}

.home-popular-list {
    display: grid;
    width: 100%;
    margin: .2rem 0 0;
    padding: 0;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
    gap: .55rem;
    list-style: none;
    text-align: left;
}

.home-popular-list li {
    min-width: 0;
    padding: .55rem .7rem;
    border: 1px solid rgba(67, 97, 238, .12);
    border-radius: 10px;
    background: rgba(255, 255, 255, .82);
}

.home-popular-mask,
.home-popular-list a {
    display: inline-block;
    max-width: 100%;
    overflow-wrap: anywhere;
    color: var(--primary-dark);
    font-weight: 600;
    text-decoration: none;
}

.home-popular-mask {
    letter-spacing: .08em;
}

.home-popular-list a:hover,
.home-popular-list a:focus-visible {
    text-decoration: underline;
}

.home-popular-definition,
.home-popular-no-definition {
    margin: .1rem 0 0;
    color: var(--neutral-700);
    font-size: .85rem;
    line-height: 1.35;
}

.home-popular-no-definition {
    font-style: italic;
}

@media (max-width: 480px) {
    .home-popular-views {
        display: flex;
        width: 100%;
    }

    .home-popular-views label {
        flex: 1 1 auto;
        padding: .55rem .4rem;
        text-align: center;
    }
}

.home-discovery {
    margin-top: 2rem;
}

.home-section-heading {
    margin-bottom: 1rem;
    text-align: center;
}

.home-discovery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .85rem;
}

.home-discovery-card {
    padding: 1.15rem;
    border: 1px solid rgba(67, 97, 238, .12);
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 .45rem 1.25rem rgba(38, 52, 122, .06);
}

/* Generated once with FLUX.2 klein and trimmed to their content. Decorative:
   the heading says the same thing, so alt="" keeps screen readers from
   announcing a picture of tiles. */
.home-discovery-art {
    display: block;
    width: 100%;
    height: 6.5rem;
    margin-bottom: .9rem;
    object-fit: contain;
}

.home-discovery-card h3 {
    margin-bottom: .35rem;
    color: var(--primary-dark);
    font-size: 1rem;
    font-weight: 800;
}

.home-discovery-card p {
    margin: 0;
    color: var(--neutral-600);
    font-size: .8rem;
    line-height: 1.45;
}

.not-found-art {
    display: block;
    width: min(100%, 17.5rem);
    height: auto;
    margin: 0 auto 1.25rem;
}

/* A search tab with nothing in it, and a search with no results at all. */
.results-empty {
    display: grid;
    padding: 1.25rem 1rem 1rem;
    justify-items: center;
    gap: .5rem;
    border: 1px dashed rgba(67, 97, 238, .25);
    border-radius: 1rem;
    background: rgba(67, 97, 238, .04);
    color: var(--neutral-700);
    text-align: center;
}

.results-empty p { margin: 0; }

.results-empty-art {
    width: auto;
    height: 5.5rem;
}

/* The footer title with the tile from the favicon, so the site's mark
   appears once on the page and not only in the browser tab. */
.footer h4.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
}

.footer-brand-logo {
    width: 2rem;
    height: 2rem;
}

.pangram-container {
    background-color: white;
    border-radius: 18px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.08), 0 5px 15px rgba(0,0,0,0.05);
    padding: 40px;
    margin-bottom: 40px;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    border-top: 5px solid var(--primary-color);
    position: relative;
    overflow: hidden;
}

.pangram-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%);
    pointer-events: none;
}

@media (max-width: 768px) {
    .pangram-container {
        padding: 20px;
        margin-bottom: 20px;
    }
}

.pangram-container:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.12), 0 8px 20px rgba(0,0,0,0.08);
}

.pangram-title {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-weight: 800;
    letter-spacing: -0.5px;
    position: relative;
    display: inline-block;
    text-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.pangram-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 3px;
    opacity: 0.9;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Ensure the wobble title container inherits styles properly */
.wobble-title-container {
    color: inherit;
    font-weight: inherit;
    letter-spacing: inherit;
}

/* Out of the flow and out of the way, in the bottom left corner. Unlike the
   top right, its distance from the site title does not depend on how wide the
   title happens to be - which is what put it over the letter tiles on a phone
   - and unlike the bottom right it shares no corner with the scroll-to-top
   button. Opaque enough to stay readable over whatever scrolls under it, and
   below the z-index of the XP notice, the one thing allowed to cover it. */
.site-xp {
    position: fixed;
    z-index: 1030;
    left: 20px;
    bottom: calc(20px + env(safe-area-inset-bottom));
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .22rem .65rem;
    border: 1px solid rgba(67, 97, 238, .2);
    border-radius: 999px;
    background: rgba(255, 255, 255, .92);
    color: var(--neutral-700);
    font-size: .74rem;
    font-weight: 600;
    letter-spacing: .01em;
    text-decoration: none;
    box-shadow: 0 .2rem .6rem rgba(28, 42, 88, .10);
    transition: border-color .2s ease, color .2s ease;
}

/* Room at the end of the page for the space it occupies, so it can never sit
   permanently over the last line of the footer. Added by site.js, so a visitor
   without XP pays nothing for a badge they do not have. */
body.has-xp-badge { padding-bottom: 3.5rem; }

/* On a phone the total is the part worth keeping; the level is one tap away on
   the page this links to. */
@media (max-width: 640px) {
    .site-xp {
        left: 12px;
        gap: .28rem;
        padding: .15rem .5rem;
        font-size: .68rem;
    }

    .site-xp i,
    .site-xp .site-xp-level { display: none; }
}

.site-xp[hidden] { display: none; }

.site-xp:hover,
.site-xp:focus-visible {
    border-color: rgba(67, 97, 238, .42);
    color: var(--primary-color);
}

.site-xp i { color: var(--primary-color); }

.site-xp-total { color: var(--primary-color); }

.pangram-slogan {
    /* Blue and medium rather than light grey: on the header's pastel
       background the grey all but disappeared. */
    color: #4a3fb5;
    font-size: 1.15rem;
    font-style: italic;
    margin-bottom: 30px;
    margin-top: 15px;
    font-weight: 500;
    letter-spacing: 1.2px;
    clear: both;
    display: block;
    text-shadow: 0 1px 1px rgba(255,255,255,0.8);
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    .pangram-slogan {
        margin-bottom: 20px;
        margin-top: 5px;
    }
}

/* Style for clickable title and subtitle */
.text-center a {
    cursor: pointer;
    transition: all 0.3s ease;
}

.text-center a:hover .pangram-title {
    transform: translateY(-3px);
    color: var(--secondary-color);
}

/* Adjust hover behavior for wobbling tiles */
.text-center a:hover .wobble-title-container {
    transform: none;
}

.text-center a:hover .pangram-slogan {
    color: var(--accent-color);
}

.form-control {
    border-radius: 12px;
    padding: 14px 20px;
    border: 2px solid var(--neutral-300);
    transition: all 0.3s ease;
    font-size: 1.05rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02) inset;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(67, 97, 238, 0.2), 0 2px 5px rgba(0,0,0,0.02) inset;
    transform: translateY(-2px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
    border-radius: 12px;
    padding: 14px 28px;
    font-weight: 600;
    letter-spacing: 0.6px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 6px 15px rgba(67, 97, 238, 0.3);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 50%, rgba(0,0,0,0.05) 100%);
    z-index: -1;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(67, 97, 238, 0.4);
}

.btn-primary:active {
    transform: translateY(1px);
    box-shadow: 0 4px 10px rgba(67, 97, 238, 0.3);
}

/* The invitation into the daily game: on the home page under the search
   card, on a word page under its results. Compact enough not to compete
   with the content the visitor actually came for. */
.game-promo-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 1rem 1.1rem;
    align-items: center;
    gap: 1rem;
    border: 1px solid rgba(67, 97, 238, .18);
    border-radius: 1rem;
    background: linear-gradient(135deg, rgba(67, 97, 238, .07), rgba(114, 9, 183, .04));
    color: inherit;
    text-decoration: none;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.game-promo-card--illustrated {
    grid-template-columns: auto minmax(0, 1fr) minmax(7rem, 10rem) auto;
    border-color: rgba(247, 37, 133, .2);
    background:
        radial-gradient(circle at 85% 0, rgba(247, 37, 133, .12), transparent 38%),
        linear-gradient(135deg, rgba(67, 97, 238, .08), rgba(247, 37, 133, .055));
}

.game-promo-art {
    display: none;
    width: 100%;
    aspect-ratio: 520 / 207;
    filter: drop-shadow(0 .45rem .6rem rgba(67, 97, 238, .12));
}

@media (min-width: 601px) {
    .game-promo-art {
        display: block;
        background: url("../images/word-chain-tiles.webp") center / contain no-repeat;
    }
}

.game-promo-card--illustrated .game-promo-action {
    background: var(--accent-color);
    color: #fff;
    box-shadow: 0 .45rem 1rem rgba(247, 37, 133, .22);
}

.game-promo-card:hover,
.game-promo-card:focus-visible {
    border-color: rgba(67, 97, 238, .48);
    color: inherit;
    outline: none;
    box-shadow: 0 .7rem 1.6rem rgba(28, 42, 88, .10);
    transform: translateY(-2px);
}

.game-promo-card:focus-visible {
    box-shadow: 0 0 0 .25rem rgba(67, 97, 238, .18);
}

.game-promo-icon {
    display: grid;
    width: 3.15rem;
    height: 3.15rem;
    place-items: center;
    border-radius: .85rem;
    background: #fff;
    box-shadow: 0 .35rem .9rem rgba(67, 97, 238, .12);
}

.game-promo-icon img {
    width: 2.1rem;
    height: 2.1rem;
}

.game-promo-copy {
    display: grid;
    min-width: 0;
}

.game-promo-meta {
    display: flex;
    align-items: center;
    gap: .45rem;
}

.game-promo-kicker {
    color: var(--primary-color);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.game-promo-new {
    display: inline-flex;
    padding: .12rem .45rem;
    align-items: center;
    border-radius: 999px;
    background: var(--accent-dark);
    color: #fff;
    font-size: .58rem;
    font-weight: 800;
    letter-spacing: .06em;
    line-height: 1.25;
    text-transform: uppercase;
}

.game-promo-title {
    color: var(--primary-dark);
    font-size: 1.05rem;
}

.game-promo-description {
    color: var(--neutral-600);
    font-size: .78rem;
    line-height: 1.35;
}

.game-promo-action {
    display: inline-flex;
    padding: .55rem .8rem;
    align-items: center;
    gap: .35rem;
    border-radius: .7rem;
    background: #fff;
    color: var(--primary-color);
    font-size: .78rem;
    font-weight: 700;
    white-space: nowrap;
}

.word-definition {
    max-width: 48rem;
    margin: 0 auto 1.5rem;
    padding: 1rem 1.15rem;
    border: 1px solid rgba(67, 97, 238, .16);
    border-left: .3rem solid var(--primary-color);
    border-radius: .8rem;
    background: rgba(67, 97, 238, .045);
}

.word-definition-title {
    margin: 0 0 .35rem;
    color: var(--primary-dark);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.word-definition-text {
    margin: 0;
    color: var(--neutral-800);
    font-size: 1rem;
    line-height: 1.55;
}

.word-definition-gender {
    display: inline-block;
    margin-left: .35rem;
    padding: .1rem .4rem;
    border-radius: .35rem;
    background: rgba(67, 97, 238, .06);
    color: var(--neutral-600);
    font-size: .75rem;
    font-weight: 600;
    font-style: italic;
    vertical-align: middle;
}

.word-definition-pos {
    display: inline-block;
    margin-left: .5rem;
    padding: .1rem .45rem;
    border-radius: .35rem;
    background: rgba(67, 97, 238, .12);
    color: var(--primary-dark);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: lowercase;
}

.word-definition-senses {
    margin: 0;
    padding-left: 1.35rem;
}

.word-definition-sense + .word-definition-sense {
    margin-top: .6rem;
}

.word-definition-sense::marker {
    color: var(--primary-dark);
    font-weight: 700;
}

/* In a list the class label leads the line instead of trailing a heading. */
.word-definition-sense .word-definition-pos {
    margin: 0 .35rem 0 0;
    vertical-align: .1em;
}

.word-definition-sense .word-definition-gender {
    margin: 0 .35rem 0 0;
}

.word-sense-translations {
    display: flex;
    flex-wrap: wrap;
    margin: .35rem 0 0;
    gap: .2rem .9rem;
    font-size: .85rem;
}

.word-sense-translation-language {
    margin-right: .25rem;
    color: var(--neutral-500);
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.word-sense-translation a {
    color: var(--primary-dark);
    font-weight: 600;
}

.word-definition-example {
    margin: .5rem 0 0;
    color: var(--neutral-600);
    font-size: .92rem;
    font-style: italic;
    line-height: 1.5;
}

.word-definition-lemma {
    display: flex;
    margin: .55rem 0 0;
    align-items: baseline;
    gap: .4rem;
    color: var(--neutral-600);
    font-size: .82rem;
}

.word-definition-source {
    margin: .5rem 0 0;
    color: var(--neutral-500);
    font-size: .75rem;
}

.word-definition-lemma a {
    color: var(--primary-dark);
    font-weight: 700;
}

.word-translations {
    max-width: 48rem;
    margin: -.75rem auto 1.5rem;
    padding: .75rem 1.15rem;
    border: 1px solid rgba(67, 97, 238, .12);
    border-radius: .8rem;
}

.word-translations-list {
    display: flex;
    flex-wrap: wrap;
    margin: 0;
    gap: .35rem 1.25rem;
    font-size: .9rem;
}

.word-translations-item {
    display: flex;
    align-items: baseline;
    gap: .4rem;
}

.word-translations-item dt {
    color: var(--neutral-600);
    font-size: .8rem;
}

.word-translations-item dd {
    margin: 0;
}

.word-translations-item a {
    color: var(--primary-dark);
    font-weight: 700;
}

@media (max-width: 600px) {
    .game-promo-card {
        grid-template-columns: auto minmax(0, 1fr);
        padding: .9rem;
        gap: .75rem;
    }

    .game-promo-card--illustrated {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .game-promo-art {
        display: none;
    }

    .game-promo-action {
        grid-column: 1 / -1;
        min-height: 2.8rem;
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .game-promo-card { transition: none; }
}

/* Subtle glowing effect for random word button */
@keyframes glow-pulse {
    0% {
        box-shadow: 0 0 3px rgba(108, 117, 125, 0.2);
    }
    50% {
        box-shadow: 0 0 8px rgba(108, 117, 125, 0.4);
    }
    100% {
        box-shadow: 0 0 3px rgba(108, 117, 125, 0.2);
    }
}

.btn-secondary {
    background: linear-gradient(135deg, var(--neutral-600) 0%, var(--neutral-700) 100%);
    border: none;
    border-radius: 12px;
    padding: 14px 28px;
    font-weight: 600;
    letter-spacing: 0.6px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 6px 15px rgba(108, 117, 125, 0.3);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-secondary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 50%, rgba(0,0,0,0.05) 100%);
    z-index: -1;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, var(--neutral-600) 0%, var(--neutral-800) 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(108, 117, 125, 0.4);
}

.btn-secondary:active {
    transform: translateY(1px);
    box-shadow: 0 4px 10px rgba(108, 117, 125, 0.3);
}

.btn-glow {
    animation: glow-pulse 3s ease-in-out infinite;
    position: relative;
}

.btn-glow::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    border-radius: 8px;
    background: linear-gradient(45deg, rgba(108, 117, 125, 0.2), transparent, rgba(108, 117, 125, 0.2));
    z-index: -1;
    animation: rotate-gradient 6s linear infinite;
    opacity: 0.3;
}

@keyframes rotate-gradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.btn-glow::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    background: radial-gradient(circle, rgba(108, 117, 125, 0.1) 0%, rgba(108, 117, 125, 0) 70%);
    opacity: 0;
    z-index: -1;
    animation: glow-radial 3s ease-in-out infinite;
}

@keyframes glow-radial {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.05);
    }
    100% {
        opacity: 0;
        transform: scale(0.9);
    }
}

/* Spin animation for the random icon */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}


/* Apply spin animation occasionally */
.btn-glow i.fa-random {
    display: inline-block;
    animation: spin 1.5s ease-in-out;
    animation-iteration-count: 1;
    animation-delay: 2s;
    animation-fill-mode: both;
}

/* Repeat the spin animation at intervals */
.btn-glow:hover i.fa-random {
    animation: spin 0.8s ease-in-out;
}

/* Scroll indicator */
.pangram-list::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(to top, rgba(255,255,255,0.8), rgba(255,255,255,0));
    pointer-events: none; /* Allow scrolling through the indicator */
    opacity: 0.8;
    border-radius: 0 0 10px 10px;
}

.list-group-item {
    padding: 15px 20px;
    border-left: 0;
    border-right: 0;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    border-color: var(--neutral-300);
}

/* Add subtle hover effect */
.list-group-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.list-group-item:hover::after {
    width: 100%;
}

.list-group-item:first-child {
    border-top: 0;
}

.list-group-item:last-child {
    border-bottom: 0;
}

.list-group-item:hover {
    background-color: rgba(67, 97, 238, 0.08);
    transform: translateX(8px);
    border-color: rgba(67, 97, 238, 0.1);
}

.list-group-item::before {
    content: '\f0da';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--primary-color);
    margin-right: 10px;
    opacity: 0;
    transition: all 0.2s ease;
}

.list-group-item:hover::before {
    opacity: 1;
    margin-right: 15px;
}

.footer {
    background: linear-gradient(135deg, var(--dark-color) 0%, #3a3f44 100%);
    color: white;
    padding: 2.2rem 0 calc(2.2rem + env(safe-area-inset-bottom));
    margin-top: 3.5rem;
    border-top: 5px solid var(--accent-color);
    box-shadow: 0 -10px 30px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 70%);
    pointer-events: none;
}

.footer a {
    color: var(--success-color);
    text-decoration: none;
    transition: color .2s ease;
    font-weight: 500;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .65rem 1.15rem;
}

.footer-links a {
    display: inline-flex;
    min-height: 2.75rem;
    align-items: center;
    color: #dbe5ff;
    font-size: .86rem;
}

.footer-copyright {
    margin: 1.1rem 0 0;
    color: rgba(255, 255, 255, .68);
    font-size: .78rem;
}

.footer a:hover {
    color: white;
    text-decoration: none;
}

.footer h4 {
    font-weight: 700;
    margin-bottom: 20px;
    position: relative;
    display: inline-block;
    padding-bottom: 10px;
}

.footer h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--accent-color);
    border-radius: 3px;
}

/* Badge for word count */
.word-count {
    /* Never "#" on one line and the number on the next beside a long heading. */
    flex-shrink: 0;
    white-space: nowrap;
    background-color: var(--primary-color);
    color: white;
    border-radius: 20px;
    padding: 6px 16px;
    font-weight: 600;
    display: inline-block;
    margin-left: 10px;
    box-shadow: 0 3px 8px rgba(67, 97, 238, 0.2);
    transition: all 0.3s ease;
}

.word-count:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(67, 97, 238, 0.3);
}

/* Letter highlight */
.highlight-letters {
    background-color: rgba(247, 37, 133, 0.1);
    border-radius: 8px;
    padding: 4px 12px;
    font-weight: 600;
    color: var(--accent-color);
    box-shadow: 0 2px 5px rgba(247, 37, 133, 0.1);
    transition: all 0.3s ease;
    display: inline-block;
}

.highlight-letters:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(247, 37, 133, 0.15);
    background-color: rgba(247, 37, 133, 0.15);
}

/* Lightning bolt animation */

/* Style for clickable words */
.clickable-word {
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    align-items: center;
    width: 100%;
    height: 100%;
    min-height: 24px;
    padding: 15px 20px;
    line-height: 1.5;
    box-sizing: border-box !important;
    position: relative;
    z-index: 1;
}

.clickable-word::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    width: 0;
    background: var(--primary-color);
    transition: width 0.3s ease;
    z-index: -1;
}

/* Apply styles based on tab type using data-tab attribute */
.word-item[data-tab="anagrams"] .clickable-word {
    font-weight: bold !important;
}

.word-item[data-tab="subpangrams"] .clickable-word {
    color: var(--neutral-600) !important; /* text-muted color */
}

/* Letter filter styles are now in letter-filter.css */

/* Ensure consistent heights for list items */
.word-item {
    height: 54px !important;
    min-height: 54px !important;
    max-height: 54px !important;
    display: flex !important;
    align-items: center !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    line-height: 1.5 !important;
}

.clickable-word:hover {
    color: var(--accent-color);
    transform: translateX(8px);
}

.clickable-word:hover::before {
    width: 100%;
}

/* Improved card styles */
.card {
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    border-radius: 16px;
    overflow: hidden;
    border: none;
    box-shadow: 0 8px 20px rgba(0,0,0,0.05);
}

.card-body {
    padding: 1.5rem;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

/* Enhanced tab styles with 3D effect */
.nav-tabs {
    border-bottom: 1px solid rgba(67, 97, 238, 0.2);
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
    gap: 8px;
    display: flex;
}

.nav-tabs .nav-link {
    border-radius: 12px 12px 0 0;
    padding: 14px 24px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    margin-right: 5px;
    border: 1px solid var(--neutral-300);
    border-bottom: none;
    background-color: #ffffff;
    box-shadow: 0 -3px 8px rgba(0, 0, 0, 0.05);
    transform: translateY(2px);
}

.nav-tabs .nav-link.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(0);
    box-shadow: 0 -5px 15px rgba(67, 97, 238, 0.25);
    z-index: 2;
}

.nav-tabs .nav-link:not(.active) {
    opacity: 0.8;
}

.nav-tabs .nav-link:not(.active):hover {
    background-color: #e9ecef;
    border-color: #dee2e6;
    transform: translateY(0);
    opacity: 1;
}

/* Tab content without delay */
.tab-content {
    position: relative;
    z-index: 1;
}

.tab-pane {
    transition: none;
}

.tab-pane.fade {
    transition: none;
}

/* Override Bootstrap's default fade timing */
.fade {
    transition: none;
}

/* Improved badge styles */
.badge {
    padding: 5px 8px;
    border-radius: 10px;
    font-weight: 500;
}

/* Enhanced word page specific styles */
.word-header {
    background-color: rgba(67, 97, 238, 0.08);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 35px;
    border-left: 5px solid var(--primary-color);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
}

.word-header:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.1);
}

.word-title {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
    font-weight: 800;
    letter-spacing: -0.5px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.05);
    position: relative;
    display: inline-block;
    word-break: break-word; /* Allow long words to break */
    hyphens: auto; /* Enable hyphenation */
    max-width: 100%; /* Ensure it doesn't overflow container */
    overflow-wrap: break-word; /* Ensure long words wrap */
}

.word-title::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--accent-color);
    border-radius: 3px;
}

/* Adjust title size based on length */
.word-title.long-title {
    font-size: 2rem;
}

.word-title.very-long-title {
    font-size: 1.8rem;
    letter-spacing: -0.8px;
}

@media (max-width: 576px) {
    .word-title {
        font-size: 2rem;
    }
    
    .word-title.long-title {
        font-size: 1.7rem;
    }
    
    .word-title.very-long-title {
        font-size: 1.5rem;
        letter-spacing: -1px;
    }
}

/* The line under the word on a Dutch word page: what the page offers.
   Plain text, small and muted, so the word stays the only heading. */
.word-subtitle {
    margin: 2px 0 0;
    color: var(--neutral-600);
    font-size: .95rem;
    line-height: 1.35;
}

.word-letters {
    font-size: 1.2rem;
    color: var(--secondary-color);
    font-family: monospace;
    letter-spacing: 2px;
    background-color: rgba(255,255,255,0.7);
    padding: 5px 10px;
    border-radius: 5px;
    display: block;
    width: fit-content;
    margin-top: 10px;
    margin-bottom: 10px;
    clear: both;
}

/* Scrabble info styling */
.scrabble-info {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.scrabble-info .badge {
    font-size: 0.9rem;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 500;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.scrabble-info .badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

@media (max-width: 576px) {
    .scrabble-info {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .scrabble-info .badge {
        font-size: 0.8rem;
        padding: 5px 10px;
    }
}

.back-button {
    margin-bottom: 20px;
}

.back-button .btn {
    transition: all 0.3s ease;
    border-radius: 8px;
    padding: 8px 16px;
}

.back-button .btn:hover {
    transform: translateX(-5px);
}

/* Alert styles */
.alert {
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border: none;
    position: relative;
    overflow: hidden;
}

.alert::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.alert-info::before {
    background-color: var(--primary-color);
}

.alert-warning::before {
    background-color: #ffc107;
}

.alert-danger::before {
    background-color: #dc3545;
}

.alert-success::before {
    background-color: #28a745;
}

/* Alert icon alignment */
.alert i {
    width: 24px;
    height: 24px;
    text-align: center;
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

/* Social sharing buttons styles */
.social-share-buttons {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    padding: 0;
    margin-top: 15px;
    margin-left: -2px; /* Compensate for any default spacing */
    gap: 10px;
}

/* Legal and Contact pages styling */
.legal-page h1, .contact-page h1, .explain-page h1 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-weight: 700;
    font-size: 2.2rem;
    position: relative;
    padding-bottom: 0.75rem;
}

.legal-page h1::after, .contact-page h1::after, .explain-page h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 80px;
    height: 3px;
    background: var(--accent-color);
    border-radius: 3px;
}

.legal-page h2, .contact-page h2, .explain-page h2 {
    color: var(--secondary-color);
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
    font-size: 1.5rem;
}

.legal-page h3, .contact-page h3, .explain-page h3 {
    color: var(--primary-dark);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    font-size: 1.25rem;
}

.legal-page p, .contact-page p, .explain-page p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.legal-page ul, .contact-page ul, .explain-page ul {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.legal-page li, .contact-page li, .explain-page li {
    margin-bottom: 0.5rem;
}

.legal-page hr, .contact-page hr {
    margin: 2rem 0;
    opacity: 0.15;
    border-color: var(--primary-color);
}

.legal-page .lead, .contact-page .lead {
    font-size: 1.1rem;
    color: var(--neutral-700);
    margin-bottom: 1.5rem;
}

.legal-page .back-nav, .contact-page .back-nav {
    margin-top: 2rem;
}

.legal-page strong, .contact-page strong {
    color: var(--neutral-800);
}

@media (max-width: 768px) {
    .legal-page h1, .contact-page h1 {
        font-size: 1.8rem;
    }
    
    .legal-page h2, .contact-page h2 {
        font-size: 1.3rem;
    }
    
    .legal-page h3, .contact-page h3 {
        font-size: 1.1rem;
    }
}

.social-btn {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    color: var(--primary-color);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    background-color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.social-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 70%);
    opacity: 0.6;
    z-index: -1;
}

.social-btn:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
    color: var(--accent-color);
    background-color: white;
}

.social-btn:active {
    transform: translateY(0) scale(0.95);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    .social-share-buttons {
        padding: 0;
        margin-top: 10px;
    }
    
    .social-btn {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }
    
    .letter-btn {
        width: 48px;
        height: 48px;
        font-size: 1.2rem;
    }
    
    /* Mobile tab styles */
    .nav-tabs {
        display: flex;
        flex-wrap: wrap;
        margin-bottom: 10px;
    }
    
    .nav-tabs .nav-link {
        padding: 10px 15px;
        font-size: 0.95rem;
        margin-bottom: 5px;
    }
    
    .nav-tabs .nav-link.active {
        box-shadow: 0 -2px 8px rgba(67, 97, 238, 0.2);
    }
    
    .home-search-intro {
        padding: 1.15rem 1rem .9rem;
    }

    .home-search-body {
        padding: 1rem;
    }

    .home-search-intro p {
        font-size: .84rem;
        line-height: 1.45;
    }

    /* Six letters, the glass and two words fit a 360 px phone; narrower than
       that the second word drops to its own line. */
    .search-example {
        flex-wrap: wrap;
        gap: .3rem;
    }

    .search-example-letters {
        gap: .15rem;
    }

    .search-example-letter,
    .search-example-word {
        height: 1.9rem;
        font-size: .92rem;
    }

    .search-example-letter {
        width: 1.4rem;
    }

    .search-example-word-third {
        display: none;
    }

    .search-example-joint {
        width: 1.4rem;
        height: 1.4rem;
    }

    .search-example-word {
        padding: 0 .45rem;
    }

    .home-search-help {
        font-size: .74rem;
    }

    .home-facts {
        grid-template-columns: 1fr;
        margin: .9rem 0 2.2rem;
    }

    .home-fact {
        padding: .72rem .85rem;
    }

    .home-fact + .home-fact {
        border-top: 1px solid var(--neutral-300);
        border-left: 0;
    }

    .home-discovery-grid {
        grid-template-columns: 1fr;
        gap: .65rem;
    }

    .home-discovery-card {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        padding: .9rem;
        column-gap: .8rem;
    }

    .home-discovery-art {
        grid-row: 1 / 3;
        width: 4.75rem;
        height: 3.5rem;
        margin: 0;
        align-self: center;
    }

    .home-discovery-card h3 {
        margin: 0;
    }

    .home-section-heading {
        text-align: left;
    }

    /* Compact footer links remain comfortable touch targets without becoming
       a stack of full-width outlined buttons. */
    .footer {
        padding: 1.8rem 0 calc(1.8rem + env(safe-area-inset-bottom));
        margin-top: 2.5rem;
    }

    .footer-links {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .2rem .8rem;
        text-align: left;
    }

    .footer-links a {
        font-size: .78rem;
    }

    .footer-copyright {
        padding: 0 2.5rem;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .pangram-container {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .form-control {
        padding: 12px 16px;
        font-size: 1rem;
    }
    
    .btn-primary, .btn-secondary {
        padding: 12px 20px;
        font-size: 0.95rem;
    }

    .home-landing-page .pangram-container {
        padding: 0;
    }

    /* The cards above reach the screen's edge and keep their own padding;
       these two blocks have none, so they take the chain teaser's inset. */
    .home-popular,
    .home-discovery {
        padding-inline: 1.1rem;
    }

    .home-search-actions {
        grid-template-columns: 1fr;
    }
}

@media (hover: none), (pointer: coarse) {
    .pangram-container:hover,
    .card:hover,
    .btn-primary:hover,
    .btn-secondary:hover {
        transform: none;
    }
}

/* Ad containers (partials/_ads.html) - moved here since that partial is only ever
   {% from ... import %}'d for its macros, so a <style> block inside it never rendered */
.ad-container {
    overflow: hidden;
    background-color: var(--neutral-200);
    border-radius: 0.25rem;
    padding: 0.5rem;
    /* Without an explicit width, a flex-centered parent (e.g. the footer's
       d-flex justify-content-center) shrinks this to its content instead of
       the available row width, so AdSense's responsive ad format measures a
       tiny width and serves a narrow/tall creative instead of a flat one. */
    width: 100%;
}

.ad-label {
    font-size: 0.7rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Footer ad height limit */
footer .ad-container {
    max-height: 120px; /* Limit height in footer */
    overflow: hidden; /* Hide anything exceeding the max-height */
}

/* Belt-and-suspenders for app/static/js/ads-lazy.js's fill-status check: if an ad
   slot can't be filled (e.g. while the site is still pending AdSense approval),
   don't leave an empty "Advertisement" box on screen. */
.ad-container:has(ins.adsbygoogle[data-ad-status="unfilled"]) {
    display: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .ad-container ins.adsbygoogle[data-ad-format="horizontal"] {
        width: 100%;
        max-width: 320px;
        height: auto;
    }
}
/* Short, non-blocking progression feedback carried across Random Word navigation. */
.global-xp-feedback {
    position: fixed;
    top: max(1rem, env(safe-area-inset-top));
    left: 50%;
    z-index: 1080;
    margin: 0;
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    /* The site's own primary gradient, the one every primary button wears.
       It used to be a green that appears nowhere else on the site - not a
       token, not the game's green - which read as a stray notification on a
       word page rather than as this site telling you something. */
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 0.35rem 1rem rgba(0, 0, 0, 0.2);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -0.75rem);
    transition: opacity 160ms ease, transform 160ms ease;
}

.global-xp-feedback.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

@media (prefers-reduced-motion: reduce) {
    .global-xp-feedback {
        transition: none;
    }
}

/* --- The page that explains the search: /how-it-works --- */

/* The worked example: the word first, because that is what the reader
   compares, and the rule that makes it that kind of word beside it. */
.explain-list {
    margin: 0 0 1.5rem;
}

.explain-list dt {
    display: flex;
    margin-top: 1rem;
    align-items: center;
    gap: .55rem;
    color: var(--primary-dark);
    font-weight: 700;
}

/* The same pictures as the three cards on the home page, small, so the
   three names read as the same three things there. */
.explain-term-art {
    width: 2.6rem;
    height: 2rem;
    object-fit: contain;
}

.explain-list dd {
    display: flex;
    margin: .35rem 0 0;
    padding: .65rem .9rem;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .1rem .75rem;
    border-radius: .8rem;
    background: rgba(67, 97, 238, .06);
}

.explain-list dd a {
    color: var(--primary-color);
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    text-decoration: none;
}

.explain-list dd a:hover,
.explain-list dd a:focus-visible {
    text-decoration: underline;
}

.explain-list dd span {
    min-width: 0;
    flex: 1 1 16rem;
    color: var(--neutral-700);
}

.explain-uses {
    display: grid;
    padding-left: 0;
    gap: .7rem;
    list-style: none;
}

.explain-uses li {
    display: grid;
    padding: .75rem .95rem;
    gap: .15rem;
    border: 1px solid var(--neutral-300);
    border-radius: .85rem;
    background: var(--neutral-100);
}

.explain-uses strong {
    color: var(--primary-dark);
}

.explain-uses span {
    color: var(--neutral-700);
}

.explain-game {
    margin-top: 2rem;
    padding: 1.1rem 1.2rem;
    border-radius: 1rem;
    background:
        linear-gradient(135deg, rgba(67, 97, 238, .08), rgba(247, 37, 133, .06));
}

.explain-page .explain-game h2 {
    margin-top: 0;
}

/* The way from the three cards on the home page to the long answer. */
/* The landscape at the bottom of the home page. The line stands above the
   picture on a band of the picture's own sky colour, so it never lands on
   the sun however wide the screen is. */
.home-closing {
    margin: 2.5rem 0 0;
    overflow: hidden;
    border-radius: 1.25rem;
    background: #d8cef1;
    box-shadow: 0 .9rem 2.3rem rgba(38, 52, 122, .10);
}

.home-closing-art {
    display: block;
    width: 100%;
    height: auto;
    /* Fade the top edge into the band, which would otherwise show as a seam. */
    -webkit-mask-image: linear-gradient(to bottom, transparent, #000 3rem);
    mask-image: linear-gradient(to bottom, transparent, #000 3rem);
}

.home-closing-line {
    margin: 0;
    padding: 1.1rem 1rem 0;
    color: var(--primary-dark);
    font-size: clamp(1.05rem, 3.4vw, 1.9rem);
    font-weight: 800;
    letter-spacing: -.02em;
    text-align: center;
}

.home-discovery-more {
    margin: 1.2rem 0 0;
    text-align: center;
}

.home-discovery-more a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
}

/* The guides on the home page (app/guides.py) reuse the discovery cards, but
   have no picture: on a phone the card's two-column grid would put the title
   where the picture goes, so these stay plain blocks at every width. */
.home-discovery-card.home-guide-card {
    display: block;
}

.home-guide-card h3 a {
    color: inherit;
    text-decoration: none;
}

.home-guide-card h3 a:hover,
.home-guide-card h3 a:focus-visible {
    text-decoration: underline;
}

.home-discovery-more a + a {
    margin-left: 1.25rem;
}

/* Four guides read better as two by two than as three and one. So do the
   four things the Dutch home page offers (index.html, .home-offer). */
.home-guides .home-discovery-grid,
.home-offer .home-discovery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 767.98px) {
    .home-guides .home-discovery-grid,
    .home-offer .home-discovery-grid {
        grid-template-columns: 1fr;
    }
}

/* Each offer card is one link: the heading's link is stretched over the
   card, so the whole card is the target on a phone. */
.home-offer-card {
    position: relative;
    transition: border-color .15s ease;
}

.home-offer-card h3 a::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
}

.home-offer-card:hover,
.home-offer-card:focus-within {
    border-color: rgba(67, 97, 238, .4);
}

/* The Dutch home page's <h1> wears the eyebrow's look (index.html). */
h1.home-title {
    margin-top: 0;
    line-height: 1.4;
}

/* A screenshot in a guide: phone-sized, so never wider than a phone, and
   framed so the white of the page does not run into the white of the shot. */
.guide-figure {
    margin: 1.25rem auto 1.5rem;
    max-width: 22rem;
    text-align: center;
}

.guide-figure img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid rgba(67, 97, 238, .15);
    border-radius: 1rem;
    box-shadow: 0 .45rem 1.25rem rgba(38, 52, 122, .08);
}

.guide-figure figcaption {
    margin-top: .6rem;
    color: var(--neutral-600);
    font-size: .85rem;
    line-height: 1.4;
}

.home-discovery-more a:hover,
.home-discovery-more a:focus-visible {
    text-decoration: underline;
}

/* The language picker of the multilingual site (partials/_language_picker.html).
   The closed picker always shows which language this is: flag, code and the
   language's own name. */
/* Above the title, right-aligned, by default. Positioned all the same: a
   static element ignores z-index, and the open menu then fell underneath the
   title tiles and the search card that follow it. */
.language-picker {
    position: relative;
    z-index: 1040;
    display: flex;
    justify-content: flex-end;
    padding: 0 16px .6rem;
    font-size: .85rem;
}

.language-picker details { position: relative; }

/* In the corner only where the corner is free: the title is about 620px
   wide and centred, and the closed picker up to 265px ("Português
   (Brasil)"), so below roughly 1215px the two meet. */
@media (min-width: 1280px) {
    .language-picker {
        position: absolute;
        top: 12px;
        right: 16px;
        padding: 0;
    }
}

.language-picker summary {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .28rem .7rem .28rem .3rem;
    border: 2px solid rgba(67, 97, 238, .35);
    border-radius: 999px;
    background: #fff;
    color: var(--dark-color);
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    box-shadow: 0 4px 14px rgba(67, 97, 238, .14);
    transition: border-color .15s ease, box-shadow .15s ease;
}

.language-picker summary::-webkit-details-marker { display: none; }

.language-picker summary:hover,
.language-picker summary:focus-visible,
.language-picker details[open] summary {
    border-color: var(--primary-color);
    box-shadow: 0 6px 18px rgba(67, 97, 238, .24);
}

.language-flag {
    flex: none;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 1px rgba(33, 37, 41, .12);
}

.language-code {
    padding: .05rem .4rem;
    border-radius: 999px;
    background: var(--primary-color);
    color: #fff;
    font-size: .7rem;
    letter-spacing: .04em;
}

.language-caret {
    color: var(--primary-color);
    transition: transform .15s ease;
}

.language-picker details[open] .language-caret { transform: rotate(180deg); }

.language-picker ul {
    position: absolute;
    right: 0;
    margin: .4rem 0 0;
    padding: .35rem;
    min-width: 13.5rem;
    list-style: none;
    background: #fff;
    border: 1px solid rgba(67, 97, 238, .2);
    border-radius: .9rem;
    box-shadow: 0 10px 28px rgba(33, 37, 41, .14);
}

.language-picker li a {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .4rem .65rem;
    border-radius: .6rem;
    color: var(--dark-color);
    text-decoration: none;
}

.language-picker li a:hover,
.language-picker li a:focus-visible {
    background: rgba(67, 97, 238, .08);
    color: var(--primary-color);
}

.language-picker li a[aria-current="page"] {
    background: rgba(67, 97, 238, .12);
    color: var(--primary-color);
    font-weight: 700;
}

.language-check {
    margin-left: auto;
    color: var(--primary-color);
}

@media (max-width: 768px) {
    .language-picker {
        padding: 0 12px .6rem;
        font-size: .8rem;
    }

    /* Nine languages always fit, also on a short screen held sideways. */
    .language-picker ul {
        max-height: calc(100vh - 5rem);
        max-height: calc(100dvh - 5rem);
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    /* The flag and the code say it; the name would push the title down. */
    .language-picker summary .language-name { display: none; }
}

/* The site header: a generated pastel background with the site's 3D pieces
   at its edges (app/static/images/header-bg-*.webp), fading into the page,
   under the name. */
body > header {
    display: flow-root;
    margin-top: -40px;
    padding-top: 52px;
    background:
        linear-gradient(to bottom, rgba(243, 245, 249, 0) 55%, #f3f5f9 100%),
        url('../images/header-bg-wide.webp') center top / cover no-repeat;
}

@media (max-width: 768px) {
    body > header {
        margin-top: -10px;
        padding-top: 10px;
        background-image:
            linear-gradient(to bottom, rgba(243, 245, 249, 0) 55%, #f3f5f9 100%),
            url('../images/header-bg-narrow.webp');
    }
}

/* A hint before the answer, above a search that finds one of today's popular
   words (partials/_puzzle_hint.html, js/puzzle-hint.js). */
.puzzle-hint {
    padding: 1rem 1.1rem 1.1rem;
    border: 1px solid rgba(67, 97, 238, .22);
    border-radius: 16px;
    background: rgba(255, 255, 255, .86);
}

.puzzle-hint-kicker {
    color: var(--primary-color);
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.puzzle-hint-title {
    margin: .1rem 0 .5rem;
    color: var(--primary-dark);
    font-size: 1.15rem;
    font-weight: 700;
}

.puzzle-hint-definition {
    margin: 0 0 .75rem;
    color: var(--neutral-700);
    font-size: 1.05rem;
    line-height: 1.4;
}

.puzzle-hint-boxes {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
    margin-bottom: .9rem;
}

.puzzle-hint-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.4rem;
    border: 2px dashed rgba(67, 97, 238, .45);
    border-radius: 8px;
    color: var(--primary-dark);
    font-size: 1.15rem;
    font-weight: 700;
    text-transform: uppercase;
}

.puzzle-hint-box.is-open {
    border-style: solid;
    border-color: var(--primary-color);
    background: rgba(67, 97, 238, .1);
}

.puzzle-hint-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.puzzle-hint-solved {
    margin: 0;
    font-weight: 600;
}

.puzzle-hint-foot {
    margin: .7rem 0 0;
    color: var(--neutral-700);
    font-size: .85rem;
}

.clickable-word.is-puzzle-masked {
    letter-spacing: .12em;
    cursor: default;
}

/* Today's games as three small cards under a word page's results
   (partials/_game_cards.html). */
.game-cards-promo {
    display: flex;
    align-items: center;
    gap: .7rem;
    margin-bottom: .7rem;
}

.game-cards-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 12px;
    background: var(--primary-color);
    color: #fff;
    font-size: 1.1rem;
}

.game-cards-title {
    margin: 0;
    color: var(--primary-dark);
    font-size: 1.15rem;
    font-weight: 700;
}

.game-cards-lead {
    margin: .1rem 0 0;
    color: var(--neutral-700);
    font-size: .9rem;
}

.game-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    gap: .6rem;
}

.game-card {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    padding: .7rem .85rem;
    border: 1px solid rgba(67, 97, 238, .2);
    border-radius: 12px;
    background: rgba(255, 255, 255, .86);
    color: var(--neutral-700);
    text-decoration: none;
    transition: border-color .15s ease, transform .15s ease;
}

.game-card:hover,
.game-card:focus-visible {
    border-color: var(--primary-color);
    color: var(--neutral-700);
    transform: translateY(-1px);
}

.game-card-name {
    color: var(--primary-color);
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.game-card-puzzle {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem;
    color: var(--primary-dark);
    font-weight: 700;
}

.game-card-tile {
    padding: .1rem .5rem;
    border-radius: 7px;
    background: var(--primary-dark);
    color: #fff;
}

.game-card-tile.is-blank {
    border: 2px dashed rgba(67, 97, 238, .5);
    background: none;
    color: var(--primary-color);
}

.game-card-side { text-transform: uppercase; font-size: .9rem; }

.game-card-boxes { display: inline-flex; gap: .15rem; }

.game-card-box {
    width: .8rem;
    height: 1rem;
    border: 1.5px solid rgba(67, 97, 238, .55);
    border-radius: 3px;
}

.game-card-clue {
    color: var(--primary-dark);
    font-weight: 600;
    line-height: 1.3;
}

.game-card-hint { font-size: .8rem; }

/* The fold in a long puzzle block: the lengths nobody asked for, one tap away. */
.word-puzzle-more {
    margin-top: 0.5rem;
}

.word-puzzle-more summary {
    cursor: pointer;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.35rem 0;
}

.word-puzzle-more[open] summary {
    margin-bottom: 0.35rem;
}

/* On a phone the word's own card took a third of the screen before anything
   was said about the word. The same things, on fewer lines. */
@media (max-width: 576px) {
    .word-header {
        padding: 14px 16px;
        margin-bottom: 18px;
    }

    .word-header .word-title {
        margin-bottom: 10px;
    }

    .word-header .word-letters {
        display: none;
    }

    .word-header .scrabble-info {
        display: inline-flex;
        margin: 0.25rem 0.5rem 0 0 !important;
        vertical-align: middle;
    }

    .word-header .scrabble-info .badge {
        font-size: 0.8rem;
        padding: 4px 10px;
    }

    .word-header .social-share-buttons {
        display: inline-flex;
        margin-top: 0.25rem !important;
        vertical-align: middle;
    }
}

/* Custom CSS for letter filter */
.letter-filter-container {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    padding: 16px;
    background: linear-gradient(135deg, var(--neutral-200) 0%, var(--neutral-300) 100%);
    border-radius: 14px;
    border: none;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
}

.letter-filter-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0) 100%);
    pointer-events: none;
}

/* The legend above the buttons: press a letter, blue must be in the word,
   red must not. The swatches are the buttons' own two colours. */
.letter-filter-legend {
    flex-basis: 100%;
    position: relative;
    z-index: 1;
    text-align: center;
    font-size: 0.9rem;
    color: var(--neutral-700);
}

.letter-filter-legend-lead {
    margin: 0 0 0.35rem;
    font-weight: 600;
}

.letter-filter-legend-states {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.letter-filter-legend-states li {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.legend-swatch {
    flex: none;
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 0.3rem;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.legend-swatch-include {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.legend-swatch-exclude {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-dark) 100%);
}

.legend-swatch-off {
    background: linear-gradient(135deg, var(--neutral-100) 0%, var(--neutral-200) 100%);
}

/* Where a guide to the filter exists, the legend links to it. */
.letter-filter-legend-more i {
    color: var(--primary-color);
}

.letter-filter-legend-more a {
    color: var(--primary-color);
    font-weight: 600;
}

.letter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    flex-grow: 1;
    justify-content: center;
    position: relative;
    z-index: 1;
}

/* Wobble animation for letter buttons */
@keyframes subtle-wobble {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-2px) rotate(-1deg);
    }
    50% {
        transform: translateY(0) rotate(0deg);
    }
    75% {
        transform: translateY(-2px) rotate(1deg);
    }
}

@keyframes letter-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.letter-pulse {
    animation: letter-pulse 0.5s ease !important;
}

.letter-btn {
    width: 48px;
    height: 48px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.25rem;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--neutral-100) 0%, var(--neutral-200) 100%);
    border: none;
    color: var(--neutral-700);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    transform-origin: center bottom;
    animation: subtle-wobble 6s ease-in-out infinite;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

/* Apply different animation delays for natural effect */
.letter-btn:nth-child(odd) {
    animation-delay: -0.2s;
}

.letter-btn:nth-child(even) {
    animation-delay: -0.5s;
}

.letter-btn:nth-child(3n) {
    animation-delay: -0.7s;
}

.letter-btn:nth-child(3n+1) {
    animation-delay: -1.1s;
}

/* More energetic animation when hovering over the container */
.letter-buttons:hover .letter-btn {
    animation-duration: 3s;
}

/* 3D effect for buttons */
.letter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.6) 0%, rgba(255,255,255,0) 50%, rgba(0,0,0,0.05) 100%);
    border-radius: 4px;
    pointer-events: none;
}

/* Only apply hover effects to inactive buttons */
.letter-btn:not(.active):not(.excluded):hover {
    background: linear-gradient(135deg, rgba(67, 97, 238, 0.1) 0%, rgba(67, 97, 238, 0.2) 100%);
    color: var(--primary-color);
    z-index: 2;
    transform: translateY(-5px) rotate(0deg) !important;
    box-shadow: 0 8px 15px rgba(67, 97, 238, 0.25);
    animation-play-state: paused !important;
}

.letter-btn.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    z-index: 3;
    animation-play-state: paused;
    box-shadow: 0 5px 12px rgba(67, 97, 238, 0.3);
    transform: translateY(-2px);
    /* Add a border to make it more visible */
    border: 2px solid white;
}

/* Hover state for active buttons */
.letter-btn.active:hover {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    box-shadow: 0 8px 15px rgba(67, 97, 238, 0.4);
    transform: translateY(-3px) !important;
}

.letter-btn.excluded {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-dark) 100%);
    color: white;
    z-index: 3;
    animation-play-state: paused;
    box-shadow: 0 5px 12px rgba(247, 37, 133, 0.3);
    transform: translateY(-2px);
    /* Add a border to make it more visible */
    border: 2px solid white;
}

/* Hover state for excluded buttons */
.letter-btn.excluded:hover {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-dark) 100%);
    box-shadow: 0 8px 15px rgba(247, 37, 133, 0.4);
    transform: translateY(-3px) !important;
}

/* Improved focus state for accessibility */
.letter-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.4), 0 5px 12px rgba(67, 97, 238, 0.2);
    z-index: 4;
}

/* Mobile optimizations */
@media (max-width: 576px) {
    .letter-filter-container {
        padding: 12px 10px;
        gap: 8px;
        margin-bottom: 15px;
    }
    
    .letter-buttons {
        gap: 8px;
    }
    
    .letter-btn {
        width: 48px;  /* Slightly larger for better touch targets */
        height: 48px; /* Slightly larger for better touch targets */
        font-size: 1.2rem;
        border-radius: 10px;
        margin: 2px; /* Add margin for better spacing */
        touch-action: manipulation; /* Improve touch handling */
    }
    
    /* Reduce animation for better performance on mobile */
    .letter-btn {
        animation: none; /* Disable wobble animation on mobile */
    }
    
    /* Disable hover effects on touch devices */
    @media (hover: none) {
        .letter-btn:not(.active):not(.excluded):hover {
            transform: none !important;
            background: linear-gradient(135deg, var(--neutral-100) 0%, var(--neutral-200) 100%);
            color: var(--neutral-700);
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
        }
        
        .letter-buttons:hover .letter-btn {
            animation: none;
        }
        
        /* Keep active and excluded styles on touch devices */
        .letter-btn.active, .letter-btn.active:hover {
            background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
            color: white;
            border: 2px solid white;
        }
        
        .letter-btn.excluded, .letter-btn.excluded:hover {
            background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-dark) 100%);
            color: white;
            border: 2px solid white;
        }
    }
    
    /* Active state for touch devices */
    .letter-btn.active {
        transform: translateY(0) !important; /* Prevent unwanted movement */
    }
    
    .letter-btn.excluded {
        transform: translateY(0) !important; /* Prevent unwanted movement */
    }
}

/* Larger mobile devices and tablets */
@media (min-width: 577px) and (max-width: 768px) {
    .letter-btn {
        width: 46px;
        height: 46px;
        margin: 1px;
    }
}

/**
 * Pangram Vinder - Lazy Loading CSS
 * Styles for lazy loading functionality
 */

/* Scrollable container for word lists */
.pangram-list {
    max-height: 500px;
    min-height: 200px;
    overflow-y: auto;
    position: relative;
    border: 1px solid var(--neutral-300);
    border-radius: 14px;
    padding: 0;
    margin-bottom: 1.5rem;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    box-shadow: 0 3px 10px rgba(0,0,0,0.03) inset;
    background: linear-gradient(to bottom, rgba(255,255,255,0.8) 0%, rgba(255,255,255,1) 100%);
}

/* Customize scrollbar for webkit browsers */
.pangram-list::-webkit-scrollbar {
    width: 8px;
}

.pangram-list::-webkit-scrollbar-track {
    background: var(--neutral-200);
    border-radius: 10px;
}

.pangram-list::-webkit-scrollbar-thumb {
    background: var(--neutral-500);
    border-radius: 10px;
}

.pangram-list::-webkit-scrollbar-thumb:hover {
    background: var(--neutral-600);
}

/* Loading indicator */
.loading-indicator {
    padding: 1rem 1.5rem;
    background: linear-gradient(to bottom, var(--neutral-200) 0%, var(--neutral-300) 100%);
    border-top: 1px solid var(--neutral-300);
    color: var(--neutral-700);
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.loading-indicator i {
    color: var(--primary-color);
    animation: spin 1.5s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Smooth transitions for loading new items */
.list-group-item {
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Hover effect for word items */
.word-item:hover {
    background-color: rgba(67, 97, 238, 0.08);
    transform: translateX(8px);
}

.word-length-header {
    justify-content: center !important;
    background-color: rgba(67, 97, 238, 0.05);
}

.word-length-header small {
    color: var(--primary-color);
}

/* Ensure the list container takes up space even when empty */
.list-group {
    min-height: 120px;
    position: relative;
}

/* Fade-in animation for newly loaded items */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.list-group-item.new-item {
    animation: fadeInUp 0.5s ease forwards;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .pangram-list {
        max-height: 350px;
        min-height: 150px;
    }
    
    .loading-indicator {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
}

/* Wobbling Tiles Effect for Site Title */

/* Container for the title with tiles */
.wobble-title-container {
    display: inline-flex;
    flex-wrap: nowrap;
    justify-content: center;
    margin-bottom: 15px;
    width: 100%;
    max-width: 100%;
    /* Clip sideways only. overflow-x: hidden turned the other axis into a
       scroll box as well, which cut off the top of every tile that leans or
       lifts (the wobble, the hover) - the title always looked trimmed. clip
       leaves the vertical axis alone, and the padding is the room a lifted
       tile needs. */
    overflow-x: clip;
    overflow-y: visible;
    padding: 10px 0 2px;
    white-space: nowrap;
    position: relative;
    z-index: 1;
}

/* Individual letter tile */
.letter-tile {
    display: inline-block;
    position: relative;
    margin: 0 3px 5px 3px;
    padding: 10px 6px;
    background: linear-gradient(135deg, white 0%, var(--neutral-200) 100%);
    color: #3f37c9;
    font-weight: 800;
    border-radius: 10px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.12);
    transform-origin: center bottom;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), 
                box-shadow 0.3s ease, 
                color 0.3s ease;
    animation: wobble 3s ease-in-out infinite;
    animation-play-state: paused;
    border: none;
    min-width: 1.3em;
    text-align: center;
    line-height: 1;
    overflow: hidden;
}

.letter-tile::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.5) 0%, rgba(255,255,255,0) 100%);
    pointer-events: none;
    /* Under the letter, not over it: on top, the sheen paled the letters. */
    z-index: -1;
}

/* Apply different animation delays to create natural effect */
.letter-tile:nth-child(odd) {
    animation-delay: -0.2s;
}

.letter-tile:nth-child(even) {
    animation-delay: -0.5s;
}

.letter-tile:nth-child(3n) {
    animation-delay: -0.7s;
}

.letter-tile:nth-child(3n+1) {
    animation-delay: -1.1s;
}

.letter-tile:nth-child(5n) {
    animation-delay: -1.5s;
}

/* Start animation when hovering over the container */
.wobble-title-container:hover .letter-tile {
    animation-play-state: running;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

/* Individual hover effect for each tile */
.letter-tile:hover {
    transform: translateY(-8px) rotate(0deg) !important;
    box-shadow: 0 12px 24px rgba(67, 97, 238, 0.35);
    color: var(--accent-color);
    z-index: 10;
    animation-play-state: paused !important;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), 
                box-shadow 0.3s ease, 
                color 0.3s ease;
}

/* Wobble animation */
@keyframes wobble {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-4px) rotate(-3deg);
    }
    50% {
        transform: translateY(0) rotate(0deg);
    }
    75% {
        transform: translateY(-4px) rotate(3deg);
    }
}

/* 3D effect for tiles */
.letter-tile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.7) 0%, rgba(255,255,255,0) 50%, rgba(0,0,0,0.05) 100%);
    border-radius: 8px;
    pointer-events: none;
    z-index: 1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .wobble-title-container {
        margin-bottom: 8px;
    }
    
    .letter-tile {
        padding: 8px 4px;
        margin: 0 2px 3px 2px;
        font-size: 0.9em;
        border-radius: 8px;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        min-width: 1.1em;
    }
    
    @keyframes wobble {
        0%, 100% {
            transform: translateY(0) rotate(0deg);
        }
        25% {
            transform: translateY(-2px) rotate(-1deg);
        }
        50% {
            transform: translateY(0) rotate(0deg);
        }
        75% {
            transform: translateY(-2px) rotate(1deg);
        }
    }
    
    .letter-tile:hover {
        transform: translateY(-4px) rotate(0deg) !important;
        box-shadow: 0 6px 12px rgba(67, 97, 238, 0.3);
    }
}

/* For very small screens */
@media (max-width: 480px) {
    .wobble-title-container {
        margin-bottom: 10px;
    }
    
    .letter-tile {
        padding: 6px 3px;
        margin: 0 1px 2px 1px;
        font-size: 0.8em;
        min-width: 1em;
        border-radius: 6px;
        box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
    }
    
    .letter-tile:hover {
        transform: translateY(-3px) rotate(0deg) !important;
        box-shadow: 0 5px 10px rgba(67, 97, 238, 0.25);
    }
}

/* Add a class for the slogan to ensure proper alignment */
.pangram-slogan {
    clear: both;
    display: block;
    margin-top: 5px;
    transition: all 0.3s ease;
}

/**
 * Typewriter Effect Styling
 */

/* Style the placeholder text for the typewriter effect */
#letters::placeholder {
    color: #777777; /* Darker gray color for better visibility */
    opacity: 1; /* Ensure full opacity in all browsers */
    transition: color 0.3s ease;
    font-style: italic; /* Make it italic for distinction */
}

/* Ensure the placeholder is visible in all browsers */
#letters::-webkit-input-placeholder {
    color: #777777;
    opacity: 1;
    font-style: italic;
}

#letters::-moz-placeholder {
    color: #777777;
    opacity: 1;
    font-style: italic;
}

#letters:-ms-input-placeholder {
    color: #777777;
    opacity: 1;
    font-style: italic;
}

#letters:-moz-placeholder {
    color: #777777;
    opacity: 1;
    font-style: italic;
}

/* Add a special style for the input when typewriter is active */
#letters.typewriter-active {
    background-color: #f9f9f9; /* Slight background color to indicate active state */
}

/* Add a blinking cursor effect to the placeholder */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Apply the cursor animation when the placeholder is active */
#letters.typewriter-active::placeholder {
    border-right: 2px solid #aaaaaa;
    animation: blink 1s step-end infinite;
}

/* Modern Effects CSS for Pangrammer - Making the site more dazzling and irresistible */

/* Enhanced color variables */
:root {
    /* Animation durations */
    --animation-slow: 1.2s;
    --animation-medium: 0.6s;
    --animation-fast: 0.3s;
    
    /* Gradient variables */
    --gradient-primary: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    --gradient-accent: linear-gradient(135deg, var(--accent-color) 0%, #7209b7 100%);
    --gradient-light: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    --gradient-dark: linear-gradient(135deg, #212529 0%, #343a40 100%);
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 16px rgba(0,0,0,0.15);
    --shadow-xl: 0 12px 24px rgba(0,0,0,0.2);
    
    /* Border radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
}

/* Animated background effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(67, 97, 238, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(247, 37, 133, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
    animation: subtle-pulse 15s ease-in-out; /* Removed infinite alternate */
}

@keyframes subtle-pulse {
    0% {
        opacity: 0.5;
        transform: scale(1);
    }
    100% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

/* Glass morphism effect for containers */
.pangram-container {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.9) !important;
    animation: container-reveal 0.8s ease-out forwards;
}

@keyframes container-reveal {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Add a subtle border glow effect on hover */
.pangram-container:hover::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: var(--gradient-primary);
    z-index: -1;
    border-radius: calc(var(--radius-lg) + 2px);
    opacity: 0;
    animation: border-glow 2s ease-in-out; /* Removed infinite */
}

@keyframes border-glow {
    0%, 100% {
        opacity: 0;
    }
    50% {
        opacity: 0.5;
    }
}

/* Enhanced title with gradient text */
.pangram-title {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent !important;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

/* Animated underline for title */
.pangram-title::after {
    background: var(--gradient-accent) !important;
    animation: width-pulse 3s ease-in-out infinite;
}

@keyframes width-pulse {
    0%, 100% {
        width: 60%;
    }
    50% {
        width: 90%;
    }
}

/* Animated slogan */
.pangram-slogan {
    animation: slogan-reveal 1s ease-out 0.5s forwards;
    opacity: 0;
    transform: translateY(10px);
}

@keyframes slogan-reveal {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Add a subtle highlight effect to the slogan */
.pangram-slogan::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 1px;
    background: var(--accent-color);
    transition: width 0.5s ease;
}

.text-center a:hover .pangram-slogan::after {
    width: 50%;
}

/* Enhanced buttons with ripple effect */
.btn-primary, .btn-secondary {
    position: relative;
    overflow: hidden;
    transform-origin: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Add a ripple effect on click */
.btn-primary::after, .btn-secondary::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%, -50%);
    transform-origin: 50% 50%;
}

.btn-primary:active::after, .btn-secondary:active::after {
    animation: ripple 0.6s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0) translate(-50%, -50%);
        opacity: 0.5;
    }
    100% {
        transform: scale(20, 20) translate(-50%, -50%);
        opacity: 0;
    }
}

/* Enhanced hover effects for buttons */
.btn-primary:hover, .btn-secondary:hover {
    transform: translateY(-3px) scale(1.03);
}

.btn-primary:active, .btn-secondary:active {
    transform: translateY(1px) scale(0.98);
}

/* Floating animation for cards - disabled to prevent search bar movement */
.card {
    /* animation: float 6s ease-in-out; */ /* Animation disabled to keep search bar still */
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Enhanced form controls */
.form-control {
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.form-control:focus {
    /* Removed transform to prevent misalignment with input-group-text */
    box-shadow: var(--shadow-lg);
}

/* Staggered animation for list items */
.word-item {
    opacity: 0;
    transform: translateX(-20px);
    animation: slide-in 0.2s ease forwards; /* Faster animation */
}

.word-item:nth-child(1) { animation-delay: 0.02s; } /* Faster stagger */
.word-item:nth-child(2) { animation-delay: 0.04s; }
.word-item:nth-child(3) { animation-delay: 0.06s; }
.word-item:nth-child(4) { animation-delay: 0.08s; }
.word-item:nth-child(5) { animation-delay: 0.1s; }
.word-item:nth-child(6) { animation-delay: 0.12s; }
.word-item:nth-child(7) { animation-delay: 0.14s; }
.word-item:nth-child(8) { animation-delay: 0.16s; }
.word-item:nth-child(9) { animation-delay: 0.18s; }
.word-item:nth-child(10) { animation-delay: 0.2s; }
/* Add more if needed */

@keyframes slide-in {
    0% {
        opacity: 0;
        transform: translateX(-20px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Enhanced hover effect for list items */
.list-group-item:hover {
    background: linear-gradient(90deg, rgba(67, 97, 238, 0.05) 0%, rgba(67, 97, 238, 0.1) 100%) !important;
    transform: translateX(8px) scale(1.02) !important;
    z-index: 2;
}

/* Pulsing effect for badges */
.badge {
    animation: badge-pulse 2s infinite;
}

@keyframes badge-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Enhanced word highlight */
.highlight-letters {
    background: linear-gradient(120deg, rgba(247, 37, 133, 0.1) 0%, rgba(247, 37, 133, 0.2) 100%);
    animation: highlight-pulse 3s infinite;
}

@keyframes highlight-pulse {
    0%, 100% {
        box-shadow: 0 2px 5px rgba(247, 37, 133, 0.1);
    }
    50% {
        box-shadow: 0 4px 12px rgba(247, 37, 133, 0.2);
    }
}

/* Enhanced tabs with animated indicator */
.nav-tabs .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--gradient-accent);
    animation: tab-indicator 0.3s ease-out forwards;
}

@keyframes tab-indicator {
    0% {
        width: 0;
        left: 50%;
    }
    100% {
        width: 100%;
        left: 0;
    }
}

/* Enhanced footer with animated gradient */
.footer {
    position: relative;
    overflow: hidden;
}

.footer::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 300%;
    height: 100%;
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0) 0%, 
        rgba(255, 255, 255, 0.05) 25%, 
        rgba(255, 255, 255, 0.05) 50%, 
        rgba(255, 255, 255, 0) 75%);
    animation: footer-shine 8s linear infinite;
    pointer-events: none;
}

@keyframes footer-shine {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(33.33%);
    }
}

/* Enhanced social buttons */
.social-btn {
    transform-origin: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.social-btn:hover {
    transform: translateY(-5px) scale(1.2) rotate(5deg);
}

/* Animated word title on word page */
.word-title {
    animation: word-title-reveal 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    opacity: 0;
    transform: translateY(-10px);
}

@keyframes word-title-reveal {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Word letters animation */
.word-letters {
    animation: word-letters-reveal 0.8s ease-out 0.3s forwards;
    opacity: 0;
    transform: translateY(10px);
}

@keyframes word-letters-reveal {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scrabble info animation */
.scrabble-info {
    animation: scrabble-info-reveal 0.8s ease-out 0.5s forwards;
    opacity: 0;
}

@keyframes scrabble-info-reveal {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

/* Enhanced letter filter buttons */
.letter-btn {
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(240,240,240,0.9) 100%);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.letter-btn:hover {
    transform: translateY(-5px) scale(1.1) rotate(5deg) !important;
    background: linear-gradient(135deg, rgba(67, 97, 238, 0.1) 0%, rgba(67, 97, 238, 0.2) 100%);
    box-shadow: 0 8px 15px rgba(67, 97, 238, 0.25);
}

.letter-btn.active {
    animation: letter-btn-active 0.5s ease forwards;
}

@keyframes letter-btn-active {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* Mobile optimizations */
@media (max-width: 768px) {
    /* Adjust animations for better performance on mobile */
    .pangram-container {
        animation-duration: 0.5s;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
    
    .word-item {
        animation-duration: 0.3s;
    }
    
    /* Optimize hover effects for touch */
    .list-group-item:active {
        background: linear-gradient(90deg, rgba(67, 97, 238, 0.05) 0%, rgba(67, 97, 238, 0.1) 100%) !important;
        transform: translateX(8px) scale(1.02) !important;
    }
    
    /* Enhance touch targets */
    .btn-primary, .btn-secondary, .nav-tabs .nav-link {
        padding: 12px 20px;
    }
    
    .letter-btn {
        width: 44px;
        height: 44px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/* Loading animation */
.loading-animation {
    display: inline-block;
    position: relative;
    width: 80px;
    height: 80px;
}

.loading-animation div {
    position: absolute;
    top: 33px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--primary-color);
    animation-timing-function: cubic-bezier(0, 1, 1, 0);
}

.loading-animation div:nth-child(1) {
    left: 8px;
    animation: loading-animation1 0.6s infinite;
}

.loading-animation div:nth-child(2) {
    left: 8px;
    animation: loading-animation2 0.6s infinite;
}

.loading-animation div:nth-child(3) {
    left: 32px;
    animation: loading-animation2 0.6s infinite;
}

.loading-animation div:nth-child(4) {
    left: 56px;
    animation: loading-animation3 0.6s infinite;
}

@keyframes loading-animation1 {
    0% {
        transform: scale(0);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes loading-animation3 {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(0);
    }
}

@keyframes loading-animation2 {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(24px, 0);
    }
}

.ripple-effect {
    position: absolute;
    width: 100px;
    height: 100px;
    margin-top: -50px;
    margin-left: -50px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.7);
    animation: ripple 0.6s linear;
    transform: scale(0);
    opacity: 1;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.input-focused {
    position: relative;
}

.input-focused::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--gradient-primary);
    animation: input-focus-line 0.3s ease forwards;
    transform-origin: center;
}

@keyframes input-focus-line {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

/* Scroll Indicator Styling */
.scroll-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    z-index: 100;
}

.scroll-indicator.visible {
    opacity: 0.8;
    transform: translateY(0);
}

.scroll-indicator:hover {
    transform: translateY(-5px);
    opacity: 1;
    box-shadow: 0 6px 15px rgba(0,0,0,0.3);
}

/* Mobile optimizations for new elements */
@media (max-width: 768px) {
    .scroll-indicator {
        width: 36px;
        height: 36px;
        bottom: 15px;
        right: 15px;
        font-size: 0.9rem;
    }
}

.chain-shell {
    --chain-blue: var(--primary-color);
    --chain-green: #2b9348;
    --chain-red: #d64045;
    --chain-gold: #b8860b;
    max-width: 720px;
    margin: 0 auto 3rem;
}

.chain-intro {
    padding: 1rem 0;
}

.chain-kicker {
    display: inline-block;
    color: var(--chain-blue);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.chain-title {
    margin: .35rem 0 .5rem;
    font-weight: 800;
}

.chain-date {
    color: var(--neutral-600);
    font-size: .9rem;
}

.chain-game {
    position: relative;
    padding: clamp(1.1rem, 4vw, 2rem);
    border: 1px solid rgba(67, 97, 238, .14);
    border-radius: 1.25rem;
    /* Pastel with chain links in two corners (generated, like the header),
       under a white wash so the answers stay the calmest thing on it. */
    background:
        linear-gradient(rgba(255, 255, 255, .55), rgba(255, 255, 255, .55)),
        url('../images/chain-board-bg.webp') center / cover no-repeat,
        #fff;
    box-shadow: 0 1rem 2.5rem rgba(28, 42, 88, .10);
}

.chain-countdown {
    display: grid;
    min-height: 20rem;
    padding: 1.5rem 0;
    place-content: center;
    justify-items: center;
}

/* The explanation under the clock. Narrow on purpose: it is read once, by
   somebody who has never seen the game, and a wide paragraph of it under a
   round clock reads as a wall. */
.chain-howto {
    max-width: 30rem;
    margin-bottom: 1rem;
    text-align: center;
}

.chain-example {
    display: inline-block;
    padding: .4rem .9rem;
    border-radius: 999px;
    background: rgba(67, 97, 238, .09);
    color: var(--chain-blue);
    font-weight: 600;
}

.chain-rules summary {
    color: var(--chain-blue);
    cursor: pointer;
    font-size: .95rem;
    font-weight: 600;
}

.chain-rule-list {
    margin: .6rem 0 0;
    padding: 0;
    list-style: none;
    text-align: left;
}

.chain-rule-list li {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .35rem 0;
    border-top: 1px solid rgba(67, 97, 238, .12);
    font-size: .92rem;
}

.chain-rule-list li:first-child { border-top: 0; }
.chain-rule-icon { flex: 0 0 auto; width: 2.5rem; height: 2.5rem; }
.chain-rule-list strong { color: var(--game-stat-navy); }
/* The rule and what it means are one sentence on one line; without a mark
   between them the name runs straight into its own explanation. */
.chain-rule-list strong::after { content: ' — '; color: var(--neutral-600); }
.chain-rule-list span { color: var(--neutral-600); }

.chain-countdown-clock {
    position: relative;
    display: grid;
    width: clamp(7.5rem, 28vw, 10rem);
    height: clamp(7.5rem, 28vw, 10rem);
    margin-bottom: 1.4rem;
    place-items: center;
    border-radius: 50%;
    background:
        radial-gradient(circle at center, #fff 58%, transparent 60%),
        conic-gradient(from -90deg, var(--primary-color), #7209b7, #4cc9f0, var(--primary-color));
    box-shadow: 0 1rem 2.5rem rgba(67, 97, 238, .18);
}

/* Before the count the panel shows the game instead of a clock with nothing
   on it: the illustration of linked tiles takes the clock's place, and the
   two swap when chain.js sets .is-counting. The start button under it is the
   one control, so there is no play triangle that only looks like a button. */
.chain-countdown-clock:not(.is-counting) { display: none; }
.chain-countdown-clock.is-counting + .chain-start-art { display: none; }

.chain-start-art {
    display: block;
    width: min(30rem, 82vw);
    max-width: 100%;
    height: auto;
    margin-bottom: 1.4rem;
    filter: drop-shadow(0 .6rem .9rem rgba(67, 97, 238, .14));
}

.chain-countdown-value {
    display: none;
    color: var(--game-stat-navy);
    font-size: clamp(3rem, 12vw, 4.6rem);
    font-weight: 800;
    line-height: 1;
}

.chain-countdown-clock.is-counting .chain-countdown-value { display: block; }

.chain-countdown-clock.is-ticking {
    animation: chain-countdown-pulse .7s cubic-bezier(.2, .8, .2, 1);
}

.chain-countdown-clock.is-go {
    background:
        radial-gradient(circle at center, #fff 58%, transparent 60%),
        conic-gradient(from -90deg, #2b9348, #80b918, #4cc9f0, #2b9348);
}

.chain-countdown-clock.is-go .chain-countdown-value {
    color: var(--chain-green);
    font-size: clamp(1.4rem, 6vw, 2rem);
}

@keyframes chain-countdown-pulse {
    0% { opacity: .5; transform: scale(.82); }
    65% { opacity: 1; transform: scale(1.06); }
    100% { transform: scale(1); }
}

/* A row of numbered circles joined by a line. Each step draws the stretch of
   line to its left, so the line turns green up to the step being played. The
   circle size follows the viewport: ten of them have to fit a phone. */
.chain-steps {
    --chain-step-size: clamp(1.35rem, 6.5vw, 2rem);
    --chain-step-track: #e3e6ee;
    display: flex;
    margin: 0;
    padding: 0;
    list-style: none;
}

.chain-step {
    position: relative;
    display: flex;
    flex: 1 1 0;
    min-width: 0;
    justify-content: center;
}

.chain-step::before {
    position: absolute;
    top: 50%;
    right: 50%;
    width: 100%;
    height: 2px;
    background: var(--chain-step-track);
    content: '';
    transform: translateY(-50%);
    transition: background-color .35s ease;
}

.chain-step:first-child::before { display: none; }

.chain-step.is-done::before,
.chain-step.is-current::before { background: var(--chain-green); }

.chain-step span {
    position: relative;
    z-index: 1;
    display: inline-flex;
    width: var(--chain-step-size);
    height: var(--chain-step-size);
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #eef0f5;
    color: #8a91a5;
    font-size: calc(var(--chain-step-size) * .42);
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    line-height: 1;
    transition: background-color .35s ease, color .35s ease, box-shadow .35s ease;
}

.chain-step.is-current span {
    background: #cdeed8;
    box-shadow: 0 0 0 2px #9fd9b2;
    color: #1e6b35;
}

/* One wrong click turns the step yellow, more than one red: the same three
   colours as the result grid and the shared squares. The step being played
   shows it in the light shade, a finished step in the full one. */
.chain-step.is-current.has-miss span {
    background: #fdf0c4;
    box-shadow: 0 0 0 2px #f0d27c;
    color: #8a6100;
}

.chain-step.is-current.has-misses span {
    background: #fbd9da;
    box-shadow: 0 0 0 2px #efa6a9;
    color: #a3262b;
}

/* The number makes way for a check mark drawn from two borders, so it needs
   no icon from the Font Awesome subset. */
.chain-step.is-done span {
    background: var(--chain-green);
    color: transparent;
}

.chain-step.is-done.has-miss span { background: #e0a800; }
.chain-step.is-done.has-misses span { background: var(--chain-red); }

.chain-step.is-done span::after {
    position: absolute;
    top: 46%;
    left: 50%;
    width: 28%;
    height: 50%;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    content: '';
    transform: translate(-50%, -50%) rotate(45deg);
}

.chain-play-status {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: .6rem;
}

/* Three figures with the number large and the label above it: the clock and
   the score are what the game is about, and they were a line of small print. */
.chain-play-status-item {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: center;
    gap: .1rem;
    padding: .45rem .5rem;
    border-radius: .85rem;
    background: rgba(67, 97, 238, .06);
}

.chain-play-status-item[hidden] { display: none; }

.chain-play-status-item span {
    overflow: hidden;
    color: var(--neutral-600);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.chain-play-status-item strong {
    flex: 0 0 auto;
    color: var(--game-stat-navy);
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.chain-live-timer strong { color: var(--chain-green); }

.chain-live-best strong { color: var(--chain-gold); }

/* Past the record: still shown, but it is no longer within reach. */
.chain-live-best.is-behind { opacity: .55; }
.chain-live-best.is-behind strong { text-decoration: line-through; }

/* The chain so far, as letter tiles joined by pink links. One row that
   scrolls sideways; chain.js keeps the newest word in view. */
.chain-trail {
    display: flex;
    align-items: center;
    gap: 0;
    margin: 0 0 1rem;
    padding: .35rem .25rem .6rem;
    list-style: none;
    overflow-x: auto;
    /* Swiped, not dragged: a scrollbar under the tiles read as a second
       progress bar. */
    scrollbar-width: none;
}

.chain-trail::-webkit-scrollbar { display: none; }

.chain-trail:empty { display: none; }

/* On the finished game: all of it at once, wrapped rather than scrolled. */
.chain-trail.is-final {
    flex-wrap: wrap;
    justify-content: center;
    row-gap: .5rem;
    margin: 1rem 0 .75rem;
    overflow: visible;
}

.chain-trail-word {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
}

.chain-trail-word + .chain-trail-word::before {
    content: '';
    flex: 0 0 auto;
    width: 1.1rem;
    height: .45rem;
    margin: 0 .2rem;
    border: 2px solid #f72585;
    border-radius: 999px;
}

.chain-trail-tiles { display: inline-flex; gap: 2px; }

.chain-trail-letter {
    display: inline-grid;
    place-items: center;
    min-width: 1.35rem;
    height: 1.6rem;
    padding: 0 .2rem;
    border-radius: .35rem;
    background: linear-gradient(135deg, #fff 0%, var(--neutral-200) 100%);
    box-shadow: 0 2px 4px rgba(28, 42, 88, .14);
    color: #3f37c9;
    font-size: .85rem;
    font-weight: 800;
    line-height: 1;
}

.chain-trail-word.is-current .chain-trail-letter {
    background: #3f37c9;
    color: #fff;
}

.chain-trail-word.is-new .chain-trail-tiles {
    animation: chain-link-in .45s cubic-bezier(.175, .885, .32, 1.275);
}

@keyframes chain-link-in {
    from { opacity: 0; transform: translateY(-.6rem) scale(.6); }
    to { opacity: 1; transform: none; }
}

.chain-word-card {
    padding: 1.5rem 1rem;
    border-radius: 1rem;
    background: linear-gradient(145deg, rgba(67, 97, 238, .08), rgba(114, 9, 183, .06));
}

.chain-word-label {
    color: var(--neutral-600);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.chain-source {
    margin: .25rem 0 .65rem;
    overflow-wrap: anywhere;
    color: var(--game-stat-navy);
    font-size: clamp(2rem, 8vw, 3.4rem);
    font-weight: 800;
    line-height: 1.1;
}

.chain-relation {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .25rem .85rem .25rem .3rem;
    border-radius: 999px;
    background: rgba(67, 97, 238, .09);
    color: var(--chain-blue);
    font-size: .95rem;
    font-weight: 600;
}

.chain-relation-icon {
    width: 2rem;
    height: 2rem;
    filter: drop-shadow(0 2px 3px rgba(28, 42, 88, .18));
}

.chain-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .8rem;
    margin: 1.25rem 0 .8rem;
}

.chain-option {
    position: relative;
    min-height: 4.25rem;
    padding: .75rem;
    overflow: hidden;
    overflow-wrap: anywhere;
    border: 2px solid #dfe4ff;
    border-radius: .9rem;
    background: #fff;
    color: #27336d;
    font-size: clamp(1rem, 3vw, 1.2rem);
    font-weight: 700;
    transition: transform .15s ease, border-color .15s ease, background-color .15s ease;
}

.chain-option:hover:not(:disabled),
.chain-option:focus-visible:not(:disabled) {
    transform: translateY(-2px);
    border-color: var(--chain-blue);
    outline: none;
}

.chain-option.is-wrong {
    border-color: rgba(214, 64, 69, .45);
    background: rgba(214, 64, 69, .08);
    color: var(--chain-red);
}

.chain-option.is-correct {
    border-color: rgba(43, 147, 72, .55);
    background: rgba(43, 147, 72, .12);
    color: var(--chain-green);
}

.chain-options.is-cooling .chain-option {
    cursor: not-allowed;
}

.chain-options.is-cooling .chain-option:not(.is-wrong) {
    border-color: #e7eaf5;
    color: rgba(39, 51, 109, .45);
}

.chain-options.is-cooling .chain-option::after {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: .25rem;
    transform-origin: left;
    animation: chain-cooldown-sweep var(--chain-cooldown-ms, 3000ms) linear forwards;
    background: var(--chain-red);
    content: '';
}

@keyframes chain-cooldown-sweep {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

.chain-feedback {
    min-height: 1.6rem;
    text-align: center;
    font-weight: 700;
}

.chain-feedback.is-wrong { color: var(--chain-red); }
.chain-feedback.is-correct { color: var(--chain-green); }

.chain-xp-feedback {
    position: absolute;
    z-index: 2;
    top: 1rem;
    right: 1rem;
    margin: 0;
    padding: .4rem .7rem;
    pointer-events: none;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--chain-blue) 0%, var(--secondary-color) 100%);
    color: #fff;
    font-size: .9rem;
    font-weight: 800;
    opacity: 0;
    transform: translateY(.5rem);
}

.chain-xp-feedback.is-visible {
    animation: chain-xp-pop 1.1s ease-out;
}

@keyframes chain-xp-pop {
    0% { opacity: 0; transform: translateY(.5rem) scale(.9); }
    18%, 70% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(-.35rem) scale(1); }
}

.chain-complete {
    padding: 1rem 0;
}

/* The trophy on a finished game. It arrives with a small bounce: this is the
   moment the game pays out, and the one place a little motion is earned. */
.chain-finish-art {
    display: block;
    width: auto;
    height: clamp(6rem, 22vw, 8rem);
    margin: 0 auto 1rem;
    filter: drop-shadow(0 .7rem 1rem rgba(217, 158, 11, .28));
    animation: chain-trophy-pop .6s cubic-bezier(.2, .9, .3, 1.25) both;
}

@keyframes chain-trophy-pop {
    0% { opacity: 0; transform: translateY(.6rem) scale(.7); }
    100% { opacity: 1; transform: none; }
}

/* The result is the moment someone is willing to tell a friend, so the row of
   share buttons sits in a card of its own with a question above it. The
   buttons themselves are the site's ordinary social buttons: a game is not
   the place to invent a second visual language for the same action. */
.chain-share {
    --chain-share-tint: #f6f3ff;
    --chain-share-tint-2: #eef2ff;
    --chain-share-edge: #e2ddfa;
    --chain-share-ink: #39305c;
    --chain-share-ink-soft: #655c7b;

    margin: 1.5rem 0;
    padding: clamp(1.1rem, 4vw, 1.8rem);
    border: 1px solid var(--chain-share-edge);
    border-radius: 1.25rem;
    background: linear-gradient(135deg, var(--chain-share-tint), var(--chain-share-tint-2));
    text-align: center;
}

.chain-share h4 {
    color: var(--chain-share-ink);
    font-size: 1.35rem;
    font-weight: 750;
}

.chain-share-invite {
    margin: .6rem 0 1.2rem;
    color: var(--chain-share-ink-soft);
    font-size: .9rem;
}

/* The one control most people should press, and the only route from this page
   to the chat apps no intent url reaches. It carries a word as well as an
   icon: among four round icons a fifth round icon is not an invitation. The
   row below it keeps every button it had. */
.chain-share-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    width: min(100%, 22rem);
    margin: 0 auto 1rem;
    padding: .8rem 1.4rem;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--chain-blue) 0%, var(--secondary-color) 100%);
    color: #fff;
    font-size: 1.02rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease;
    box-shadow: 0 .5rem 1.1rem rgba(67, 56, 202, .22);
}

.chain-share-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 .7rem 1.4rem rgba(67, 56, 202, .28);
}

.chain-share-primary:active { transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
    .chain-share-primary { transition: none; }
    .chain-share-primary:hover { transform: none; }
}

.chain-share .social-share-buttons {
    margin-left: 0;
    justify-content: center;
}

.chain-share button.social-btn {
    padding: 0;
    border: 0;
    cursor: pointer;
}

.chain-share a:focus-visible,
.chain-share button:focus-visible {
    outline: 3px solid var(--chain-blue);
    outline-offset: 4px;
}

.chain-share-feedback {
    margin: .6rem 0 0;
    color: var(--chain-green);
    font-size: .85rem;
}

/* Only ever visible when the clipboard refused; the message above it says so,
   so this stays neutral rather than green. */
.chain-share-fallback {
    display: block;
    width: 100%;
    margin: .5rem 0 0;
    padding: .4rem .6rem;
    border: 1px solid var(--neutral-300);
    border-radius: .35rem;
    background: var(--neutral-100);
    color: var(--neutral-700);
    font-size: .8rem;
    resize: vertical;
}

.chain-step-summary > summary {
    padding: .35rem 0;
    cursor: pointer;
    text-align: center;
}

.chain-step-summary > summary:focus-visible {
    border-radius: .35rem;
    outline: 2px solid var(--chain-blue);
    outline-offset: 2px;
}

.chain-step-summary[open] > summary { margin-bottom: .75rem; }

.chain-result-grid {
    margin: 1.2rem 0 .5rem;
    font-size: clamp(1.45rem, 6vw, 2.15rem);
    letter-spacing: .08em;
}

.chain-score {
    color: var(--neutral-700);
    font-size: 1.1rem;
    font-weight: 700;
}

.chain-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .75rem;
}

@media (max-width: 600px) {
    .chain-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.chain-stat {
    display: flex;
    min-height: 5rem;
    flex-direction: column;
    justify-content: center;
    border-radius: .85rem;
    background: #f5f7ff;
}

.chain-stat strong {
    color: var(--game-stat-navy);
    font-size: 1.6rem;
}

.chain-stat span {
    color: var(--neutral-600);
    font-size: .78rem;
}

.chain-stat.is-xp {
    border: 1px solid rgba(43, 147, 72, .22);
    background: rgba(43, 147, 72, .09);
}

.chain-stat.is-xp strong {
    animation: chain-xp-arrive .55s ease-out both;
    color: var(--chain-green);
    font-size: 2.1rem;
}

.chain-stat.is-xp span { color: rgba(43, 147, 72, .8); }

@keyframes chain-xp-arrive {
    0% { opacity: 0; transform: scale(.55); }
    65% { transform: scale(1.14); }
    100% { opacity: 1; transform: scale(1); }
}

.chain-stat .chain-stat-note {
    margin-top: .15rem;
    font-size: .68rem;
    opacity: .75;
}

.chain-time-note {
    margin: -.75rem 0 1.25rem;
    font-size: .85rem;
    font-weight: 600;
}

.chain-time-note[hidden] { display: none; }

/* The answer to somebody else's result. Same shape as the note above it and a
   separate element, because that one measures you against yourself. */
.chain-challenge-note {
    margin: -.5rem 0 1.25rem;
    font-size: .9rem;
    font-weight: 600;
}

.chain-challenge-note[hidden] { display: none; }

.chain-challenge-note.is-faster { color: var(--chain-green); }

.chain-challenge-note.is-slower { color: var(--neutral-600); }

/* The line that keeps a challenge alive on arrival: whoever opened a shared
   link reads the time to beat before the countdown, not a cold start. */
.chain-challenge {
    max-width: 28rem;
    margin: 0 auto 1.4rem;
    padding: .8rem 1rem;
    border: 1px solid var(--chain-share-edge, #e2ddfa);
    border-radius: .9rem;
    background: linear-gradient(135deg, #f6f3ff, #eef2ff);
    color: #39305c;
    font-size: .95rem;
}

.chain-challenge strong { display: block; }

.chain-challenge span {
    display: block;
    margin-top: .2rem;
    color: #655c7b;
    font-size: .85rem;
}

.chain-time-note.is-faster { color: var(--chain-green); }

.chain-time-note.is-slower { color: var(--neutral-600); }

.chain-time-note.is-first { color: var(--chain-blue); }

.chain-time-note.is-record {
    color: var(--chain-gold);
    font-size: .95rem;
}

.chain-progression {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .85rem;
    text-align: left;
}

.chain-progression.is-level-only { grid-template-columns: 1fr; }

.chain-xp-earned,
.chain-level-progress {
    padding: .9rem 1rem;
    border: 1px solid #e4e9fb;
    border-radius: .9rem;
    background: #f8f9ff;
}

.chain-xp-earned[hidden],
.chain-level-progress[hidden] { display: none; }

.chain-xp-earned h4 { text-align: center; }

.chain-xp-row,
.chain-xp-total-row,
.chain-level-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .75rem;
}

.chain-xp-row {
    padding: .2rem 0;
    color: var(--neutral-700);
}

.chain-xp-row.is-empty { opacity: .45; }

.chain-xp-row.is-empty strong { color: var(--neutral-600); }

.chain-xp-row strong,
.chain-xp-total-row strong {
    color: var(--chain-green);
    font-variant-numeric: tabular-nums;
}

.chain-xp-total-row {
    margin-top: .35rem;
    padding-top: .5rem;
    justify-content: flex-end;
    border-top: 1px solid #dce2f7;
    font-size: 1.15rem;
}

.chain-xp-collected {
    margin: .45rem 0 0;
    color: var(--neutral-600);
    font-size: .76rem;
    text-align: right;
}

.chain-xp-collected[hidden] { display: none; }

.chain-level-progress {
    display: grid;
    align-content: center;
    gap: .8rem;
}

.chain-level-heading span {
    color: var(--neutral-600);
    font-size: .84rem;
    font-variant-numeric: tabular-nums;
}

.chain-level-progress .progress {
    height: .6rem;
    border-radius: 999px;
}

.chain-level-progress .progress-bar {
    background: linear-gradient(90deg, var(--chain-green), #80b918);
}

.chain-solution-track {
    display: flex;
    flex-wrap: wrap;
    margin: 0;
    padding: .75rem .35rem 1rem;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    list-style: none;
}

.chain-solution-word {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: .55rem;
    color: var(--game-stat-navy);
    font-size: .95rem;
    font-weight: 800;
}

.chain-word-link {
    border-radius: .35rem;
    color: inherit;
    text-decoration: none;
}

.chain-word-link:hover,
.chain-word-link:focus-visible {
    text-decoration: underline;
    text-underline-offset: .2em;
}

.chain-solution-word::after {
    color: var(--chain-blue);
    content: '→';
    font-size: 1.2rem;
}

.chain-solution-word:last-child {
    padding: .42rem .7rem;
    border-radius: .7rem;
    background: rgba(43, 147, 72, .12);
    color: var(--chain-green);
}

.chain-solution-word:last-child::after { content: none; }

.chain-step-details {
    overflow: hidden;
    border: 1px solid #e8ebf8;
    border-radius: .85rem;
}

.chain-step-detail {
    display: flex;
    padding: .65rem .8rem;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    border-bottom: 1px solid #edf0fa;
    font-size: .86rem;
}

.chain-step-detail:last-child { border-bottom: 0; }
.chain-step-overview { display: grid; gap: .2rem; }
.chain-step-description { font-weight: 700; }
.chain-step-solution {
    display: flex;
    align-items: baseline;
    gap: .45rem;
    color: var(--neutral-700);
    font-size: 1rem;
}
.chain-step-solution strong { color: var(--chain-green); }
.chain-step-arrow { color: var(--chain-blue); }
.chain-step-performance { color: var(--neutral-600); text-align: right; }

@media (max-width: 480px) {
    .chain-play-status { gap: .35rem; }
    .chain-play-status-item { padding: .35rem .25rem; }
    .chain-play-status-item span { font-size: .62rem; letter-spacing: .03em; }
    .chain-play-status-item strong { font-size: 1.2rem; }
    /* Two columns, not one: four answers stacked put the last of them below
       the fold on every phone, and an answer you have to scroll to is an
       answer you take longer over than the person you are racing. The tiles
       stay well over the 44 px a finger needs. */
    .chain-option { min-height: 3.4rem; font-size: clamp(.95rem, 4vw, 1.1rem); }
    .chain-game { border-radius: 1rem; }
    .chain-step-detail { align-items: flex-start; flex-direction: column; gap: .2rem; }
    .chain-step-performance { text-align: left; }
    .chain-progression { grid-template-columns: 1fr; }
}

/* Everything that belongs to the game page but not to playing it. The
   date and the navigation are what a first visitor reads; once the clock is
   running they only push the answers off the screen, and the heading shrinks
   to its name and one line. Small screens only - on a desktop there is room
   for all of it. */
@media (max-width: 600px) {
    /* The start button belongs above the fold on a phone: a first visitor who
       has to scroll to find it is one tap further from playing, and the panel
       grew when the explanation moved onto it. Every value here is space
       around things, not the things themselves. */
    .chain-intro { padding: .5rem 0; }
    .chain-countdown { padding: .75rem 0; }
    .chain-countdown-clock {
        width: clamp(6rem, 22vw, 8rem);
        height: clamp(6rem, 22vw, 8rem);
        margin-bottom: 1rem;
    }
    .chain-howto { margin-bottom: .75rem; }

    /* Folded, not hidden: since the game opens straight on its first step
       (320c8ad) a phone never showed the heading at all, and someone who came
       in from the footer or a search saw four words with no name or purpose.
       Five of seven abandoned puzzles stopped before the first answer
       (insights, October 2026). Name and one line stay; kicker and date go. */
    /* !important against bootstrap's .mb-4 on the header, as on .chain-nav. */
    body.chain-is-playing .chain-intro { margin-bottom: .5rem !important; padding: 0; }
    body.chain-is-playing .chain-kicker,
    body.chain-is-playing .chain-date { display: none; }
    body.chain-is-playing .chain-title { margin: 0 0 .1rem; font-size: 1.15rem; }
    body.chain-is-playing .chain-intro p { font-size: .85rem; line-height: 1.35; }
    /* !important because the row carries bootstrap's .d-flex, which is
       display: flex !important and wins over anything without it. */
    body.chain-is-playing .chain-nav { display: none !important; }
    body.chain-is-playing .chain-game { padding: 1rem .85rem; }
    body.chain-is-playing .chain-word-card { padding: 1rem .75rem; }
    body.chain-is-playing .chain-options { margin: .9rem 0 .6rem; }
}

@media (prefers-reduced-motion: reduce) {
    .chain-trail-word.is-new .chain-trail-tiles { animation: none; }
    .chain-stat.is-xp strong { animation: none; }
    .chain-countdown-clock.is-ticking { animation: none; }
    .chain-finish-art { animation: none; }
    .chain-xp-feedback.is-visible { animation: none; opacity: 1; transform: none; }
    .chain-option, .chain-step::before, .chain-step span { transition: none; }
    .chain-options.is-cooling .chain-option::after { animation: none; }
}

/* The rules under a running game: small and out of the way of the answers. */
.chain-rules-play {
    margin-top: 1rem;
    font-size: .9rem;
    text-align: left;
}

/* Today's first link on the home page (partials/_chain_teaser.html). It
   borrows the game's own pill and answer buttons, so it looks like the game
   it opens. */
.chain-teaser {
    padding: 1.1rem 1.1rem 1rem;
    border: 1px solid rgba(67, 97, 238, .18);
    border-radius: 1.25rem;
    background: linear-gradient(145deg, rgba(67, 97, 238, .09), rgba(247, 37, 133, .07));
}

.chain-teaser-head {
    display: flex;
    align-items: center;
    gap: .55rem;
    margin-bottom: .6rem;
}

.chain-teaser-head img { width: 1.9rem; height: 1.9rem; }

.chain-teaser-kicker {
    color: var(--primary-color);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.chain-teaser-title {
    margin: 0;
    color: #2b2d7c;
    font-size: 1.05rem;
    font-weight: 800;
}

.chain-teaser-word {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .6rem;
    margin: .2rem 0 .8rem;
}

.chain-teaser-word b {
    color: #2b2d7c;
    font-size: 1.9rem;
    font-weight: 800;
    line-height: 1;
}

.chain-teaser-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    margin: .5rem 0 .35rem;
}

.chain-teaser-tile,
.chain-teaser-blank {
    display: inline-grid;
    min-width: 6.5rem;
    min-height: 3rem;
    padding: .35rem .9rem;
    place-items: center;
    border-radius: .9rem;
    font-size: clamp(1.1rem, 5.5vw, 1.45rem);
    font-weight: 800;
    line-height: 1.1;
    overflow-wrap: anywhere;
}

.chain-teaser-tile {
    background: #2b2d7c;
    color: #fff;
}

.chain-teaser-blank {
    flex: none;
    border: 2px dashed rgba(67, 97, 238, .55);
    color: rgba(67, 97, 238, .7);
}

.chain-teaser-joint { width: 1.7rem; height: 1.7rem; }

.chain-teaser-rule {
    display: flex;
    justify-content: center;
    margin-bottom: .7rem;
}

/* The rule is a label here, not a control: with its tinted pill and shadowed
   icon it looked more tappable than the four answers (Stefan, 27 October
   2026). The game keeps the pill; there the answers are plainly buttons. */
.chain-teaser .chain-relation {
    padding: 0;
    background: none;
    color: var(--primary-color);
}

.chain-teaser .chain-relation-icon {
    width: 1.6rem;
    height: 1.6rem;
    filter: none;
}

.chain-teaser-prompt {
    margin: 0 0 .55rem;
    color: #2b2d7c;
    font-size: .92rem;
    font-weight: 600;
}

.chain-teaser-prompt strong { font-weight: 800; }

.chain-teaser .chain-options { margin: 0 0 .7rem; }

/* Raised keys that sink when pressed, so the answers read as buttons. */
.chain-teaser .chain-option {
    display: grid;
    min-height: 2.9rem;
    place-items: center;
    border-color: rgba(67, 97, 238, .45);
    box-shadow: 0 3px 0 rgba(67, 97, 238, .28), 0 6px 14px rgba(28, 42, 88, .08);
    text-decoration: none;
}

.chain-teaser .chain-option:hover,
.chain-teaser .chain-option:focus-visible {
    border-color: var(--primary-color);
}

.chain-teaser .chain-option:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 rgba(67, 97, 238, .28);
}

.chain-teaser-foot {
    margin: 0;
    color: var(--neutral-600);
    font-size: .82rem;
    text-align: center;
}
/* Daily Lockword. The board and the tiles of the word trail are the chain's;
   what is here is the clue, the boxes and the ring of letters. */
.lock-intro { margin-bottom: 1rem; padding: .25rem 0 0; }

.lock-intro-text {
    max-width: 32rem;
    margin: 0 auto .2rem;
    color: var(--neutral-600);
    font-size: .95rem;
}

.lock-clue {
    position: relative;
    margin-bottom: .6rem;
    padding: .7rem .85rem .8rem;
    border: 1px solid rgba(67, 97, 238, .16);
    border-radius: .9rem;
    background: #fff;
    text-align: center;
}

.lock-clue-label {
    display: block;
    color: var(--neutral-600);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.lock-clue-text {
    margin: .25rem 0 .65rem;
    color: #2d3a7c;
    font-size: clamp(1.3rem, 5.2vw, 1.65rem);
    font-weight: 700;
    line-height: 1.25;
}

.lock-boxes {
    display: flex;
    gap: clamp(.12rem, .8vw, .25rem);
    justify-content: center;
}

/* Grown to fit eleven boxes on a phone, as many as a solution can have. */
.lock-box {
    display: grid;
    flex: 0 1 1.9rem;
    place-items: center;
    aspect-ratio: 1 / 1.14;
    min-width: 0;
    border: 2px dashed #c5cbe6;
    border-radius: .4rem;
    color: #9aa3d0;
    font-size: clamp(.85rem, 3.6vw, 1.1rem);
    font-weight: 800;
    line-height: 1;
}

.lock-box.is-known {
    border: 2px solid #3f37c9;
    background: #3f37c9;
    color: #fff;
}

/* Empty until the flying tile lands on it. */
.lock-box.is-known.is-arriving {
    border: 2px dashed #3f37c9;
    background: none;
    color: transparent;
}

.lock-box.is-landed { animation: lock-box-click .32s cubic-bezier(.175, .885, .32, 1.275); }

@keyframes lock-box-click {
    0% { transform: translateY(.2rem) scale(1.18); }
    55% { transform: translateY(0) scale(.92); }
    100% { transform: none; }
}

.lock-box.is-solved {
    border-color: #e0a412;
    background: linear-gradient(160deg, #f7cf5a, #e0a412);
    color: #3a2a00;
}

.lock-status {
    display: flex;
    flex-wrap: wrap;
    gap: .15rem .6rem;
    align-items: center;
    justify-content: center;
    color: var(--neutral-600);
    font-size: .9rem;
    text-align: center;
}

.lock-status strong {
    color: #2d3a7c;
    font-size: 1.02rem;
    font-weight: 800;
}

.lock-xp {
    padding: .1rem .55rem;
    border: 1px solid #f1d98e;
    border-radius: 999px;
    background: #fff6dc;
    color: #8a6200;
    font-size: .8rem;
    font-weight: 800;
}

.lock-entry {
    min-height: 3rem;
    margin-top: .25rem;
    border-bottom: 3px solid rgba(67, 97, 238, .22);
    color: #2d3a7c;
    font-size: clamp(1.7rem, 7vw, 2.4rem);
    font-weight: 800;
    letter-spacing: .06em;
    line-height: 1.25;
    text-align: center;
    overflow-wrap: anywhere;
}

/* Says what to do where the word will appear: nobody reads the intro. */
.lock-entry:empty::before {
    content: attr(data-hint);
    display: block;
    padding-top: .55rem;
    color: var(--neutral-600);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0;
}

.lock-feedback {
    min-height: 1.35rem;
    margin: .2rem 0 0;
    color: var(--neutral-600);
    font-size: .88rem;
    font-weight: 700;
    text-align: center;
}

.lock-feedback.is-wrong { color: #d64045; }
.lock-feedback.is-correct { color: #2b9348; }

.lock-ring {
    position: relative;
    width: min(17rem, 100%);
    aspect-ratio: 1;
    margin: .2rem auto 1rem;
}

.lock-ring[hidden], .lock-actions[hidden], .lock-entry[hidden], .lock-feedback[hidden] {
    display: none;
}

.lock-tile {
    position: absolute;
    top: calc(50% + var(--tile-y) - 11.5%);
    left: calc(50% + var(--tile-x) - 10.5%);
    z-index: 2;
    display: grid;
    width: 21%;
    aspect-ratio: 1 / 1.08;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: .7rem;
    background: linear-gradient(160deg, #4d45de, #3f37c9);
    box-shadow: 0 .25rem 0 #2c2690, 0 .5rem 1rem rgba(28, 42, 88, .18);
    color: #fff;
    font-size: clamp(1.25rem, 5.4vw, 1.6rem);
    font-weight: 800;
    line-height: 1;
    touch-action: manipulation;
    transition: transform .08s ease, box-shadow .08s ease;
    user-select: none;
}

.lock-tile:active {
    box-shadow: 0 .08rem 0 #2c2690;
    transform: translateY(.17rem);
}

.lock-link {
    position: absolute;
    top: calc(50% + var(--tile-y));
    left: calc(50% + var(--tile-x));
    z-index: 1;
    width: 1.1rem;
    height: .5rem;
    margin: -.25rem 0 0 -.55rem;
    border: 2.5px solid #f72585;
    border-radius: 999px;
    transform: rotate(var(--link-turn));
}

.lock-center {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    pointer-events: none;
}

.lock-padlock {
    position: relative;
    width: 31%;
    aspect-ratio: 300 / 413;
    filter: drop-shadow(0 .45rem .5rem rgba(114, 9, 183, .25));
}

.lock-padlock img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.lock-padlock-shackle {
    transform-origin: 78.2% 41%;
}

/* The two parts of one picture: the shackle really leaves the body. */
.lock-ring.is-open .lock-padlock-shackle { transform: translateY(-13%) rotate(26deg); }

.lock-ring.is-opening .lock-padlock { animation: lock-rattle .34s ease-in-out; }

.lock-ring.is-opening .lock-padlock-shackle {
    animation: lock-spring .62s .3s cubic-bezier(.3, 1.5, .5, 1) backwards;
}

.lock-padlock-count {
    position: absolute;
    top: 41%;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: clamp(1.1rem, 5vw, 1.45rem);
    font-weight: 800;
    text-shadow: 0 1px 3px rgba(90, 10, 130, .55);
}

.lock-ring.is-open .lock-link { opacity: 0; }

.lock-ring.is-opening .lock-link {
    animation: lock-link-fall .75s calc(.35s + var(--link-delay)) ease-in backwards;
}

.lock-flyer {
    position: fixed;
    z-index: 1090;
    margin: 0;
    pointer-events: none;
    transform-origin: top left;
}

@keyframes lock-rattle {
    0%, 100% { transform: rotate(0); }
    20% { transform: rotate(-5deg); }
    45% { transform: rotate(5deg); }
    70% { transform: rotate(-3deg); }
}

@keyframes lock-spring {
    from { transform: none; }
    to { transform: translateY(-13%) rotate(26deg); }
}

@keyframes lock-link-fall {
    from { opacity: 1; transform: rotate(var(--link-turn)); }
    to { opacity: 0; transform: translateY(5rem) rotate(calc(var(--link-turn) + 160deg)); }
}

.lock-actions {
    display: grid;
    grid-template-columns: 1fr 1fr 1.6fr;
    gap: .5rem;
    margin-bottom: 1rem;
}

.lock-actions .btn {
    padding: .6rem .4rem;
    border-radius: .75rem;
    font-weight: 700;
    white-space: nowrap;
    touch-action: manipulation;
}

.lock-found-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--neutral-600);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.lock-text-button {
    padding: 0;
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}

.lock-trail { min-height: 1.6rem; margin-bottom: .25rem; }

.lock-trail .chain-trail-letter { background: #3f37c9; color: #fff; }

.lock-trail .chain-trail-word.is-current .chain-trail-letter {
    background: linear-gradient(160deg, #f7cf5a, #e0a412);
    color: #3a2a00;
}

.lock-trail.is-missed {
    flex-wrap: wrap;
    margin-top: .75rem;
    overflow: visible;
    opacity: .75;
}

.lock-result {
    margin-top: .75rem;
    padding: 1rem;
    border: 1px solid rgba(67, 97, 238, .16);
    border-radius: .9rem;
    background: #fff;
    text-align: center;
}

.lock-result:focus { outline: none; }

.lock-result-xp {
    margin: 0 0 .75rem;
    color: #b8860b;
    font-size: 1.15rem;
    font-weight: 800;
}

.lock-result-xp:empty { display: none; }

.lock-result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    justify-content: center;
    align-items: center;
    margin-bottom: .5rem;
}

@media (max-width: 767.98px) {
    .lock-shell .chain-kicker, .lock-shell .chain-date { display: none; }
    .lock-intro .chain-title { margin-top: 0; font-size: 1.5rem; }
    .lock-intro-text { font-size: .8rem; }
    .lock-clue-text { font-size: 1.15rem; }
    .lock-ring { width: min(13.8rem, 100%); margin-bottom: .65rem; }
    .lock-entry { min-height: 2.5rem; }
}

/* On the home page the card around it is the frame. */
.lock-shell--home { max-width: none; margin-inline: 0; }

.lock-shell--home .lock-game {
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
}

.lock-shell--home .is-finished-earlier .lock-ring,
.lock-shell--home .is-finished-earlier .lock-actions,
.lock-shell--home .is-finished-earlier .lock-entry,
.lock-shell--home .is-finished-earlier .lock-feedback,
.lock-shell--home .is-finished-earlier .lock-found-head,
.lock-shell--home .is-finished-earlier .lock-trail:not(.is-missed) { display: none; }

@media (prefers-reduced-motion: reduce) {
    .lock-ring.is-opening .lock-padlock,
    .lock-ring.is-opening .lock-padlock-shackle,
    .lock-ring.is-opening .lock-link,
    .lock-box.is-landed { animation: none; }
}

/* Daily Bridgeword. The board is the chain's; what is here is the five rows
   LEFT - boxes - RIGHT and the keyword under them. Indigo tiles as the
   Lockword ring, a gold first box because that letter goes to the keyword,
   pink dashes for the bridge. */
.bridge-shell {
    --bridge-ink: #2d3a7c;
    --bridge-indigo: #3f37c9;
    --bridge-indigo-light: #4d45de;
    --bridge-gold: #e0a412;
    --bridge-gold-light: #f7cf5a;
    --bridge-pink: #f72585;
    --bridge-box: clamp(1.5rem, 7vw, 2.05rem);
}

.bridge-intro { margin-bottom: 1rem; padding: .25rem 0 0; }

.bridge-intro-text {
    max-width: 32rem;
    margin: 0 auto .2rem;
    color: var(--neutral-600);
    font-size: .95rem;
}

.bridge-status {
    display: flex;
    flex-wrap: wrap;
    gap: .2rem .7rem;
    align-items: center;
    justify-content: center;
    margin-bottom: .7rem;
    color: var(--neutral-600);
    font-size: .9rem;
}

.bridge-status strong { color: var(--bridge-ink); font-weight: 800; }

.bridge-clock { font-variant-numeric: tabular-nums; }

.bridge-xp {
    padding: .1rem .55rem;
    border: 1px solid #f1d98e;
    border-radius: 999px;
    background: #fff6dc;
    color: #8a6200;
    font-size: .8rem;
    font-weight: 800;
}

.bridge-xp[hidden] { display: none; }

.bridge-rows {
    display: grid;
    gap: .5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.bridge-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 1.1rem auto 1.1rem minmax(0, 1fr);
    gap: .35rem;
    align-items: center;
    padding: .5rem .6rem;
    border: 2px solid rgba(67, 97, 238, .12);
    border-radius: .9rem;
    background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.bridge-row.is-active {
    border-color: var(--bridge-indigo);
    box-shadow: 0 .35rem 1rem rgba(63, 55, 201, .16);
}

.bridge-row.is-solved { border-color: rgba(43, 147, 72, .45); }
.bridge-row.is-gave-up { background: #f4f5f9; }

.bridge-side {
    min-width: 0;
    color: var(--bridge-ink);
    font-size: clamp(.82rem, 3.4vw, 1.02rem);
    font-weight: 800;
    letter-spacing: .04em;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.bridge-side.is-left { text-align: right; }
.bridge-side.is-right { text-align: left; }

.bridge-dash {
    height: 3px;
    border-radius: 2px;
    background: var(--bridge-pink);
}

.bridge-row.is-gave-up .bridge-dash { background: #c9ccd9; }

.bridge-slot {
    position: relative;
    justify-self: center;
}

.bridge-boxes {
    display: flex;
    gap: clamp(.12rem, .6vw, .22rem);
    justify-content: center;
}

.bridge-box {
    display: grid;
    width: var(--bridge-box);
    aspect-ratio: 1 / 1.12;
    place-items: center;
    border: 2px dashed #c5cbe6;
    border-radius: .42rem;
    background: #fff;
    color: var(--bridge-indigo);
    font-size: calc(var(--bridge-box) * .52);
    font-weight: 800;
    line-height: 1;
}

.bridge-box.is-first { border-color: var(--bridge-gold); }

.bridge-box.is-cursor {
    border-style: solid;
    border-color: var(--bridge-indigo);
    animation: bridge-cursor 1.1s ease-in-out infinite;
}

.bridge-box.is-first.is-cursor { border-color: var(--bridge-gold); }

@keyframes bridge-cursor {
    50% { box-shadow: inset 0 -.2rem 0 rgba(63, 55, 201, .35); }
}

.bridge-box.is-typed {
    border: 2px solid var(--bridge-indigo);
    background: linear-gradient(160deg, var(--bridge-indigo-light), var(--bridge-indigo));
    color: #fff;
    box-shadow: 0 .16rem 0 #2c2690;
}

/* A letter that was shown, not typed: the same tile, paler. */
.bridge-box.is-given {
    border: 2px solid #b9b5ef;
    background: #ecebfc;
    color: var(--bridge-indigo);
}

.bridge-row.is-solved .bridge-box.is-given {
    border-color: var(--bridge-indigo);
    background: linear-gradient(160deg, var(--bridge-indigo-light), var(--bridge-indigo));
    color: #fff;
}

.bridge-box.is-first.is-typed,
.bridge-row.is-solved .bridge-box.is-first {
    border-color: var(--bridge-gold);
    background: linear-gradient(160deg, var(--bridge-gold-light), var(--bridge-gold));
    color: #3a2a00;
    box-shadow: 0 .16rem 0 #a87a08;
}

/* A shown first letter: given, not yet earned, so the pale gold. */
.bridge-row:not(.is-solved) .bridge-box.is-first.is-given {
    border-color: var(--bridge-gold);
    background: #fff6dc;
    color: #8a6200;
}

.bridge-row.is-gave-up .bridge-box { border-color: #c9ccd9; background: #e9eaf0; color: #6b7088; box-shadow: none; }

/* The input lies over the boxes, invisible: tapping a row is tapping it, so
   a phone opens its keyboard. 16px keeps iOS from zooming in. */
.bridge-input {
    position: absolute;
    inset: -.35rem -.5rem;
    width: calc(100% + 1rem);
    padding: 0;
    border: 0;
    background: transparent;
    color: transparent;
    caret-color: transparent;
    font-size: 16px;
    opacity: 0;
    cursor: pointer;
}

.bridge-input:disabled { cursor: default; }

.bridge-slot.is-shaking { animation: bridge-shake .38s ease; }

.bridge-slot.is-shaking .bridge-box.is-typed {
    border-color: #d64045;
    background: #d64045;
    box-shadow: 0 .16rem 0 #9e2a2e;
}

@keyframes bridge-shake {
    20% { transform: translateX(-.35rem); }
    40% { transform: translateX(.35rem); }
    60% { transform: translateX(-.2rem); }
    80% { transform: translateX(.2rem); }
}

.bridge-row-note {
    grid-column: 1 / -1;
    color: #2b9348;
    font-size: .8rem;
    font-weight: 700;
    text-align: center;
}

.bridge-row-note[hidden] { display: none; }

.bridge-feedback {
    min-height: 1.35rem;
    margin: .5rem 0 .2rem;
    color: var(--neutral-600);
    font-size: .88rem;
    font-weight: 700;
    text-align: center;
}

.bridge-feedback.is-wrong { color: #d64045; }
.bridge-feedback.is-correct { color: #2b9348; }

.bridge-controls {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: .5rem;
    margin-bottom: .9rem;
}

.bridge-controls[hidden] { display: none; }

.bridge-controls .btn {
    padding: .6rem .4rem;
    border-radius: .75rem;
    font-weight: 700;
    white-space: nowrap;
}

.bridge-key {
    padding: .75rem .85rem .85rem;
    border: 2px dashed rgba(224, 164, 18, .55);
    border-radius: .9rem;
    background: #fffbef;
    text-align: center;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.bridge-key.is-active {
    border-style: solid;
    border-color: var(--bridge-gold);
    box-shadow: 0 .35rem 1rem rgba(224, 164, 18, .2);
}

.bridge-key.is-solved { border-style: solid; border-color: rgba(43, 147, 72, .45); background: #fff; }

.bridge-key-label {
    display: inline-flex;
    gap: .3rem;
    align-items: center;
    color: #8a6200;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.bridge-key-clue {
    margin: .25rem 0 .6rem;
    color: var(--bridge-ink);
    font-size: clamp(1.05rem, 4.4vw, 1.3rem);
    font-weight: 700;
    line-height: 1.25;
}

.bridge-key-slot { display: inline-block; }

.bridge-key-slot .bridge-box { border-color: rgba(224, 164, 18, .7); }

.bridge-key-slot .bridge-box.is-given {
    border-color: var(--bridge-gold);
    background: linear-gradient(160deg, var(--bridge-gold-light), var(--bridge-gold));
    color: #3a2a00;
}

.bridge-key-hint {
    margin: .5rem 0 0;
    color: var(--neutral-600);
    font-size: .78rem;
}

.bridge-key.is-gave-up { border-style: solid; border-color: #c9ccd9; background: #f4f5f9; }
.bridge-key.is-gave-up .bridge-key-slot .bridge-box { border-color: #c9ccd9; background: #e9eaf0; color: #6b7088; }
.bridge-key.is-solved .bridge-key-hint, .bridge-key.is-gave-up .bridge-key-hint { display: none; }

.bridge-foot { margin-top: .4rem; text-align: center; }

.bridge-text-button {
    padding: 0;
    font-size: .8rem;
    font-weight: 600;
}

.bridge-text-button[hidden] { display: none; }

.bridge-result {
    margin-top: .9rem;
    padding: 1rem;
    border: 1px solid rgba(67, 97, 238, .16);
    border-radius: .9rem;
    background: #fff;
    text-align: center;
}

.bridge-result:focus { outline: none; }

.bridge-result-grid {
    margin: 0 0 .35rem;
    font-size: 1.5rem;
    letter-spacing: .12em;
}

.bridge-result-xp {
    margin: 0 0 .75rem;
    color: #b8860b;
    font-size: 1.15rem;
    font-weight: 800;
}

.bridge-result-xp:empty { display: none; }

.bridge-result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    justify-content: center;
    margin-bottom: .5rem;
}

.bridge-result-actions .btn[hidden] { display: none; }

.bridge-solution {
    display: grid;
    gap: .3rem;
    margin: .75rem 0;
    padding: 0;
    list-style: none;
    font-size: .95rem;
}

.bridge-solution-row strong { color: var(--bridge-indigo); text-transform: uppercase; }
.bridge-solution-row.is-gave-up strong { color: #6b7088; }
.bridge-word-link { font-weight: 600; }

/* A phone has no room for both words beside the boxes: the words go on one
   line, the boxes under them, and the dashes bridge from each word to them. */
@media (max-width: 575.98px) {
    .bridge-shell .chain-kicker, .bridge-shell .chain-date { display: none; }
    .bridge-intro .chain-title { margin-top: 0; font-size: 1.5rem; }
    .bridge-intro-text { font-size: .8rem; }
    .bridge-game { padding: .8rem .65rem; }

    .bridge-row {
        grid-template-columns: auto minmax(.6rem, 1fr) minmax(.6rem, 1fr) auto;
        grid-template-areas:
            "left dash-left dash-right right"
            "slot slot slot slot";
        gap: .3rem .35rem;
        padding: .4rem .45rem .5rem;
    }

    .bridge-side.is-left { grid-area: left; text-align: left; }
    .bridge-side.is-right { grid-area: right; text-align: right; }
    .bridge-dash.is-left { grid-area: dash-left; }
    .bridge-dash.is-right { grid-area: dash-right; }
    .bridge-row > .bridge-slot { grid-area: slot; }
    .bridge-row-note { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
    .bridge-box.is-cursor, .bridge-slot.is-shaking { animation: none; }
}

/* Today's first row on the home page (partials/_bridge_teaser.html): the
   chain teaser's card with one row of the game in it, as a link. */
.bridge-teaser-icon {
    color: var(--bridge-indigo);
    font-size: 1.6rem;
}

.bridge-teaser .bridge-teaser-row {
    margin: .4rem 0 .7rem;
    color: inherit;
    text-decoration: none;
}

.bridge-teaser .bridge-teaser-row:hover,
.bridge-teaser .bridge-teaser-row:focus-visible {
    border-color: var(--bridge-indigo);
    box-shadow: 0 .35rem 1rem rgba(63, 55, 201, .16);
}

/* The tussen-s of a compound (publieks|jury), on the word it belongs to:
   lighter and smaller, so it reads as glue and not as part of the word. */
.bridge-joint {
    color: var(--bridge-pink);
    font-weight: 700;
    font-size: .85em;
}

.game-history-shell {
    max-width: 920px;
    margin: 0 auto 3rem;
}

/* The lifetime total leads this page, so it is the one block that is allowed
   to be large. Gold, like the trophy on a finished game, so the two say the
   same thing in the same colour. */
.game-xp-hero {
    display: grid;
    max-width: 26rem;
    margin: 0 auto 1.75rem;
    padding: 1.4rem 1.5rem;
    justify-items: center;
    gap: .35rem;
    border: 1px solid rgba(217, 158, 11, .25);
    border-radius: 1.25rem;
    background: linear-gradient(160deg, rgba(217, 158, 11, .12), rgba(255, 255, 255, .6));
    text-align: center;
}

.game-xp-hero[hidden] { display: none; }

/* The same trophy a finished game shows, smaller. */
.game-xp-trophy {
    width: auto;
    height: 4.25rem;
    filter: drop-shadow(0 .45rem .7rem rgba(217, 158, 11, .25));
}

/* Rising columns of tiles over the page title: what this page is about,
   before a single number has been read. */
.game-history-art {
    display: block;
    width: auto;
    height: clamp(5rem, 18vw, 6.5rem);
    margin: 0 auto .75rem;
    filter: drop-shadow(0 .5rem .8rem rgba(67, 97, 238, .14));
}

.game-xp-total {
    color: #b8860b;
    font-size: 2.6rem;
    font-weight: 800;
    line-height: 1.1;
}

.game-xp-level {
    color: var(--neutral-700);
    font-size: .9rem;
    font-weight: 600;
}

.game-xp-bar {
    width: 100%;
    height: .5rem;
    margin-top: .5rem;
    border-radius: 999px;
    /* Its own track: bootstrap's grey disappears into the card behind it. */
    background: rgba(217, 158, 11, .18);
}

.game-xp-bar .progress-bar {
    background: linear-gradient(90deg, #d99e0b, #b8860b);
}

.game-history-card {
    padding: clamp(1rem, 4vw, 2rem);
    border: 1px solid rgba(67, 97, 238, .14);
    border-radius: 1.25rem;
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 1rem 2.5rem rgba(28, 42, 88, .10);
}

.game-history-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
}

.game-history-grid.is-primary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.game-history-stat {
    display: flex;
    min-height: 5.4rem;
    padding: .75rem;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: .85rem;
    background: #f5f7ff;
    text-align: center;
}

.game-history-stat.is-prominent {
    background: linear-gradient(145deg, rgba(67, 97, 238, .10), rgba(114, 9, 183, .07));
}

.game-history-stat strong {
    color: var(--game-stat-navy);
    font-size: clamp(1.15rem, 4vw, 1.65rem);
    line-height: 1.2;
}

.game-history-stat span {
    margin-top: .25rem;
    color: var(--neutral-600);
    font-size: .75rem;
}

.game-history-list {
    overflow: hidden;
    border: 1px solid #e8ebf8;
    border-radius: .9rem;
}

.game-history-row {
    display: flex;
    min-height: 4rem;
    padding: .75rem 1rem;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid #edf0fa;
    color: inherit;
    text-decoration: none;
}

.game-history-row:last-child { border-bottom: 0; }
.game-history-row[href]:hover { background: #f8f9ff; }

.game-history-date {
    flex: 0 0 auto;
    color: var(--neutral-700);
    font-size: .86rem;
    font-weight: 700;
}

.game-history-result {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: flex-end;
    gap: .8rem;
}

.game-history-attempts {
    overflow: hidden;
    font-size: clamp(.72rem, 2.5vw, 1rem);
    letter-spacing: .02em;
    white-space: nowrap;
}

.game-history-time {
    min-width: 4.2rem;
    color: var(--neutral-600);
    text-align: right;
}

.game-relation-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
}

.game-relation-card {
    padding: 1rem;
    border: 1px solid #e8ebf8;
    border-radius: .85rem;
    background: #fbfcff;
}

.game-relation-card h5 {
    color: var(--game-stat-navy);
    letter-spacing: .04em;
}

.game-relation-values {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: .35rem .75rem;
    font-size: .8rem;
}

.game-relation-values dt { color: var(--neutral-600); font-weight: 500; }
.game-relation-values dd { margin: 0; color: var(--game-stat-navy); font-weight: 700; text-align: right; }

@media (max-width: 767px) {
    .game-history-grid.is-primary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 480px) {
    .game-history-card { border-radius: 1rem; }
    .game-history-row { align-items: flex-start; flex-direction: column; gap: .35rem; }
    .game-history-result { width: 100%; justify-content: space-between; }
    .game-history-attempts { max-width: 55%; }
    .game-relation-grid { grid-template-columns: 1fr; }
}
