/* ==========================================================================
   BLOCK BREAKER — SINGLE SHARED STYLESHEET
   1. Shared portal, guides, navigation, and responsive layout
   2. Game HUD, canvas, controls, and gameplay styles
   ========================================================================== */
/* Shared guide and portal components for Block Breaker Arcade. */
html {
    background: #080c18;
    color-scheme: dark;
}

html[data-theme="light"] {
    background: #eef3fb;
    color-scheme: light;
}

body {
    margin: 0;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 1px solid rgba(174,195,232,.11);
    background: rgba(5,13,29,.9);
    backdrop-filter: blur(18px);
}

.topbar {
    display: flex;
    width: min(1200px, calc(100% - 36px));
    min-height: 70px;
    align-items: center;
    gap: 25px;
    margin: 0 auto;
    padding: 0;
}

.brand {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 11px;
    color: #f4f7ff;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid rgba(101,171,255,.35);
    border-radius: 14px;
    color: #63e5ee;
    background: linear-gradient(145deg,rgba(68,127,242,.24),rgba(120,84,229,.13));
    box-shadow: 0 0 28px rgba(77,151,255,.15), inset 0 1px rgba(255,255,255,.12);
}

.brand-mark svg {
    width: 22px;
    height: 22px;
}

.brand-name {
    font-size: 18px;
    font-weight: 750;
    letter-spacing: .03em;
}

.brand-sub {
    display: block;
    margin-top: 2px;
    color: #94a0bd;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 22px;
    margin-left: 8px;
}

.main-nav a {
    padding: 9px 13px;
    border-radius: 11px;
}

.main-nav a:hover, .main-nav a[aria-current="page"] {
    color: #fff;
    background: rgba(255,255,255,.07);
}

.main-nav a:hover {
    transform: translateY(-1px);
}

.main-nav a:focus-visible {
    outline: 2px solid #66e5ec;
    outline-offset: 3px;
}

.theme-toggle {
    margin-left: auto;
}

.theme-icon {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.theme-icon-moon {
    display: none;
}

.theme-toggle {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(150,174,222,.22);
    border-radius: 12px;
    color: #d6e2fa;
    background: linear-gradient(180deg,rgba(30,44,73,.94),rgba(14,23,42,.96));
    box-shadow: 0 3px 0 rgba(0,0,0,.18), inset 0 1px rgba(255,255,255,.08);
    cursor: pointer;
    transition: border-color .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.theme-toggle:hover {
    border-color: rgba(109,222,232,.6);
    color: #86eff0;
    transform: translateY(-1px);
}

.theme-toggle:active {
    transform: translateY(1px);
}

.theme-toggle:focus-visible {
    outline: 2px solid #66e5ec;
    outline-offset: 3px;
}

.main-nav a, .site-footer nav a {
    color: #aeb9d3;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: color .18s ease, background .18s ease, transform .18s ease;
}

.main-nav a:hover, .site-footer nav a:hover {
    color: #75e8ec;
}

.portal-cta {
    display: inline-flex;
    min-height: 39px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 14px;
    border: 1px solid rgba(112, 226, 235, .28);
    border-radius: 11px;
    color: #d9ffff;
    background: rgba(63, 155, 190, .11);
    font-size: 14px;
    font-weight: 900;
    text-decoration: none;
    transition: .18s ease;
}

.portal-cta:hover {
    border-color: rgba(112, 226, 235, .65);
    background: rgba(63, 155, 190, .2);
    transform: translateY(-1px);
}

.leaderboard-more {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 11px;
    padding: 9px 10px;
    border: 1px solid rgba(126, 212, 234, .13);
    border-radius: 9px;
    color: #aee8f0;
    background: rgba(85, 167, 255, .055);
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.leaderboard-more:hover {
    border-color: rgba(126, 212, 234, .36);
    color: #e2ffff;
}

.portal-content, .portal-faq {
    max-width: 1200px;
    margin: 65px auto 0;
}

.portal-description .portal-section-heading {
    max-width: 1000px;
}

.portal-description {
    width: 100%;
    max-width: none;
    margin: 58px auto 70px;
    padding: 27px 30px 25px;
    border: 1px solid rgba(154,180,225,.17);
    border-radius: 20px;
    background: linear-gradient(145deg,rgba(17,31,58,.9),rgba(22,39,72,.8));
    box-shadow: 0 18px 55px rgba(0,0,0,.17);
    backdrop-filter: blur(18px);
}

.portal-description .portal-section-heading {
    max-width: 1000px;
    margin: 0 auto 30px;
    text-align: left;
}

.portal-description .portal-section-heading h2 {
    margin: 0 0 12px;
    font-size: clamp(30px,4vw,42px);
    line-height: 1.08;
    letter-spacing: -.04em;
}

.portal-description .portal-section-heading p {
    font-size: 17px;
    line-height: 1.8;
}

.portal-copy-grid {
    display: grid;
    max-width: 1000px;
    grid-template-columns: 1fr;
    gap: 0;
    margin: 0 auto;
}

.portal-copy-block {
    padding: 25px 0 0;
    border: 0;
    border-top: 1px solid rgba(154,180,225,.17);
    border-radius: 0;
    background: transparent;
}

.portal-copy-block h3 {
    margin: 0 0 9px;
    color: #eaf2ff;
    font-size: clamp(22px,2.5vw,27px);
    letter-spacing: -.03em;
    line-height: 1.2;
}

.portal-copy-block p {
    margin: 0 0 14px;
    color: #a0acc7;
    font-size: 17px;
    line-height: 1.8;
}

.portal-copy-block p:last-child {
    margin-bottom: 0;
}

.portal-section-heading {
    max-width: 660px;
    margin: 0 auto 24px;
    text-align: center;
}

.portal-eyebrow, .guide-card-kicker, .page-kicker {
    color: #77dfe9;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .18em;
    text-transform: uppercase;
}

.portal-section-heading h2 {
    margin: 9px 0 8px;
    color: #f4f7ff;
    font-size: clamp(23px, 3.4vw, 34px);
    letter-spacing: -.045em;
}

.portal-section-heading p {
    margin: 0;
    color: #94a0bd;
    font-size: 15px;
    line-height: 1.75;
}

.portal-guide-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.portal-guide-card {
    display: flex;
    min-height: 218px;
    flex-direction: column;
    padding: 18px;
    border: 1px solid rgba(173, 192, 255, .13);
    border-radius: 16px;
    color: inherit;
    background: linear-gradient(150deg, rgba(23, 31, 55, .78), rgba(12, 17, 32, .84));
    text-decoration: none;
    transition: border-color .18s ease, transform .18s ease, background .18s ease;
}

.portal-guide-card:hover {
    border-color: rgba(99, 229, 238, .42);
    background: linear-gradient(150deg, rgba(27, 42, 70, .92), rgba(12, 17, 32, .96));
    transform: translateY(-3px);
}

.portal-guide-card h3 {
    margin: 12px 0 9px;
    color: #eef4ff;
    font-size: 19px;
    letter-spacing: -.02em;
    line-height: 1.3;
}

.portal-guide-card p {
    margin: 0 0 16px;
    color: #98a5c2;
    font-size: 14px;
    line-height: 1.7;
}

.guide-card-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    color: #83e9ed;
    font-size: 13px;
    font-weight: 850;
}

.portal-faq {
    margin-top: 58px;
}

.faq-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
}

.faq-item {
    padding: 15px 17px;
    border: 1px solid rgba(173, 192, 255, .1);
    border-radius: 13px;
    background: rgba(15, 22, 41, .7);
}

.faq-item summary {
    color: #eaf0ff;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
}

.faq-item p {
    margin: 12px 0 0;
    color: #99a6c3;
    font-size: 15px;
    line-height: 1.75;
}

.site-footer {
    display: grid;
    justify-items: center;
    gap: 10px;
    margin: 64px 0 0;
    padding: 24px 0 4px;
    border-top: 1px solid rgba(173, 192, 255, .1);
    color: #7987a4;
    text-align: center;
}

.footer-brand {
    color: #dce8ff;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .13em;
    text-decoration: none;
}

.footer-brand span {
    color: #7bdfe4;
}

.site-footer p {
    margin: 0;
    font-size: 12px;
}

.site-footer nav {
    display: flex;
    gap: 17px;
    margin: 3px 0;
}

.site-footer nav a {
    font-size: 12px;
}

.site-footer small {
    max-width: 650px;
    color: #66728d;
    font-size: 11px;
    line-height: 1.6;
}

/* Standalone guide and leaderboard pages. */
.portal-page {
    min-height: 100vh;
    position: relative;
    isolation: isolate;
    color: #f5f7ff;
    font-size: 16px;
    line-height: 1.5;
    font-family: "Outfit", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: transparent;
}

.portal-page::before {
    position: fixed;
    z-index: -1;
    inset: 0;
    content: "";
    pointer-events: none;
    background: radial-gradient(ellipse at 50% -15%, rgba(69, 102, 200, .18), transparent 45%), linear-gradient(180deg, rgba(5, 10, 23, .13), rgba(5, 10, 23, .52)), url("/assets/block-breaker-arcade-background.webp") center / cover no-repeat;
}

.portal-shell {
    width: min(1200px, calc(100% - 36px));
    margin: 0 auto;
    padding: 23px 0 54px;
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin: 0 0 24px;
    color: #6f7d9b;
    font-size: 12px;
}

.breadcrumbs a {
    color: #9db3d9;
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: #7fe7ec;
}

.page-hero {
    max-width: 760px;
    margin: 0 auto 35px;
    text-align: center;
}

.page-hero h1 {
    margin: 10px 0 12px;
    color: #f4f7ff;
    font-size: clamp(32px, 6vw, 56px);
    line-height: 1.02;
    letter-spacing: -.055em;
}

.page-hero p {
    max-width: 670px;
    margin: 0 auto;
    color: #a0acc7;
    font-size: 16px;
    line-height: 1.75;
}

.page-meta {
    margin-top: 14px;
    color: #74819d;
    font-size: 12px;
}

.feature-guide {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(180px, .8fr);
    gap: 22px;
    align-items: center;
    margin: 0 0 32px;
    padding: clamp(20px, 4vw, 33px);
    border: 1px solid rgba(112, 220, 238, .21);
    border-radius: 20px;
    background: linear-gradient(125deg, rgba(30, 76, 111, .3), rgba(26, 28, 61, .55) 55%, rgba(14, 19, 37, .92));
}

.feature-guide h2 {
    margin: 8px 0;
    color: #eff8ff;
    font-size: clamp(22px, 3vw, 32px);
    letter-spacing: -.04em;
}

.feature-guide p {
    margin: 0;
    color: #a6b3ce;
    font-size: 15px;
    line-height: 1.75;
}

.feature-art {
    display: grid;
    min-height: 145px;
    place-items: center;
    border: 1px solid rgba(151, 183, 252, .12);
    border-radius: 15px;
    background: radial-gradient(circle at 50% 35%, rgba(82, 172, 255, .22), rgba(18, 27, 52, .24) 70%);
}

.feature-art span {
    color: #98eeef;
    font-size: 58px;
    filter: drop-shadow(0 0 24px rgba(100, 226, 237, .32));
}

.library-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 15px;
    margin: 39px 0 16px;
}

