:root {
    --bg: #090b0e;
    --panel: #12161c;
    --panel-hover: #202731;
    --border: #252b35;
    --text: #f5f7fa;
    --muted: #929aa6;
    --orange: #ff7417;
    --orange-light: #ff9a55;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.55 Inter, system-ui, sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
}

.shell {
    width: min(1180px, calc(100% - 32px));
    margin-inline: auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid #242831;
    background: rgba(9, 11, 14, 0.92);
    backdrop-filter: blur(14px);
}

.nav {
    display: flex;
    min-height: 82px;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 13px;
    font-size: 19px;
    font-weight: 800;
}

.site-logo {
    width: 86px;
    height: 62px;
    object-fit: contain;
}

.brand em,
.rank {
    color: var(--orange);
    font-style: normal;
}

.nav nav,
.footer-links {
    display: flex;
    gap: 22px;
}

.nav nav a {
    color: #aeb5c0;
}

.nav nav a:hover,
.nav nav a.active {
    color: white;
}

.hero {
    padding: 90px 0 82px;
    border-bottom: 1px solid var(--border);
    background:
        radial-gradient(
            circle at 50% -20%,
            rgba(255, 116, 23, 0.30),
            transparent 43rem
        ),
        linear-gradient(180deg, #11161d, var(--bg));
}

.hero-wide {
    max-width: 1040px;
    text-align: center;
}

.eyebrow {
    color: var(--orange-light);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.14em;
}

.hero h1 {
    margin: 18px 0;
    font-size: clamp(54px, 9vw, 104px);
    line-height: 0.9;
    letter-spacing: -0.06em;
}

.hero mark {
    display: block;
    background: none;
    color: var(--orange);
}

.hero p {
    max-width: 780px;
    margin: auto;
    color: #b1b8c4;
    font-size: 19px;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 50px;
    margin-top: 32px;
    color: var(--muted);
}

.hero-stats span {
    display: grid;
}

.hero-stats b {
    color: white;
    font-size: 25px;
}

.content,
.profile-page,
.legal-page,
.admin-page {
    padding: 42px 0 90px;
}

.section-heading {
    margin-bottom: 20px;
}

.centered {
    text-align: center;
}

.section-heading h2 {
    margin: 5px 0 0;
    font-size: 34px;
}

.podium {
    display: grid;
    grid-template-columns: 1fr 1.12fr 1fr;
    align-items: end;
    gap: 18px;
    max-width: 980px;
    margin: 0 auto 44px;
}

.podium-card {
    position: relative;
    display: grid;
    min-height: 285px;
    justify-items: center;
    gap: 12px;
    padding: 30px 22px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background:
        linear-gradient(
            160deg,
            rgba(255, 116, 23, 0.10),
            var(--panel) 48%
        );
    text-align: center;
    transition:
        transform 0.2s ease,
        border-color 0.2s ease;
}

.podium-card:hover {
    border-color: var(--orange);
    transform: translateY(-4px);
}

.podium-card.place-1 {
    min-height: 330px;
    border-color: rgba(255, 116, 23, 0.75);
    transform: translateY(-24px);
}

.podium-card.place-1:hover {
    transform: translateY(-30px);
}

.podium-place {
    position: absolute;
    top: 16px;
    left: 18px;
    color: var(--orange-light);
    font-size: 24px;
    font-weight: 900;
}

.podium-avatar {
    width: 94px;
    height: 94px;
    border: 3px solid #333b47;
    border-radius: 50%;
    object-fit: cover;
}

.place-1 .podium-avatar {
    width: 112px;
    height: 112px;
    border-color: var(--orange);
}

.podium-person h3 {
    margin: 0;
}

.podium-person small,
.muted {
    color: var(--muted);
}

.podium-level,
.badge {
    display: inline-flex;
    align-items: baseline;
    gap: 7px;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--orange);
    color: #111;
    font-weight: 900;
}

.podium-level span,
.badge small {
    font-size: 9px;
    text-transform: uppercase;
}

