/*
 * Kebulai 2026 product theme.
 * Loaded after the legacy stylesheets as the single visual source of truth.
 */

:root {
    --green-950: #071a14;
    --green-900: #0c2b20;
    --green-800: #124936;
    --green-700: #176a4b;
    --green-600: #1d8a5e;
    --green-500: #28a873;
    --lime: #d9f740;
    --lime-strong: #c9eb24;
    --lime-soft: #f2facd;
    --orange: #ef6b42;
    --blue: #316bc4;
    --red: #ce4150;
    --purple: #7853b6;
    --gold: #d2a514;
    --text: #14231e;
    --muted: #66746e;
    --line: #d9e1dd;
    --line-strong: #c4d0ca;
    --surface: #ffffff;
    --surface-soft: #f5f7f6;
    --background: #eef2f0;
    --shadow: 0 24px 64px rgba(7, 26, 20, .13);
    --shadow-small: 0 8px 28px rgba(7, 26, 20, .07);
    --radius: 8px;
    --radius-small: 6px;
}

html {
    color-scheme: light;
    background: var(--background);
    scroll-padding-top: 104px;
}

body {
    min-width: 320px;
    color: var(--text);
    background: var(--background);
    font-size: 15px;
    line-height: 1.65;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

body::before {
    position: fixed;
    z-index: -1;
    inset: 0 0 auto;
    height: 360px;
    pointer-events: none;
    background: linear-gradient(180deg, #e3ebe7 0, rgba(238, 242, 240, 0) 100%);
    content: "";
}

a {
    color: var(--green-700);
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}

a:hover {
    color: var(--green-500);
}

h1,
h2,
h3,
h4 {
    margin-top: 0;
    color: var(--green-950);
    line-height: 1.28;
    letter-spacing: 0;
}

h1 {
    font-size: 30px;
}

h2 {
    font-size: 24px;
}

h3 {
    font-size: 18px;
}

p {
    margin-top: 0;
}

::selection {
    color: var(--green-950);
    background: var(--lime);
}

:focus-visible {
    outline: 3px solid rgba(49, 107, 196, .38);
    outline-offset: 3px;
}

.site-shell {
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    z-index: 100;
    top: 10px;
    min-height: 72px;
    gap: 24px;
    margin: 10px 0 26px;
    padding: 11px 14px 11px 16px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 8px;
    color: #fff;
    background: rgba(7, 26, 20, .97);
    box-shadow: 0 16px 42px rgba(7, 26, 20, .2);
    backdrop-filter: blur(16px);
}

.brand {
    gap: 12px;
    flex: 0 0 auto;
    color: #fff;
}

.brand:hover {
    color: #fff;
}

.brand-ball {
    width: 43px;
    height: 43px;
    flex-basis: 43px;
    background: var(--lime);
    box-shadow: 0 0 0 4px rgba(217, 247, 64, .12);
}

.brand-copy strong {
    color: #fff;
    font-size: 20px;
    font-weight: 850;
}

.brand-copy small {
    color: rgba(255, 255, 255, .55);
    font-size: 11px;
}

.main-nav {
    gap: 2px;
}

.main-nav a {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    gap: 6px;
    padding: 9px 10px;
    border-radius: 6px;
    color: rgba(255, 255, 255, .72);
    font-size: 13px;
    font-weight: 720;
}

.main-nav a svg {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
    opacity: .72;
}

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

.main-nav a[aria-current="page"]:not(.nav-primary)::after {
    position: absolute;
    right: 10px;
    bottom: 3px;
    left: 10px;
    height: 2px;
    border-radius: 2px;
    background: var(--lime);
    content: "";
}

.main-nav .nav-primary {
    color: var(--green-950);
    background: var(--lime);
    box-shadow: none;
}

.main-nav .nav-primary:hover {
    color: var(--green-950);
    background: #e4fb65;
}

.main-nav .nav-danger {
    color: #ffb0b7;
}

.nav-toggle {
    border-color: rgba(255, 255, 255, .18);
}

.main-content {
    min-height: calc(100vh - 280px);
}

body:not(.page-index) .main-content {
    padding-top: 2px;
}

.panel,
.box {
    margin: 0;
    padding: 28px 24px;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.main-content > .panel,
.main-content > .box {
    margin-bottom: 16px;
}

.main-content > .panel:first-child:not(.ranking-panel) {
    border-top: 1px solid var(--line);
}

.panel-title {
    align-items: flex-start;
    margin-bottom: 22px;
}

.panel-title h1,
.panel-title h2,
.panel-title h3,
.panel-title h4 {
    margin-bottom: 0;
}

.panel-title h2::after {
    display: none;
}

.panel-title .muted,
.panel-title p {
    margin: 5px 0 0;
}

.muted,
.help-text {
    color: var(--muted);
}

.help-text {
    line-height: 1.5;
}

.hero {
    border: 0;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.page-index .hero {
    min-height: 440px;
    margin-bottom: 36px;
    padding: 48px;
    background-position: center 42%;
    box-shadow: 0 26px 68px rgba(7, 26, 20, .22);
}

.page-index .hero h1,
.page-index .hero-title {
    font-size: 48px;
    line-height: 1.1;
}

.page-index .hero p {
    color: rgba(255, 255, 255, .76);
    line-height: 1.75;
}

.hero-actions .btn-lime {
    min-height: 48px;
    padding-right: 22px;
    padding-left: 22px;
}

.page-index .hero-stats {
    box-shadow: 0 18px 36px rgba(0, 0, 0, .12);
}

.page-index .hero-stat {
    background: rgba(6, 24, 18, .82);
}

.page-index .hero-stat strong {
    font-variant-numeric: tabular-nums;
}

.page-matchmaking .hero,
.page-inbox .hero,
.page-admin_dashboard .hero {
    min-height: 310px;
    padding: 44px;
    background: var(--green-900);
}

.page-matchmaking .hero h1,
.page-inbox .hero h1,
.page-admin_dashboard .hero h1 {
    margin: 18px 0 9px;
    font-size: 40px;
}

.page-matchmaking .hero p,
.page-inbox .hero p,
.page-admin_dashboard .hero p {
    color: rgba(255, 255, 255, .65);
}

.hero-stat {
    border-radius: 6px;
}

.ranking-panel {
    margin-bottom: 24px;
    padding: 0;
    border-bottom: 0;
}

.ranking-panel .panel-title h2 {
    font-size: 30px;
}

.filter-form {
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow-small);
}

input,
select,
textarea {
    min-height: 46px;
    padding: 10px 13px;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    color: var(--text);
    background: #fbfcfb;
}

input:hover,
select:hover,
textarea:hover {
    border-color: #a8b9b0;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--green-600);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(29, 138, 94, .11);
}

input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--green-700);
}

label {
    color: #273a32;
    font-size: 14px;
    font-weight: 760;
}

.form-group {
    margin-bottom: 18px;
}

.form-grid {
    gap: 16px;
}

.btn {
    min-height: 43px;
    padding: 9px 16px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 780;
    letter-spacing: 0;
    box-shadow: none;
    transition: transform .16s, border-color .16s, background .16s, color .16s, box-shadow .16s;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    border-color: var(--green-700);
    color: #fff;
    background: var(--green-700);
    box-shadow: 0 8px 18px rgba(23, 106, 75, .16);
}

.btn-primary:hover {
    color: #fff;
    background: var(--green-800);
}

.btn-lime {
    border-color: var(--lime);
    color: var(--green-950);
    background: var(--lime);
    box-shadow: 0 8px 18px rgba(151, 180, 5, .16);
}

.btn-lime:hover {
    color: var(--green-950);
    background: #e5fb69;
}

.btn-secondary {
    border-color: #d5dfda;
    color: var(--green-900);
    background: #edf2ef;
}

.btn-secondary:hover {
    border-color: #bdccc4;
    color: var(--green-900);
    background: #e3ebe7;
}

.btn-orange {
    border-color: var(--orange);
    background: var(--orange);
}

.btn-blue {
    border-color: var(--blue);
    background: var(--blue);
}

.btn-danger {
    border-color: var(--red);
    background: var(--red);
}

.btn-purple {
    border-color: var(--purple);
    background: var(--purple);
}

.is-loading::after {
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: kebulai-spin .7s linear infinite;
    content: "";
}

@keyframes kebulai-spin {
    to { transform: rotate(360deg); }
}

.tabs {
    gap: 3px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #e3e9e6;
}

.tab {
    border-radius: 5px;
    color: #56665f;
    background: transparent;
    font-size: 14px;
}

.tab.active {
    color: #fff;
    background: var(--green-900);
    box-shadow: 0 5px 14px rgba(7, 26, 20, .14);
}

.region-tabs {
    gap: 6px;
}

.region-chip {
    padding: 7px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    color: #5b6862;
    background: rgba(255, 255, 255, .62);
}

.region-chip:hover {
    border-color: var(--green-600);
    color: var(--green-800);
}

.region-chip.active {
    border-color: var(--green-900);
    color: var(--lime);
    background: var(--green-900);
}

.tag {
    min-height: 24px;
    padding: 3px 8px;
    border: 1px solid #dfe6e2;
    border-radius: 5px;
    color: #617069;
    background: #f0f4f2;
    line-height: 1.3;
}

.tag-city {
    border-color: #d9e89a;
    color: #3c5a18;
    background: var(--lime-soft);
}

.tag-success {
    border-color: #bfe3cf;
    color: #17603f;
    background: #e4f5eb;
}

.tag-warning {
    border-color: #efdc9d;
    color: #755914;
    background: #fff5d6;
}

.tag-danger {
    border-color: #efc4c8;
    color: #912e39;
    background: #fff0f1;
}

.player-list {
    gap: 9px;
}

.player-card {
    min-height: 96px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
    box-shadow: 0 2px 0 rgba(7, 26, 20, .02);
}

.player-card:hover {
    transform: translateY(-2px);
    border-color: #adbbb4;
    box-shadow: var(--shadow-small);
}

.rank-number {
    width: 46px;
    height: 46px;
    border: 1px solid #d5dfda;
    border-radius: 6px;
    font-variant-numeric: tabular-nums;
}

.rank-1 {
    border-color: var(--gold);
    color: #513c00;
    background: #f3d768;
}

.rank-2 {
    border-color: #a9b5bb;
    color: #34434a;
    background: #dce3e6;
}

.rank-3 {
    border-color: #b86d3c;
    color: #fff;
    background: #c77a49;
}

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

.player-score strong {
    color: var(--green-700);
    font-size: 26px;
    font-variant-numeric: tabular-nums;
}

.message-card,
.match-row,
.review-card {
    margin-bottom: 10px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
}

.message-card:last-child,
.match-row:last-child,
.review-card:last-child {
    margin-bottom: 0;
    border-bottom: 1px solid var(--line);
}

.message-card h3,
.message-card h4,
.match-row h3,
.review-card h3 {
    margin-bottom: 8px;
}

.message-card p:last-child,
.match-row p:last-child,
.review-card p:last-child {
    margin-bottom: 0;
}

.message-card-header {
    align-items: center;
}

.empty {
    min-height: 150px;
    display: grid;
    place-items: center;
    border: 1px dashed var(--line-strong);
    border-radius: 7px;
    color: var(--muted);
    background: rgba(255, 255, 255, .42);
}

.alert {
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 14px;
}

.alert-success {
    border-color: #bee2ce;
    color: #175d3e;
    background: #e5f5ec;
}

.alert-error {
    border-color: #efc5ca;
    color: #8d303a;
    background: #fff0f1;
}

.alert-warning {
    border-color: #ecd798;
    color: #725711;
    background: #fff5d6;
}

.alert-info {
    border-color: #bfd4ef;
    color: #285b91;
    background: #eef5ff;
}

.pagination a,
.pagination span {
    min-width: 42px;
    min-height: 40px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
}

.pagination .current {
    border-color: var(--green-700);
    background: var(--green-700);
}

.algorithm-panel {
    border: 1px solid var(--line);
    border-left: 4px solid var(--blue);
    border-radius: 7px;
    background: #f7f9f8;
}

.auth-card {
    width: min(680px, 100%);
    margin: 42px auto 58px;
    padding: 36px;
    border: 1px solid var(--line);
    border-top: 5px solid var(--lime);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
}

.page-login .auth-card,
.page-forgot_password .auth-card,
.page-admin_login .auth-card,
.page-admin_reauth .auth-card {
    width: min(560px, 100%);
}

.page-register .auth-card,
.page-admin_edit_player .auth-card {
    width: min(780px, 100%);
}

.auth-card h1 {
    font-size: 28px;
}

.auth-card > p {
    margin-bottom: 28px;
}

.auth-secondary {
    margin-top: 14px;
}

.captcha-row img,
[data-captcha-refresh] {
    border-color: var(--line-strong);
    background: var(--surface-soft);
}

.region-selector {
    gap: 8px;
}

.region-option {
    min-height: 44px;
    border-color: var(--line);
    border-radius: 6px;
    background: var(--surface-soft);
}

.region-option:hover {
    border-color: var(--green-600);
    background: #edf5f1;
}

.profile-hero {
    min-height: 245px;
    align-items: center;
    padding: 34px;
    border: 0;
    border-radius: 8px;
    background: var(--green-900);
    box-shadow: var(--shadow);
}

.profile-hero h1 {
    color: #fff;
    font-size: 34px;
}

.profile-hero p {
    color: rgba(255, 255, 255, .72);
}

.profile-tags span {
    border-radius: 5px;
    color: var(--green-950);
    background: var(--lime);
}

.profile-tags a {
    color: inherit;
}

.score-box {
    min-width: 130px;
    padding: 18px;
    border-radius: 7px;
    background: rgba(0, 0, 0, .2);
}

.score-box strong {
    font-size: 32px;
}

.stat-row {
    margin: 0 0 20px;
    border: 1px solid var(--line);
    border-top: 3px solid var(--green-800);
    border-radius: 7px;
    background: #fff;
    box-shadow: none;
}

.stat-item {
    min-height: 90px;
    display: grid;
    align-content: center;
    gap: 4px;
}

.elo-trend {
    border-color: var(--line);
}

.elo-trend-bar {
    background: var(--green-600);
}

.achievement-badge {
    border-radius: 6px;
}

.h2h-panel {
    border: 1px solid #d7ccec;
    border-left: 4px solid var(--purple);
    background: #faf8fd;
}

.pending-panel {
    border: 1px solid #ecd798;
    border-left: 4px solid var(--gold);
    background: #fffdf5;
}

.more-function-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.more-function-link {
    min-height: 112px;
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-content: center;
    column-gap: 14px;
    padding: 18px;
    border: 1px solid var(--line);
    border-left: 1px solid var(--line);
    border-radius: 7px;
    color: var(--text);
    background: #fff;
}

.more-function-link:hover {
    transform: translateY(-2px);
    border-color: #b2c1ba;
    color: var(--text);
    background: #fff;
    box-shadow: var(--shadow-small);
}

.function-icon {
    width: 46px;
    height: 46px;
    grid-row: 1 / 3;
    display: grid;
    place-items: center;
    align-self: center;
    border-radius: 7px;
    color: var(--green-800);
    background: var(--lime-soft);
}

.function-icon svg {
    width: 22px;
    height: 22px;
}

.more-function-link strong,
.more-function-link span:not(.function-icon) {
    grid-column: 2;
}

.more-function-link strong {
    align-self: end;
    font-size: 16px;
}

.more-function-link span:not(.function-icon) {
    align-self: start;
    line-height: 1.5;
}

.court-benefit-grid {
    gap: 12px;
}

.court-benefit-card {
    padding: 18px;
    border-color: var(--line);
    border-radius: 7px;
    background: #fff;
}

.court-benefit-card:hover {
    border-color: #b5c4bd;
    box-shadow: var(--shadow-small);
}

.court-public-facts span {
    border: 1px solid #e2e8e5;
    border-radius: 6px;
    background: var(--surface-soft);
}

.court-review-quote,
.checkin-ticket {
    border-radius: 0 6px 6px 0;
}

.admin-grid,
.admin-stats {
    gap: 10px;
}

.admin-stat {
    min-height: 112px;
    display: grid;
    align-content: center;
    padding: 18px;
    border: 1px solid var(--line);
    border-top: 4px solid var(--green-600);
    border-radius: 7px;
    background: #fff;
    box-shadow: none;
}

.admin-stat strong {
    font-size: 29px;
    font-variant-numeric: tabular-nums;
}

.admin-module-tabs {
    top: 94px;
    border-color: var(--line);
    background: rgba(238, 242, 240, .96);
}

.table-wrap {
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
    box-shadow: none;
}

table {
    border-collapse: separate;
    border-spacing: 0;
}

th,
td {
    padding: 13px 14px;
    border-bottom: 1px solid #e4e9e6;
}

th {
    color: #42534b;
    background: #f0f4f2;
    font-size: 12px;
    text-transform: none;
}

tr:last-child td {
    border-bottom: 0;
}

tbody tr:hover td {
    background: #fafcfb;
}

.danger-zone {
    border: 1px solid #efc7cb;
    border-left: 4px solid var(--red);
    border-radius: 7px;
    background: #fff8f8;
}

.prose {
    max-width: 900px;
    padding: 36px 0;
}

.prose h1 {
    font-size: 34px;
}

.prose h2 {
    padding-top: 24px;
    border-top: 1px solid var(--line);
}

.site-footer {
    margin-top: 54px;
    padding: 30px 24px;
    border: 0;
    border-radius: 8px 8px 0 0;
    color: rgba(255, 255, 255, .5);
    background: var(--green-950);
    font-size: 12px;
}

.site-footer p {
    margin: 3px 0;
}

.footer-links {
    margin-top: 12px;
}

.footer-links a {
    color: rgba(255, 255, 255, .72);
}

@media (max-width: 1080px) {
    .site-header {
        top: 0;
        margin-top: 0;
    }

    .main-nav {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .main-nav a {
        justify-content: flex-start;
    }

    .page-index .hero {
        padding: 42px;
    }

    .more-function-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .page-index .hero {
        min-height: 500px;
    }

    .page-matchmaking .hero,
    .page-inbox .hero,
    .page-admin_dashboard .hero {
        grid-template-columns: 1fr;
        min-height: 0;
        padding: 34px;
    }

    .page-matchmaking .hero-stats,
    .page-inbox .hero-stats,
    .page-admin_dashboard .hero-stats {
        width: 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .court-benefit-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    html {
        scroll-padding-top: 84px;
    }

    body {
        font-size: 14px;
    }

    body::before {
        height: 240px;
    }

    .site-shell {
        width: min(100% - 16px, 1280px);
    }

    .site-header {
        min-height: 62px;
        margin-bottom: 16px;
        padding: 9px 10px;
    }

    .brand-ball {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
    }

    .brand-copy strong {
        font-size: 18px;
    }

    .main-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .main-nav a {
        min-height: 44px;
        padding: 10px;
    }

    .panel,
    .box {
        padding: 24px 4px;
    }

    .panel-title {
        margin-bottom: 18px;
    }

    .panel-title h1 {
        font-size: 26px;
    }

    .panel-title h2 {
        font-size: 21px;
    }

    .page-index .hero {
        min-height: 450px;
        margin-bottom: 30px;
        padding: 32px 24px 24px;
        background-position: 62% center;
    }

    .page-index .hero h1,
    .page-index .hero-title {
        font-size: 34px;
    }

    .page-matchmaking .hero,
    .page-inbox .hero,
    .page-admin_dashboard .hero {
        padding: 28px 22px;
    }

    .page-matchmaking .hero h1,
    .page-inbox .hero h1,
    .page-admin_dashboard .hero h1 {
        font-size: 31px;
    }

    .filter-form,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .filter-form {
        padding: 10px;
    }

    .form-grid {
        gap: 0;
    }

    .auth-card {
        margin-top: 26px;
        padding: 28px 22px;
    }

    .profile-hero {
        min-height: 0;
        padding: 28px 22px;
    }

    .profile-hero h1 {
        font-size: 30px;
    }

    .message-card,
    .match-row,
    .review-card {
        padding: 15px;
    }

    .table-wrap {
        border-radius: 6px;
    }

    .admin-module-tabs {
        top: 0;
    }

    .site-footer {
        margin-top: 36px;
    }
}

@media (max-width: 520px) {
    h1 {
        font-size: 27px;
    }

    h2 {
        font-size: 21px;
    }

    .brand-copy small {
        display: block;
        max-width: 120px;
    }

    .page-index .hero {
        min-height: 450px;
        padding: 28px 18px 18px;
        background-position: 64% center;
    }

    .page-index .hero h1,
    .page-index .hero-title {
        font-size: 30px;
    }

    .page-index .hero p {
        font-size: 13px;
    }

    .hero-actions {
        gap: 13px;
    }

    .page-index .hero-stat {
        min-height: 66px;
    }

    .ranking-panel .panel-title,
    .message-card-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .ranking-panel .panel-title .btn,
    .filter-form .btn {
        width: 100%;
    }

    .ranking-panel .tabs {
        grid-template-columns: 1fr 1fr;
    }

    .ranking-panel .tab {
        min-width: 0;
        padding: 9px 7px;
        font-size: 11px;
    }

    .player-card {
        gap: 10px;
        padding: 14px 12px;
    }

    .player-score {
        padding-top: 7px;
        border-top: 1px solid var(--line);
    }

    .more-function-grid,
    .court-benefit-grid,
    .court-public-facts {
        grid-template-columns: 1fr;
    }

    .more-function-link {
        min-height: 102px;
    }

    .stat-row {
        grid-template-columns: 1fr;
    }

    .stat-item {
        min-height: 78px;
    }

    .flex-actions .btn {
        flex: 1 1 auto;
    }

    .auth-card {
        padding: 24px 18px;
    }

    .region-selector {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .captcha-row {
        grid-template-columns: minmax(0, 1fr) 110px;
    }

    .algorithm-panel {
        padding: 17px;
    }

    .site-footer {
        padding: 26px 14px;
        font-size: 11px;
        line-height: 1.8;
    }
}

@media (max-width: 360px) {
    .site-shell {
        width: min(100% - 10px, 1280px);
    }

    .brand-copy small {
        display: none;
    }

    .page-index .hero h1,
    .page-index .hero-title {
        font-size: 27px;
    }

    .region-selector {
        grid-template-columns: 1fr;
    }
}

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

/* Page-specific corrections for legacy component layout constraints. */
.page-index .ranking-panel {
    width: 100%;
    box-sizing: border-box;
    padding-right: 24px;
    padding-left: 24px;
}

.page-index .ranking-panel .tabs {
    width: 100%;
}

.page-index .ranking-panel .tab {
    min-width: 0;
}

.page-index .algorithm-panel {
    padding-left: 20px;
}

.page-player_profile .algorithm-panel {
    display: block;
    margin-right: 24px;
    margin-left: 24px;
    padding-right: 18px;
    padding-left: 15px;
}

.page-player_profile .algorithm-panel .panel-title {
    margin-bottom: 16px;
}

.page-player_profile .algorithm-panel .algorithm-rule {
    margin: 0;
    padding: 14px 0;
    line-height: 1.75;
}

.page-player_profile .algorithm-panel .algorithm-rule + .algorithm-rule {
    border-top: 1px solid var(--line);
}

@media (max-width: 760px) {
    .page-index .ranking-panel,
    .page-index .algorithm-panel {
        padding-right: 4px;
    }

    .page-index .ranking-panel {
        padding-left: 4px;
    }

    .page-index .algorithm-panel {
        padding-left: 0;
    }

    .page-player_profile .algorithm-panel {
        margin-right: 4px;
        margin-left: 4px;
        padding-right: 15px;
        padding-left: 12px;
    }
}

/* Preserve the complete 16:9 homepage photograph at every breakpoint. */
.page-index .hero {
    min-height: 0;
    aspect-ratio: 16 / 9;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}

@media (max-width: 760px) {
    .page-index .hero {
        min-height: 0;
        aspect-ratio: auto;
        padding-top: calc(56.25% + 24px);
        background-color: var(--green-950);
        background-position: center, center, center top;
        background-size: 100% 100%, 100% 100%, 100% auto;
    }
}