.library-head h2 {
    margin: 6px 0 0;
    font-size: 23px;
    letter-spacing: -.035em;
}

.library-head p {
    margin: 0;
    color: #8794b1;
    font-size: 14px;
}

.guide-library {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px;
}

.library-card {
    display: flex;
    flex-direction: column;
    min-height: 178px;
    padding: 20px;
    border: 1px solid rgba(173, 192, 255, .12);
    border-radius: 15px;
    color: inherit;
    background: linear-gradient(145deg, rgba(23,31,55,.88), rgba(12,17,32,.95));
    text-decoration: none;
    transition: .18s ease;
}

.library-card:hover {
    border-color: rgba(110, 225, 234, .42);
    transform: translateY(-2px);
}

.library-card h3 {
    margin: 11px 0 7px;
    color: #eef4ff;
    font-size: 16px;
}

.library-card p {
    margin: 0 0 13px;
    color: #98a5c2;
    font-size: 14px;
    line-height: 1.7;
}

.library-card .guide-card-link {
    margin-top: auto;
}

.article-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 245px;
    gap: 24px;
    align-items: start;
}

.article-body {
    min-width: 0;
}

.article-section {
    margin: 0 0 14px;
    padding: 25px 27px;
    border: 1px solid rgba(173, 192, 255, .11);
    border-radius: 16px;
    background: linear-gradient(150deg, rgba(21,29,52,.86), rgba(12,17,32,.9));
    scroll-margin-top: 20px;
}

.article-section h2 {
    margin: 0 0 12px;
    color: #eef4ff;
    font-size: 20px;
    letter-spacing: -.03em;
}

.article-section h3 {
    margin: 21px 0 7px;
    color: #dce8ff;
    font-size: 14px;
}

.article-section p, .article-section li {
    color: #a3afca;
    font-size: 16px;
    line-height: 1.85;
}

.article-section p {
    margin: 0 0 12px;
}

.article-section p:last-child {
    margin-bottom: 0;
}

.article-section ul, .article-section ol {
    display: grid;
    gap: 7px;
    margin: 10px 0 0;
    padding-left: 20px;
}

.article-callout {
    margin: 17px 0 0;
    padding: 13px 15px;
    border-left: 3px solid #69dbe4;
    border-radius: 0 10px 10px 0;
    color: #b9d9ea;
    background: rgba(64,153,188,.09);
    font-size: 11px;
    line-height: 1.7;
}