.podium-level b {
    font-size: 27px;
}

.podium-xp {
    color: #adb5c0;
    font-weight: 800;
}

.quick-add-card,
.filters,
.card,
.profile-hero,
.progress-card,
.queue-progress-card,
.stat,
.unknown-profile-card,
.add-profile-card,
.legal-card {
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--panel);
}

.quick-add-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 24px;
    padding: 26px;
}

.quick-add-card h2 {
    margin: 5px 0;
}

.quick-add-card p {
    margin: 0;
    color: var(--muted);
}

.filters {
    display: flex;
    align-items: end;
    gap: 14px;
    margin-bottom: 30px;
    padding: 18px;
}

.filters label,
.add-profile-form label {
    flex: 1;
}

.filters label > span,
.add-profile-form label > span {
    display: block;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

input,
select,
button {
    min-height: 46px;
    border: 1px solid #303743;
    border-radius: 10px;
    background: #0c0f13;
    color: white;
    padding: 0 13px;
    font: inherit;
}

input,
select {
    width: 100%;
}

button,
.button-link,
.wot-link {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 10px;
    background: var(--orange);
    color: #111;
    padding: 0 20px;
    font-weight: 900;
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.card {
    overflow: hidden;
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 24px;
}

.card-head h2 {
    margin: 5px 0 0;
}

.card-head p {
    color: var(--muted);
}

.table-wrap {
    overflow: auto;
}

table {
    width: 100%;
    min-width: 850px;
    border-collapse: collapse;
}

th,
td {
    padding: 16px 20px;
    border-top: 1px solid #242a34;
    text-align: left;
}

th {
    color: #8f97a2;
    font-size: 11px;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.ranking-table tbody tr {
    transition: background-color 0.18s ease;
}

.ranking-table tbody tr:hover {
    background: var(--panel-hover);
}

.driver {
    display: flex;
    align-items: center;
    gap: 12px;
}

.driver > img {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    object-fit: cover;
}

.driver > span {
    display: flex;
    flex-direction: column;
}

.driver small {
    color: var(--muted);
}

.country-flag {
    width: 28px !important;
    height: 18px !important;
    border-radius: 3px !important;
    object-fit: cover !important;
}

.country-flag.inline {
    width: 22px !important;
    height: 14px !important;
    margin-left: 5px;
    vertical-align: middle;
}

.badge.compact {
    padding: 5px 9px;
    font-size: 15px;
}

.empty {
    padding: 42px;
    color: var(--muted);
    text-align: center;
}

.pagination {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 18px;
    padding: 20px;
    border-top: 1px solid var(--border);
}

.pagination-side {
    display: flex;
}

.pagination-next {
    justify-content: flex-end;
}

.page-select-form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-select-form input {
    display: none;
}

.page-select-form select {
    width: auto;
}

.page-link {
    padding: 10px 14px;
    border: 1px solid #303743;
    border-radius: 10px;
    color: var(--orange-light);
}

.page-link.disabled {
    color: #626a75;
}

.formula {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 36px;
    margin-top: 40px;
    padding: 38px;
    border-radius: 20px;
    background: linear-gradient(120deg, #161b22, #101318);
}

.formula code,
.add-profile-card code {
    padding: 20px;
    border-radius: 12px;
    background: #090b0e;
    color: #ffad75;
}

.profile-hero {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 25px;
    padding: 30px;
}

.profile-avatar {
    width: 140px;
    height: 140px;
    border-radius: 24px;
    object-fit: cover;
}

.profile-identity h1 {
    margin: 8px 0;
    font-size: 50px;
}

.profile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.wot-link {
    background: #29313c;
    color: white;
}

.profile-rank-panel {
    display: grid;
    min-width: 190px;
    justify-items: center;
    gap: 10px;
    padding: 20px;
    border: 1px solid rgba(255, 116, 23, 0.5);
    border-radius: 18px;
    text-align: center;
}

.profile-rank-panel > span {
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
}

.profile-rank-panel > strong {
    color: var(--orange-light);
    font-size: 20px;
}

.progress-card,
.queue-progress-card {
    margin: 24px 0;
    padding: 24px;
}

.progress-card > div:first-child,
.queue-progress-card > div:first-child {
    display: flex;
    justify-content: space-between;
}

.progress {
    height: 10px;
    margin-top: 16px;
    overflow: hidden;
    border-radius: 99px;
    background: #090b0e;
}

.progress i {
    display: block;
    height: 100%;
    background: var(--orange);
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    margin: 24px 0;
}

.stat {
    padding: 22px;
}

.stat span {
    color: var(--muted);
}

.stat b {
    display: block;
    margin-top: 6px;
    font-size: 20px;
}

.game-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.game-card dl {
    margin: 0;
    padding: 0 24px 24px;
}

.game-card dl div {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 13px 0;
    border-top: 1px solid #282e38;
}

.game-card dt {
    color: var(--muted);
}

.game-card dd {
    margin: 0;
    font-weight: 800;
}

.profile-page .profile-hero,
.profile-page .progress-card,
.profile-page .queue-progress-card,
.profile-page .stat,
.profile-page .game-card {
    transition:
        border-color 0.2s ease,
        transform 0.2s ease;
}

.profile-page .profile-hero:hover,
.profile-page .progress-card:hover,
.profile-page .queue-progress-card:hover,
.profile-page .stat:hover,
.profile-page .game-card:hover {
    border-color: var(--orange);
    transform: translateY(-2px);
}

.unknown-profile-card,
.add-profile-card,
.legal-card {
    max-width: 900px;
    margin: auto;
    padding: 34px;
}

.unknown-profile-card h1,
.add-profile-card h1,
.legal-card h1 {
    font-size: 48px;
}

.add-profile-form {
    display: flex;
    align-items: end;
    gap: 14px;
    margin: 24px 0;
}

.info-box,
.placeholder-notice,
.update-notice {
    margin-top: 16px;
    padding: 16px;
    border: 1px solid #303743;
    border-radius: 12px;
    background: #0d1014;
    color: #aab1bb;
}

.queue-status {
    display: inline-grid;
    margin: 20px 0;
    padding: 18px 24px;
    border-radius: 15px;
    background: var(--orange);
    color: #111;
    text-align: center;
}

.queue-status b {
    font-size: 36px;
}

.queue-inline {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    padding: 10px 14px;
    border: 1px solid rgba(255, 116, 23, 0.5);
    border-radius: 10px;
}

.site-footer {
    border-top: 1px solid #242831;
    padding: 28px 0;
    color: #7f8791;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    gap: 30px;
}

.footer-inner > div {
    display: grid;
}

.cookie-banner {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 100;
    display: flex;
    max-width: 720px;
    align-items: center;
    gap: 20px;
    padding: 20px;
    border: 1px solid #38404c;
    border-radius: 18px;
    background: #141920;
}

.cookie-banner[hidden] {
    display: none;
}

.cookie-actions {
    display: flex;
    gap: 8px;
}

.cookie-actions button {
    background: #2a313b;
}

.cookie-actions .primary {
    background: var(--orange);
    color: #111;
}

@media (max-width: 900px) {
    .podium,
    .formula,
    .game-grid {
        grid-template-columns: 1fr;
    }

    .podium-card.place-1,
    .podium-card.place-1:hover {
        order: -1;
        transform: none;
    }

    .filters,
    .add-profile-form {
        display: grid;
    }

    .profile-hero {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
    }

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

@media (max-width: 620px) {
    .nav nav,
    .brand span {
        display: none;
    }

    .hero h1 {
        font-size: 54px;
    }

    .hero-stats,
    .footer-inner {
        flex-direction: column;
    }

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

    .page-select-form {
        grid-column: 1 / -1;
        grid-row: 1;
    }

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

    .cookie-banner {
        left: 16px;
        right: 16px;
        display: grid;
    }
}
