:root {
    --navy: #061b3b;
    --navy-soft: #11314a;
    --blue: #59b8d5;
    --blue-light: #dceff4;
    --aqua: #8fd2c2;
    --aqua-dark: #4eaa98;
    --white: #ffffff;
    --ink: #18222d;
    --muted: #5d6872;
    --border: #d6e1e5;
    --surface: #f3f8f9;
    --danger-bg: #fff1f1;
    --danger-border: #efb2b2;
    --danger-text: #8e2222;
    --shadow: 0 14px 36px rgba(6, 27, 59, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--surface);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
}

body.modal-open {
    overflow: hidden;
}

button,
input,
select {
    font: inherit;
}

.container {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.hero {
    position: relative;
    min-height: 360px;
    overflow: hidden;
    background: var(--navy);
}

.hero__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.hero__overlay {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    min-height: 360px;
    background:
        linear-gradient(
            90deg,
            rgba(6, 27, 59, 0.94) 0%,
            rgba(6, 27, 59, 0.82) 37%,
            rgba(6, 27, 59, 0.24) 67%,
            rgba(6, 27, 59, 0.12) 100%
        );
}

.hero__content {
    max-width: 640px;
    padding: 42px 0;
    color: var(--white);
}

.hero__eyebrow,
.intro__tag,
.ranking-header__tag,
.modal__eyebrow {
    margin: 0 0 8px;
    color: var(--aqua);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.hero h1 {
    max-width: 700px;
    margin: 0;
    font-size: clamp(2.15rem, 5vw, 4.2rem);
    line-height: 1.04;
    letter-spacing: -0.04em;
}

.hero__text {
    max-width: 480px;
    margin: 18px 0 0;
    color: #edf9fa;
    font-size: 1.05rem;
}

.intro {
    padding: 56px 0 34px;
    text-align: center;
}

.intro__tag {
    color: var(--aqua-dark);
}

.intro h2 {
    margin: 0;
    color: var(--navy);
    font-size: clamp(1.7rem, 3vw, 2.4rem);
}

.intro p:not(.intro__tag) {
    max-width: 740px;
    margin: 14px auto 0;
    color: var(--muted);
}

.rankings {
    padding: 20px 0 64px;
}

.filters {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    padding: 22px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.filter-group label,
.search-field__label {
    color: var(--navy);
    font-size: 0.86rem;
    font-weight: 800;
}

.filter-group select,
.search-field input {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    color: var(--ink);
    background: var(--white);
    border: 1px solid #b7c8cf;
    border-radius: 9px;
    outline: none;
}

.filter-group select:focus,
.search-field input:focus {
    border-color: var(--aqua-dark);
    box-shadow: 0 0 0 3px rgba(78, 170, 152, 0.2);
}

.ranking-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin: 38px 0 18px;
}

.ranking-header__tag {
    color: var(--aqua-dark);
}

.ranking-header h2 {
    margin: 0;
    color: var(--navy);
    font-size: clamp(1.45rem, 3vw, 2.1rem);
}

.ranking-header__meta {
    color: var(--muted);
    font-size: 0.9rem;
    text-align: right;
}

.meta-divider {
    margin: 0 5px;
}

.search-row {
    display: flex;
    align-items: end;
    gap: 12px;
    margin-bottom: 18px;
}

.search-field {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 7px;
}

.button {
    min-height: 46px;
    padding: 10px 16px;
    border: 0;
    border-radius: 9px;
    cursor: pointer;
    font-weight: 800;
    transition: transform 0.15s ease, background-color 0.15s ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button--secondary {
    color: var(--navy);
    background: var(--blue-light);
}

.button--secondary:hover {
    background: #cde5eb;
}

.status {
    padding: 15px 17px;
    color: var(--navy);
    background: #e8f5f2;
    border-left: 4px solid var(--aqua-dark);
    border-radius: 8px;
    font-weight: 700;
}

.table-wrap {
    margin-top: 18px;
    overflow-x: auto;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
}

table {
    width: 100%;
    min-width: 680px;
    border-collapse: collapse;
}

thead {
    color: var(--white);
    background: var(--navy);
}

th,
td {
    padding: 13px 15px;
    text-align: left;
    border-bottom: 1px solid #e6edef;
}

th {
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

tbody tr:nth-child(even) {
    background: #f8fbfc;
}

tbody tr:hover {
    background: #e9f7f4;
}

tbody tr:last-child td {
    border-bottom: 0;
}

th:first-child,
td:first-child {
    width: 72px;
    text-align: center;
}

td:first-child,
td:last-child {
    font-weight: 800;
}

th:last-child,
td:last-child {
    text-align: right;
}

.empty-state,
.error-state {
    margin-top: 18px;
    padding: 28px;
    text-align: center;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 14px;
}

.empty-state h3,
.error-state h3 {
    margin: 0;
    color: var(--navy);
}

.empty-state p,
.error-state p {
    margin: 8px 0 0;
    color: var(--muted);
}

.error-state {
    color: var(--danger-text);
    background: var(--danger-bg);
    border-color: var(--danger-border);
}

.error-state h3,
.error-state p {
    color: var(--danger-text);
}

.ranking-note {
    margin-top: 30px;
    padding: 24px 26px;
    color: #183447;
    background: #e4f3f3;
    border-left: 5px solid var(--aqua-dark);
    border-radius: 12px;
}

.ranking-note h3 {
    margin: 0 0 10px;
    color: var(--navy);
    font-size: 1.1rem;
}

.ranking-note p {
    margin: 10px 0 0;
}

.site-footer {
    padding: 28px 0;
    color: #e7f4f6;
    background: var(--navy);
}

.site-footer__content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    font-size: 0.9rem;
}

.site-footer p {
    margin: 0;
}

.footer-link {
    padding: 0;
    color: var(--aqua);
    cursor: pointer;
    background: transparent;
    border: 0;
    border-bottom: 1px solid transparent;
    font-weight: 800;
    text-decoration: none;
}

.footer-link:hover,
.footer-link:focus-visible {
    border-bottom-color: var(--aqua);
    outline: none;
}

.modal[hidden] {
    display: none;
}

.modal {
    position: fixed;
    z-index: 1000;
    inset: 0;
    display: grid;
    padding: 20px;
    place-items: center;
}

.modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(6, 27, 59, 0.76);
}

.modal__content {
    position: relative;
    z-index: 1;
    width: min(720px, 100%);
    max-height: min(760px, calc(100vh - 40px));
    overflow: auto;
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 22px 65px rgba(0, 0, 0, 0.32);
}

.modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 24px 26px 18px;
    color: var(--white);
    background: var(--navy);
}

.modal__eyebrow {
    color: var(--aqua);
}

.modal__header h2 {
    margin: 0;
    font-size: 1.55rem;
}

.modal__close {
    display: grid;
    width: 38px;
    height: 38px;
    padding: 0;
    color: var(--white);
    cursor: pointer;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    font-size: 1.9rem;
    line-height: 1;
    place-items: center;
}

.modal__close:hover,
.modal__close:focus-visible {
    color: var(--navy);
    background: var(--white);
    outline: none;
}

.modal__body {
    padding: 26px;
}

.modal__body h3 {
    margin: 22px 0 8px;
    color: var(--navy);
    font-size: 1.05rem;
}

.modal__body h3:first-child {
    margin-top: 0;
}

.modal__body p {
    margin: 0;
    color: var(--muted);
}

.modal__body a {
    color: #167f70;
    font-weight: 800;
}

@media (max-width: 780px) {
    .hero,
    .hero__overlay {
        min-height: 300px;
    }

    .hero__overlay {
        background:
            linear-gradient(
                90deg,
                rgba(6, 27, 59, 0.92) 0%,
                rgba(6, 27, 59, 0.75) 70%,
                rgba(6, 27, 59, 0.42) 100%
            );
    }

    .hero__image {
        object-position: 38% center;
    }

    .filters {
        grid-template-columns: 1fr;
    }

    .ranking-header,
    .site-footer__content {
        align-items: flex-start;
        flex-direction: column;
    }

    .ranking-header__meta {
        text-align: left;
    }

    .search-row {
        align-items: stretch;
        flex-direction: column;
    }

    .button {
        width: 100%;
    }

    .intro {
        padding-top: 40px;
    }

    .meta-divider {
        display: none;
    }

    #updateInfo {
        display: block;
        margin-top: 3px;
    }

    .modal {
        padding: 12px;
    }

    .modal__header,
    .modal__body {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .container {
        width: min(100% - 24px, 1180px);
    }

    .hero__content {
        padding: 34px 0;
    }

    .filters {
        padding: 16px;
        border-radius: 14px;
    }

    th,
    td {
        padding: 11px 12px;
    }

    .modal__header h2 {
        font-size: 1.35rem;
    }
}