.guide-aside {
    position: sticky;
    top: 18px;
    display: grid;
    gap: 11px;
}

.aside-card {
    padding: 17px;
    border: 1px solid rgba(173, 192, 255, .11);
    border-radius: 14px;
    background: rgba(17,23,42,.82);
}

.aside-card h2 {
    margin: 0 0 12px;
    color: #edf3ff;
    font-size: 16px;
}

.toc-list, .related-list {
    display: grid;
    gap: 9px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.toc-list a, .related-list a {
    color: #9cabc8;
    font-size: 13px;
    line-height: 1.6;
    text-decoration: none;
}

.toc-list a:hover, .related-list a:hover {
    color: #7be4eb;
}

.related-label {
    display: block;
    margin-bottom: 4px;
    color: #6fdbdf;
    font-size: 8px;
    font-weight: 900;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.portal-cta-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 27px 0 0;
    padding: 20px 22px;
    border: 1px solid rgba(101, 211, 224, .18);
    border-radius: 15px;
    background: linear-gradient(115deg, rgba(41,107,140,.16), rgba(81,71,145,.11));
}

.portal-cta-panel h2 {
    margin: 0 0 4px;
    color: #edfaff;
    font-size: 16px;
}

.portal-cta-panel p {
    margin: 0;
    color: #92a0bd;
    font-size: 13px;
    line-height: 1.6;
}

.leader-periods {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin: 26px 0 17px;
}

.leader-period {
    padding: 9px 14px;
    border: 1px solid rgba(173,192,255,.13);
    border-radius: 10px;
    color: #a0acc5;
    background: rgba(17,23,42,.82);
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}

.leader-period.active {
    border-color: rgba(108,221,232,.6);
    color: #07131e;
    background: linear-gradient(100deg,#74eff0,#9bcaff);
}

.leaderboard-table-wrap {
    overflow-x: auto;
    border: 1px solid rgba(173,192,255,.12);
    border-radius: 16px;
    background: rgba(17,23,42,.8);
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 430px;
}

.leaderboard-table th {
    padding: 13px 17px;
    color: #73819d;
    font-size: 11px;
    letter-spacing: .13em;
    text-align: left;
    text-transform: uppercase;
}

.leaderboard-table td {
    padding: 14px 17px;
    border-top: 1px solid rgba(173,192,255,.075);
    color: #d5def2;
    font-size: 14px;
}

.leaderboard-table td:first-child {
    color: #69dfe5;
    font-weight: 900;
}

.leaderboard-table td:last-child {
    color: #b8d7ff;
    font-weight: 900;
    text-align: right;
}

.leaderboard-player {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
}

.leaderboard-player > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.leaderboard-player .leader-flag {
    width: 25px;
    height: 18px;
    flex: 0 0 25px;
}

.leader-flag {
    width: 23px;
    height: 17px;
    flex: 0 0 23px;
    border: 1px solid rgba(150,170,205,.35);
    border-radius: 3px;
    object-fit: cover;
    box-shadow: 0 1px 3px rgba(0,0,0,.22);
}

.leader-flag.is-unknown {
    opacity: .72;
}

.leaderboard-note {
    max-width: 700px;
    margin: 15px auto 0;
    color: #7886a3;
    font-size: 12px;
    line-height: 1.75;
    text-align: center;
}

.leaderboard-state {
    min-height: 20px;
    margin-top: 12px;
    color: #93a0bb;
    font-size: 14px;
    text-align: center;
}

.portal-footer {
    margin-top: 54px;
    padding-top: 20px;
    border-top: 1px solid rgba(173,192,255,.1);
    color: #71809c;
    text-align: center;
}

.portal-footer p {
    margin: 0 0 9px;
    font-size: 10px;
}

.portal-footer nav {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 10px;
}

.portal-footer nav a {
    color: #9aa8c5;
    font-size: 10px;
    text-decoration: none;
}

.portal-footer nav a:hover {
    color: #7de3ea;
}

.portal-footer small {
    color: #66728d;
    font-size: 9px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    clip-path: inset(50%);
}

@media (max-width: 900px) {
    .portal-guide-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .article-layout {
        grid-template-columns: minmax(0, 1fr) 210px;
        gap: 14px;
    }

}

@media (max-width: 720px) {
    .topbar {
        width: calc(100% - 24px);
        min-height: 62px;
        flex-wrap: wrap;
        gap: 12px;
    }

    .brand {
        gap: 8px;
    }

    .brand-name {
        font-size: 17px;
    }

    .brand-mark {
        width: 38px;
        height: 38px;
        border-radius: 12px;
    }

    .main-nav {
        order: 3;
        width: 100%;
        justify-content: center;
        gap: 26px;
    }

    .theme-toggle {
        order: 2;
        margin-left: auto;
    }

    .portal-content, .portal-faq {
        margin-top: 46px;
    }

    .portal-description {
        margin-top: 42px;
    }

    .portal-copy-grid {
        grid-template-columns: 1fr;
    }

    .portal-copy-block {
        padding: 20px 0 0;
    }

    .faq-grid {
        grid-template-columns: 1fr;
    }

    .portal-shell {
        width: calc(100% - 24px);
        padding-top: 15px;
    }

    .article-layout {
        grid-template-columns: 1fr;
    }

    .guide-aside {
        position: static;
        grid-row: 1;
    }

    .toc-list {
        grid-template-columns: 1fr 1fr;
    }

    .article-section {
        padding: 20px;
    }

}

@media (max-width: 480px) {
    .portal-guide-grid, .guide-library {
        grid-template-columns: 1fr;
    }

    .portal-guide-card {
        min-height: 160px;
    }

    .feature-guide {
        grid-template-columns: 1fr;
    }

    .feature-art {
        min-height: 105px;
    }

    .library-head {
        align-items: start;
        flex-direction: column;
    }

    .portal-cta-panel {
        align-items: start;
        flex-direction: column;
    }

    .toc-list {
        grid-template-columns: 1fr;
    }

    .main-nav {
        gap: 18px;
    }

    .main-nav a {
        font-size: 13px;
    }

    .theme-toggle {
        width: 38px;
        height: 38px;
    }

    .portal-cta {
        min-height: 36px;
        padding: 0 10px;
        font-size: 11px;
    }

}

@media (max-width: 390px) {
    .theme-icon {
        width: 18px;
        height: 18px;
    }

    .topbar {
        gap: 9px;
    }

    .brand {
        gap: 7px;
    }

    .brand-mark {
        width: 34px;
        height: 34px;
        border-radius: 11px;
    }

    .brand-name {
        font-size: 15px;
        letter-spacing: .02em;
    }

    .brand-sub {
        display: none;
    }

}

html[data-theme="light"] .portal-page {
    color: #192844;
    background: transparent;
}

html[data-theme="light"] .portal-page::before {
    background: linear-gradient(180deg, rgba(241,246,253,.81), rgba(238,243,251,.88)), url("/assets/block-breaker-arcade-background.webp") center / cover no-repeat;
}

html[data-theme="light"] .site-header {
    border-color: rgba(83,105,145,.17);
    background: rgba(248,250,254,.9);
}

html[data-theme="light"] .brand, html[data-theme="light"] .brand-name {
    color: #192844;
}

html[data-theme="light"] .brand-sub {
    color: #62718a;
}

html[data-theme="light"] .theme-toggle {
    border-color: rgba(83,105,145,.19);
    color: #405674;
    background: linear-gradient(180deg,#fff,#e9eff8);
    box-shadow: 0 3px 0 rgba(48,66,101,.1), inset 0 1px #fff;
}

html[data-theme="light"] .theme-toggle:hover {
    border-color: rgba(49,154,176,.5);
    color: #167f8c;
}

html[data-theme="light"] .theme-icon-sun {
    display: none;
}

html[data-theme="light"] .theme-icon-moon {
    display: block;
}

html[data-theme="light"] .page-hero h1, html[data-theme="light"] .portal-section-heading h2, html[data-theme="light"] .library-head h2, html[data-theme="light"] .article-section h2, html[data-theme="light"] .article-section h3, html[data-theme="light"] .aside-card h2, html[data-theme="light"] .portal-cta-panel h2, html[data-theme="light"] .faq-item summary {
    color: #192844;
}

html[data-theme="light"] .breadcrumbs, html[data-theme="light"] .page-hero p, html[data-theme="light"] .page-meta, html[data-theme="light"] .library-head p, html[data-theme="light"] .article-section p, html[data-theme="light"] .article-section li, html[data-theme="light"] .portal-cta-panel p, html[data-theme="light"] .faq-item p, html[data-theme="light"] .portal-footer, html[data-theme="light"] .portal-footer small {
    color: #5c6b84;
}

html[data-theme="light"] .main-nav a, html[data-theme="light"] .breadcrumbs a, html[data-theme="light"] .portal-footer nav a, html[data-theme="light"] .site-footer nav a, html[data-theme="light"] .toc-list a, html[data-theme="light"] .related-list a {
    color: #405674;
}

html[data-theme="light"] .main-nav a:hover, html[data-theme="light"] .breadcrumbs a:hover, html[data-theme="light"] .portal-footer nav a:hover, html[data-theme="light"] .site-footer nav a:hover {
    color: #167f8c;
}

html[data-theme="light"] .main-nav a:hover, html[data-theme="light"] .main-nav a[aria-current="page"] {
    color: #167f8c;
    background: rgba(49,154,176,.12);
}

html[data-theme="light"] .portal-eyebrow, html[data-theme="light"] .guide-card-kicker, html[data-theme="light"] .page-kicker {
    color: #26758d;
}

html[data-theme="light"] .guide-card-link {
    color: #26758d;
}

html[data-theme="light"] .leaderboard-more {
    border-color: rgba(68,139,164,.2);
    color: #28566a;
    background: linear-gradient(180deg,#f8fdff,#eaf4f8);
    box-shadow: 0 2px 0 rgba(64,106,140,.07), inset 0 1px #fff;
}

html[data-theme="light"] .footer-brand {
    color: #344863;
}

html[data-theme="light"] .portal-cta {
    border-color: rgba(51,137,166,.3);
    color: #17455a;
    background: linear-gradient(180deg,#fff,#eaf5fa);
    box-shadow: 0 3px 0 rgba(64,106,140,.12), inset 0 1px #fff;
}

html[data-theme="light"] .portal-content .portal-guide-card, html[data-theme="light"] .faq-item, html[data-theme="light"] .library-card, html[data-theme="light"] .article-section, html[data-theme="light"] .aside-card, html[data-theme="light"] .leaderboard-table-wrap {
    border-color: rgba(83,105,145,.17);
    color: #273a58;
    background: linear-gradient(150deg,rgba(255,255,255,.97),rgba(237,242,250,.97));
    box-shadow: 0 8px 22px rgba(48,67,103,.07), inset 0 1px #fff;
}

html[data-theme="light"] .portal-description {
    border-color: rgba(83,105,145,.17);
    background: linear-gradient(145deg,rgba(255,255,255,.97),rgba(235,241,250,.96));
    box-shadow: 0 18px 46px rgba(47,67,103,.1), inset 0 1px #fff;
}

html[data-theme="light"] .portal-copy-block {
    border-top-color: rgba(83,105,145,.17);
    background: transparent;
    box-shadow: none;
}

html[data-theme="light"] .portal-guide-card h3, html[data-theme="light"] .portal-copy-block h3, html[data-theme="light"] .library-card h3 {
    color: #1d2f4c;
}

html[data-theme="light"] .portal-guide-card p, html[data-theme="light"] .portal-copy-block p, html[data-theme="light"] .library-card p {
    color: #5c6b84;
}

html[data-theme="light"] .feature-guide {
    border-color: rgba(66,141,175,.22);
    background: linear-gradient(125deg,#e2f4fa,#edf0fc 55%,#fff);
    box-shadow: 0 16px 34px rgba(48,67,103,.09), inset 0 1px #fff;
}

html[data-theme="light"] .feature-guide h2, html[data-theme="light"] .feature-guide p {
    color: #213b5a;
}

html[data-theme="light"] .feature-art {
    border-color: rgba(83,105,145,.14);
    background: radial-gradient(circle at 50% 35%,rgba(82,172,255,.16),rgba(230,237,248,.72) 70%);
}

html[data-theme="light"] .article-callout {
    color: #32536b;
    background: rgba(64,153,188,.1);
}

html[data-theme="light"] .portal-cta-panel {
    border-color: rgba(75,147,174,.2);
    background: linear-gradient(115deg,rgba(215,242,249,.75),rgba(230,228,251,.72));
}

html[data-theme="light"] .leader-period {
    border-color: rgba(83,105,145,.17);
    color: #445a78;
    background: linear-gradient(180deg,#fff,#edf2f9);
    box-shadow: 0 2px 0 rgba(48,66,101,.08);
}

html[data-theme="light"] .leaderboard-table-wrap {
    background: rgba(255,255,255,.95);
}

html[data-theme="light"] .leaderboard-table th {
    color: #62718a;
}

html[data-theme="light"] .leaderboard-table td {
    border-color: rgba(83,105,145,.13);
    color: #344968;
}

html[data-theme="light"] .leaderboard-table td:last-child {
    color: #244e84;
}

html[data-theme="light"] .leaderboard-note, html[data-theme="light"] .leaderboard-state {
    color: #5c6b84;
}

html[data-theme="light"] .portal-footer {
    border-color: rgba(83,105,145,.17);
}

html[data-theme="light"] .portal-footer small {
    color: #687892;
}

/* 2026 editorial refresh: open up dividers, improve readability and vary surfaces. */
.portal-copy-block {
    padding: 36px 0 28px;
    margin-top: 17px;
    border-top-color: rgba(125,224,218,.28);
}

.portal-copy-block:first-child {
    border-top: 0;
    margin-top: 0;
    padding-top: 8px;
}

.portal-copy-block + .portal-copy-block {
    margin-top: 15px;
}

.portal-copy-block h3 {
    font-size: clamp(24px,2.6vw,29px);
    margin-bottom: 15px;
}

.portal-copy-block p {
    font-size: 18px;
    line-height: 1.9;
    color: #d0daec;
}

.portal-description {
    background: linear-gradient(128deg,rgba(20,38,53,.94),rgba(32,34,60,.91) 58%,rgba(34,34,51,.96));
    border-color: rgba(114,216,203,.28);
}

.portal-section-heading p, .page-hero p {
    font-size: 18px;
}

.article-section {
    margin-bottom: 24px;
    padding: 34px 36px;
    background: linear-gradient(145deg,rgba(28,40,53,.94),rgba(23,30,50,.94));
    border-color: rgba(109,207,204,.22);
    scroll-margin-top: 92px;
}

.article-section:nth-of-type(even) {
    background: linear-gradient(135deg,rgba(35,35,56,.95),rgba(28,45,55,.93));
    border-color: rgba(175,158,221,.22);
}

.article-section h2 {
    font-size: clamp(25px,3vw,31px);
    margin-bottom: 18px;
    line-height: 1.25;
}

.article-section h3 {
    font-size: 21px;
    margin-top: 26px;
}

.article-section p,.article-section li {
    font-size: 18px;
    line-height: 1.85;
    color: #d1dbee;
}

.article-section p {
    margin-bottom: 20px;
}

.article-section ul,.article-section ol {
    gap: 12px;
    padding-left: 27px;
}

.article-callout {
    font-size: 17px;
    padding: 19px 21px;
    background: rgba(54,175,159,.13);
    color: #e0f6ed;
}

.library-card,.portal-guide-card {
    background: linear-gradient(140deg,rgba(30,48,53,.94),rgba(34,34,60,.93));
    border-color: rgba(114,214,198,.24);
}

.library-card:nth-child(even),.portal-guide-card:nth-child(even) {
    background: linear-gradient(145deg,rgba(42,35,61,.96),rgba(25,44,55,.94));
}

.library-card h3,.portal-guide-card h3 {
    font-size: 21px;
}

.library-card p,.portal-guide-card p {
    font-size: 17px;
    line-height: 1.75;
    color: #c1cce2;
}

.guide-card-kicker,.page-kicker {
    font-size: 12px;
}

.toc-list a,.related-list a {
    font-size: 15px;
}

.aside-card {
    background: rgba(32,42,52,.96);
}

html[data-theme="light"] .portal-copy-block p,html[data-theme="light"] .article-section p,html[data-theme="light"] .article-section li {
    color:#44546e;
}

html[data-theme="light"] .article-section:nth-of-type(even) {
    background:linear-gradient(135deg,#fff9f4,#f0f4ff);
}

html[data-theme="light"] .portal-description {
    background:linear-gradient(135deg,#fffef9,#ebf6f5 60%,#f3eefc);
}

html[data-theme="light"] .article-callout {
    color:#245466;
    background:#e5f7f2;
}

@media (max-width: 720px) {
    .article-section {
        padding: 25px 22px;
    }

    .portal-description {
        padding: 24px 20px;
    }

    .article-section p,.article-section li,.portal-copy-block p {
        font-size: 17px;
    }

    .portal-copy-block {
        padding: 29px 0 22px;
    }

}

/* ===================== GAME STYLES ===================== */
/* Game-page styles, separated from shared portal styles. */
:root {
    color-scheme: dark;
    --bg: #080c18;
    --panel: rgba(17, 23, 42, .88);
    --panel-strong: #121a30;
    --line: rgba(173, 192, 255, .13);
    --text: #f5f7ff;
    --muted: #94a0bd;
    --blue: #55a7ff;
    --cyan: #63e5ee;
    --violet: #aa8dff;
    --green: #6be5b0;
    --shadow: 0 24px 70px rgba(0, 0, 0, .36);
    font-family: "Outfit", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

html {
    background: var(--bg);
}

* {
    box-sizing: border-box;
}

body {
    position: relative;
    isolation: isolate;
    min-width: 320px;
    min-height: 100vh;
    color: var(--text);
    background: transparent;
}

body::before {
    position: fixed;
    z-index: -1;
    inset: 0;
    content: "";
    pointer-events: none;
    background: radial-gradient(ellipse at 50% -15%, rgba(69, 102, 200, .18), transparent 45%), linear-gradient(180deg, rgba(5, 10, 23, .13), rgba(5, 10, 23, .52)), url("/assets/block-breaker-arcade-background.webp") center / cover no-repeat;
}

button {
    font: inherit;
}

.shell {
    width: min(1200px, calc(100% - 36px));
    margin: 0 auto;
    padding: 14px 0 44px;
}

.top-note {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
}

.live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 12px rgba(107, 229, 176, .9);
}

h1 {
    margin: 0;
    font-size: clamp(30px, 4vw, 42px);
    line-height: 1.08;
    letter-spacing: -.04em;
}

.game-layout {
    display: block;
    width: 100%;
}

.game-card {
    position: relative;
    width: 100%;
    min-width: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(164,185,216,.34);
    border-radius: 16px;
    background: #f0f4fc;
    color: #17243d;
    box-shadow: 0 22px 58px rgba(0,0,0,.32), 0 1px 0 rgba(255,255,255,.5) inset;
}

.side-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: linear-gradient(145deg, rgba(17,31,58,.94), rgba(22,39,72,.85));
    box-shadow: 0 18px 55px rgba(0,0,0,.2), inset 0 1px rgba(255,255,255,.06);
}

.hud {
    display: grid;
    min-height: 78px;
    grid-template-columns: repeat(5, minmax(0,1fr)) auto;
    gap: 12px;
    align-items: stretch;
    margin: 0;
    padding: 12px 15px;
    background: linear-gradient(180deg,#f8faff,#edf2fb);
    color: #17233b;
}

.stat {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 7px 10px;
    border: 1px solid #dbe3ef;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 3px 10px rgba(28,53,82,.06), inset 0 1px #fff;
}

.stat-label {
    display: block;
    margin-bottom: 1px;
    color: #73819a;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.stat-value {
    display: flex;
    align-items: center;
    min-height: 22px;
    margin-top: 1px;
    color: #17243d;
    font-size: 20px;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    font-weight: 850;
}

.lives {
    gap: 4px;
    color: #e34b68;
    letter-spacing: .04em;
}

#bestValue {
    color: #0b9b80;
}

.hud-actions {
    display: flex;
    gap: 8px;
    align-items: stretch;
    justify-content: flex-end;
    margin-left: 3px;
}

.icon-btn {
    display: grid;
    width: 48px;
    min-height: 48px;
    flex: 0 0 auto;
    place-items: center;
    padding: 0;
    border: 1px solid #d7e0ed;
    border-radius: 12px;
    color: #425b7d;
    background: linear-gradient(180deg,#fff,#f8faff);
    box-shadow: 0 3px 10px rgba(32,54,87,.07);
    cursor: pointer;
    transition: border-color .16s, color .16s, transform .16s, box-shadow .16s;
}

.icon-btn:hover {
    border-color: #73c5ed;
    color: #147ea0;
    transform: translateY(-2px);
    box-shadow: 0 7px 18px rgba(53,135,176,.16);
}

.icon-btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 4px rgba(32,54,87,.1);
}

.icon-btn:focus-visible, .primary-btn:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 3px;
}

.icon-btn svg {
    width: 17px;
    height: 17px;
}

.arena-wrap {
    position: relative;
    width: 100%;
    min-height: 360px;
    height: auto;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 0;
    border-top: 1px solid #d9e2f0;
    border-radius: 0;
    background: #081225;
    box-shadow: inset 0 0 32px rgba(2,8,23,.28);
    touch-action: none;
}

#arenaWrap:fullscreen, #arenaWrap:-webkit-full-screen, #arenaWrap.is-fullscreen-fallback {
    position: fixed;
    inset: 0;
    z-index: 10000;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
    max-height: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

html.game-fullscreen-active, body.game-fullscreen-active {
    overflow: hidden;
    overscroll-behavior: none;
}

body.game-fullscreen-active {
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
}

.arena-exit-fullscreen {
    position: absolute;
    top: calc(env(safe-area-inset-top, 0px) + 12px);
    right: calc(env(safe-area-inset-right, 0px) + 12px);
    z-index: 10;
    display: none;
    width: 44px;
    height: 44px;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(210,230,255,.28);
    border-radius: 13px;
    color: #eff7ff;
    background: rgba(7,15,30,.82);
    box-shadow: 0 6px 20px rgba(0,0,0,.34);
    backdrop-filter: blur(12px);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.arena-exit-fullscreen:focus-visible {
    outline: 2px solid #70e7f5;
    outline-offset: 3px;
}

#arenaWrap.is-fullscreen-fallback .arena-exit-fullscreen, #arenaWrap:fullscreen .arena-exit-fullscreen, #arenaWrap:-webkit-full-screen .arena-exit-fullscreen {
    display: grid;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.arena-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 22px;
    text-align: center;
    background: radial-gradient(ellipse at center, rgba(7, 11, 24, .72), rgba(7, 11, 24, .28) 75%);
    backdrop-filter: blur(4px);
    transition: opacity .2s ease, visibility .2s ease;
}

.arena-overlay.is-hidden {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.overlay-card {
    width: min(390px, 100%);
    max-height: calc(100% - 8px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 28px 27px 25px;
    border: 1px solid rgba(255,255,255,.9);
    border-radius: 22px;
    color: #15233c;
    background: rgba(246,249,255,.97);
    box-shadow: 0 22px 70px rgba(2,8,23,.5), 0 0 32px rgba(85,167,255,.13), inset 0 1px #fff;
}

.overlay-kicker {
    color: #087f95;
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.overlay-card h2 {
    margin: 9px 0 7px;
    color: #15233c;
    font-size: clamp(27px, 4vw, 36px);
    font-weight: 850;
    letter-spacing: -.04em;
    line-height: 1.1;
}

.overlay-card p {
    margin: 0 auto 20px;
    max-width: 310px;
    color: #64728a;
    font-size: 15px;
    line-height: 1.65;
}

.arena-overlay[data-phase="over"] .overlay-card, .arena-overlay[data-phase="won"] .overlay-card {
    width: min(360px, 100%);
    padding: 18px 20px 14px;
    border-radius: 18px;
}

.arena-overlay[data-phase="over"] .overlay-card h2, .arena-overlay[data-phase="won"] .overlay-card h2 {
    margin: 4px 0 3px;
    font-size: clamp(24px, 3.4vw, 32px);
}

.arena-overlay[data-phase="over"] .overlay-card > p, .arena-overlay[data-phase="won"] .overlay-card > p {
    margin-bottom: 10px;
    font-size: 14px;
    line-height: 1.4;
}

.arena-overlay[data-phase="over"] .result-stats, .arena-overlay[data-phase="won"] .result-stats {
    gap: 6px;
    margin: 0 0 9px;
}

.arena-overlay[data-phase="over"] .result-stat, .arena-overlay[data-phase="won"] .result-stat {
    padding: 7px;
}

.arena-overlay[data-phase="over"] .result-stat strong, .arena-overlay[data-phase="won"] .result-stat strong {
    margin-top: 2px;
    font-size: 17px;
}

.arena-overlay[data-phase="over"] .save-score-panel, .arena-overlay[data-phase="won"] .save-score-panel {
    margin: 0 0 7px;
}

.arena-overlay[data-phase="over"] .save-score-panel label, .arena-overlay[data-phase="won"] .save-score-panel label {
    margin-bottom: 4px;
    font-size: 11px;
}

.arena-overlay[data-phase="over"] .save-score-row input, .arena-overlay[data-phase="won"] .save-score-row input {
    height: 38px;
    font-size: 14px;
}

.arena-overlay[data-phase="over"] .save-score-row .primary-btn, .arena-overlay[data-phase="won"] .save-score-row .primary-btn {
    min-height: 36px;
}

.arena-overlay[data-phase="over"] .save-status, .arena-overlay[data-phase="won"] .save-status {
    min-height: 0;
    margin: 4px 2px 0;
    font-size: 11px;
    line-height: 1.3;
}

.arena-overlay[data-phase="over"] #startBtn, .arena-overlay[data-phase="won"] #startBtn {
    min-height: 40px;
    padding: 0 18px;
    font-size: 14px;
}

.arena-overlay[data-phase="over"] .start-hint, .arena-overlay[data-phase="won"] .start-hint {
    display: none;
}

.primary-btn {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 0 22px;
    border: 0;
    border-radius: 13px;
    color: #06111e;
    background: linear-gradient(100deg, #74eff0, #8bbdff 53%, #b49bff);
    box-shadow: 0 8px 26px rgba(86, 181, 237, .25);
    font-size: 15px;
    font-weight: 850;
    cursor: pointer;
    transition: transform .18s ease, filter .18s ease;
}

.primary-btn:hover {
    filter: brightness(1.08);
    transform: translateY(-2px);
}

.primary-btn svg {
    width: 15px;
    height: 15px;
}

.start-hint {
    margin-top: 13px;
    color: #75829a;
    font-size: 12px;
}

.result-stats {
    display: none;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
    margin: -3px 0 16px;
}

.result-stats.visible {
    display: grid;
}

.result-stat {
    padding: 9px;
    border: 1px solid rgba(112, 132, 166, .2);
    border-radius: 11px;
    background: rgba(255,255,255,.72);
}

.result-stat span {
    display: block;
    color: #64728a;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.result-stat strong {
    display: block;
    margin-top: 4px;
    color: #17243d;
    font-size: 19px;
    font-variant-numeric: tabular-nums;
}

.save-score-panel {
    display: none;
    margin: -3px 0 14px;
    text-align: left;
}

.save-score-panel.visible {
    display: block;
}

.save-score-panel label {
    display: block;
    margin-bottom: 6px;
    color: #37465e;
    font-size: 13px;
    font-weight: 750;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.save-score-row {
    display: flex;
    gap: 7px;
}

.save-score-row input {
    width: 100%;
    min-width: 0;
    height: 44px;
    padding: 0 12px;
    border: 1px solid #d6e0ed;
    border-radius: 11px;
    color: #17243d;
    background: #fff;
    font: inherit;
    font-size: 15px;
}

.save-score-row input:focus {
    outline: 2px solid rgba(99,229,238,.7);
    outline-offset: 1px;
}

.save-score-row .primary-btn {
    min-height: 42px;
    flex: 0 0 auto;
    padding: 0 13px;
    border-radius: 11px;
    font-size: 11px;
}

.save-score-row .primary-btn:disabled {
    cursor: default;
    filter: saturate(.55);
    opacity: .7;
}

.save-status {
    min-height: 20px;
    margin: 8px 2px 0;
    color: #66748d;
    font-size: 13px;
    line-height: 1.5;
}

.secondary-btn {
    display: none;
    margin: 9px auto 0;
    padding: 8px 10px;
    border: 0;
    color: #586a84;
    background: transparent;
    font-size: 12px;
    cursor: pointer;
}

.secondary-btn.visible {
    display: block;
}

.game-foot {
    display: flex;
    min-height: 49px;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 20px;
    border-top: 1px solid #e0e6ef;
    color: #53647f;
    background: #f4f7fd;
    font-size: 13px;
}

.game-foot span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

kbd {
    min-width: 22px;
    height: 23px;
    display: inline-grid;
    place-items: center;
    margin-right: 2px;
    padding: 0 5px;
    border: 1px solid rgba(82,99,127,.4);
    border-bottom-width: 2px;
    border-radius: 6px;
    color: #ecf2ff;
    background: #182641;
    font: inherit;
    font-size: 11px;
    font-weight: 750;
    line-height: 1;
}

.home-leaderboard {
    margin: 34px auto 0;
}

.home-leaderboard .side-card {
    position: relative;
    padding: 25px 28px 20px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: linear-gradient(145deg, rgba(17,31,58,.94), rgba(22,39,72,.85));
    box-shadow: 0 18px 55px rgba(0,0,0,.18), inset 0 1px rgba(255,255,255,.06);
    backdrop-filter: blur(18px);
}

.side-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 18px;
    color: #f1f4ff;
    font-size: clamp(26px, 3vw, 34px);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -.035em;
}

.side-heading svg {
    width: 21px;
    height: 21px;
    color: var(--cyan);
}

.leader-tabs {
    width: min(100%, 430px);
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
    margin: 0 0 12px auto;
    padding: 5px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: rgba(7,18,37,.44);
}

.leader-tab {
    min-width: 0;
    min-height: 38px;
    padding: 0 8px;
    border: 0;
    border-radius: 9px;
    color: #a5b1cd;
    background: transparent;
    font-size: 14px;
    font-weight: 750;
    cursor: pointer;
    transition: .18s ease;
}

.leader-tab.active {
    color: #081321;
    background: linear-gradient(100deg,#74eff0,#9bcaff);
    box-shadow: 0 3px 10px rgba(100,205,231,.2), inset 0 1px rgba(255,255,255,.6);
}

.leaderboard-list {
    display: grid;
    gap: 7px;
    min-height: 48px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.leaderboard-row {
    display: grid;
    min-height: 62px;
    grid-template-columns: 36px minmax(0,1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 8px 11px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: #c4cfe7;
    background: rgba(22,39,72,.72);
    box-shadow: inset 0 1px rgba(255,255,255,.035);
    font-size: 15px;
}

.leaderboard-row:nth-child(1) {
    border-color: rgba(255,199,94,.34);
    background: linear-gradient(100deg,rgba(255,199,94,.12),rgba(22,39,72,.72));
}

.leader-rank {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    color: #d5e1f6;
    background: #324668;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    font-weight: 850;
}

.leaderboard-row:nth-child(1) .leader-rank {
    color: #34230b;
    background: #ffc75e;
}

.leaderboard-row:nth-child(2) .leader-rank {
    color: #263851;
    background: #d7e4f3;
}

.leaderboard-row:nth-child(3) .leader-rank {
    color: #412318;
    background: #d39477;
}

.leader-name {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 9px;
    overflow: hidden;
    color: #e4eafa;
    font-size: 15px;
    font-weight: 750;
}

.leader-name-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.leader-score {
    color: #78ead2;
    font-size: 18px;
    font-variant-numeric: tabular-nums;
    font-weight: 850;
}

.leaderboard-status {
    min-height: 28px;
    margin-top: 10px;
    color: #93a0bc;
    font-size: 14px;
    line-height: 1.5;
}

.below-note {
    margin: 14px 4px 0;
    color: #66728e;
    font-size: 10px;
    text-align: center;
}

.toast {
    position: absolute;
    top: 16px;
    left: 50%;
    z-index: 3;
    padding: 9px 13px;
    border: 1px solid rgba(101, 221, 226, .3);
    border-radius: 999px;
    color: #dfffff;
    background: rgba(11, 28, 43, .9);
    box-shadow: 0 9px 25px rgba(0,0,0,.25);
    font-size: 11px;
    font-weight: 800;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -8px);
    transition: .24s ease;
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

@media (max-width: 720px) {
    .shell {
        width: calc(100% - 24px);
        padding-top: 11px;
    }

    .game-card {
        border-radius: 13px;
        padding: 0;
    }

    .hud {
        grid-template-columns: repeat(5, minmax(0,1fr));
        gap: 6px;
        margin-bottom: 0;
        padding: 9px 8px;
    }

    .stat {
        min-width: 0;
        padding: 7px 5px;
        border-radius: 9px;
    }

    .stat-label {
        font-size: 9px;
        letter-spacing: .06em;
    }

    .stat-value {
        min-height: 19px;
        font-size: 16px;
    }

    .hud-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
        margin-top: 1px;
    }

    .icon-btn {
        width: 40px;
        min-height: 40px;
        border-radius: 10px;
    }

    .arena-wrap {
        min-height: 390px;
        height: min(58svh, 500px);
        aspect-ratio: auto;
        border-radius: 0;
    }

    .game-foot {
        min-height: 44px;
        padding: 8px 12px;
        font-size: 12px;
    }

    .home-leaderboard {
        margin-top: 28px;
    }

    .home-leaderboard .side-card {
        padding: 20px 15px 16px;
        border-radius: 16px;
    }

    .side-heading {
        margin-bottom: 15px;
        font-size: 26px;
    }

    .leader-tabs {
        margin: 0 0 11px;
    }

    .leader-tab {
        min-height: 34px;
        padding: 0 3px;
        font-size: 12px;
    }

    .leaderboard-row {
        min-height: 56px;
        grid-template-columns: 32px minmax(0,1fr) auto;
        gap: 8px;
        padding: 7px 8px;
        font-size: 14px;
    }

    .leader-rank {
        width: 27px;
        height: 27px;
        font-size: 11px;
    }

    .leader-name {
        font-size: 14px;
    }

    .leader-score {
        font-size: 16px;
    }

    .below-note {
        margin-top: 11px;
    }

}

@media (max-width: 390px) {
    .arena-wrap {
        min-height: 370px;
    }

    .game-foot {
        flex-direction: column;
        gap: 5px;
    }

}

@media (max-height: 560px) {
    .arena-overlay {
        padding: 8px;
    }

    .arena-overlay[data-phase="over"] .overlay-card, .arena-overlay[data-phase="won"] .overlay-card {
        padding: 10px 14px 9px;
    }

    .arena-overlay[data-phase="over"] .result-stats, .arena-overlay[data-phase="won"] .result-stats {
        gap: 4px;
        margin-bottom: 6px;
    }

    .arena-overlay[data-phase="over"] .result-stat, .arena-overlay[data-phase="won"] .result-stat {
        padding: 5px;
    }

}

html[data-theme="light"] {
    color-scheme: light;
    --bg: #eef3fb;
    --panel: rgba(255, 255, 255, .94);
    --panel-strong: #ffffff;
    --line: rgba(72, 94, 132, .18);
    --text: #17243d;
    --muted: #5e6e89;
    --shadow: 0 22px 50px rgba(47, 67, 103, .13);
}

html[data-theme="light"] body {
    color: var(--text);
    background: transparent;
}

html[data-theme="light"] body::before {
    background: linear-gradient(180deg, rgba(241, 246, 253, .81), rgba(238, 243, 251, .88)), url("/assets/block-breaker-arcade-background.webp") center / cover no-repeat;
}

html[data-theme="light"] .side-heading, html[data-theme="light"] .stat-value, html[data-theme="light"] .leader-name {
    color: #192844;
}

html[data-theme="light"] .stat-label, html[data-theme="light"] .game-foot, html[data-theme="light"] .leaderboard-status {
    color: #62718a;
}

html[data-theme="light"] .game-card, html[data-theme="light"] .home-leaderboard .side-card {
    border-color: rgba(78, 101, 143, .2);
    background: linear-gradient(150deg, rgba(255,255,255,.98), rgba(235,241,250,.98));
    box-shadow: 0 24px 50px rgba(47,67,103,.14), 0 3px 0 rgba(255,255,255,.9), inset 0 1px #fff;
}

html[data-theme="light"] .stat {
    border-color: rgba(86, 108, 148, .17);
    background: linear-gradient(180deg, #ffffff, #edf2f9);
    box-shadow: 0 4px 0 rgba(48,66,101,.1), inset 0 1px #fff;
}

html[data-theme="light"] .stat-value {
    color: #1d2c49;
}

html[data-theme="light"] .lives {
    color: #e34668;
}

html[data-theme="light"] .icon-btn {
    border-color: rgba(81,104,146,.2);
    color: #435571;
    background: linear-gradient(180deg, #fff, #e9eff8);
    box-shadow: inset 0 1px #fff, 0 3px 0 rgba(48,66,101,.12);
}

html[data-theme="light"] .icon-btn:hover {
    border-color: rgba(49, 154, 176, .55);
    color: #102746;
}

html[data-theme="light"] .game-foot kbd {
    color: #344661;
    border-color: rgba(77,99,138,.23);
    background: #f9fbff;
}

html[data-theme="light"] .leader-tabs {
    border-color: rgba(79,101,141,.15);
    background: rgba(220,228,241,.72);
}

html[data-theme="light"] .leader-tab {
    color: #566783;
}

html[data-theme="light"] .leaderboard-row {
    border-color: rgba(83,105,145,.14);
    color: #384a67;
    background: linear-gradient(115deg, rgba(255,255,255,.96), rgba(233,239,248,.9));
    box-shadow: inset 0 1px #fff, 0 2px 5px rgba(58,77,113,.06);
}

html[data-theme="light"] .leaderboard-row:nth-child(1) {
    border-color: rgba(199,142,43,.28);
    background: linear-gradient(110deg,#fff6df,#f4f6fb);
}

html[data-theme="light"] .leader-rank {
    color: #287c90;
}

html[data-theme="light"] .leader-score {
    color: #244e84;
}

.leaderboard-row.empty-state {
    grid-template-columns: minmax(0, 1fr);
    min-height: 72px;
    text-align: center;
    line-height: 1.5;
}

.leaderboard-row.empty-state:nth-child(1) {
    border-color: var(--line);
    background: rgba(22,39,72,.5);
}

html[data-theme="light"] .leaderboard-row.empty-state:nth-child(1) {
    border-color: rgba(83,105,145,.14);
    background: linear-gradient(115deg, rgba(255,255,255,.96), rgba(233,239,248,.9));
}

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

}

/* Fit the complete play panel in the visible window while keeping a 16:9 arena. */
@media (min-width: 721px) {
    .game-layout {
        width: min(100%, max(320px, calc(177.78vh - 472px)));
        margin-inline: auto;
    }

    .arena-wrap {
        min-height: 0;
    }

}

/* On phones, reserve room for the header, HUD, and controls below the arena. */
@media (max-width: 720px) {
    .arena-wrap {
        height: min(58vh, 500px, calc(100vh - 289px));
        min-height: min(390px, calc(100vh - 289px));
    }

}

@supports (height: 100svh) {
    @media (min-width: 721px) {
        .game-layout {
            width: min(100%, max(320px, calc(177.78svh - 472px)));
        }

    }

    @media (max-width: 720px) {
        .arena-wrap {
            height: min(58svh, 500px, calc(100svh - 289px));
            min-height: min(390px, calc(100svh - 289px));
        }

    }

}
