/*
 * Blockade Brigade home page (CMS page "home", below the theme hero).
 * Source: game repo tools/web_export/cms/media/home/home.css -> server pub/media/home/home.css,
 * loaded by the page itself (tools/web_export/cms/home.html), so no theme CSS rebuild.
 * Colours and fonts are the storefront's tokens (tailwind-source.css @theme); the rivet is the
 * menu plate's (--bb-rivet, theme/bb-menu-plate.css). See docs/website-theme.md.
 */

.bbh {
    --bbh-gap: clamp(2.5rem, 5vw, 4rem);
    color: var(--color-bb-text, #e8ecf5);
    font-family: var(--font-body, inherit);
    margin: 0 0 2rem;
}
.bbh > * + * { margin-top: var(--bbh-gap); }
.bbh *, .bbh *::before, .bbh *::after { box-sizing: border-box; }
.bbh h2 {
    margin: 0;
    font-family: var(--font-display, inherit);
    font-weight: 700;
    font-size: clamp(1.5rem, 2.6vw, 2.1rem);
    line-height: 1.15;
    color: var(--color-bb-text, #e8ecf5);
}
.bbh p { margin: 0; }
.bbh ul, .bbh ol { margin: 0; padding: 0; list-style: none; }
.bbh a { color: var(--color-bb-blue, #38bdf8); }
.bbh a:focus-visible { outline: 2px solid var(--color-bb-blue, #38bdf8); outline-offset: 3px; border-radius: 4px; }
.bbh-muted { color: var(--color-bb-muted, #9aa6c0); }
.bbh-kicker {
    margin: 0 0 .4rem;
    color: var(--color-bb-amber, #f59e0b);
    font-family: var(--font-display, inherit);
    font-weight: 700;
    font-size: .8rem;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.bbh-link {
    font-family: var(--font-display, inherit);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}
.bbh-link:hover { color: var(--color-bb-amber-hi, #fbbf24); }

/* ---------- Armour plate: a panel with a rivet in each corner ---------- */
.bbh-plate {
    position: relative;
    border: 1px solid var(--color-bb-line, #2a3756);
    border-radius: 10px;
    background:
        linear-gradient(180deg, rgb(255 255 255 / .035), transparent 40%),
        var(--color-bb-panel, #161f36);
    box-shadow: inset 0 1px 0 rgb(255 255 255 / .07), inset 0 -2px 0 rgb(0 0 0 / .25), 0 1rem 2.5rem rgb(0 0 0 / .35);
}
.bbh-rivets {
    position: absolute;
    inset: 10px;
    pointer-events: none;
    background:
        var(--bb-rivet) left top / 14px 14px no-repeat,
        var(--bb-rivet) right top / 14px 14px no-repeat,
        var(--bb-rivet) left bottom / 14px 14px no-repeat,
        var(--bb-rivet) right bottom / 14px 14px no-repeat;
    opacity: .9;
}

/* ---------- Buttons (the hero's plates) ---------- */
.bbh-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.bbh .bbh-btn {
    display: inline-block;
    padding: .75rem 1.4rem;
    border-radius: 6px;
    background: var(--color-bb-amber, #f59e0b);
    color: #0e1424;
    font-family: var(--font-display, inherit);
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    text-decoration: none;
    box-shadow: inset 0 -2px 0 rgb(0 0 0 / .32), inset 0 1px 0 rgb(255 255 255 / .18);
    transition: background-color .15s, transform .15s;
}
.bbh .bbh-btn:hover { background: var(--color-bb-amber-hi, #fbbf24); transform: translateY(-1px); }
.bbh .bbh-btn:active { transform: translateY(1px); box-shadow: none; }
.bbh .bbh-btn-2 {
    background: var(--color-bb-panel-2, #1d2844);
    color: var(--color-bb-text, #e8ecf5);
    box-shadow: inset 0 0 0 1px var(--color-bb-line, #2a3756), inset 0 -2px 0 rgb(0 0 0 / .32);
}
.bbh .bbh-btn-2:hover { background: var(--color-bb-panel-2, #1d2844); color: var(--color-bb-amber-hi, #fbbf24); box-shadow: inset 0 0 0 1px var(--color-bb-amber, #f59e0b), inset 0 -2px 0 rgb(0 0 0 / .32); }

/* ---------- 1. Pitch ---------- */
.bbh-pitch { padding: clamp(1.75rem, 4vw, 3rem); text-align: center; }
.bbh-pitch h2 { font-size: clamp(1.7rem, 3.4vw, 2.6rem); }
.bbh-pitch h2::after {
    content: "";
    display: block;
    width: 6rem;
    height: 6px;
    margin: .9rem auto 0;
    border-radius: 2px;
    background: repeating-linear-gradient(-45deg, var(--color-bb-amber, #f59e0b) 0 8px, var(--color-bb-bg, #0e1424) 8px 16px);
}
.bbh-lede {
    max-width: 46rem;
    margin: 1.25rem auto 0 !important;
    color: var(--color-bb-muted, #9aa6c0);
    font-size: 1.08rem;
    line-height: 1.6;
}
.bbh-highlights {
    display: grid;
    gap: 1rem;
    margin-top: 2rem !important;
    text-align: left;
}
@media (min-width: 768px) { .bbh-highlights { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.bbh-highlights li {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: .9rem;
    align-items: start;
    padding: 1rem;
    border: 1px solid var(--color-bb-line, #2a3756);
    border-radius: 8px;
    background: var(--color-bb-panel-2, #1d2844);
}
.bbh-icon {
    grid-row: span 2;
    width: 2.6rem;
    height: 2.6rem;
    padding: .5rem;
    border-radius: 8px;
    background: rgb(245 158 11 / .12);
    color: var(--color-bb-amber, #f59e0b);
}
.bbh-highlights strong { font-family: var(--font-display, inherit); font-size: 1.05rem; color: var(--color-bb-text, #e8ecf5); }
.bbh-highlights span { color: var(--color-bb-muted, #9aa6c0); font-size: .92rem; line-height: 1.45; }

/* ---------- 2. Founder Edition ---------- */
.bbh-founder {
    display: grid;
    gap: 1.75rem;
    align-items: center;
    padding: clamp(1.5rem, 3.5vw, 2.5rem);
    border-top: 3px solid var(--color-bb-gold, #d9a33a);
}
@media (min-width: 768px) { .bbh-founder { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 2.5rem; } }
@media (min-width: 1024px) { .bbh-founder { grid-template-columns: 18rem minmax(0, 1fr); } }
.bbh-founder-art { width: 100%; max-width: 18rem; margin: 0 auto; }
.bbh-founder-art > img,
.bbh-founder-ph {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 5;
    border: 1px solid var(--color-bb-line, #2a3756);
    border-radius: 8px;
    background: var(--color-bb-bg, #0e1424);
    box-shadow: 0 1rem 2rem rgb(0 0 0 / .45);
}
.bbh-founder-art > img { object-fit: contain; }
.bbh-founder-ph {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .8rem;
    padding: 1.5rem;
    background:
        radial-gradient(circle at 50% 38%, rgb(56 189 248 / .18), transparent 60%),
        linear-gradient(180deg, #1d2844, #0e1424);
}
.bbh-founder-ph img { width: 72%; height: auto; filter: drop-shadow(0 .75rem 1.5rem rgb(0 0 0 / .5)); }
.bbh-founder-ph-plate {
    padding: .4rem 1rem;
    border-radius: 6px;
    background: var(--color-bb-amber, #f59e0b);
    box-shadow: inset 0 -2px 0 rgb(0 0 0 / .25);
    color: #0e1424;
    font-family: var(--font-display, inherit);
    font-weight: 700;
    font-size: .85rem;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.bbh-founder-ph-note { color: var(--color-bb-muted, #9aa6c0); font-size: .8rem; }
.bbh-founder-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem 1rem; margin: .9rem 0 0 !important; }
.bbh-price-now { color: var(--color-bb-amber, #f59e0b); font-family: var(--font-display, inherit); font-weight: 700; font-size: 2.2rem; line-height: 1; }
.bbh-price-later { color: var(--color-bb-muted, #9aa6c0); font-size: .95rem; }
.bbh-perks { display: grid; gap: .45rem; margin: 1.2rem 0 1.5rem !important; }
.bbh-perks li { position: relative; padding-left: 1.4rem; line-height: 1.45; }
.bbh-perks li::before {
    content: "";
    position: absolute;
    left: 0;
    top: .3em;
    width: .8rem;
    height: .8rem;
    background: var(--bb-rivet) center / contain no-repeat;
}
.bbh-perks strong { color: var(--color-bb-amber-hi, #fbbf24); font-weight: 600; }

/* ---------- Section heads ---------- */
.bbh-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: .5rem 1.5rem;
    margin-bottom: 1.25rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid var(--color-bb-line, #2a3756);
}

/* ---------- 3, 4. Tower and enemy portraits ---------- */
.bbh-units { display: grid; gap: .9rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .bbh-units--6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 640px) { .bbh-units--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .bbh-units--6 { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.bbh-units li { display: flex; }
.bbh .bbh-unit {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: .6rem .6rem .9rem;
    border: 1px solid var(--color-bb-line, #2a3756);
    border-radius: 8px;
    background: var(--color-bb-panel, #161f36);
    box-shadow: inset 0 1px 0 rgb(255 255 255 / .06);
    color: var(--color-bb-text, #e8ecf5);
    text-decoration: none;
    transition: transform .15s, border-color .15s;
}
.bbh .bbh-unit:hover { transform: translateY(-3px); border-color: var(--color-bb-gold, #d9a33a); }
.bbh-unit img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    margin-bottom: .6rem;
    border-radius: 6px;
    background: radial-gradient(circle at 50% 55%, rgb(56 189 248 / .16), transparent 68%), var(--color-bb-bg, #0e1424);
}
.bbh-unit--boss img { background: radial-gradient(circle at 50% 55%, rgb(255 59 47 / .16), transparent 68%), var(--color-bb-bg, #0e1424); }
.bbh-unit strong { font-family: var(--font-display, inherit); font-weight: 700; font-size: 1.02rem; }
.bbh-unit span { margin-top: .2rem; color: var(--color-bb-muted, #9aa6c0); font-size: .85rem; line-height: 1.35; }

/* ---------- 5. Leaderboards ---------- */
.bbh-boards { display: grid; gap: 1.75rem; padding: clamp(1.5rem, 3.5vw, 2.5rem); }
@media (min-width: 768px) { .bbh-boards { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: center; } }
.bbh-boards-text p:not(.bbh-kicker) { margin-top: .8rem; line-height: 1.55; color: var(--color-bb-muted, #9aa6c0); }
.bbh-boards-text .bbh-actions { margin-top: 1.4rem; }
.bbh-top3 {
    padding: 1.1rem 1.2rem;
    border: 1px solid var(--color-bb-line, #2a3756);
    border-radius: 8px;
    background: var(--color-bb-bg, #0e1424);
}
.bbh-top3-title { margin-bottom: .7rem !important; font-family: var(--font-display, inherit); font-weight: 700; font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; color: var(--color-bb-gold, #d9a33a); }
.bbh-top3-list li {
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr) auto;
    gap: .6rem;
    align-items: center;
    padding: .45rem 0;
    border-bottom: 1px solid var(--color-bb-line, #2a3756);
}
.bbh-rank { color: var(--color-bb-amber, #f59e0b); font-family: var(--font-mono, monospace); font-weight: 600; }
.bbh-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bbh-wave { color: var(--color-bb-muted, #9aa6c0); font-family: var(--font-mono, monospace); font-size: .9rem; }
.bbh-top3 .bbh-link { display: inline-block; margin-top: .8rem; font-size: .9rem; }
.bbh-top3 > .bbh-muted { margin-bottom: .2rem; }

/* ---------- 6. What's New ---------- */
.bbh .bbh-new-list { padding: .5rem 1.25rem; }
.bbh-new-list li {
    display: flex;
    gap: .9rem;
    align-items: baseline;
    padding: .8rem 0;
    line-height: 1.5;
}
.bbh-new-list li + li { border-top: 1px solid var(--color-bb-line, #2a3756); }
.bbh-tag {
    flex: 0 0 5.6rem;
    padding: .15rem .4rem;
    border-radius: 4px;
    color: #0e1424;
    font-family: var(--font-display, inherit);
    font-weight: 700;
    font-size: .72rem;
    letter-spacing: .05em;
    text-align: center;
    text-transform: uppercase;
}
.bbh-tag--new { background: #f59e0b; }
.bbh-tag--improved { background: #38bdf8; }
.bbh-tag--fixed { background: #4ade80; }
.bbh-tag--balance { background: #b794f6; }
.bbh-tag--removed { background: #ff3b2f; }
.bbh-tag--other { background: #9aa6c0; }
.bbh-new > p { margin-top: 1rem; }
@media (max-width: 639px) {
    .bbh .bbh-new-list { padding: .25rem 1rem; }
    .bbh-new-list li { flex-direction: column; gap: .4rem; }
    .bbh-tag { flex-basis: auto; }
}

/* ---------- 7. Clanker ---------- */
.bbh-clanker {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--color-bb-line, #2a3756);
    border-radius: 10px;
    background: radial-gradient(circle at 10% 50%, rgb(56 189 248 / .12), transparent 45%), var(--color-bb-panel, #161f36);
}
.bbh-clanker > img { flex: 0 0 auto; width: 8rem; height: auto; }
.bbh-clanker p { margin-top: .5rem; color: var(--color-bb-muted, #9aa6c0); line-height: 1.55; }
@media (max-width: 639px) {
    .bbh-clanker { flex-direction: column; text-align: center; }
    .bbh-clanker > img { width: 7rem; }
}

/* ---------- 8. Follow the build ---------- */
.bbh > .bbh-follow { margin-top: 1.5rem; color: var(--color-bb-muted, #9aa6c0); text-align: center; }

@media (prefers-reduced-motion: reduce) {
    .bbh .bbh-btn, .bbh .bbh-unit { transition: none; }
    .bbh .bbh-btn:hover, .bbh .bbh-unit:hover, .bbh .bbh-btn:active { transform: none; }
}
